| Previous | 15994 Revisions | Next |
| r14897 Wednesday 11th April, 2012 at 14:52:11 UTC by Miodrag Milanović |
|---|
| Sync with MAME r15957 (no whatsnew) |
| [src/emu] | devcpu.h diexec.c diexec.h driver.c driver.h emu.h emu.mak gamedrv.h machine.c machine.h mconfig.h |
| [src/emu/audio] | |
| [src/emu/cpu/arm] | arm.c |
| [src/emu/cpu/arm7] | arm7core.c arm7core.h |
| [src/emu/cpu/cp1610] | cp1610.c |
| [src/emu/cpu/e132xs] | e132xs.c |
| [src/emu/cpu/f8] | f8.c |
| [src/emu/cpu/g65816] | g65816.c g65816cm.h |
| [src/emu/cpu/h6280] | h6280.c h6280.h |
| [src/emu/cpu/h83002] | h8priv.h |
| [src/emu/cpu/hcd62121] | hcd62121.c |
| [src/emu/cpu/hd6309] | hd6309.c |
| [src/emu/cpu/i386] | i386.c i386priv.h |
| [src/emu/cpu/i8008] | i8008.c |
| [src/emu/cpu/i8085] | i8085.c |
| [src/emu/cpu/i86] | i286.c i86.c |
| [src/emu/cpu/i960] | i960.c |
| [src/emu/cpu/jaguar] | jaguar.c |
| [src/emu/cpu/konami] | konami.c |
| [src/emu/cpu/m37710] | m37710.c m37710cm.h |
| [src/emu/cpu/m6502] | m4510.c m6502.c m6509.c m65ce02.c |
| [src/emu/cpu/m6800] | m6800.c |
| [src/emu/cpu/m68000] | m68kcpu.c m68kcpu.h |
| [src/emu/cpu/m6805] | m6805.c |
| [src/emu/cpu/m6809] | m6809.c |
| [src/emu/cpu/mb88xx] | mb88xx.c |
| [src/emu/cpu/mc68hc11] | mc68hc11.c |
| [src/emu/cpu/mcs48] | mcs48.c |
| [src/emu/cpu/mcs51] | mcs51.c |
| [src/emu/cpu/minx] | minx.c |
| [src/emu/cpu/mips] | mips3com.c mips3com.h mips3drc.c r3000.c |
| [src/emu/cpu/nec] | nec.c necpriv.h v25.c v25priv.h |
| [src/emu/cpu/pdp1] | tx0.c |
| [src/emu/cpu/powerpc] | ppc.c ppccom.c ppccom.h ppcdrc.c |
| [src/emu/cpu/rsp] | rsp.h rspdrc.c |
| [src/emu/cpu/s2650] | s2650.c |
| [src/emu/cpu/saturn] | saturn.c |
| [src/emu/cpu/se3208] | se3208.c |
| [src/emu/cpu/sh2] | sh2.c sh2comn.c sh2comn.h sh2drc.c |
| [src/emu/cpu/sh4] | sh4.c sh4comn.h |
| [src/emu/cpu/sharc] | sharc.c |
| [src/emu/cpu/sm8500] | sm8500.c |
| [src/emu/cpu/spc700] | spc700.c |
| [src/emu/cpu/t11] | t11.c |
| [src/emu/cpu/tlcs90] | tlcs90.c |
| [src/emu/cpu/tlcs900] | tlcs900.c |
| [src/emu/cpu/tms32025] | tms32025.c |
| [src/emu/cpu/tms32031] | tms32031.h |
| [src/emu/cpu/tms32051] | tms32051.c |
| [src/emu/cpu/tms34010] | tms34010.c |
| [src/emu/cpu/tms7000] | tms7000.c |
| [src/emu/cpu/tms9900] | 99xxcore.h |
| [src/emu/cpu/upd7810] | upd7810.c |
| [src/emu/cpu/v30mz] | v30mz.c |
| [src/emu/cpu/v60] | v60.c |
| [src/emu/cpu/v810] | v810.c |
| [src/emu/cpu/z180] | z180.c |
| [src/emu/cpu/z80] | z80.c |
| [src/emu/cpu/z8000] | z8000.c |
| [src/emu/machine] | generic.c generic.h |
| [src/emu/video] | generic.c generic.h |
| [src/lib/util] | palette.h |
| [src/mame] | mame.lst mame.mak |
| [src/mame/audio] | 8080bw.c astrof.c aztarac.c blockade.c cchasm.c cinemat.c circus.c copsnrob.c cyberbal.c dkong.c gotya.c harddriv.c hyprolyb.c irem.c jedi.c laserbat.c m72.c mario.c mcr.c mcr.h micro3d.c mw8080bw.c n8080.c redalert.c scramble.c segag80r.c segag80v.c senjyo.c spacefb.c starwars.c timeplt.c williams.c |
| [src/mame/drivers] | 1942.c 1943.c 1945kiii.c 2mindril.c 39in1.c 40love.c 5clown.c 8080bw.c 88games.c ace.c acefruit.c acommand.c actfancr.c aeroboto.c aerofgt.c airbustr.c ajax.c albazc.c albazg.c aliens.c alpha68k.c ambush.c amspdwy.c aquarium.c arcadecl.c argus.c aristmk4.c armedf.c ashnojoe.c asterix.c astinvad.c astrafr.c astrocde.c astrocorp.c astrof.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c atarisy4.c atetris.c attckufo.c avt.c aztarac.c backfire.c badlands.c batman.c battlane.c battlera.c battlnts.c bbusters.c beaminv.c berzerk.c bestleag.c bfcobra.c bfm_sc1.c bfm_sc4.c bfm_sc4h.c bfm_sc5.c bfmsys85.c bigstrkb.c bingoc.c bingor.c bionicc.c bishi.c bking.c blackt96.c bladestl.c blitz.c blktiger.c blockade.c blockhl.c blockout.c bloodbro.c blstroid.c blueprnt.c bmcbowl.c bogeyman.c bombjack.c boogwing.c bottom9.c boxer.c brkthru.c btime.c bublbobl.c buggychl.c buster.c bwing.c cabal.c cabaret.c calchase.c calorie.c capbowl.c cardline.c carjmbre.c carrera.c caswin.c cb2001.c cball.c cbasebal.c cbuster.c cchasm.c cclimber.c cd32.c cesclass.c champbas.c champbwl.c chanbara.c chinagat.c chinsan.c chqflag.c cinemat.c circus.c circusc.c citycon.c clayshoo.c clshroad.c cmmb.c cninja.c cntsteer.c coinmstr.c coinmvga.c combatsc.c commando.c contra.c coolridr.c cop01.c copsnrob.c corona.c cosmic.c cps1.c crbaloon.c crimfght.c crospang.c crshrace.c crystal.c cshooter.c csplayh5.c cultures.c cvs.c cyberbal.c cybertnk.c cyclemb.c d9final.c dacholer.c dai3wksi.c dambustr.c darius.c darkhors.c darkseal.c dassault.c dblewing.c dbz.c dcheese.c dcon.c ddayjlc.c ddealer.c ddenlovr.c ddragon.c ddragon3.c deadang.c dec0.c dec8.c deco156.c deco32.c deco_ld.c deniam.c deshoros.c destroyr.c dietgo.c discoboy.c diverboy.c djboy.c dkong.c dlair.c dmndrby.c dogfgt.c dominob.c dooyong.c dorachan.c dotrikun.c dreamwld.c drgnmst.c drmicro.c drtomy.c dynadice.c egghunt.c embargo.c enigma2.c eprom.c equites.c esd16.c esh.c espial.c ettrivia.c exedexes.c exerion.c exprraid.c exterm.c exzisus.c f-32.c f1gp.c fantland.c fastfred.c fcombat.c fcrash.c feversoc.c finalizr.c firebeat.c firefox.c firetrap.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c fortecar.c freekick.c fromanc2.c funkball.c funkyjet.c funybubl.c fuukifg2.c gaelco.c gaiden.c gal3.c galaga.c galaxi.c galaxia.c galaxian.c galaxold.c galivan.c galpani2.c galpani3.c galpanic.c galspnbl.c gamecstl.c gameplan.c gamtor.c gauntlet.c gberet.c gbusters.c gcpinbal.c gei.c ghosteo.c gijoe.c ginganin.c gladiatr.c glass.c gng.c go2000.c goal92.c goindol.c goldngam.c goldnpkr.c goldstar.c good.c goodejan.c gotcha.c gotya.c gpworld.c gradius3.c grchamp.c gstream.c gstriker.c gsword.c gticlub.c gts3.c gumbo.c gunsmoke.c gyruss.c halleys.c harddriv.c hcastle.c hexion.c highvdeo.c himesiki.c hitpoker.c homedata.c hotblock.c hotstuff.c hvyunit.c hyperspt.c igs009.c igs011.c igs017.c igs_m027.c igspoker.c imolagp.c intrscti.c inufuku.c iqblock.c ironhors.c istellar.c itech32.c itech8.c jack.c jackal.c jackie.c jackpool.c jaguar.c jailbrek.c jalmah.c jangou.c jchan.c jedi.c jokrwild.c jollyjgr.c jongkyo.c jubilee.c junofrst.c kaneko16.c kangaroo.c karnov.c kas89.c kchamp.c kickgoal.c kingdrby.c kingobox.c kinst.c klax.c kncljoe.c koftball.c koikoi.c konamigv.c konamim2.c ksayakyu.c ksys573.c ladyfrog.c laserbas.c laserbat.c lasso.c lastduel.c legionna.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 luckgrln.c lucky74.c lwings.c m107.c m14.c m63.c m72.c m79amb.c m90.c m92.c macs.c madalien.c madmotor.c magic10.c magicard.c magicfly.c magictg.c magtouch.c mainevt.c mainsnk.c mappy.c marinedt.c mario.c mastboy.c matmania.c mayumi.c mazerbla.c mcatadv.c mcr.c mcr3.c mcr68.c mediagx.c megasys1.c megazone.c meijinsn.c merit.c metlclsh.c metro.c mgolf.c micro3d.c midas.c midqslvr.c midvunit.c midyunit.c mikie.c mil4000.c miniboy7.c minivadr.c mirage.c mirax.c missb2.c missile.c mitchell.c mlanding.c model1.c model2.c model3.c mogura.c mole.c momoko.c moo.c mosaic.c mpoker.c mrflea.c ms32.c msisaac.c mugsmash.c multigam.c munchmo.c murogem.c murogmbl.c mw8080bw.c mwarr.c mystwarr.c n8080.c namconb1.c namcos11.c namcos12.c namcos22.c namcos23.c nbmj8991.c nbmj9195.c nemesis.c neogeo.c neoprint.c news.c nexus3d.c nightgal.c ninjakd2.c niyanpai.c nmg5.c nmk16.c nsmpoker.c nwk-tr.c nycaptor.c nyny.c offtwall.c ohmygod.c olibochu.c omegrace.c oneshot.c onetwo.c opwolf.c othello.c othldrby.c overdriv.c pacland.c pacman.c pandoras.c panicr.c parodius.c pasha2.c pass.c pbaction.c pcat_nit.c pcktgal.c pcxt.c peplus.c pgm.c photon2.c photoply.c pinkiri8.c pipedrm.c pipeline.c pirates.c pitnrun.c pkscram.c pktgaldx.c playmark.c plygonet.c pntnpuzl.c pokechmp.c poker72.c poo.c pooyan.c popeye.c popobear.c portrait.c powerins.c ppmast93.c prehisle.c progolf.c psikyo.c psychic5.c pturn.c punchout.c pushman.c pzletime.c qdrmfgp.c quantum.c quasar.c queen.c quizpani.c quizpun2.c quizshow.c r2dtank.c r2dx_v33.c raiden.c raiden2.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c re900.c realbrk.c redalert.c relief.c renegade.c retofinv.c rgum.c rmhaihai.c rockrage.c rocnrope.c rohga.c rollerg.c rollrace.c rotaryf.c roul.c route16.c royalmah.c rpunch.c rungun.c safarir.c sandscrp.c sauro.c savquest.c sbasketb.c sbowling.c sbrkout.c scobra.c scotrsht.c scramble.c sderby.c seattle.c segae.c segag80r.c segag80v.c segahang.c segald.c segaorun.c segas16a.c segas16b.c segas18.c segas32.c segaxbd.c segaybd.c seibuspi.c sengokmj.c senjyo.c seta.c seta2.c sf.c sfbonus.c sfkick.c shadfrce.c shangha3.c shanghai.c shisen.c shootout.c shougi.c shuuz.c sidearms.c sidepckt.c sigmab98.c skeetsht.c skimaxx.c skullxbo.c skyarmy.c skyfox.c skylncr.c sliver.c slotcarn.c snesb.c snk.c snk68.c snowbros.c solomon.c sonson.c sothello.c spacefb.c spaceg.c spbactn.c spcforce.c spdodgeb.c speedbal.c speedspn.c speglsht.c splash.c splus.c spoker.c spool99.c spy.c srmp2.c srmp5.c srmp6.c srumbler.c ssfindo.c sshot.c sslam.c ssozumo.c sstrangr.c st0016.c stadhero.c starwars.c statriv2.c stlforce.c stv.c sub.c subsino.c subsino2.c summit.c suna16.c suna8.c supbtime.c supdrapo.c superdq.c superqix.c superwng.c suprgolf.c suprloco.c suprslam.c surpratk.c system1.c system16.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_h.c taito_o.c taito_x.c taito_z.c taitogn.c taitosj.c taitowlf.c tankbatt.c tankbust.c taotaido.c tapatune.c targeth.c tatsumi.c tattack.c taxidriv.c tbowl.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c terracre.c tgtpanic.c thedeep.c thepit.c thoop2.c thunderj.c thunderx.c tickee.c tigeroad.c timelimt.c timeplt.c timetrv.c tmaster.c tmnt.c tmspoker.c tnzs.c toaplan2.c toki.c tomcat.c toobin.c topspeed.c toratora.c toypop.c tp84.c trackfld.c trvmadns.c tryout.c tsamurai.c ttchamp.c tugboat.c tumbleb.c tumblep.c tutankhm.c twin16.c twincobr.c twins.c tx1.c ultraman.c ultrsprt.c umipoker.c unkhorse.c vamphalf.c vaportra.c vastar.c vball.c vcombat.c vectrex.c vegas.c vendetta.c vigilant.c vindictr.c viper.c vmetal.c volfied.c vroulet.c vulgus.c wallc.c wardner.c warpsped.c warpwarp.c wc90.c wc90b.c wecleman.c welltris.c wgp.c whitestar.c williams.c wink.c witch.c wiz.c wldarrow.c wrally.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c xtheball.c xtom3d.c xybots.c yunsun16.c yunsung8.c zaccaria.c zaxxon.c zerozone.c zn.c zodiack.c zr107.c |
| [src/mame/includes] | 8080bw.h arcadecl.h astrof.h atarig1.h atarig42.h atarigt.h atarigx2.h atarisy1.h atarisy2.h aztarac.h badlands.h batman.h bfm_sc45.h blockade.h blstroid.h cchasm.h cd32.h cinemat.h circus.h copsnrob.h cyberbal.h ddragon.h dkong.h eprom.h fastfred.h foodf.h galaga.h galaxia.h galaxian.h galpani2.h galpanic.h gauntlet.h gladiatr.h gotya.h gsword.h harddriv.h jedi.h klax.h laserbat.h liberatr.h lockon.h mario.h mcr.h mcr3.h mcr68.h micro3d.h midvunit.h model2.h model3.h mw8080bw.h n8080.h namconb1.h namcos22.h offtwall.h pgm.h psikyo.h quasar.h rampart.h redalert.h relief.h scramble.h segag80r.h segag80v.h segas32.h seibuspi.h senjyo.h seta.h seta2.h shuuz.h skullxbo.h spacefb.h st0016.h starwars.h stv.h thunderj.h toobin.h tx1.h vindictr.h xybots.h |
| [src/mame/machine] | ajax.c bublbobl.c decocass.c decoprot.c leland.c mcr68.c midyunit.c mie.c pgmprot1.c scramble.c seicop.c ticket.c ticket.h williams.c wrally.c |
| [src/mame/video] | 1942.c 1943.c 40love.c aeroboto.c ambush.c amspdwy.c appoooh.c arkanoid.c armedf.c ashnojoe.c atarigt.c bagman.c bankp.c baraduke.c battlane.c battlex.c bionicc.c bking.c blktiger.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c btime.c bublbobl.c buggychl.c cabal.c cbuster.c champbas.c circusc.c cischeat.c citycon.c cloak.c clshroad.c cninja.c commando.c cop01.c cosmic.c cps1.c crbaloon.c cvs.c dassault.c ddragon.c ddragon3.c deadang.c dec0.c dec8.c decbac06.c deckarn.c decmxc06.c deco32.c decocass.c decospr.c dietgo.c digdug.c docastle.c dogfgt.c dooyong.c dynduke.c equites.c esd16.c exprraid.c exzisus.c fastfred.c finalizr.c firetrap.c flower.c flstory.c foodf.c freekick.c funkybee.c funkyjet.c fuukifg2.c fuukifg3.c gaelco2.c gaiden.c galaga.c galaxold.c gaplus.c gberet.c ginganin.c gladiatr.c gng.c goindol.c gottlieb.c gotya.c gunsmoke.c hanaawas.c higemaru.c himesiki.c holeland.c hyperspt.c hyprduel.c ironhors.c jack.c jackal.c jailbrek.c kan_panb.c kan_pand.c kchamp.c kingobox.c ksayakyu.c ladybug.c ladyfrog.c lasso.c lastduel.c liberate.c liberatr.c lkage.c lsasquad.c lwings.c m52.c m58.c m72.c m92.c madmotor.c mainsnk.c mappy.c markham.c mcr68.c mermaid.c metlclsh.c metro.c mikie.c mitchell.c mjkjidai.c mouser.c mrjong.c mustache.c n8080.c namcos1.c namcos86.c nbmj8891.c ninjakd2.c nmk16.c nova2001.c nycaptor.c othldrby.c pacland.c paradise.c pbaction.c pcktgal.c pitnrun.c pktgaldx.c pokechmp.c pooyan.c popeye.c powerins.c prehisle.c psikyo.c psychic5.c pushman.c quizdna.c rallyx.c realbrk.c redclash.c renegade.c retofinv.c rocnrope.c rohga.c sauro.c sbasketb.c scotrsht.c senjyo.c seta2.c sf.c shangha3.c shaolins.c shisen.c shootout.c sidearms.c simpl156.c simpsons.c skyfox.c skykid.c snk.c snk6502.c solomon.c sonson.c spcforce.c spdodgeb.c speedbal.c srumbler.c sshangha.c ssozumo.c st0016.c stfight.c strnskil.c suna16.c suna8.c supbtime.c superqix.c suprloco.c system1.c tagteam.c tecmo.c tecmo16.c tehkanwc.c terracre.c thedeep.c tigeroad.c timeplt.c toaplan1.c toki.c toypop.c trackfld.c travrusa.c tryout.c tsamurai.c tumblep.c twin16.c vaportra.c vastar.c vball.c vulgus.c warpwarp.c welltris.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xxmissio.c yiear.c yunsun16.c zaccaria.c zaxxon.c zodiack.c |
| [src/mess/drivers] | ng_aes.c supracan.c |
| r14896 | r14897 | |
|---|---|---|
| 8934 | 8934 | haunthig // (c) 200? |
| 8935 | 8935 | |
| 8936 | 8936 | // IGS PGM System Games |
| 8937 | pgm | |
| 8938 | orlegend // (c) 1997 | |
| 8939 | orlegende // (c) 1997 | |
| 8940 | orlegendc // (c) 1997 | |
| 8941 | orlegendca // (c) 1997 | |
| 8942 | orlegend111c // (c) 1997 | |
| 8943 | orlegend105k // (c) 1997 | |
| 8944 | drgw2 // (c) 1997 | |
| 8945 | dw2v100x // (c) 1997 | |
| 8946 | drgw2c // (c) 1997 | |
| 8947 | drgw2j // (c) 1997 | |
| 8948 | drgw3 // (c) 1998 | |
| 8949 | drgw3105 // (c) 1998 | |
| 8950 | drgw3100 // (c) 1998 | |
| 8951 | dwex // (c) 1998 | |
| 8952 | killbld // (c) 1998 | |
| 8953 | killbld104 // (c) 1998 | |
| 8954 | kov // (c) 1999 | |
| 8955 | kovplus // (c) 1999 | |
| 8956 | kovplusa // (c) 1999 | |
| 8937 | pgm // Base Unit | |
| 8938 | orlegend // (c) 1997 Oriental Legend | |
| 8939 | orlegende // | |
| 8940 | orlegendc // | |
| 8941 | orlegendca // | |
| 8942 | orlegend111c // | |
| 8943 | orlegend105k // | |
| 8944 | drgw2 // (c) 1997 Dragon World 2 | |
| 8945 | dw2v100x // | |
| 8946 | drgw2c // | |
| 8947 | drgw2j // | |
| 8948 | drgw3 // (c) 1998 Dragon World 3 | |
| 8949 | drgw3105 // | |
| 8950 | drgw3100 // | |
| 8951 | dwex // (c) 1998 Dragon World 3 EX | |
| 8952 | killbld // (c) 1998 The Killing Blade | |
| 8953 | killbld104 // | |
| 8954 | kov // (c) 1999 Knights of Valor | |
| 8955 | kov115 // | |
| 8956 | kov100 // | |
| 8957 | kovplus // (c) 1999 Knights of Valor Plus (aka 10 Character version) | |
| 8958 | kovplusa // | |
| 8957 | 8959 | kovsgqyz // bootleg |
| 8958 | 8960 | kovsgqyza // bootleg |
| 8959 | 8961 | kovsgqyzb // bootleg |
| 8960 | kov115 // (c) 1999 | |
| 8961 | kov100 // (c) 1999 | |
| 8962 | kovsh // (c) 1999 | |
| 8963 | kovsh103 // (c) 1999 | |
| 8962 | kovsh // (c) 1999 Knights of Valor Superheroes | |
| 8963 | kovsh103 // | |
| 8964 | 8964 | kovqhsgs // bootleg |
| 8965 | photoy2k // (c) 1999 Photo Y2k | |
| 8966 | photoy2k102 // | |
| 8967 | photoy2k104 // | |
| 8968 | puzlstar // (c) 1999 Puzzle Star | |
| 8969 | olds // (c) 1999 Oriental Legend Super / Special | |
| 8970 | olds100 // | |
| 8971 | olds100a // | |
| 8972 | kov2 // (c) 2000 Knights of Valor 2 | |
| 8973 | kov2106 // | |
| 8974 | kov2103 // | |
| 8975 | kov2102 // | |
| 8976 | kov2101 // | |
| 8977 | kov2100 // | |
| 8978 | kov2p // (c) 2000 Knights of Valor 2 Nine Dragons | |
| 8979 | kov2p205 // | |
| 8980 | ddp2 // (c) 2001 DoDonPachi 2 - Bee Storm | |
| 8981 | ddp2100 // | |
| 8982 | ddp2101 // | |
| 8983 | puzzli2 // (c) 2001 Puzzli 2 | |
| 8984 | martmast // (c) 2001 Martial Masters | |
| 8985 | martmastc // | |
| 8986 | martmastc102 // | |
| 8987 | theglad // (c) 2001 The Gladiator | |
| 8988 | theglada // | |
| 8989 | thegladpcb // | |
| 8990 | dw2001 // (c) 2001 Dragon World 2001 | |
| 8991 | dwpc // (c) 2001 Dragon World Pretty Chance | |
| 8992 | py2k2 // (c) 2001 Photo Y2K2 | |
| 8993 | dmnfrnt // (c) 2002 Demon Front | |
| 8994 | dmnfrnta // | |
| 8995 | dmnfrntpcb // | |
| 8996 | kovshp // (c) 200? Knights of Valor Superheroes PLUS | |
| 8997 | kovshxas // bootleg | |
| 8965 | 8998 | kovlsqh // bootleg |
| 8966 | 8999 | kovlsqh2 // bootleg |
| 8967 | 9000 | kovlsjb // bootleg |
| 8968 | 9001 | kovlsjba // bootleg |
| 8969 | photoy2k // (c) 1999 | |
| 8970 | photoy2k102 // (c) 1999 | |
| 8971 | photoy2k104 // (c) 1999 | |
| 8972 | puzlstar // (c) 1999 | |
| 8973 | olds // (c) 1999 | |
| 8974 | olds100 // (c) 1999 | |
| 8975 | olds100a // (c) 1999 | |
| 8976 | kov2 // (c) 2000 | |
| 8977 | kov2106 // (c) 2000 | |
| 8978 | kov2103 // (c) 2000 | |
| 8979 | kov2102 // (c) 2000 | |
| 8980 | kov2101 // (c) 2000 | |
| 8981 | kov2100 // (c) 2000 | |
| 8982 | kov2p // (c) 2000 | |
| 8983 | kov2p205 // (c) 2000 | |
| 8984 | ddp2 // (c) 2001 | |
| 8985 | ddp2100 // (c) 2001 | |
| 8986 | ddp2101 // (c) 2001 | |
| 8987 | puzzli2 // (c) 2001 | |
| 8988 | martmast // (c) 2001 | |
| 8989 | martmastc // (c) 2001 | |
| 8990 | martmastc102 // (c) 2001 | |
| 8991 | theglad // (c) 2001 | |
| 8992 | theglada // (c) 2001 | |
| 8993 | thegladpcb | |
| 8994 | dw2001 // (c) 2001 | |
| 8995 | dwpc // (c) 2001 | |
| 8996 | py2k2 // (c) 2001 | |
| 8997 | dmnfrnt // (c) 2002 | |
| 8998 | dmnfrnta // (c) 2002 | |
| 8999 | dmnfrntpcb | |
| 9000 | kovshp | |
| 9001 | oldsplus | |
| 9002 | killbldp | |
| 9003 | happy6 | |
| 9004 | svg | |
| 9005 | svgpcb | |
| 9006 | ket // (c) 2002 Cave | |
| 9007 | keta // (c) 2002 Cave | |
| 9008 | ketb // (c) 2002 Cave | |
| 9009 | ddpdoj // (c) 2002 Cave | |
| 9010 | ddpdoja // (c) 2002 Cave | |
| 9011 | ddpdojb // (c) 2002 Cave | |
| 9012 | ddpdojblk // (c) 2002 Cave | |
| 9013 | espgal // (c) 2003 Cave | |
| 9002 | oldsplus // (c) 2004 Oriental Legend Super Plus | |
| 9003 | killbldp // (c) 2004 Killing Blade Plus | |
| 9004 | happy6 // (c) 200? Happy 6 | |
| 9005 | svg // (c) 2003 Spectral vs Generation | |
| 9006 | svgpcb // | |
| 9007 | ket // (c) 2002 Ketsui | |
| 9008 | keta // | |
| 9009 | ketb // | |
| 9010 | ddpdoj // (c) 2002 DoDonPachi Dai-Ou-Jou | |
| 9011 | ddpdoja // | |
| 9012 | ddpdojb // | |
| 9013 | ddpdojblk // | |
| 9014 | espgal // (c) 2003 Espgaluda | |
| 9015 | ||
| 9016 | // IGS PGM2 Platform | |
| 9017 | ||
| 9014 | 9018 | orleg2 // (c) 2007 |
| 9015 | 9019 | orleg2o // |
| 9016 | 9020 | kov2nl // (c) 2008 |
| r14896 | r14897 | |
| 17222 | 17226 | ad5tornc // Tornado Club (Bellfruit) |
| 17223 | 17227 | ad5vpa // Video Poker Ace (Bellfruit) |
| 17224 | 17228 | ad5vlv // Viva Las Vegas (Bellfruit) |
| 17225 | ad5u1337 // Unknown Scorpion '39211337' (Mazooma) | |
| 17226 | 17229 | |
| 17227 | 17230 | |
| 17228 | 17231 |
| r14896 | r14897 | |
|---|---|---|
| 370 | 370 | ***************************************************************************/ |
| 371 | 371 | |
| 372 | 372 | |
| 373 | WRITE8_ | |
| 373 | WRITE8_M | |
| 374 | 374 | { |
| 375 | micro3d_state *state = space->machine().driver_data<micro3d_state>(); | |
| 376 | state->m_dac_data = data; | |
| 375 | m_dac_data = data; | |
| 377 | 376 | } |
| 378 | 377 | |
| 379 | WRITE8_ | |
| 378 | WRITE8_M | |
| 380 | 379 | { |
| 381 | 380 | /* TODO: This controls upd7759 volume */ |
| 382 | 381 | } |
| 383 | 382 | |
| 384 | WRITE8_ | |
| 383 | WRITE8_M | |
| 385 | 384 | { |
| 386 | micro3d_state *state = space->machine().driver_data<micro3d_state>(); | |
| 387 | 385 | |
| 388 | | |
| 386 | | |
| 389 | 387 | |
| 390 | 388 | switch (offset) |
| 391 | 389 | { |
| 392 | 390 | case 0x01: |
| 393 | 391 | { |
| 394 | micro3d_noise_sh_w( | |
| 392 | micro3d_noise_sh_w( | |
| 395 | 393 | break; |
| 396 | 394 | } |
| 397 | 395 | case 0x03: |
| 398 | 396 | { |
| 399 | device_t *upd = | |
| 397 | device_t *upd = | |
| 400 | 398 | upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0); |
| 401 | 399 | upd7759_reset_w(upd, (data & 0x10) ? 0 : 1); |
| 402 | 400 | break; |
| r14896 | r14897 | |
| 404 | 402 | } |
| 405 | 403 | } |
| 406 | 404 | |
| 407 | READ8_ | |
| 405 | READ8_M | |
| 408 | 406 | { |
| 409 | micro3d_state *state = space->machine().driver_data<micro3d_state>(); | |
| 410 | 407 | |
| 411 | 408 | switch (offset) |
| 412 | 409 | { |
| 413 | case 0x01: return (state->m_sound_port_latch[offset] & 0x7f) | input_port_read(space->machine(), "SOUND_SW"); | |
| 414 | case 0x03: return (state->m_sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine().device("upd7759")) ? 0x08 : 0); | |
| 410 | case 0x01: return (m_sound_port_latch[offset] & 0x7f) | input_port_read(machine(), "SOUND_SW"); | |
| 411 | case 0x03: return (m_sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(machine().device("upd7759")) ? 0x08 : 0); | |
| 415 | 412 | default: return 0; |
| 416 | 413 | } |
| 417 | 414 | } |
| r14896 | r14897 | |
|---|---|---|
| 11 | 11 | #include "includes/spacefb.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | READ8_ | |
| 14 | READ8_M | |
| 15 | 15 | { |
| 16 | spacefb_state *state = space->machine().driver_data<spacefb_state>(); | |
| 17 | return (state->m_sound_latch & 0x18) << 1; | |
| 16 | return (m_sound_latch & 0x18) << 1; | |
| 18 | 17 | } |
| 19 | 18 | |
| 20 | 19 | |
| 21 | READ8_ | |
| 20 | READ8_M | |
| 22 | 21 | { |
| 23 | spacefb_state *state = space->machine().driver_data<spacefb_state>(); | |
| 24 | return state->m_sound_latch & 0x20; | |
| 22 | return m_sound_latch & 0x20; | |
| 25 | 23 | } |
| 26 | 24 | |
| 27 | 25 | |
| 28 | READ8_ | |
| 26 | READ8_M | |
| 29 | 27 | { |
| 30 | spacefb_state *state = space->machine().driver_data<spacefb_state>(); | |
| 31 | return state->m_sound_latch & 0x04; | |
| 28 | return m_sound_latch & 0x04; | |
| 32 | 29 | } |
| 33 | 30 | |
| 34 | 31 | |
| 35 | WRITE8_ | |
| 32 | WRITE8_M | |
| 36 | 33 | { |
| 37 | spacefb_state *state = space->machine().driver_data<spacefb_state>(); | |
| 38 | samples_device *samples = space->machine().device<samples_device>("samples"); | |
| 34 | samples_device *samples = machine().device<samples_device>("samples"); | |
| 39 | 35 | |
| 40 | cputag_set_input_line( | |
| 36 | cputag_set_input_line( | |
| 41 | 37 | |
| 42 | 38 | /* enemy killed */ |
| 43 | if (!(data & 0x01) && ( | |
| 39 | if (!(data & 0x01) && ( | |
| 44 | 40 | |
| 45 | 41 | /* ship fire */ |
| 46 | if (!(data & 0x40) && ( | |
| 42 | if (!(data & 0x40) && ( | |
| 47 | 43 | |
| 48 | 44 | /* |
| 49 | 45 | * Explosion Noise |
| 50 | 46 | * |
| 51 | 47 | * Actual sample has a bit of attack at the start, but these doesn't seem to be an easy way |
| 52 | 48 | * to play the attack part, then loop the middle bit until the sample is turned off |
| 53 | * Fortunately it seems like the recorded sample of the spaceship death is the longest the sample plays for. | |
| 49 | * Fortunately it seems like the recorded sample of the &spaceship death is the longest the sample plays for. | |
| 54 | 50 | * We loop it just in case it runs out |
| 55 | 51 | */ |
| 56 | if ((data & 0x80) != ( | |
| 52 | if ((data & 0x80) != ( | |
| 57 | 53 | { |
| 58 | 54 | if (data & 0x80) |
| 59 | 55 | /* play decaying noise */ |
| r14896 | r14897 | |
| 63 | 59 | samples->start(2,2, true); |
| 64 | 60 | } |
| 65 | 61 | |
| 66 | | |
| 62 | | |
| 67 | 63 | } |
| 68 | 64 | |
| 69 | 65 |
| r14896 | r14897 | |
|---|---|---|
| 313 | 313 | if (~data & 0x20) state->m_curr_sound_pins |= 1 << 0xc; |
| 314 | 314 | |
| 315 | 315 | if (state->m_n8080_hardware == 1) |
| 316 | flip_screen_set_no_update( | |
| 316 | state->flip_screen_set_no_update( | |
| 317 | 317 | if (state->m_n8080_hardware == 3) |
| 318 | 318 | state->m_helifire_flash = data & 0x20; |
| 319 | 319 | |
| r14896 | r14897 | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
| 330 | WRITE8_ | |
| 330 | WRITE8_M | |
| 331 | 331 | { |
| 332 | | |
| 332 | | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | WRITE8_ | |
| 335 | WRITE8_M | |
| 336 | 336 | { |
| 337 | | |
| 337 | | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | |
| 341 | ||
| 341 | ||
| 342 | 342 | { |
| 343 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 344 | 343 | UINT8 val = 0; |
| 345 | 344 | |
| 346 | if ((state->m_curr_sound_pins >> 0xb) & 1) val |= 0x01; | |
| 347 | if ((state->m_curr_sound_pins >> 0xa) & 1) val |= 0x02; | |
| 348 | if ((state->m_curr_sound_pins >> 0x9) & 1) val |= 0x04; | |
| 349 | if ((state->m_curr_sound_pins >> 0x8) & 1) val |= 0x08; | |
| 350 | if ((state->m_curr_sound_pins >> 0x5) & 1) val |= 0x10; | |
| 351 | if ((state->m_curr_sound_pins >> 0x3) & 1) val |= 0x20; | |
| 352 | if ((state->m_curr_sound_pins >> 0x2) & 1) val |= 0x40; | |
| 353 | if ((state->m_curr_sound_pins >> 0x1) & 1) val |= 0x80; | |
| 345 | if ((m_curr_sound_pins >> 0xb) & 1) val |= 0x01; | |
| 346 | if ((m_curr_sound_pins >> 0xa) & 1) val |= 0x02; | |
| 347 | if ((m_curr_sound_pins >> 0x9) & 1) val |= 0x04; | |
| 348 | if ((m_curr_sound_pins >> 0x8) & 1) val |= 0x08; | |
| 349 | if ((m_curr_sound_pins >> 0x5) & 1) val |= 0x10; | |
| 350 | if ((m_curr_sound_pins >> 0x3) & 1) val |= 0x20; | |
| 351 | if ((m_curr_sound_pins >> 0x2) & 1) val |= 0x40; | |
| 352 | if ((m_curr_sound_pins >> 0x1) & 1) val |= 0x80; | |
| 354 | 353 | |
| 355 | 354 | return val; |
| 356 | 355 | } |
| 357 | 356 | |
| 358 | 357 | |
| 359 | ||
| 358 | ||
| 360 | 359 | { |
| 361 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 362 | return (state->m_curr_sound_pins >> 0x7) & 1; | |
| 360 | return (m_curr_sound_pins >> 0x7) & 1; | |
| 363 | 361 | } |
| 364 | ||
| 362 | ||
| 365 | 363 | { |
| 366 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 367 | return (state->m_curr_sound_pins >> 0xc) & 1; | |
| 364 | return (m_curr_sound_pins >> 0xc) & 1; | |
| 368 | 365 | } |
| 369 | 366 | |
| 370 | 367 | |
| 371 | ||
| 368 | ||
| 372 | 369 | { |
| 373 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 374 | return (state->m_curr_sound_pins >> 0x3) & 1; | |
| 370 | return (m_curr_sound_pins >> 0x3) & 1; | |
| 375 | 371 | } |
| 376 | ||
| 372 | ||
| 377 | 373 | { |
| 378 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 379 | return (state->m_curr_sound_pins >> 0x4) & 1; | |
| 374 | return (m_curr_sound_pins >> 0x4) & 1; | |
| 380 | 375 | } |
| 381 | 376 | |
| 382 | 377 | |
| 383 | ||
| 378 | ||
| 384 | 379 | { |
| 385 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 386 | 380 | UINT8 val = 0; |
| 387 | 381 | |
| 388 | if ((state->m_curr_sound_pins >> 0x7) & 1) val |= 0x01; | |
| 389 | if ((state->m_curr_sound_pins >> 0x8) & 1) val |= 0x02; | |
| 390 | if ((state->m_curr_sound_pins >> 0x9) & 1) val |= 0x04; | |
| 391 | if ((state->m_curr_sound_pins >> 0x1) & 1) val |= 0x08; | |
| 382 | if ((m_curr_sound_pins >> 0x7) & 1) val |= 0x01; | |
| 383 | if ((m_curr_sound_pins >> 0x8) & 1) val |= 0x02; | |
| 384 | if ((m_curr_sound_pins >> 0x9) & 1) val |= 0x04; | |
| 385 | if ((m_curr_sound_pins >> 0x1) & 1) val |= 0x08; | |
| 392 | 386 | |
| 393 | 387 | return val; |
| 394 | 388 | } |
| 395 | 389 | |
| 396 | 390 | |
| 397 | ||
| 391 | ||
| 398 | 392 | { |
| 399 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 400 | return ((state->m_curr_sound_pins >> 0xc) & 1) ? 0x10 : 0x00; /* not used */ | |
| 393 | return ((m_curr_sound_pins >> 0xc) & 1) ? 0x10 : 0x00; /* not used */ | |
| 401 | 394 | } |
| 402 | 395 | |
| 403 | 396 | |
| 404 | ||
| 397 | ||
| 405 | 398 | { |
| 406 | dac_data_w( | |
| 399 | dac_data_w( | |
| 407 | 400 | } |
| 408 | 401 | |
| 409 | 402 | |
| 410 | ||
| 403 | ||
| 411 | 404 | { |
| 412 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 413 | dac_data_w(space->machine().device("dac"), data * state->m_helifire_dac_volume); | |
| 405 | dac_data_w(machine().device("dac"), data * m_helifire_dac_volume); | |
| 414 | 406 | } |
| 415 | 407 | |
| 416 | 408 | |
| 417 | ||
| 409 | ||
| 418 | 410 | { |
| 419 | n8080_state *state = space->machine().driver_data<n8080_state>(); | |
| 420 | state->m_helifire_dac_phase = data & 0x80; | |
| 411 | m_helifire_dac_phase = data & 0x80; | |
| 421 | 412 | |
| 422 | 413 | /* data & 0x40 not emulated */ |
| 423 | 414 | /* data & 0x20 not emulated */ |
| 424 | 415 | |
| 425 | if ( | |
| 416 | if ( | |
| 426 | 417 | { |
| 427 | | |
| 418 | | |
| 428 | 419 | } |
| 429 | 420 | else |
| 430 | 421 | { |
| 431 | | |
| 422 | | |
| 432 | 423 | } |
| 433 | 424 | |
| 434 | | |
| 425 | | |
| 435 | 426 | } |
| 436 | 427 | |
| 437 | 428 | |
| r14896 | r14897 | |
| 558 | 549 | } |
| 559 | 550 | |
| 560 | 551 | |
| 561 | static ADDRESS_MAP_START( n8080_sound_cpu_map, AS_PROGRAM, 8, | |
| 552 | static ADDRESS_MAP_START( n8080_sound_cpu_map, AS_PROGRAM, 8, n8080 | |
| 562 | 553 | ADDRESS_MAP_GLOBAL_MASK(0x3ff) |
| 563 | 554 | AM_RANGE(0x0000, 0x03ff) AM_ROM |
| 564 | 555 | ADDRESS_MAP_END |
| 565 | 556 | |
| 566 | 557 | |
| 567 | static ADDRESS_MAP_START( n8080_sound_io_map, AS_IO, 8, driver_device ) | |
| 568 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ_LEGACY(n8080_8035_t0_r) | |
| 569 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_LEGACY(n8080_8035_t1_r) | |
| 570 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ_LEGACY(n8080_8035_p1_r) | |
| 558 | static ADDRESS_MAP_START( n8080_sound_io_map, AS_IO, 8, n8080_state ) | |
| 559 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(n8080_8035_t0_r) | |
| 560 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n8080_8035_t1_r) | |
| 561 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(n8080_8035_p1_r) | |
| 571 | 562 | |
| 572 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE | |
| 563 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE | |
| 573 | 564 | ADDRESS_MAP_END |
| 574 | 565 | |
| 575 | 566 | |
| 576 | static ADDRESS_MAP_START( helifire_sound_io_map, AS_IO, 8, driver_device ) | |
| 577 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ_LEGACY(helifire_8035_t0_r) | |
| 578 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_LEGACY(helifire_8035_t1_r) | |
| 579 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ_LEGACY(helifire_8035_p2_r) | |
| 567 | static ADDRESS_MAP_START( helifire_sound_io_map, AS_IO, 8, n8080_state ) | |
| 568 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(helifire_8035_t0_r) | |
| 569 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(helifire_8035_t1_r) | |
| 570 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(helifire_8035_p2_r) | |
| 580 | 571 | |
| 581 | AM_RANGE(0x00, 0x7f) AM_READ | |
| 572 | AM_RANGE(0x00, 0x7f) AM_READ | |
| 582 | 573 | |
| 583 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE_LEGACY(helifire_dac_w) | |
| 584 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE_LEGACY(helifire_sound_ctrl_w) | |
| 574 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(helifire_dac_w) | |
| 575 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(helifire_sound_ctrl_w) | |
| 585 | 576 | ADDRESS_MAP_END |
| 586 | 577 | |
| 587 | 578 |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | * |
| 36 | 36 | *************************************/ |
| 37 | 37 | |
| 38 | READ8_ | |
| 38 | READ8_M | |
| 39 | 39 | { |
| 40 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 41 | int temp = input_port_read(space->machine(), "JSAII"); | |
| 42 | if (!(input_port_read(space->machine(), "IN0") & 0x8000)) temp ^= 0x80; | |
| 43 | if (state->m_cpu_to_sound_ready) temp ^= 0x40; | |
| 44 | if (state->m_sound_to_cpu_ready) temp ^= 0x20; | |
| 40 | int temp = input_port_read(machine(), "JSAII"); | |
| 41 | if (!(input_port_read(machine(), "IN0") & 0x8000)) temp ^= 0x80; | |
| 42 | if (m_cpu_to_sound_ready) temp ^= 0x40; | |
| 43 | if (m_sound_to_cpu_ready) temp ^= 0x20; | |
| 45 | 44 | return temp; |
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | |
| 49 | READ8_ | |
| 48 | READ8_M | |
| 50 | 49 | { |
| 51 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 52 | 50 | int temp = 0xff; |
| 53 | if (state->m_sound_data_from_6502_ready) temp ^= 0x80; | |
| 54 | if (state->m_sound_data_from_68k_ready) temp ^= 0x40; | |
| 51 | if (m_sound_data_from_6502_ready) temp ^= 0x80; | |
| 52 | if (m_sound_data_from_68k_ready) temp ^= 0x40; | |
| 55 | 53 | return temp; |
| 56 | 54 | } |
| 57 | 55 | |
| 58 | 56 | |
| 59 | WRITE8_ | |
| 57 | WRITE8_M | |
| 60 | 58 | { |
| 61 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 62 | memory_set_bankptr(space->machine(), "soundbank", &state->m_bank_base[0x1000 * ((data >> 6) & 3)]); | |
| 63 | coin_counter_w(space->machine(), 1, (data >> 5) & 1); | |
| 64 | coin_counter_w(space->machine(), 0, (data >> 4) & 1); | |
| 65 | cputag_set_input_line(space->machine(), "dac", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 66 | if (!(data & 0x01)) devtag_reset(space->machine(), "ymsnd"); | |
| 59 | memory_set_bankptr(machine(), "soundbank", &m_bank_base[0x1000 * ((data >> 6) & 3)]); | |
| 60 | coin_counter_w(machine(), 1, (data >> 5) & 1); | |
| 61 | coin_counter_w(machine(), 0, (data >> 4) & 1); | |
| 62 | cputag_set_input_line(machine(), "dac", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 63 | if (!(data & 0x01)) devtag_reset(machine(), "ymsnd"); | |
| 67 | 64 | } |
| 68 | 65 | |
| 69 | 66 | |
| 70 | READ8_ | |
| 67 | READ8_M | |
| 71 | 68 | { |
| 72 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 73 | state->m_sound_data_from_68k_ready = 0; | |
| 74 | return state->m_sound_data_from_68k; | |
| 69 | m_sound_data_from_68k_ready = 0; | |
| 70 | return m_sound_data_from_68k; | |
| 75 | 71 | } |
| 76 | 72 | |
| 77 | 73 | |
| 78 | WRITE8_ | |
| 74 | WRITE8_M | |
| 79 | 75 | { |
| 80 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 81 | 76 | |
| 82 | state->m_sound_data_from_6502 = data; | |
| 83 | state->m_sound_data_from_6502_ready = 1; | |
| 77 | m_sound_data_from_6502 = data; | |
| 78 | m_sound_data_from_6502_ready = 1; | |
| 84 | 79 | |
| 85 | if (! | |
| 80 | if (! | |
| 86 | 81 | { |
| 87 | state->m_io_68k_int = 1; | |
| 88 | update_sound_68k_interrupts(space->machine()); | |
| 82 | m_io_68k_int = 1; | |
| 83 | update_sound_68k_interrupts(machine()); | |
| 89 | 84 | } |
| 90 | 85 | } |
| 91 | 86 | |
| r14896 | r14897 | |
| 116 | 111 | } |
| 117 | 112 | |
| 118 | 113 | |
| 119 | WRITE16_ | |
| 114 | WRITE16_M | |
| 120 | 115 | { |
| 121 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 122 | if (state->m_io_68k_int) | |
| 116 | if (m_io_68k_int) | |
| 123 | 117 | { |
| 124 | state->m_io_68k_int = 0; | |
| 125 | update_sound_68k_interrupts(space->machine()); | |
| 118 | m_io_68k_int = 0; | |
| 119 | update_sound_68k_interrupts(machine()); | |
| 126 | 120 | } |
| 127 | 121 | } |
| 128 | 122 | |
| 129 | 123 | |
| 130 | READ16_ | |
| 124 | READ16_M | |
| 131 | 125 | { |
| 132 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 133 | int temp = (state->m_sound_data_from_6502 << 8) | 0xff; | |
| 126 | int temp = (m_sound_data_from_6502 << 8) | 0xff; | |
| 134 | 127 | |
| 135 | | |
| 128 | | |
| 136 | 129 | |
| 137 | if (state->m_sound_data_from_6502_ready) temp ^= 0x08; | |
| 138 | if (state->m_sound_data_from_68k_ready) temp ^= 0x04; | |
| 130 | if (m_sound_data_from_6502_ready) temp ^= 0x08; | |
| 131 | if (m_sound_data_from_68k_ready) temp ^= 0x04; | |
| 139 | 132 | return temp; |
| 140 | 133 | } |
| 141 | 134 | |
| 142 | 135 | |
| 143 | WRITE16_ | |
| 136 | WRITE16_M | |
| 144 | 137 | { |
| 145 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 146 | 138 | if (ACCESSING_BITS_8_15) |
| 147 | 139 | { |
| 148 | state->m_sound_data_from_68k = (data >> 8) & 0xff; | |
| 149 | state->m_sound_data_from_68k_ready = 1; | |
| 140 | m_sound_data_from_68k = (data >> 8) & 0xff; | |
| 141 | m_sound_data_from_68k_ready = 1; | |
| 150 | 142 | } |
| 151 | 143 | } |
| 152 | 144 | |
| 153 | 145 | |
| 154 | WRITE16_ | |
| 146 | WRITE16_M | |
| 155 | 147 | { |
| 156 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 157 | device_t *dac = space->machine().device((offset & 8) ? "dac2" : "dac1"); | |
| 148 | device_t *dac = machine().device((offset & 8) ? "dac2" : "dac1"); | |
| 158 | 149 | dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4); |
| 159 | 150 | |
| 160 | if ( | |
| 151 | if ( | |
| 161 | 152 | { |
| 162 | state->m_fast_68k_int = 0; | |
| 163 | update_sound_68k_interrupts(space->machine()); | |
| 153 | m_fast_68k_int = 0; | |
| 154 | update_sound_68k_interrupts(machine()); | |
| 164 | 155 | } |
| 165 | 156 | } |
| r14896 | r14897 | |
|---|---|---|
| 3 | 3 | #include "sound/tms3615.h" |
| 4 | 4 | #include "includes/laserbat.h" |
| 5 | 5 | |
| 6 | WRITE8_ | |
| 6 | WRITE8_M | |
| 7 | 7 | { |
| 8 | laserbat_state *state = space->machine().driver_data<laserbat_state>(); | |
| 9 | state->m_csound1 = data; | |
| 8 | m_csound1 = data; | |
| 10 | 9 | } |
| 11 | 10 | |
| 12 | WRITE8_ | |
| 11 | WRITE8_M | |
| 13 | 12 | { |
| 14 | laserbat_state *state = space->machine().driver_data<laserbat_state>(); | |
| 15 | 13 | int ksound = 0; |
| 16 | 14 | |
| 17 | 15 | if (data & 0x01) |
| 18 | 16 | { |
| 19 | 17 | int noise_filter_res = 0, vco_res = 0; |
| 20 | 18 | |
| 21 | switch( | |
| 19 | switch( | |
| 22 | 20 | { |
| 23 | 21 | case 0x00: |
| 24 | 22 | noise_filter_res = RES_K(270); |
| r14896 | r14897 | |
| 54 | 52 | break; |
| 55 | 53 | } |
| 56 | 54 | |
| 57 | sn76477_noise_filter_res_w(state->m_sn, noise_filter_res); | |
| 58 | sn76477_vco_res_w(state->m_sn, vco_res); | |
| 55 | sn76477_noise_filter_res_w(m_sn, noise_filter_res); | |
| 56 | sn76477_vco_res_w(m_sn, vco_res); | |
| 59 | 57 | |
| 60 | sn76477_enable_w(state->m_sn, (state->m_csound1 & 0x08) ? 1 : 0); // AB SOUND | |
| 61 | sn76477_mixer_b_w(state->m_sn, (state->m_csound1 & 0x10) ? 1 : 0); // _VCO/NOISE | |
| 58 | sn76477_enable_w(m_sn, (m_csound1 & 0x08) ? 1 : 0); // AB SOUND | |
| 59 | sn76477_mixer_b_w(m_sn, (m_csound1 & 0x10) ? 1 : 0); // _VCO/NOISE | |
| 62 | 60 | |
| 63 | state->m_degr = (state->m_csound1 & 0x20) ? 1 : 0; | |
| 64 | state->m_filt = (state->m_csound1 & 0x40) ? 1 : 0; | |
| 65 | state->m_a = (state->m_csound1 & 0x80) ? 1 : 0; | |
| 66 | state->m_us = 0; // sn76477 pin 12 | |
| 61 | m_degr = (m_csound1 & 0x20) ? 1 : 0; | |
| 62 | m_filt = (m_csound1 & 0x40) ? 1 : 0; | |
| 63 | m_a = (m_csound1 & 0x80) ? 1 : 0; | |
| 64 | m_us = 0; // sn76477 pin 12 | |
| 67 | 65 | } |
| 68 | 66 | |
| 69 | sn76477_vco_w( | |
| 67 | sn76477_vco_w( | |
| 70 | 68 | |
| 71 | 69 | switch((data & 0x1c) >> 2) |
| 72 | 70 | { |
| 73 | 71 | case 0x00: |
| 74 | sn76477_slf_res_w( | |
| 72 | sn76477_slf_res_w( | |
| 75 | 73 | break; |
| 76 | 74 | case 0x01: |
| 77 | sn76477_slf_res_w( | |
| 75 | sn76477_slf_res_w( | |
| 78 | 76 | break; |
| 79 | 77 | case 0x02: |
| 80 | sn76477_slf_res_w( | |
| 78 | sn76477_slf_res_w( | |
| 81 | 79 | break; |
| 82 | 80 | case 0x03: |
| 83 | sn76477_slf_res_w( | |
| 81 | sn76477_slf_res_w( | |
| 84 | 82 | break; |
| 85 | 83 | case 0x04: // not connected |
| 86 | 84 | break; |
| 87 | 85 | case 0x05: // SL1 |
| 88 | | |
| 86 | | |
| 89 | 87 | break; |
| 90 | 88 | case 0x06: // SL2 |
| 91 | | |
| 89 | | |
| 92 | 90 | break; |
| 93 | 91 | case 0x07: // SL3 |
| 94 | | |
| 92 | | |
| 95 | 93 | break; |
| 96 | 94 | } |
| 97 | 95 | |
| 98 | ksound = ((data & 0x02) << 23) + ( | |
| 96 | ksound = ((data & 0x02) << 23) + ( | |
| 99 | 97 | |
| 100 | tms3615_enable_w(state->m_tms1, ksound & 0x1fff); | |
| 101 | tms3615_enable_w(state->m_tms2, (ksound >> 13) << 1); | |
| 98 | tms3615_enable_w(m_tms1, ksound & 0x1fff); | |
| 99 | tms3615_enable_w(m_tms2, (ksound >> 13) << 1); | |
| 102 | 100 | |
| 103 | | |
| 101 | | |
| 104 | 102 | |
| 105 | 103 | // (data & 0x80) = reset |
| 106 | 104 | } |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | }; |
| 47 | 47 | |
| 48 | 48 | |
| 49 | WRITE8_ | |
| 49 | WRITE8_M | |
| 50 | 50 | { |
| 51 | senjyo_state *state = space->machine().driver_data<senjyo_state>(); | |
| 52 | samples_device *samples = space->machine().device<samples_device>("samples"); | |
| 51 | samples_device *samples = machine().device<samples_device>("samples"); | |
| 53 | 52 | |
| 54 | state->m_single_volume = data & 0x0f; | |
| 55 | samples->set_volume(0, state->m_single_volume / 15.0); | |
| 53 | m_single_volume = data & 0x0f; | |
| 54 | samples->set_volume(0, m_single_volume / 15.0); | |
| 56 | 55 | } |
| 57 | 56 | |
| 58 | 57 |
| r14896 | r14897 | |
|---|---|---|
| 686 | 686 | DISCRETE_SOUND_END |
| 687 | 687 | |
| 688 | 688 | |
| 689 | WRITE8_ | |
| 689 | WRITE8_M | |
| 690 | 690 | { |
| 691 | device_t *device = space->machine().device("discrete"); | |
| 692 | copsnrob_state *state = space->machine().driver_data<copsnrob_state>(); | |
| 693 | UINT8 latched_data = state->m_ic_h3_data; | |
| 691 | device_t *device = machine().device("discrete"); | |
| 692 | UINT8 latched_data = m_ic_h3_data; | |
| 694 | 693 | UINT8 special_data = data & 0x01; |
| 695 | 694 | |
| 696 | 695 | /* ignore if no change */ |
| r14896 | r14897 | |
| 730 | 729 | |
| 731 | 730 | case 0x06: |
| 732 | 731 | /* One Start */ |
| 733 | set_led_status( | |
| 732 | set_led_status( | |
| 734 | 733 | break; |
| 735 | 734 | |
| 736 | 735 | case 0x07: |
| 737 | 736 | discrete_sound_w(device, COPSNROB_AUDIO_ENABLE, special_data); |
| 738 | // | |
| 737 | // | |
| 739 | 738 | break; |
| 740 | 739 | |
| 741 | 740 | } |
| 742 | 741 | |
| 743 | | |
| 742 | | |
| 744 | 743 | } |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | WRITE8_ | |
| 45 | WRITE8_M | |
| 46 | 46 | { |
| 47 | samples_device *samples = | |
| 47 | samples_device *samples = | |
| 48 | 48 | if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n"); |
| 49 | 49 | samples->start(0,0); |
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | WRITE8_ | |
| 53 | WRITE8_M | |
| 54 | 54 | { |
| 55 | 55 | if (BLOCKADE_LOG) mame_printf_debug("Boom End\n"); |
| 56 | 56 | return; |
| r14896 | r14897 | |
|---|---|---|
| 217 | 217 | * |
| 218 | 218 | *************************************/ |
| 219 | 219 | |
| 220 | WRITE8_ | |
| 220 | WRITE8_M | |
| 221 | 221 | { |
| 222 | segag80r_state *state = space->machine().driver_data<segag80r_state>(); | |
| 223 | 222 | static const float attack_resistor[10] = |
| 224 | 223 | { |
| 225 | 224 | 120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f |
| 226 | 225 | }; |
| 227 | samples_device *samples = | |
| 226 | samples_device *samples = | |
| 228 | 227 | float freq_factor; |
| 229 | 228 | |
| 230 | UINT8 diff = data ^ state->m_sound_state[offset]; | |
| 231 | state->m_sound_state[offset] = data; | |
| 229 | UINT8 diff = data ^ m_sound_state[offset]; | |
| 230 | m_sound_state[offset] = data; | |
| 232 | 231 | |
| 233 | 232 | switch (offset) |
| 234 | 233 | { |
| r14896 | r14897 | |
| 254 | 253 | if ((data & 0x10) && samples->playing(4)) samples->stop(4); |
| 255 | 254 | |
| 256 | 255 | /* MUTE */ |
| 257 | | |
| 256 | | |
| 258 | 257 | |
| 259 | 258 | /* REFILL: channel 5 */ |
| 260 | 259 | if (!(data & 0x40) && !samples->playing(5)) samples->start(5, 9); |
| r14896 | r14897 | |
| 284 | 283 | if ((diff & 0x08) && !(data & 0x08)) samples->start(8, 13); |
| 285 | 284 | |
| 286 | 285 | /* ATTACK RATE */ |
| 287 | if ((diff & 0x10) && !(data & 0x10)) | |
| 286 | if ((diff & 0x10) && !(data & 0x10)) | |
| 288 | 287 | |
| 289 | 288 | /* RATE RESET */ |
| 290 | if (!(data & 0x20)) | |
| 289 | if (!(data & 0x20)) | |
| 291 | 290 | |
| 292 | 291 | /* BONUS: channel 9 */ |
| 293 | 292 | if ((diff & 0x40) && !(data & 0x40)) samples->start(9, 14); |
| r14896 | r14897 | |
| 303 | 302 | /* account for the fact that frequency goes up as CV goes down */ |
| 304 | 303 | /* WARP is already taken into account by the differing samples above */ |
| 305 | 304 | freq_factor = (11.5f - 8.163f) * (-22.0f / attack_resistor[0]) + 8.163f; |
| 306 | freq_factor /= (11.5f - 8.163f) * (-22.0f / attack_resistor[ | |
| 305 | freq_factor /= (11.5f - 8.163f) * (-22.0f / attack_resistor[ | |
| 307 | 306 | |
| 308 | 307 | /* adjust the sample rate of invader sounds based the sound_rate */ |
| 309 | 308 | /* this is an approximation */ |
| r14896 | r14897 | |
| 688 | 687 | * |
| 689 | 688 | *************************************/ |
| 690 | 689 | |
| 691 | WRITE8_ | |
| 690 | WRITE8_M | |
| 692 | 691 | { |
| 693 | segag80r_state *state = space->machine().driver_data<segag80r_state>(); | |
| 694 | samples_device *samples = space->machine().device<samples_device>("samples"); | |
| 695 | UINT8 diff = data ^ state->m_sound_state[offset]; | |
| 696 | state->m_sound_state[offset] = data; | |
| 692 | samples_device *samples = machine().device<samples_device>("samples"); | |
| 693 | UINT8 diff = data ^ m_sound_state[offset]; | |
| 694 | m_sound_state[offset] = data; | |
| 697 | 695 | |
| 698 | 696 | switch (offset) |
| 699 | 697 | { |
| r14896 | r14897 | |
| 751 | 749 | static READ8_DEVICE_HANDLER( n7751_status_r ); |
| 752 | 750 | static WRITE8_DEVICE_HANDLER( n7751_command_w ); |
| 753 | 751 | static WRITE8_DEVICE_HANDLER( n7751_rom_control_w ); |
| 754 | static READ8_HANDLER( n7751_rom_r ); | |
| 755 | static READ8_HANDLER( n7751_command_r ); | |
| 752 | ||
| 753 | ||
| 756 | 754 | static WRITE8_DEVICE_HANDLER( n7751_p2_w ); |
| 757 | static READ8_HANDLER( n7751_t1_r ); | |
| 758 | 755 | |
| 756 | ||
| 759 | 757 | /* |
| 760 | 758 | Monster Bash |
| 761 | 759 | |
| r14896 | r14897 | |
| 797 | 795 | * |
| 798 | 796 | *************************************/ |
| 799 | 797 | |
| 800 | static ADDRESS_MAP_START( monsterb_7751_portmap, AS_IO, 8, driver_device ) | |
| 801 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_LEGACY(n7751_t1_r) | |
| 802 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ_LEGACY(n7751_command_r) | |
| 803 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ_LEGACY(n7751_rom_r) | |
| 798 | static ADDRESS_MAP_START( monsterb_7751_portmap, AS_IO, 8, segag80r_state ) | |
| 799 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n7751_t1_r) | |
| 800 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(n7751_command_r) | |
| 801 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(n7751_rom_r) | |
| 804 | 802 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 805 | 803 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_DEVWRITE_LEGACY("audio_8243", n7751_p2_w) |
| 806 | 804 | AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE_LEGACY("audio_8243", i8243_prog_w) |
| r14896 | r14897 | |
| 976 | 974 | } |
| 977 | 975 | |
| 978 | 976 | |
| 979 | ||
| 977 | ||
| 980 | 978 | { |
| 981 | segag80r_state *state = space->machine().driver_data<segag80r_state>(); | |
| 982 | 979 | /* read from BUS */ |
| 983 | return | |
| 980 | return | |
| 984 | 981 | } |
| 985 | 982 | |
| 986 | 983 | |
| 987 | ||
| 984 | ||
| 988 | 985 | { |
| 989 | segag80r_state *state = space->machine().driver_data<segag80r_state>(); | |
| 990 | 986 | /* read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048) */ |
| 991 | 987 | /* bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used */ |
| 992 | return 0x80 | (( | |
| 988 | return 0x80 | (( | |
| 993 | 989 | } |
| 994 | 990 | |
| 995 | 991 | |
| r14896 | r14897 | |
| 1005 | 1001 | } |
| 1006 | 1002 | |
| 1007 | 1003 | |
| 1008 | ||
| 1004 | ||
| 1009 | 1005 | { |
| 1010 | 1006 | /* T1 - labelled as "TEST", connected to ground */ |
| 1011 | 1007 | return 0; |
| r14896 | r14897 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | */ |
| 137 | 137 | |
| 138 | WRITE8_ | |
| 138 | WRITE8_M | |
| 139 | 139 | { |
| 140 | samples_device *samples = | |
| 140 | samples_device *samples = | |
| 141 | 141 | data ^= 0xff; |
| 142 | 142 | |
| 143 | 143 | /* Play fireball sample */ |
| r14896 | r14897 | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | WRITE8_ | |
| 172 | WRITE8_M | |
| 173 | 173 | { |
| 174 | samples_device *samples = | |
| 174 | samples_device *samples = | |
| 175 | 175 | data ^= 0xff; |
| 176 | 176 | |
| 177 | 177 | /* Play thrust sample */ |
| r14896 | r14897 | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | |
| 199 | WRITE8_ | |
| 199 | WRITE8_M | |
| 200 | 200 | { |
| 201 | samples_device *samples = | |
| 201 | samples_device *samples = | |
| 202 | 202 | |
| 203 | 203 | data ^= 0xff; |
| 204 | 204 | |
| r14896 | r14897 | |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | WRITE8_ | |
| 234 | WRITE8_M | |
| 235 | 235 | { |
| 236 | samples_device *samples = | |
| 236 | samples_device *samples = | |
| 237 | 237 | data ^= 0xff; |
| 238 | 238 | |
| 239 | 239 | /* Play thrust sample */ |
| r14896 | r14897 | |
| 259 | 259 | |
| 260 | 260 | |
| 261 | 261 | |
| 262 | WRITE8_ | |
| 262 | WRITE8_M | |
| 263 | 263 | { |
| 264 | samples_device *samples = | |
| 264 | samples_device *samples = | |
| 265 | 265 | data ^= 0xff; |
| 266 | 266 | |
| 267 | 267 | /* craft growing */ |
| r14896 | r14897 | |
| 296 | 296 | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | WRITE8_ | |
| 299 | WRITE8_M | |
| 300 | 300 | { |
| 301 | samples_device *samples = | |
| 301 | samples_device *samples = | |
| 302 | 302 | data ^= 0xff; |
| 303 | 303 | |
| 304 | 304 | /* craft joining */ |
| r14896 | r14897 | |
|---|---|---|
| 117 | 117 | cputag_set_input_line(device->machine(), "audiocpu", 0, !state ? ASSERT_LINE : CLEAR_LINE); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | WRITE8_ | |
| 120 | WRITE8_M | |
| 121 | 121 | { |
| 122 | cputag_set_input_line( | |
| 122 | cputag_set_input_line( | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | READ8_DEVICE_HANDLER( hotshock_soundlatch_r ) |
| 126 | 126 | { |
| 127 | 127 | driver_device *drvstate = device->machine().driver_data<driver_device>(); |
| 128 | 128 | cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE); |
| 129 | return drvstate->soundlatch_r(*device->machine().device("audiocpu")->memory().space(AS_PROGRAM),0); | |
| 129 | return drvstate->soundlatch_byte_r(*device->machine().device("audiocpu")->memory().space(AS_PROGRAM),0); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static void filter_w(device_t *device, int data) |
| r14896 | r14897 | |
| 143 | 143 | filter_rc_set_RC(device,FLT_RC_LOWPASS,1000,5100,0,CAP_P(C)); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | WRITE8_ | |
| 146 | WRITE8_M | |
| 147 | 147 | { |
| 148 | filter_w(space->machine().device("filter.1.0"), (offset >> 0) & 3); | |
| 149 | filter_w(space->machine().device("filter.1.1"), (offset >> 2) & 3); | |
| 150 | filter_w(space->machine().device("filter.1.2"), (offset >> 4) & 3); | |
| 151 | filter_w(space->machine().device("filter.0.0"), (offset >> 6) & 3); | |
| 152 | filter_w(space->machine().device("filter.0.1"), (offset >> 8) & 3); | |
| 153 | filter_w(space->machine().device("filter.0.2"), (offset >> 10) & 3); | |
| 148 | filter_w(machine().device("filter.1.0"), (offset >> 0) & 3); | |
| 149 | filter_w(machine().device("filter.1.1"), (offset >> 2) & 3); | |
| 150 | filter_w(machine().device("filter.1.2"), (offset >> 4) & 3); | |
| 151 | filter_w(machine().device("filter.0.0"), (offset >> 6) & 3); | |
| 152 | filter_w(machine().device("filter.0.1"), (offset >> 8) & 3); | |
| 153 | filter_w(machine().device("filter.0.2"), (offset >> 10) & 3); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | WRITE8_ | |
| 156 | WRITE8_M | |
| 157 | 157 | { |
| 158 | filter_w(space->machine().device("filter.0.0"), (offset >> 6) & 3); | |
| 159 | filter_w(space->machine().device("filter.0.1"), (offset >> 8) & 3); | |
| 160 | filter_w(space->machine().device("filter.0.2"), (offset >> 10) & 3); | |
| 158 | filter_w(machine().device("filter.0.0"), (offset >> 6) & 3); | |
| 159 | filter_w(machine().device("filter.0.1"), (offset >> 8) & 3); | |
| 160 | filter_w(machine().device("filter.0.2"), (offset >> 10) & 3); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | void scramble_sh_init(running_machine &machine) |
| r14896 | r14897 | |
|---|---|---|
| 58 | 58 | * |
| 59 | 59 | *************************************/ |
| 60 | 60 | |
| 61 | ||
| 61 | ||
| 62 | 62 | { |
| 63 | cputag_set_input_line( | |
| 63 | cputag_set_input_line( | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r14896 | r14897 | |
| 71 | 71 | * |
| 72 | 72 | *************************************/ |
| 73 | 73 | |
| 74 | WRITE8_ | |
| 74 | WRITE8_M | |
| 75 | 75 | { |
| 76 | cputag_set_input_line( | |
| 76 | cputag_set_input_line( | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| r14896 | r14897 | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | WRITE8_ | |
| 89 | WRITE8_M | |
| 90 | 90 | { |
| 91 | | |
| 91 | | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | ||
| 95 | ||
| 96 | 96 | { |
| 97 | jedi_state *state = space->machine().driver_data<jedi_state>(); | |
| 98 | 97 | |
| 99 | *state->m_audio_comm_stat &= ~0x80; | |
| 100 | return state->m_audio_latch; | |
| 98 | *m_audio_comm_stat &= ~0x80; | |
| 99 | return m_audio_latch; | |
| 101 | 100 | } |
| 102 | 101 | |
| 103 | 102 | |
| r14896 | r14897 | |
| 114 | 113 | * |
| 115 | 114 | *************************************/ |
| 116 | 115 | |
| 117 | READ8_ | |
| 116 | READ8_M | |
| 118 | 117 | { |
| 119 | jedi_state *state = space->machine().driver_data<jedi_state>(); | |
| 120 | 118 | |
| 121 | *state->m_audio_comm_stat &= ~0x40; | |
| 122 | return state->m_audio_ack_latch; | |
| 119 | *m_audio_comm_stat &= ~0x40; | |
| 120 | return m_audio_ack_latch; | |
| 123 | 121 | } |
| 124 | 122 | |
| 125 | 123 | |
| 126 | ||
| 124 | ||
| 127 | 125 | { |
| 128 | jedi_state *state = space->machine().driver_data<jedi_state>(); | |
| 129 | 126 | |
| 130 | state->m_audio_ack_latch = data; | |
| 131 | *state->m_audio_comm_stat |= 0x40; | |
| 127 | m_audio_ack_latch = data; | |
| 128 | *m_audio_comm_stat |= 0x40; | |
| 132 | 129 | } |
| 133 | 130 | |
| 134 | 131 | |
| r14896 | r14897 | |
| 139 | 136 | * |
| 140 | 137 | *************************************/ |
| 141 | 138 | |
| 142 | ||
| 139 | ||
| 143 | 140 | { |
| 144 | jedi_state *state = space->machine().driver_data<jedi_state>(); | |
| 145 | 141 | int new_speech_strobe_state = (~offset >> 8) & 1; |
| 146 | 142 | |
| 147 | if ((new_speech_strobe_state != | |
| 143 | if ((new_speech_strobe_state != | |
| 148 | 144 | { |
| 149 | device_t *tms = space->machine().device("tms"); | |
| 150 | tms5220_data_w(tms, 0, *state->m_speech_data); | |
| 145 | device_t *tms = machine().device("tms"); | |
| 146 | tms5220_data_w(tms, 0, *m_speech_data); | |
| 151 | 147 | } |
| 152 | | |
| 148 | | |
| 153 | 149 | } |
| 154 | 150 | |
| 155 | 151 | |
| 156 | ||
| 152 | ||
| 157 | 153 | { |
| 158 | return (tms5220_readyq_r( | |
| 154 | return (tms5220_readyq_r( | |
| 159 | 155 | } |
| 160 | 156 | |
| 161 | 157 | |
| 162 | ||
| 158 | ||
| 163 | 159 | { |
| 164 | 160 | /* not supported by the TMS5220 emulator */ |
| 165 | 161 | } |
| r14896 | r14897 | |
| 178 | 174 | AM_RANGE(0x0810, 0x081f) AM_MIRROR(0x07c0) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) |
| 179 | 175 | AM_RANGE(0x0820, 0x082f) AM_MIRROR(0x07c0) AM_DEVREADWRITE_LEGACY("pokey3", pokey_r, pokey_w) |
| 180 | 176 | AM_RANGE(0x0830, 0x083f) AM_MIRROR(0x07c0) AM_DEVREADWRITE_LEGACY("pokey4", pokey_r, pokey_w) |
| 181 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x00ff) AM_READNOP AM_WRITE | |
| 177 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x00ff) AM_READNOP AM_WRITE | |
| 182 | 178 | AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x00ff) AM_READNOP AM_WRITEONLY AM_BASE(m_speech_data) |
| 183 | AM_RANGE(0x1200, 0x13ff) AM_READNOP AM_WRITE_LEGACY(speech_strobe_w) | |
| 184 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x00ff) AM_READNOP AM_WRITE_LEGACY(audio_ack_latch_w) | |
| 185 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x00ff) AM_READNOP AM_WRITE_LEGACY(speech_reset_w) | |
| 179 | AM_RANGE(0x1200, 0x13ff) AM_READNOP AM_WRITE(speech_strobe_w) | |
| 180 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x00ff) AM_READNOP AM_WRITE(audio_ack_latch_w) | |
| 181 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x00ff) AM_READNOP AM_WRITE(speech_reset_w) | |
| 186 | 182 | AM_RANGE(0x1600, 0x17ff) AM_NOP |
| 187 | AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x03ff) AM_READ_LEGACY(audio_latch_r) AM_WRITENOP | |
| 188 | AM_RANGE(0x1c00, 0x1c00) AM_MIRROR(0x03fe) AM_READ_LEGACY(speech_ready_r) AM_WRITENOP | |
| 183 | AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x03ff) AM_READ(audio_latch_r) AM_WRITENOP | |
| 184 | AM_RANGE(0x1c00, 0x1c00) AM_MIRROR(0x03fe) AM_READ(speech_ready_r) AM_WRITENOP | |
| 189 | 185 | AM_RANGE(0x1c01, 0x1c01) AM_MIRROR(0x03fe) AM_READONLY AM_WRITENOP AM_BASE(m_audio_comm_stat) |
| 190 | 186 | AM_RANGE(0x2000, 0x7fff) AM_NOP |
| 191 | 187 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | /* */ |
| 32 | 32 | /*******************************************************/ |
| 33 | 33 | |
| 34 | WRITE8_ | |
| 34 | WRITE8_M | |
| 35 | 35 | { |
| 36 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 37 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 36 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 38 | 37 | |
| 39 | sn76477_enable_w( | |
| 38 | sn76477_enable_w( | |
| 40 | 39 | |
| 41 | if (rising_bits & 0x02) state->m_samples->start(0, 0); /* MISSLE SOUND */ | |
| 42 | if (rising_bits & 0x04) state->m_samples->start(1, 1); /* EXPLOSION */ | |
| 43 | if (rising_bits & 0x08) state->m_samples->start(2, 2); /* INVADER HIT */ | |
| 44 | if (rising_bits & 0x10) state->m_samples->start(5, 8); /* BONUS MISSILE BASE */ | |
| 40 | if (rising_bits & 0x02) m_samples->start(0, 0); /* MISSLE SOUND */ | |
| 41 | if (rising_bits & 0x04) m_samples->start(1, 1); /* EXPLOSION */ | |
| 42 | if (rising_bits & 0x08) m_samples->start(2, 2); /* INVADER HIT */ | |
| 43 | if (rising_bits & 0x10) m_samples->start(5, 8); /* BONUS MISSILE BASE */ | |
| 45 | 44 | |
| 46 | | |
| 45 | | |
| 47 | 46 | |
| 48 | | |
| 47 | | |
| 49 | 48 | |
| 50 | | |
| 49 | | |
| 51 | 50 | |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | WRITE8_ | |
| 53 | WRITE8_M | |
| 55 | 54 | { |
| 56 | 55 | /* FLEET (movement) |
| 57 | 56 | |
| r14896 | r14897 | |
| 60 | 59 | D2 = 82K |
| 61 | 60 | D3 = 100K */ |
| 62 | 61 | |
| 63 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 64 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; | |
| 62 | UINT8 rising_bits = data & ~m_port_2_last_extra; | |
| 65 | 63 | |
| 66 | if (rising_bits & 0x01) state->m_samples->start(4, 3); /* FLEET */ | |
| 67 | if (rising_bits & 0x02) state->m_samples->start(4, 4); /* FLEET */ | |
| 68 | if (rising_bits & 0x04) state->m_samples->start(4, 5); /* FLEET */ | |
| 69 | if (rising_bits & 0x08) state->m_samples->start(4, 6); /* FLEET */ | |
| 70 | if (rising_bits & 0x10) state->m_samples->start(3, 7); /* SAUCER HIT */ | |
| 64 | if (rising_bits & 0x01) m_samples->start(4, 3); /* FLEET */ | |
| 65 | if (rising_bits & 0x02) m_samples->start(4, 4); /* FLEET */ | |
| 66 | if (rising_bits & 0x04) m_samples->start(4, 5); /* FLEET */ | |
| 67 | if (rising_bits & 0x08) m_samples->start(4, 6); /* FLEET */ | |
| 68 | if (rising_bits & 0x10) m_samples->start(3, 7); /* SAUCER HIT */ | |
| 71 | 69 | |
| 72 | | |
| 70 | | |
| 73 | 71 | |
| 74 | | |
| 72 | | |
| 75 | 73 | } |
| 76 | 74 | |
| 77 | 75 | |
| r14896 | r14897 | |
| 81 | 79 | /* */ |
| 82 | 80 | /*******************************************************/ |
| 83 | 81 | |
| 84 | WRITE8_ | |
| 82 | WRITE8_M | |
| 85 | 83 | { |
| 86 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 87 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 84 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 88 | 85 | |
| 89 | sn76477_enable_w( | |
| 86 | sn76477_enable_w( | |
| 90 | 87 | |
| 91 | if (rising_bits & 0x02) state->m_samples->start(0, 0); /* Shot Sound */ | |
| 92 | if (rising_bits & 0x04) state->m_samples->start(1, 1); /* Base Hit */ | |
| 93 | if (rising_bits & 0x08) state->m_samples->start(2, 2); /* Invader Hit */ | |
| 88 | if (rising_bits & 0x02) m_samples->start(0, 0); /* Shot Sound */ | |
| 89 | if (rising_bits & 0x04) m_samples->start(1, 1); /* Base Hit */ | |
| 90 | if (rising_bits & 0x08) m_samples->start(2, 2); /* Invader Hit */ | |
| 94 | 91 | |
| 95 | speaker_level_w( | |
| 92 | speaker_level_w( | |
| 96 | 93 | |
| 97 | | |
| 94 | | |
| 98 | 95 | } |
| 99 | 96 | |
| 100 | 97 | |
| r14896 | r14897 | |
| 125 | 122 | lrescue_sample_names |
| 126 | 123 | }; |
| 127 | 124 | |
| 128 | WRITE8_ | |
| 125 | WRITE8_M | |
| 129 | 126 | { |
| 130 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 131 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 127 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 132 | 128 | |
| 133 | if (rising_bits & 0x01) state->m_samples->start(0, 3); /* Thrust */ | |
| 134 | if (rising_bits & 0x02) state->m_samples->start(1, 2); /* Shot Sound */ | |
| 135 | if (rising_bits & 0x04) state->m_samples->start(0, 1); /* Death */ | |
| 136 | if (rising_bits & 0x08) state->m_samples->start(1, 0); /* Alien Hit */ | |
| 137 | if (rising_bits & 0x10) state->m_samples->start(2, 5); /* Bonus Ship (not confirmed) */ | |
| 129 | if (rising_bits & 0x01) m_samples->start(0, 3); /* Thrust */ | |
| 130 | if (rising_bits & 0x02) m_samples->start(1, 2); /* Shot Sound */ | |
| 131 | if (rising_bits & 0x04) m_samples->start(0, 1); /* Death */ | |
| 132 | if (rising_bits & 0x08) m_samples->start(1, 0); /* Alien Hit */ | |
| 133 | if (rising_bits & 0x10) m_samples->start(2, 5); /* Bonus Ship (not confirmed) */ | |
| 138 | 134 | |
| 139 | | |
| 135 | | |
| 140 | 136 | |
| 141 | | |
| 137 | | |
| 142 | 138 | |
| 143 | | |
| 139 | | |
| 144 | 140 | } |
| 145 | 141 | |
| 146 | WRITE8_ | |
| 142 | WRITE8_M | |
| 147 | 143 | { |
| 148 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 149 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; | |
| 144 | UINT8 rising_bits = data & ~m_port_2_last_extra; | |
| 150 | 145 | |
| 151 | if (rising_bits & 0x01) state->m_samples->start(1, 8); /* Footstep high tone */ | |
| 152 | if (rising_bits & 0x02) state->m_samples->start(1, 7); /* Footstep low tone */ | |
| 153 | if (rising_bits & 0x04) state->m_samples->start(1, 4); /* Bonus when counting men saved */ | |
| 146 | if (rising_bits & 0x01) m_samples->start(1, 8); /* Footstep high tone */ | |
| 147 | if (rising_bits & 0x02) m_samples->start(1, 7); /* Footstep low tone */ | |
| 148 | if (rising_bits & 0x04) m_samples->start(1, 4); /* Bonus when counting men saved */ | |
| 154 | 149 | |
| 155 | speaker_level_w( | |
| 150 | speaker_level_w( | |
| 156 | 151 | |
| 157 | if (rising_bits & 0x10) state->m_samples->start(3, 6); /* Shooting Star and Rescue Ship sounds */ | |
| 158 | if ((~data & 0x10) && (state->m_port_2_last_extra & 0x10)) state->m_samples->stop(3); /* This makes the rescue ship sound beep on and off */ | |
| 152 | if (rising_bits & 0x10) m_samples->start(3, 6); /* Shooting Star and Rescue Ship sounds */ | |
| 153 | if ((~data & 0x10) && (m_port_2_last_extra & 0x10)) m_samples->stop(3); /* This makes the rescue ship sound beep on and off */ | |
| 159 | 154 | |
| 160 | | |
| 155 | | |
| 161 | 156 | |
| 162 | | |
| 157 | | |
| 163 | 158 | } |
| 164 | 159 | |
| 165 | 160 | |
| r14896 | r14897 | |
| 169 | 164 | /* */ |
| 170 | 165 | /*******************************************************/ |
| 171 | 166 | |
| 172 | WRITE8_ | |
| 167 | WRITE8_M | |
| 173 | 168 | { |
| 174 | 169 | /* inverted flip screen bit */ |
| 175 | 170 | invadpt2_sh_port_2_w(space, offset, data ^ 0x20); |
| r14896 | r14897 | |
| 183 | 178 | /* */ |
| 184 | 179 | /*******************************************************/ |
| 185 | 180 | |
| 186 | WRITE8_ | |
| 181 | WRITE8_M | |
| 187 | 182 | { |
| 188 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 189 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 183 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 190 | 184 | |
| 191 | if (rising_bits & 0x01) state->m_samples->start(1, 2); /* Hit a balloon */ | |
| 192 | if (rising_bits & 0x02) state->m_samples->start(2, 0); /* Shot Sound */ | |
| 193 | if (rising_bits & 0x04) state->m_samples->start(2, 1); /* Base Hit */ | |
| 194 | if (rising_bits & 0x08) state->m_samples->start(1, 7); /* Hit a Bomb */ | |
| 195 | if (rising_bits & 0x10) state->m_samples->start(3, 8); /* Bonus Base at 1500 points */ | |
| 185 | if (rising_bits & 0x01) m_samples->start(1, 2); /* Hit a balloon */ | |
| 186 | if (rising_bits & 0x02) m_samples->start(2, 0); /* Shot Sound */ | |
| 187 | if (rising_bits & 0x04) m_samples->start(2, 1); /* Base Hit */ | |
| 188 | if (rising_bits & 0x08) m_samples->start(1, 7); /* Hit a Bomb */ | |
| 189 | if (rising_bits & 0x10) m_samples->start(3, 8); /* Bonus Base at 1500 points */ | |
| 196 | 190 | |
| 197 | | |
| 191 | | |
| 198 | 192 | |
| 199 | | |
| 193 | | |
| 200 | 194 | |
| 201 | | |
| 195 | | |
| 202 | 196 | } |
| 203 | 197 | |
| 204 | WRITE8_ | |
| 198 | WRITE8_M | |
| 205 | 199 | { |
| 206 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 207 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; | |
| 200 | UINT8 rising_bits = data & ~m_port_2_last_extra; | |
| 208 | 201 | |
| 209 | if (data & 0x01) state->m_samples->start(0, 7); /* Indicates plane will drop bombs */ | |
| 210 | if (data & 0x04) state->m_samples->start(0, 4); /* Plane is dropping new balloons at start of level */ | |
| 211 | if (rising_bits & 0x10) state->m_samples->start(2, 2); /* Balloon hit and bomb drops */ | |
| 202 | if (data & 0x01) m_samples->start(0, 7); /* Indicates plane will drop bombs */ | |
| 203 | if (data & 0x04) m_samples->start(0, 4); /* Plane is dropping new balloons at start of level */ | |
| 204 | if (rising_bits & 0x10) m_samples->start(2, 2); /* Balloon hit and bomb drops */ | |
| 212 | 205 | |
| 213 | | |
| 206 | | |
| 214 | 207 | |
| 215 | | |
| 208 | | |
| 216 | 209 | } |
| 217 | 210 | |
| 218 | 211 | |
| r14896 | r14897 | |
| 259 | 252 | |
| 260 | 253 | DISCRETE_SOUND_END |
| 261 | 254 | |
| 262 | WRITE8_ | |
| 255 | WRITE8_M | |
| 263 | 256 | { |
| 264 | 257 | /* bit 4 occurs every 5.25 seconds during gameplay */ |
| 265 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 266 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 258 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 267 | 259 | |
| 268 | if (rising_bits & 0x01) state->m_samples->start(1, 7); /* Death */ | |
| 269 | if (rising_bits & 0x02) state->m_samples->start(0, 1); /* Shot Sound */ | |
| 270 | if (rising_bits & 0x04) state->m_samples->start(2, 3); /* Move */ | |
| 271 | if (rising_bits & 0x08) state->m_samples->start(3, 2); /* Hit */ | |
| 260 | if (rising_bits & 0x01) m_samples->start(1, 7); /* Death */ | |
| 261 | if (rising_bits & 0x02) m_samples->start(0, 1); /* Shot Sound */ | |
| 262 | if (rising_bits & 0x04) m_samples->start(2, 3); /* Move */ | |
| 263 | if (rising_bits & 0x08) m_samples->start(3, 2); /* Hit */ | |
| 272 | 264 | |
| 273 | | |
| 265 | | |
| 274 | 266 | |
| 275 | | |
| 267 | | |
| 276 | 268 | |
| 277 | | |
| 269 | | |
| 278 | 270 | } |
| 279 | 271 | |
| 280 | WRITE8_ | |
| 272 | WRITE8_M | |
| 281 | 273 | { |
| 282 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 283 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; | |
| 274 | UINT8 rising_bits = data & ~m_port_2_last_extra; | |
| 284 | 275 | |
| 285 | if (rising_bits & 0x01) state->m_samples->start(4, 0); /* Bird dropped an egg, Lasso used */ | |
| 286 | if (rising_bits & 0x02) state->m_samples->start(4, 2); /* Egg hatches, egg shot */ | |
| 287 | if (rising_bits & 0x08) state->m_samples->start(5, 0); /* Grabber, Lasso caught something */ | |
| 288 | if (rising_bits & 0x10) state->m_samples->start(3, 7); /* Lasso sound */ | |
| 276 | if (rising_bits & 0x01) m_samples->start(4, 0); /* Bird dropped an egg, Lasso used */ | |
| 277 | if (rising_bits & 0x02) m_samples->start(4, 2); /* Egg hatches, egg shot */ | |
| 278 | if (rising_bits & 0x08) m_samples->start(5, 0); /* Grabber, Lasso caught something */ | |
| 279 | if (rising_bits & 0x10) m_samples->start(3, 7); /* Lasso sound */ | |
| 289 | 280 | |
| 290 | | |
| 281 | | |
| 291 | 282 | } |
| 292 | 283 | |
| 293 | 284 | WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w ) |
| r14896 | r14897 | |
| 787 | 778 | (1.0/ (1.0/RES_K(82) + 1.0/RES_K(39) + 1.0/RES_K(15)) + RES_K(20)) * CAP_U(1) |
| 788 | 779 | }; |
| 789 | 780 | |
| 790 | WRITE8_ | |
| 781 | WRITE8_M | |
| 791 | 782 | { |
| 792 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 793 | 783 | int effect; |
| 794 | 784 | |
| 795 | 785 | /* bit 0 - Dot Sound Enable (SX0) |
| r14896 | r14897 | |
| 800 | 790 | bit 5 - Explosion (SX5) */ |
| 801 | 791 | |
| 802 | 792 | //printf( "schaser_sh_port_1_w: %02x\n", data ); |
| 803 | discrete_sound_w(state->m_discrete, SCHASER_DOT_EN, data & 0x01); | |
| 804 | discrete_sound_w(state->m_discrete, SCHASER_DOT_SEL, data & 0x02); | |
| 793 | discrete_sound_w(m_discrete, SCHASER_DOT_EN, data & 0x01); | |
| 794 | discrete_sound_w(m_discrete, SCHASER_DOT_SEL, data & 0x02); | |
| 805 | 795 | |
| 806 | 796 | /* The effect is a variable rate 555 timer. A diode/resistor array is used to |
| 807 | 797 | * select the frequency. Because of the diode voltage drop, we can not use the |
| r14896 | r14897 | |
| 810 | 800 | * but the bleed time is so long, that we can just cheat and put the time on hold |
| 811 | 801 | * when effect = 0. */ |
| 812 | 802 | effect = (data >> 2) & 0x07; |
| 813 | if ( | |
| 803 | if ( | |
| 814 | 804 | { |
| 815 | 805 | if (effect) |
| 816 | 806 | { |
| 817 | if ( | |
| 807 | if ( | |
| 818 | 808 | { |
| 819 | 809 | /* timer re-enabled, use up remaining 555 high time */ |
| 820 | | |
| 810 | | |
| 821 | 811 | } |
| 822 | else if (! | |
| 812 | else if (! | |
| 823 | 813 | { |
| 824 | 814 | /* set 555 high time */ |
| 825 | 815 | attotime new_time = attotime(0, ATTOSECONDS_PER_SECOND * .8873 * schaser_effect_rc[effect]); |
| 826 | | |
| 816 | | |
| 827 | 817 | } |
| 828 | 818 | } |
| 829 | 819 | else |
| 830 | 820 | { |
| 831 | 821 | /* disable effect - stops at end of low cycle */ |
| 832 | if (! | |
| 822 | if (! | |
| 833 | 823 | { |
| 834 | state->m_schaser_effect_555_time_remain = state->m_schaser_effect_555_timer->remaining(); | |
| 835 | state->m_schaser_effect_555_time_remain_savable = state->m_schaser_effect_555_time_remain.as_double(); | |
| 836 | state->m_schaser_effect_555_timer->adjust(attotime::never); | |
| 824 | m_schaser_effect_555_time_remain = m_schaser_effect_555_timer->remaining(); | |
| 825 | m_schaser_effect_555_time_remain_savable = m_schaser_effect_555_time_remain.as_double(); | |
| 826 | m_schaser_effect_555_timer->adjust(attotime::never); | |
| 837 | 827 | } |
| 838 | 828 | } |
| 839 | | |
| 829 | | |
| 840 | 830 | } |
| 841 | 831 | |
| 842 | state->m_schaser_explosion = (data >> 5) & 0x01; | |
| 843 | if (state->m_schaser_explosion) | |
| 832 | m_schaser_explosion = (data >> 5) & 0x01; | |
| 833 | if (m_schaser_explosion) | |
| 844 | 834 | { |
| 845 | sn76477_amplitude_res_w( | |
| 835 | sn76477_amplitude_res_w( | |
| 846 | 836 | } |
| 847 | 837 | else |
| 848 | 838 | { |
| 849 | sn76477_amplitude_res_w( | |
| 839 | sn76477_amplitude_res_w( | |
| 850 | 840 | } |
| 851 | sn76477_enable_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion)); | |
| 852 | sn76477_one_shot_cap_voltage_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT); | |
| 853 | sn76477_mixer_b_w(state->m_sn, state->m_schaser_explosion); | |
| 841 | sn76477_enable_w(m_sn, !(m_schaser_effect_555_is_low || m_schaser_explosion)); | |
| 842 | sn76477_one_shot_cap_voltage_w(m_sn, !(m_schaser_effect_555_is_low || m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT); | |
| 843 | sn76477_mixer_b_w(m_sn, m_schaser_explosion); | |
| 854 | 844 | } |
| 855 | 845 | |
| 856 | WRITE8_ | |
| 846 | WRITE8_M | |
| 857 | 847 | { |
| 858 | 848 | /* bit 0 - Music (DAC) (SX6) |
| 859 | 849 | bit 1 - Sound Enable (SX7) |
| r14896 | r14897 | |
| 862 | 852 | bit 4 - Field Control B (SX10) |
| 863 | 853 | bit 5 - Flip Screen */ |
| 864 | 854 | |
| 865 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 866 | 855 | |
| 867 | 856 | //printf( "schaser_sh_port_2_w: %02x\n", data ); |
| 868 | 857 | |
| 869 | discrete_sound_w( | |
| 858 | discrete_sound_w( | |
| 870 | 859 | |
| 871 | discrete_sound_w(state->m_discrete, SCHASER_SND_EN, data & 0x02); | |
| 872 | space->machine().sound().system_enable(data & 0x02); | |
| 860 | discrete_sound_w(m_discrete, SCHASER_SND_EN, data & 0x02); | |
| 861 | machine().sound().system_enable(data & 0x02); | |
| 873 | 862 | |
| 874 | coin_lockout_global_w( | |
| 863 | coin_lockout_global_w( | |
| 875 | 864 | |
| 876 | state->m_schaser_background_disable = (data >> 3) & 0x01; | |
| 877 | state->m_schaser_background_select = (data >> 4) & 0x01; | |
| 865 | m_schaser_background_disable = (data >> 3) & 0x01; | |
| 866 | m_schaser_background_select = (data >> 4) & 0x01; | |
| 878 | 867 | |
| 879 | | |
| 868 | | |
| 880 | 869 | |
| 881 | | |
| 870 | | |
| 882 | 871 | } |
| 883 | 872 | |
| 884 | 873 | |
| r14896 | r14897 | |
| 911 | 900 | { |
| 912 | 901 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 913 | 902 | state->m_schaser_effect_555_time_remain = attotime::from_double(state->m_schaser_effect_555_time_remain_savable); |
| 914 | schaser_sh_port_2_w(space, 0, state->m_port_2_last_extra); | |
| 903 | state->schaser_sh_port_2_w(*space, 0, state->m_port_2_last_extra); | |
| 915 | 904 | } |
| 916 | 905 | |
| 917 | 906 | |
| r14896 | r14897 | |
| 936 | 925 | |
| 937 | 926 | state->m_schaser_effect_555_is_low = 0; |
| 938 | 927 | state->m_schaser_effect_555_timer->adjust(attotime::never); |
| 939 | schaser_sh_port_1_w(space, 0, 0); | |
| 940 | schaser_sh_port_2_w(space, 0, 0); | |
| 928 | state->schaser_sh_port_1_w(*space, 0, 0); | |
| 929 | state->schaser_sh_port_2_w(*space, 0, 0); | |
| 941 | 930 | state->m_schaser_effect_555_time_remain = attotime::zero; |
| 942 | 931 | state->m_schaser_effect_555_time_remain_savable = state->m_schaser_effect_555_time_remain.as_double(); |
| 943 | 932 | } |
| r14896 | r14897 | |
| 949 | 938 | /* - Press Left or Right to choose game to play */ |
| 950 | 939 | /****************************************************/ |
| 951 | 940 | |
| 952 | WRITE8_ | |
| 941 | WRITE8_M | |
| 953 | 942 | { |
| 954 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 955 | UINT8 rising_bits = data & ~state->m_port_3_last_extra; | |
| 943 | UINT8 rising_bits = data & ~m_port_3_last_extra; | |
| 956 | 944 | |
| 957 | if (rising_bits & 0x02) state->m_samples->start(4, 0); /* Steering */ | |
| 958 | if (rising_bits & 0x04) state->m_samples->start(0, 1); /* Collision */ | |
| 959 | if (rising_bits & 0x10) state->m_samples->start(1, 8); /* Computer car is starting to move */ | |
| 945 | if (rising_bits & 0x02) m_samples->start(4, 0); /* Steering */ | |
| 946 | if (rising_bits & 0x04) m_samples->start(0, 1); /* Collision */ | |
| 947 | if (rising_bits & 0x10) m_samples->start(1, 8); /* Computer car is starting to move */ | |
| 960 | 948 | |
| 961 | | |
| 949 | | |
| 962 | 950 | } |
| 963 | 951 | |
| 964 | 952 | |
| r14896 | r14897 | |
| 973 | 961 | /*************************************************************************************/ |
| 974 | 962 | |
| 975 | 963 | |
| 976 | WRITE8_ | |
| 964 | WRITE8_M | |
| 977 | 965 | { |
| 978 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 979 | 966 | |
| 980 | 967 | switch (data) |
| 981 | 968 | { |
| 982 | 969 | case 0x06: |
| 983 | | |
| 970 | | |
| 984 | 971 | break; |
| 985 | 972 | |
| 986 | 973 | case 0x14: |
| 987 | | |
| 974 | | |
| 988 | 975 | break; |
| 989 | 976 | |
| 990 | 977 | case 0x16: |
| 991 | | |
| 978 | | |
| 992 | 979 | break; |
| 993 | 980 | |
| 994 | 981 | case 0x1e: |
| 995 | | |
| 982 | | |
| 996 | 983 | break; |
| 997 | 984 | |
| 998 | 985 | case 0x18: /* Fuel Low */ |
| 999 | 986 | case 0x30: /* Fuel bar filling up */ |
| 1000 | | |
| 987 | | |
| 1001 | 988 | break; |
| 1002 | 989 | |
| 1003 | 990 | case 0x02: /* Coin */ |
| r14896 | r14897 | |
| 1007 | 994 | break; |
| 1008 | 995 | |
| 1009 | 996 | case 0x3a: /* Thrust, Docking, extra ship? */ |
| 1010 | | |
| 997 | | |
| 1011 | 998 | break; |
| 1012 | 999 | } |
| 1013 | 1000 | } |
| r14896 | r14897 | |
| 1018 | 1005 | /* Correct samples not available */ |
| 1019 | 1006 | /*****************************************/ |
| 1020 | 1007 | |
| 1021 | WRITE8_ | |
| 1008 | WRITE8_M | |
| 1022 | 1009 | { |
| 1023 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1024 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 1010 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 1025 | 1011 | |
| 1026 | if (rising_bits & 0x01) | |
| 1012 | if (rising_bits & 0x01) | |
| 1027 | 1013 | |
| 1028 | sn76477_enable_w( | |
| 1014 | sn76477_enable_w( | |
| 1029 | 1015 | |
| 1030 | if (rising_bits & 0x04) state->m_samples->start(0, 7); /* Translocate */ | |
| 1031 | if (rising_bits & 0x08) state->m_samples->start(0, 1); /* Jail */ | |
| 1032 | if (rising_bits & 0x10) state->m_samples->start(3, 8); /* Bonus Man */ | |
| 1016 | if (rising_bits & 0x04) m_samples->start(0, 7); /* Translocate */ | |
| 1017 | if (rising_bits & 0x08) m_samples->start(0, 1); /* Jail */ | |
| 1018 | if (rising_bits & 0x10) m_samples->start(3, 8); /* Bonus Man */ | |
| 1033 | 1019 | |
| 1034 | | |
| 1020 | | |
| 1035 | 1021 | } |
| 1036 | 1022 | |
| 1037 | WRITE8_ | |
| 1023 | WRITE8_M | |
| 1038 | 1024 | { |
| 1039 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1040 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; | |
| 1025 | UINT8 rising_bits = data & ~m_port_2_last_extra; | |
| 1041 | 1026 | |
| 1042 | if (rising_bits & 0x01) state->m_samples->start(0, 3); /* Lands on top of building, wife kicks man */ | |
| 1043 | if (rising_bits & 0x02) state->m_samples->start(1, 2); /* deposit money, start intermission, end game */ | |
| 1044 | if (rising_bits & 0x04) state->m_samples->start(2, 5); /* deposit money, start intermission, Slides down rope */ | |
| 1045 | if (rising_bits & 0x08) state->m_samples->start(3, 0); /* start intermission, end game */ | |
| 1046 | //if (rising_bits & 0x10) state->m_samples->start(3, 9); /* Dog barking */ | |
| 1027 | if (rising_bits & 0x01) m_samples->start(0, 3); /* Lands on top of building, wife kicks man */ | |
| 1028 | if (rising_bits & 0x02) m_samples->start(1, 2); /* deposit money, start intermission, end game */ | |
| 1029 | if (rising_bits & 0x04) m_samples->start(2, 5); /* deposit money, start intermission, Slides down rope */ | |
| 1030 | if (rising_bits & 0x08) m_samples->start(3, 0); /* start intermission, end game */ | |
| 1031 | //if (rising_bits & 0x10) m_samples->start(3, 9); /* Dog barking */ | |
| 1047 | 1032 | |
| 1048 | | |
| 1033 | | |
| 1049 | 1034 | |
| 1050 | | |
| 1035 | | |
| 1051 | 1036 | |
| 1052 | | |
| 1037 | | |
| 1053 | 1038 | } |
| 1054 | 1039 | |
| 1055 | 1040 | |
| r14896 | r14897 | |
| 1058 | 1043 | /* Much more work needs to be done */ |
| 1059 | 1044 | /*****************************************/ |
| 1060 | 1045 | |
| 1061 | WRITE8_ | |
| 1046 | WRITE8_M | |
| 1062 | 1047 | { |
| 1063 | 1048 | |
| 1064 | 1049 | /* bit 2 = 2nd speedup |
| 1065 | 1050 | bit 3 = 1st speedup |
| 1066 | 1051 | Death is a stream of ff's with some fe's thrown in */ |
| 1067 | 1052 | |
| 1068 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1069 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 1053 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 1070 | 1054 | |
| 1071 | if (rising_bits & 0x02) state->m_samples->start(1, 6); /* Ran over a dot */ | |
| 1072 | if (rising_bits & 0x10) state->m_samples->start(0, 1); /* Death */ | |
| 1055 | if (rising_bits & 0x02) m_samples->start(1, 6); /* Ran over a dot */ | |
| 1056 | if (rising_bits & 0x10) m_samples->start(0, 1); /* Death */ | |
| 1073 | 1057 | |
| 1074 | | |
| 1058 | | |
| 1075 | 1059 | } |
| 1076 | 1060 | |
| 1077 | WRITE8_ | |
| 1061 | WRITE8_M | |
| 1078 | 1062 | { |
| 1079 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1080 | 1063 | |
| 1081 | speaker_level_w( | |
| 1064 | speaker_level_w( | |
| 1082 | 1065 | |
| 1083 | | |
| 1066 | | |
| 1084 | 1067 | |
| 1085 | | |
| 1068 | | |
| 1086 | 1069 | } |
| 1087 | 1070 | |
| 1088 | 1071 | |
| r14896 | r14897 | |
| 1091 | 1074 | /* No information available as what the correct sounds are */ |
| 1092 | 1075 | /*******************************************************************/ |
| 1093 | 1076 | |
| 1094 | WRITE8_ | |
| 1077 | WRITE8_M | |
| 1095 | 1078 | { |
| 1096 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1097 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 1079 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 1098 | 1080 | |
| 1099 | if (rising_bits & 0x01) state->m_samples->start(0, 3); /* Game Over */ | |
| 1100 | if (rising_bits & 0x02) state->m_samples->start(2, 0); /* Bird dead */ | |
| 1101 | if (rising_bits & 0x04) state->m_samples->start(0, 1); /* Rifle being fired */ | |
| 1102 | if (rising_bits & 0x08) state->m_samples->start(1, 2); /* Man dead */ | |
| 1103 | if (rising_bits & 0x10) state->m_samples->start(5, 8); /* Bonus Man? */ | |
| 1081 | if (rising_bits & 0x01) m_samples->start(0, 3); /* Game Over */ | |
| 1082 | if (rising_bits & 0x02) m_samples->start(2, 0); /* Bird dead */ | |
| 1083 | if (rising_bits & 0x04) m_samples->start(0, 1); /* Rifle being fired */ | |
| 1084 | if (rising_bits & 0x08) m_samples->start(1, 2); /* Man dead */ | |
| 1085 | if (rising_bits & 0x10) m_samples->start(5, 8); /* Bonus Man? */ | |
| 1104 | 1086 | |
| 1105 | | |
| 1087 | | |
| 1106 | 1088 | |
| 1107 | | |
| 1089 | | |
| 1108 | 1090 | } |
| 1109 | 1091 | |
| 1110 | WRITE8_ | |
| 1092 | WRITE8_M | |
| 1111 | 1093 | { |
| 1112 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1113 | UINT8 rising_bits = data & ~state->m_port_2_last_extra; | |
| 1094 | UINT8 rising_bits = data & ~m_port_2_last_extra; | |
| 1114 | 1095 | |
| 1115 | if (rising_bits & 0x01) state->m_samples->start(1, 6); /* Ready? , Game Over */ | |
| 1116 | if (rising_bits & 0x04) state->m_samples->start(3, 7); /* Big bird dead */ | |
| 1096 | if (rising_bits & 0x01) m_samples->start(1, 6); /* Ready? , Game Over */ | |
| 1097 | if (rising_bits & 0x04) m_samples->start(3, 7); /* Big bird dead */ | |
| 1117 | 1098 | |
| 1118 | sn76477_enable_w( | |
| 1099 | sn76477_enable_w( | |
| 1119 | 1100 | |
| 1120 | if (rising_bits & 0x10) | |
| 1101 | if (rising_bits & 0x10) | |
| 1121 | 1102 | |
| 1122 | | |
| 1103 | | |
| 1123 | 1104 | |
| 1124 | | |
| 1105 | | |
| 1125 | 1106 | } |
| 1126 | 1107 | |
| 1127 | 1108 | |
| r14896 | r14897 | |
| 1130 | 1111 | /* Proper samples are unavailable */ |
| 1131 | 1112 | /*****************************************/ |
| 1132 | 1113 | |
| 1133 | WRITE8_ | |
| 1114 | WRITE8_M | |
| 1134 | 1115 | { |
| 1135 | 1116 | /* bit 3 is high while you are alive and playing */ |
| 1136 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1137 | UINT8 rising_bits = data & ~state->m_port_1_last_extra; | |
| 1117 | UINT8 rising_bits = data & ~m_port_1_last_extra; | |
| 1138 | 1118 | |
| 1139 | if (rising_bits & 0x01) state->m_samples->start(4, 4); /* Fleet move */ | |
| 1140 | if (rising_bits & 0x02) state->m_samples->start(5, 8); /* Extra Tank */ | |
| 1119 | if (rising_bits & 0x01) m_samples->start(4, 4); /* Fleet move */ | |
| 1120 | if (rising_bits & 0x02) m_samples->start(5, 8); /* Extra Tank */ | |
| 1141 | 1121 | |
| 1142 | sn76477_enable_w( | |
| 1122 | sn76477_enable_w( | |
| 1143 | 1123 | |
| 1144 | | |
| 1124 | | |
| 1145 | 1125 | } |
| 1146 | 1126 | |
| 1147 | WRITE8_ | |
| 1127 | WRITE8_M | |
| 1148 | 1128 | { |
| 1149 | _8080bw_state *state = space->machine().driver_data<_8080bw_state>(); | |
| 1150 | 1129 | |
| 1151 | 1130 | switch (data) |
| 1152 | 1131 | { |
| 1153 | 1132 | case 0x23: |
| 1154 | | |
| 1133 | | |
| 1155 | 1134 | break; |
| 1156 | 1135 | |
| 1157 | 1136 | case 0x2b: |
| 1158 | | |
| 1137 | | |
| 1159 | 1138 | break; |
| 1160 | 1139 | |
| 1161 | 1140 | case 0xa3: |
| 1162 | | |
| 1141 | | |
| 1163 | 1142 | break; |
| 1164 | 1143 | |
| 1165 | 1144 | case 0xab: |
| 1166 | | |
| 1145 | | |
| 1167 | 1146 | break; |
| 1168 | 1147 | } |
| 1169 | 1148 | } |
| r14896 | r14897 | |
|---|---|---|
| 12 | 12 | #include "sound/dac.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | WRITE8_ | |
| 15 | WRITE8_M | |
| 16 | 16 | { |
| 17 | cchasm_state *state = space->machine().driver_data<cchasm_state>(); | |
| 18 | if (state->m_coin_flag) | |
| 17 | if (m_coin_flag) | |
| 19 | 18 | { |
| 20 | state->m_coin_flag = 0; | |
| 21 | z80ctc_trg0_w(state->m_ctc, state->m_coin_flag); | |
| 19 | m_coin_flag = 0; | |
| 20 | z80ctc_trg0_w(m_ctc, m_coin_flag); | |
| 22 | 21 | } |
| 23 | 22 | } |
| 24 | 23 | |
| r14896 | r14897 | |
| 32 | 31 | } |
| 33 | 32 | } |
| 34 | 33 | |
| 35 | READ8_ | |
| 34 | READ8_M | |
| 36 | 35 | { |
| 37 | cchasm_state *state = space->machine().driver_data<cchasm_state>(); | |
| 38 | UINT8 coin = (input_port_read(space->machine(), "IN3") >> 4) & 0x7; | |
| 39 | return state->m_sound_flags | (state->m_coin_flag << 3) | coin; | |
| 36 | UINT8 coin = (input_port_read(machine(), "IN3") >> 4) & 0x7; | |
| 37 | return m_sound_flags | (m_coin_flag << 3) | coin; | |
| 40 | 38 | } |
| 41 | 39 | |
| 42 | READ8_ | |
| 40 | READ8_M | |
| 43 | 41 | { |
| 44 | cchasm_state *state = space->machine().driver_data<cchasm_state>(); | |
| 45 | state->m_sound_flags &= ~0x80; | |
| 46 | z80ctc_trg2_w(state->m_ctc, 0); | |
| 47 | return state->soundlatch2_r(*space, offset); | |
| 42 | m_sound_flags &= ~0x80; | |
| 43 | z80ctc_trg2_w(m_ctc, 0); | |
| 44 | return soundlatch2_byte_r(*&space, offset); | |
| 48 | 45 | } |
| 49 | 46 | |
| 50 | WRITE8_ | |
| 47 | WRITE8_M | |
| 51 | 48 | { |
| 52 | cchasm_state *state = space->machine().driver_data<cchasm_state>(); | |
| 53 | state->m_sound_flags |= 0x40; | |
| 54 | state->soundlatch4_w(*space, offset, data); | |
| 55 | cputag_set_input_line(space->machine(), "maincpu", 1, HOLD_LINE); | |
| 49 | m_sound_flags |= 0x40; | |
| 50 | soundlatch4_byte_w(*&space, offset, data); | |
| 51 | cputag_set_input_line(machine(), "maincpu", 1, HOLD_LINE); | |
| 56 | 52 | } |
| 57 | 53 | |
| 58 | WRITE16_ | |
| 54 | WRITE16_M | |
| 59 | 55 | { |
| 60 | cchasm_state *state = space->machine().driver_data<cchasm_state>(); | |
| 61 | 56 | //static int led; |
| 62 | 57 | |
| 63 | 58 | if (ACCESSING_BITS_8_15) |
| r14896 | r14897 | |
| 66 | 61 | switch (offset & 0xf) |
| 67 | 62 | { |
| 68 | 63 | case 0: |
| 69 | s | |
| 64 | s | |
| 70 | 65 | break; |
| 71 | 66 | case 1: |
| 72 | state->m_sound_flags |= 0x80; | |
| 73 | state->soundlatch2_w(*space, offset, data); | |
| 74 | z80ctc_trg2_w(state->m_ctc, 1); | |
| 75 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 67 | m_sound_flags |= 0x80; | |
| 68 | soundlatch2_byte_w(*&space, offset, data); | |
| 69 | z80ctc_trg2_w(m_ctc, 1); | |
| 70 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 76 | 71 | break; |
| 77 | 72 | case 2: |
| 78 | 73 | //led = data; |
| r14896 | r14897 | |
| 81 | 76 | } |
| 82 | 77 | } |
| 83 | 78 | |
| 84 | READ16_ | |
| 79 | READ16_M | |
| 85 | 80 | { |
| 86 | cchasm_state *state = space->machine().driver_data<cchasm_state>(); | |
| 87 | 81 | switch (offset & 0xf) |
| 88 | 82 | { |
| 89 | 83 | case 0x0: |
| 90 | return s | |
| 84 | return s | |
| 91 | 85 | case 0x1: |
| 92 | state->m_sound_flags &= ~0x40; | |
| 93 | return state->soundlatch4_r(*space,offset) << 8; | |
| 86 | m_sound_flags &= ~0x40; | |
| 87 | return soundlatch4_byte_r(*&space,offset) << 8; | |
| 94 | 88 | case 0x2: |
| 95 | return ( | |
| 89 | return ( | |
| 96 | 90 | case 0x5: |
| 97 | return input_port_read( | |
| 91 | return input_port_read( | |
| 98 | 92 | case 0x8: |
| 99 | return input_port_read( | |
| 93 | return input_port_read( | |
| 100 | 94 | default: |
| 101 | 95 | return 0xff << 8; |
| 102 | 96 | } |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | { |
| 47 | 47 | hyprolyb_adpcm_state *state = get_safe_token(device); |
| 48 | 48 | driver_device *drvstate = device->machine().driver_data<driver_device>(); |
| 49 | drvstate->soundlatch2_w(*state->m_space, offset, data); | |
| 49 | drvstate->soundlatch2_byte_w(*state->m_space, offset, data); | |
| 50 | 50 | state->m_adpcm_ready = 0x80; |
| 51 | 51 | } |
| 52 | 52 | |
| r14896 | r14897 | |
| 86 | 86 | hyprolyb_adpcm_state *state = get_safe_token(device); |
| 87 | 87 | driver_device *drvstate = device->machine().driver_data<driver_device>(); |
| 88 | 88 | state->m_adpcm_ready = 0x00; |
| 89 | return drvstate->soundlatch2_r(*state->m_space, offset); | |
| 89 | return drvstate->soundlatch2_byte_r(*state->m_space, offset); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static ADDRESS_MAP_START( hyprolyb_adpcm_map, AS_PROGRAM, 8, driver_device ) |
| r14896 | r14897 | |
|---|---|---|
| 198 | 198 | { |
| 199 | 199 | AY8910_LEGACY_OUTPUT, |
| 200 | 200 | AY8910_DEFAULT_LOADS, |
| 201 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 201 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 202 | 202 | DEVCB_DEVICE_HANDLER("timeplt_audio", timeplt_portB_r), |
| 203 | 203 | DEVCB_NULL, |
| 204 | 204 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | * |
| 52 | 52 | *************************************/ |
| 53 | 53 | |
| 54 | WRITE8_ | |
| 54 | WRITE8_M | |
| 55 | 55 | { |
| 56 | cinemat_state *state = space->machine().driver_data<cinemat_state>(); | |
| 57 | UINT8 oldval = state->m_sound_control; | |
| 56 | UINT8 oldval = m_sound_control; | |
| 58 | 57 | |
| 59 | 58 | /* form an 8-bit value with the new bit */ |
| 60 | | |
| 59 | | |
| 61 | 60 | |
| 62 | 61 | /* if something changed, call the sound subroutine */ |
| 63 | if ((state->m_sound_control != oldval) && state->m_sound_handler) | |
| 64 | (*state->m_sound_handler)(space->machine(), state->m_sound_control, state->m_sound_control ^ oldval); | |
| 62 | if ((m_sound_control != oldval) && m_sound_handler) | |
| 63 | (*m_sound_handler)(machine(), m_sound_control, m_sound_control ^ oldval); | |
| 65 | 64 | } |
| 66 | 65 | |
| 67 | 66 | |
| r14896 | r14897 | |
| 1598 | 1597 | * |
| 1599 | 1598 | *************************************/ |
| 1600 | 1599 | |
| 1601 | ||
| 1600 | ||
| 1602 | 1601 | { |
| 1603 | UINT16 rega = cpu_get_reg(space->machine().device("maincpu"), CCPU_A); | |
| 1604 | demon_sound_w(space->machine(), 0x00 | (~rega & 0x0f), 0x10); | |
| 1602 | UINT16 rega = cpu_get_reg(machine().device("maincpu"), CCPU_A); | |
| 1603 | demon_sound_w(machine(), 0x00 | (~rega & 0x0f), 0x10); | |
| 1605 | 1604 | } |
| 1606 | 1605 | |
| 1607 | 1606 | |
| 1608 | 1607 | static MACHINE_RESET( qb3_sound ) |
| 1609 | 1608 | { |
| 1609 | cinemat_state *state = machine.driver_data<cinemat_state>(); | |
| 1610 | 1610 | MACHINE_RESET_CALL(demon_sound); |
| 1611 | machine.device("maincpu")->memory().space(AS_IO)->install_ | |
| 1611 | machine.device("maincpu")->memory().space(AS_IO)->install_ | |
| 1612 | 1612 | |
| 1613 | 1613 | /* this patch prevents the sound ROM from eating itself when command $0A is sent */ |
| 1614 | 1614 | /* on a cube rotate */ |
| r14896 | r14897 | |
|---|---|---|
| 170 | 170 | /* and also is used to enable the amplifier and trigger the */ |
| 171 | 171 | /* discrete circuitry that produces sound effects and music */ |
| 172 | 172 | |
| 173 | WRITE8_ | |
| 173 | WRITE8_M | |
| 174 | 174 | { |
| 175 | circus_state *state = space->machine().driver_data<circus_state>(); | |
| 176 | 175 | |
| 177 | state->m_clown_z = (data & 0x0f); | |
| 178 | *(space->machine().region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG | |
| 176 | m_clown_z = (data & 0x0f); | |
| 177 | *(machine().region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG | |
| 179 | 178 | |
| 180 | 179 | /* Bits 4-6 enable/disable trigger different events */ |
| 181 | switch ( | |
| 180 | switch ( | |
| 182 | 181 | { |
| 183 | 182 | case 1: /* circus */ |
| 184 | 183 | case 4: /* ripcord */ |
| 185 | 184 | switch ((data & 0x70) >> 4) |
| 186 | 185 | { |
| 187 | 186 | case 0 : /* All Off */ |
| 188 | discrete_sound_w( | |
| 187 | discrete_sound_w( | |
| 189 | 188 | break; |
| 190 | 189 | |
| 191 | 190 | case 1 : /* Music */ |
| 192 | discrete_sound_w( | |
| 191 | discrete_sound_w( | |
| 193 | 192 | break; |
| 194 | 193 | |
| 195 | 194 | case 2 : /* Circus = Pop; Rip Cord = Splash */ |
| 196 | | |
| 195 | | |
| 197 | 196 | break; |
| 198 | 197 | |
| 199 | 198 | case 3 : /* Normal Video */ |
| 200 | 199 | break; |
| 201 | 200 | |
| 202 | 201 | case 4 : /* Circus = Miss; Rip Cord = Scream */ |
| 203 | | |
| 202 | | |
| 204 | 203 | break; |
| 205 | 204 | |
| 206 | 205 | case 5 : /* Invert Video */ |
| 207 | 206 | break; |
| 208 | 207 | |
| 209 | 208 | case 6 : /* Circus = Bounce; Rip Cord = Chute Open */ |
| 210 | | |
| 209 | | |
| 211 | 210 | break; |
| 212 | 211 | |
| 213 | 212 | case 7 : /* Circus = not used; Rip Cord = Whistle */ |
| 214 | if (state->m_game_id == 4) | |
| 215 | state->m_samples->start(3, 3); | |
| 213 | if (m_game_id == 4) | |
| 214 | m_samples->start(3, 3); | |
| 216 | 215 | break; |
| 217 | 216 | } |
| 218 | 217 | break; |
| 219 | 218 | |
| 220 | 219 | case 2: /* robotbwl */ |
| 221 | discrete_sound_w( | |
| 220 | discrete_sound_w( | |
| 222 | 221 | |
| 223 | 222 | if (data & 0x40) /* Hit */ |
| 224 | | |
| 223 | | |
| 225 | 224 | |
| 226 | 225 | if (data & 0x20) /* Roll */ |
| 227 | | |
| 226 | | |
| 228 | 227 | |
| 229 | 228 | if (data & 0x10) /* Ball Drop */ |
| 230 | | |
| 229 | | |
| 231 | 230 | |
| 232 | 231 | if (data & 0x02) /* Demerit */ |
| 233 | | |
| 232 | | |
| 234 | 233 | |
| 235 | 234 | if (data & 0x01) /* Reward */ |
| 236 | | |
| 235 | | |
| 237 | 236 | |
| 238 | 237 | // if (data & 0x04) /* Invert */ |
| 239 | 238 | break; |
| r14896 | r14897 | |
| 243 | 242 | switch ((data & 0x70) >> 4) |
| 244 | 243 | { |
| 245 | 244 | case 0 : /* All Off */ |
| 246 | discrete_sound_w( | |
| 245 | discrete_sound_w( | |
| 247 | 246 | break; |
| 248 | 247 | |
| 249 | 248 | case 1 : /* Music */ |
| 250 | discrete_sound_w( | |
| 249 | discrete_sound_w( | |
| 251 | 250 | break; |
| 252 | 251 | |
| 253 | 252 | case 2 : /* Crash */ |
| 254 | | |
| 253 | | |
| 255 | 254 | break; |
| 256 | 255 | |
| 257 | 256 | case 3 : /* Normal Video and Beep */ |
| 258 | discrete_sound_w( | |
| 257 | discrete_sound_w( | |
| 259 | 258 | break; |
| 260 | 259 | |
| 261 | 260 | case 4 : /* Skid */ |
| 262 | 261 | break; |
| 263 | 262 | |
| 264 | 263 | case 5 : /* Invert Video and Beep */ |
| 265 | discrete_sound_w( | |
| 264 | discrete_sound_w( | |
| 266 | 265 | break; |
| 267 | 266 | |
| 268 | 267 | case 6 : /* Hi Motor */ |
| r14896 | r14897 | |
| 275 | 274 | } |
| 276 | 275 | |
| 277 | 276 | /* Bit 7 enables amplifier (0 = on) */ |
| 278 | | |
| 277 | | |
| 279 | 278 | } |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | #define CHANNEL_FUEL 3 |
| 33 | 33 | |
| 34 | 34 | |
| 35 | WRITE8_ | |
| 35 | WRITE8_M | |
| 36 | 36 | { |
| 37 | astrof_state *state = space->machine().driver_data<astrof_state>(); | |
| 38 | UINT8 rising_bits = data & ~state->m_port_1_last; | |
| 37 | UINT8 rising_bits = data & ~m_port_1_last; | |
| 39 | 38 | |
| 40 | if (state->m_astrof_death_playing) | |
| 41 | state->m_astrof_death_playing = state->m_samples->playing(CHANNEL_EXPLOSION); | |
| 39 | if (m_astrof_death_playing) | |
| 40 | m_astrof_death_playing = m_samples->playing(CHANNEL_EXPLOSION); | |
| 42 | 41 | |
| 43 | if (state->m_astrof_bosskill_playing) | |
| 44 | state->m_astrof_bosskill_playing = state->m_samples->playing(CHANNEL_EXPLOSION); | |
| 42 | if (m_astrof_bosskill_playing) | |
| 43 | m_astrof_bosskill_playing = m_samples->playing(CHANNEL_EXPLOSION); | |
| 45 | 44 | |
| 46 | 45 | /* D2 - explosion */ |
| 47 | 46 | if (rising_bits & 0x04) |
| 48 | 47 | { |
| 49 | 48 | /* I *know* that the effect select port will be written shortly |
| 50 | 49 | after this one, so this works */ |
| 51 | | |
| 50 | | |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 | /* D0,D1,D3 - background noise */ |
| 55 | if ((data & 0x08) && (~ | |
| 54 | if ((data & 0x08) && (~ | |
| 56 | 55 | { |
| 57 | 56 | int sample = SAMPLE_WAVE + (data & 3); |
| 58 | | |
| 57 | | |
| 59 | 58 | } |
| 60 | 59 | |
| 61 | if ((~data & 0x08) && (state->m_port_1_last & 0x08)) | |
| 62 | state->m_samples->stop(CHANNEL_WAVE); | |
| 60 | if ((~data & 0x08) && (m_port_1_last & 0x08)) | |
| 61 | m_samples->stop(CHANNEL_WAVE); | |
| 63 | 62 | |
| 64 | 63 | /* D4 - boss laser */ |
| 65 | if ((rising_bits & 0x10) && !state->m_astrof_bosskill_playing) | |
| 66 | state->m_samples->start(CHANNEL_BOSSFIRE, SAMPLE_BOSSFIRE, 0); | |
| 64 | if ((rising_bits & 0x10) && !m_astrof_bosskill_playing) | |
| 65 | m_samples->start(CHANNEL_BOSSFIRE, SAMPLE_BOSSFIRE, 0); | |
| 67 | 66 | |
| 68 | 67 | /* D5 - fire */ |
| 69 | if ((rising_bits & 0x20) && !state->m_astrof_bosskill_playing) | |
| 70 | state->m_samples->start(CHANNEL_FIRE, SAMPLE_FIRE, 0); | |
| 68 | if ((rising_bits & 0x20) && !m_astrof_bosskill_playing) | |
| 69 | m_samples->start(CHANNEL_FIRE, SAMPLE_FIRE, 0); | |
| 71 | 70 | |
| 72 | 71 | /* D6 - don't know. Probably something to do with the explosion sounds */ |
| 73 | 72 | |
| 74 | 73 | /* D7 - sound enable bit */ |
| 75 | | |
| 74 | | |
| 76 | 75 | |
| 77 | | |
| 76 | | |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | |
| 81 | WRITE8_ | |
| 80 | WRITE8_M | |
| 82 | 81 | { |
| 83 | astrof_state *state = space->machine().driver_data<astrof_state>(); | |
| 84 | UINT8 rising_bits = data & ~state->m_port_2_last; | |
| 82 | UINT8 rising_bits = data & ~m_port_2_last; | |
| 85 | 83 | |
| 86 | 84 | /* D0-D2 - explosion select (triggered by D2 of the other port */ |
| 87 | if ( | |
| 85 | if ( | |
| 88 | 86 | { |
| 89 | 87 | /* this is really a compound effect, made up of I believe 3 sound |
| 90 | 88 | effects, but since our sample contains them all, disable playing |
| r14896 | r14897 | |
| 93 | 91 | logerror("Explosion: %x\n", data); |
| 94 | 92 | if (data & 0x04) |
| 95 | 93 | { |
| 96 | if (! | |
| 94 | if (! | |
| 97 | 95 | { |
| 98 | state->m_samples->start(CHANNEL_EXPLOSION, SAMPLE_BOSSKILL, 0); | |
| 99 | state->m_astrof_bosskill_playing = 1; | |
| 96 | m_samples->start(CHANNEL_EXPLOSION, SAMPLE_BOSSKILL, 0); | |
| 97 | m_astrof_bosskill_playing = 1; | |
| 100 | 98 | } |
| 101 | 99 | } |
| 102 | 100 | else if (data & 0x02) |
| 103 | | |
| 101 | | |
| 104 | 102 | else if (data & 0x01) |
| 105 | | |
| 103 | | |
| 106 | 104 | else |
| 107 | 105 | { |
| 108 | if (! | |
| 106 | if (! | |
| 109 | 107 | { |
| 110 | state->m_samples->start(CHANNEL_EXPLOSION, SAMPLE_DEATH, 0); | |
| 111 | state->m_astrof_death_playing = 1; | |
| 108 | m_samples->start(CHANNEL_EXPLOSION, SAMPLE_DEATH, 0); | |
| 109 | m_astrof_death_playing = 1; | |
| 112 | 110 | } |
| 113 | 111 | } |
| 114 | 112 | |
| 115 | | |
| 113 | | |
| 116 | 114 | } |
| 117 | 115 | |
| 118 | 116 | /* D3 - low fuel warning */ |
| 119 | 117 | if (rising_bits & 0x08) |
| 120 | | |
| 118 | | |
| 121 | 119 | |
| 122 | | |
| 120 | | |
| 123 | 121 | } |
| 124 | 122 | |
| 125 | 123 | |
| r14896 | r14897 | |
| 163 | 161 | * |
| 164 | 162 | *************************************/ |
| 165 | 163 | |
| 166 | WRITE8_ | |
| 164 | WRITE8_M | |
| 167 | 165 | { |
| 168 | 166 | /* nothing yet */ |
| 169 | 167 | } |
| r14896 | r14897 | |
| 181 | 179 | * |
| 182 | 180 | *************************************/ |
| 183 | 181 | |
| 184 | WRITE8_ | |
| 182 | WRITE8_M | |
| 185 | 183 | { |
| 186 | astrof_state *state = space->machine().driver_data<astrof_state>(); | |
| 187 | 184 | |
| 188 | 185 | /* D0 - sonar */ |
| 189 | 186 | |
| r14896 | r14897 | |
| 196 | 193 | /* D4 - UFO */ |
| 197 | 194 | |
| 198 | 195 | /* D5 - UFO under water */ |
| 199 | sn76477_enable_w( | |
| 196 | sn76477_enable_w( | |
| 200 | 197 | |
| 201 | 198 | /* D6 - explosion */ |
| 202 | 199 | |
| 203 | 200 | /* D7 - sound enable bit */ |
| 204 | | |
| 201 | | |
| 205 | 202 | } |
| 206 | 203 | |
| 207 | 204 |
| r14896 | r14897 | |
|---|---|---|
| 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_space_func ssio_custom_input[5]; | |
| 67 | static write8_space_func ssio_custom_output[2]; | |
| 66 | static read8_delegate ssio_custom_input[5]; | |
| 67 | static write8_delegate ssio_custom_output[2]; | |
| 68 | 68 | |
| 69 | 69 | /* Chip Squeak Deluxe-specific globals */ |
| 70 | 70 | static device_t *csdeluxe_sound_cpu; |
| r14896 | r14897 | |
| 291 | 291 | device_set_input_line(device, 0, (ssio_14024_count & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | ||
| 294 | ||
| 295 | 295 | { |
| 296 | 296 | /* a read here asynchronously resets the 14024 count, clearing /SINT */ |
| 297 | 297 | ssio_14024_count = 0; |
| r14896 | r14897 | |
| 299 | 299 | return 0xff; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | ||
| 302 | ||
| 303 | 303 | { |
| 304 | 304 | ssio_status = data; |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | ||
| 307 | ||
| 308 | 308 | { |
| 309 | 309 | return ssio_data[offset]; |
| 310 | 310 | } |
| r14896 | r14897 | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /********* external interfaces ***********/ |
| 359 | WRITE8_ | |
| 359 | WRITE8_M | |
| 360 | 360 | { |
| 361 | | |
| 361 | | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | READ8_ | |
| 364 | READ8_M | |
| 365 | 365 | { |
| 366 | 366 | return ssio_status; |
| 367 | 367 | } |
| r14896 | r14897 | |
| 386 | 386 | device_set_input_line(ssio_sound_cpu, INPUT_LINE_RESET, CLEAR_LINE); |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | READ8_ | |
| 389 | READ8_M | |
| 390 | 390 | { |
| 391 | 391 | static const char *const port[] = { "SSIO.IP0", "SSIO.IP1", "SSIO.IP2", "SSIO.IP3", "SSIO.IP4" }; |
| 392 | UINT8 result = input_port_read_safe(space->machine(), port[offset], 0xff); | |
| 393 | if (ssio_custom_input[offset]) | |
| 392 | UINT8 result = input_port_read_safe(machine(), port[offset], 0xff); | |
| 393 | if (!ssio_custom_input[offset].isnull()) | |
| 394 | 394 | result = (result & ~ssio_custom_input_mask[offset]) | |
| 395 | ( | |
| 395 | ( | |
| 396 | 396 | return result; |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | WRITE8_ | |
| 399 | WRITE8_M | |
| 400 | 400 | { |
| 401 | mcr_state *state = space->machine().driver_data<mcr_state>(); | |
| 402 | 401 | int which = offset >> 2; |
| 403 | 402 | if (which == 0) |
| 404 | state->mcr_control_port_w(*space, offset, data); | |
| 405 | if (ssio_custom_output[which]) | |
| 406 | (*ssio_custom_output[which])(space, offset, data & ssio_custom_output_mask[which]); | |
| 403 | mcr_control_port_w(*&space, offset, data); | |
| 404 | if (!ssio_custom_output[which].isnull()) | |
| 405 | ssio_custom_output[which](*&space, offset, data & ssio_custom_output_mask[which],0xff); | |
| 407 | 406 | } |
| 408 | 407 | |
| 409 | void ssio_set_custom_input(int which, int mask, read8_ | |
| 408 | void ssio_set_custom_input(int which, int mask, read8_delegate | |
| 410 | 409 | { |
| 411 | 410 | ssio_custom_input[which] = handler; |
| 412 | 411 | ssio_custom_input_mask[which] = mask; |
| 413 | 412 | } |
| 414 | 413 | |
| 415 | void ssio_set_custom_output(int which, int mask, write8_ | |
| 414 | void ssio_set_custom_output(int which, int mask, write8_delegate | |
| 416 | 415 | { |
| 417 | 416 | ssio_custom_output[which/4] = handler; |
| 418 | 417 | ssio_custom_output_mask[which/4] = mask; |
| r14896 | r14897 | |
| 444 | 443 | /********* memory interfaces ***********/ |
| 445 | 444 | |
| 446 | 445 | /* address map verified from schematics */ |
| 447 | static ADDRESS_MAP_START( ssio_map, AS_PROGRAM, 8, | |
| 446 | static ADDRESS_MAP_START( ssio_map, AS_PROGRAM, 8, mcr | |
| 448 | 447 | ADDRESS_MAP_UNMAP_HIGH |
| 449 | 448 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 450 | 449 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x0c00) AM_RAM |
| 451 | AM_RANGE(0x9000, 0x9003) AM_MIRROR(0x0ffc) AM_READ | |
| 450 | AM_RANGE(0x9000, 0x9003) AM_MIRROR(0x0ffc) AM_READ | |
| 452 | 451 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ssio.1", ay8910_address_w) |
| 453 | 452 | AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x0ffc) AM_DEVREAD_LEGACY("ssio.1", ay8910_r) |
| 454 | 453 | AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ssio.1", ay8910_data_w) |
| 455 | 454 | AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ssio.2", ay8910_address_w) |
| 456 | 455 | AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x0ffc) AM_DEVREAD_LEGACY("ssio.2", ay8910_r) |
| 457 | 456 | AM_RANGE(0xb002, 0xb002) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ssio.2", ay8910_data_w) |
| 458 | AM_RANGE(0xc000, 0xcfff) AM_READNOP AM_WRITE | |
| 457 | AM_RANGE(0xc000, 0xcfff) AM_READNOP AM_WRITE | |
| 459 | 458 | AM_RANGE(0xd000, 0xdfff) AM_WRITENOP /* low bit controls yellow LED */ |
| 460 | AM_RANGE(0xe000, 0xefff) AM_READ | |
| 459 | AM_RANGE(0xe000, 0xefff) AM_READ | |
| 461 | 460 | AM_RANGE(0xf000, 0xffff) AM_READ_PORT("SSIO.DIP") /* 6 DIP switches */ |
| 462 | 461 | ADDRESS_MAP_END |
| 463 | 462 | |
| r14896 | r14897 | |
| 550 | 549 | |
| 551 | 550 | |
| 552 | 551 | /********* external interfaces ***********/ |
| 553 | WRITE8_ | |
| 552 | WRITE8_M | |
| 554 | 553 | { |
| 555 | | |
| 554 | | |
| 556 | 555 | } |
| 557 | 556 | |
| 558 | READ8_ | |
| 557 | READ8_M | |
| 559 | 558 | { |
| 560 | 559 | return csdeluxe_status; |
| 561 | 560 | } |
| r14896 | r14897 | |
| 569 | 568 | /********* memory interfaces ***********/ |
| 570 | 569 | |
| 571 | 570 | /* address map determined by PAL; not verified */ |
| 572 | static ADDRESS_MAP_START( csdeluxe_map, AS_PROGRAM, 16, | |
| 571 | static ADDRESS_MAP_START( csdeluxe_map, AS_PROGRAM, 16, mcr | |
| 573 | 572 | ADDRESS_MAP_UNMAP_HIGH |
| 574 | 573 | ADDRESS_MAP_GLOBAL_MASK(0x1ffff) |
| 575 | 574 | AM_RANGE(0x000000, 0x007fff) AM_ROM |
| r14896 | r14897 | |
| 669 | 668 | |
| 670 | 669 | |
| 671 | 670 | /********* external interfaces ***********/ |
| 672 | WRITE8_ | |
| 671 | WRITE8_M | |
| 673 | 672 | { |
| 674 | | |
| 673 | | |
| 675 | 674 | } |
| 676 | 675 | |
| 677 | READ8_ | |
| 676 | READ8_M | |
| 678 | 677 | { |
| 679 | 678 | return soundsgood_status; |
| 680 | 679 | } |
| r14896 | r14897 | |
| 689 | 688 | /********* memory interfaces ***********/ |
| 690 | 689 | |
| 691 | 690 | /* address map determined by PAL; not verified */ |
| 692 | static ADDRESS_MAP_START( soundsgood_map, AS_PROGRAM, 16, | |
| 691 | static ADDRESS_MAP_START( soundsgood_map, AS_PROGRAM, 16, mcr | |
| 693 | 692 | ADDRESS_MAP_UNMAP_HIGH |
| 694 | 693 | ADDRESS_MAP_GLOBAL_MASK(0x7ffff) |
| 695 | 694 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| r14896 | r14897 | |
| 774 | 773 | |
| 775 | 774 | |
| 776 | 775 | /********* external interfaces ***********/ |
| 777 | WRITE8_ | |
| 776 | WRITE8_M | |
| 778 | 777 | { |
| 779 | | |
| 778 | | |
| 780 | 779 | } |
| 781 | 780 | |
| 782 | READ8_ | |
| 781 | READ8_M | |
| 783 | 782 | { |
| 784 | 783 | return turbocs_status; |
| 785 | 784 | } |
| r14896 | r14897 | |
| 793 | 792 | /********* memory interfaces ***********/ |
| 794 | 793 | |
| 795 | 794 | /* address map verified from schematics */ |
| 796 | static ADDRESS_MAP_START( turbocs_map, AS_PROGRAM, 8, | |
| 795 | static ADDRESS_MAP_START( turbocs_map, AS_PROGRAM, 8, mcr | |
| 797 | 796 | ADDRESS_MAP_UNMAP_HIGH |
| 798 | 797 | AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x3800) AM_RAM |
| 799 | 798 | AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x3ffc) AM_DEVREADWRITE("tcspia", pia6821_device, read_alt, write_alt) |
| r14896 | r14897 | |
| 847 | 846 | logerror("Write to AY-8912 = %02X\n", data); |
| 848 | 847 | } |
| 849 | 848 | |
| 850 | ||
| 849 | ||
| 851 | 850 | { |
| 852 | 851 | logerror("Write to DAC = %02X\n", data); |
| 853 | 852 | } |
| r14896 | r14897 | |
| 908 | 907 | |
| 909 | 908 | |
| 910 | 909 | /********* external interfaces ***********/ |
| 911 | WRITE8_ | |
| 910 | WRITE8_M | |
| 912 | 911 | { |
| 913 | | |
| 912 | | |
| 914 | 913 | } |
| 915 | 914 | |
| 916 | 915 | void squawkntalk_reset_w(running_machine &machine, int state) |
| r14896 | r14897 | |
| 924 | 923 | /* address map verified from schematics */ |
| 925 | 924 | /* note that jumpers control the ROM sizes; if these are changed, use the alternate */ |
| 926 | 925 | /* address map below */ |
| 927 | static ADDRESS_MAP_START( squawkntalk_map, AS_PROGRAM, 8, | |
| 926 | static ADDRESS_MAP_START( squawkntalk_map, AS_PROGRAM, 8, mcr | |
| 928 | 927 | ADDRESS_MAP_UNMAP_HIGH |
| 929 | 928 | AM_RANGE(0x0000, 0x007f) AM_RAM /* internal RAM */ |
| 930 | 929 | AM_RANGE(0x0080, 0x0083) AM_MIRROR(0x4f6c) AM_DEVREADWRITE("sntpia0", pia6821_device, read, write) |
| 931 | 930 | AM_RANGE(0x0090, 0x0093) AM_MIRROR(0x4f6c) AM_DEVREADWRITE("sntpia1", pia6821_device, read, write) |
| 932 | AM_RANGE(0x1000, 0x1fff) AM_MIRROR(0x4000) AM_WRITE | |
| 931 | AM_RANGE(0x1000, 0x1fff) AM_MIRROR(0x4000) AM_WRITE | |
| 933 | 932 | AM_RANGE(0x8000, 0xbfff) AM_MIRROR(0x4000) AM_ROM |
| 934 | 933 | ADDRESS_MAP_END |
| 935 | 934 | |
| 936 | 935 | /* alternate address map if the ROM jumpers are changed to support a smaller */ |
| 937 | 936 | /* ROM size of 2k */ |
| 938 | 937 | #ifdef UNUSED_FUNCTION |
| 939 | ADDRESS_MAP_START( squawkntalk_alt_map, AS_PROGRAM, 8, | |
| 938 | ADDRESS_MAP_START( squawkntalk_alt_map, AS_PROGRAM, 8, mcr | |
| 940 | 939 | ADDRESS_MAP_UNMAP_HIGH |
| 941 | 940 | AM_RANGE(0x0000, 0x007f) AM_RAM /* internal RAM */ |
| 942 | 941 | AM_RANGE(0x0080, 0x0083) AM_MIRROR(0x676c) AM_DEVREADWRITE("sntpia0", pia6821_device, read, write) |
| 943 | 942 | AM_RANGE(0x0090, 0x0093) AM_MIRROR(0x676c) AM_DEVREADWRITE("sntpia1", pia6821_device, read, write) |
| 944 | AM_RANGE(0x0800, 0x0fff) AM_MIRROR(0x6000) AM_WRITE | |
| 943 | AM_RANGE(0x0800, 0x0fff) AM_MIRROR(0x6000) AM_WRITE | |
| 945 | 944 | AM_RANGE(0x8000, 0x9fff) AM_MIRROR(0x6000) AM_ROM |
| 946 | 945 | ADDRESS_MAP_END |
| 947 | 946 | #endif |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | { -1, 0, 0 } /* end of array */ |
| 40 | 40 | }; |
| 41 | 41 | |
| 42 | WRITE8_ | |
| 42 | WRITE8_M | |
| 43 | 43 | { |
| 44 | gotya_state *state = space->machine().driver_data<gotya_state>(); | |
| 45 | 44 | int sample_number; |
| 46 | 45 | |
| 47 | 46 | if (data == 0) |
| 48 | 47 | { |
| 49 | state->m_samples->stop(0); | |
| 50 | state->m_theme_playing = 0; | |
| 48 | m_samples->stop(0); | |
| 49 | m_theme_playing = 0; | |
| 51 | 50 | return; |
| 52 | 51 | } |
| 53 | 52 | |
| r14896 | r14897 | |
| 56 | 55 | { |
| 57 | 56 | if (gotya_samples[sample_number].sound_command == data) |
| 58 | 57 | { |
| 59 | if (gotya_samples[sample_number].looping && | |
| 58 | if (gotya_samples[sample_number].looping && | |
| 60 | 59 | { |
| 61 | 60 | /* don't restart main theme */ |
| 62 | 61 | return; |
| 63 | 62 | } |
| 64 | 63 | |
| 65 | | |
| 64 | | |
| 66 | 65 | |
| 67 | 66 | if (gotya_samples[sample_number].channel == 0) |
| 68 | 67 | { |
| 69 | | |
| 68 | | |
| 70 | 69 | } |
| 71 | 70 | return; |
| 72 | 71 | } |
| r14896 | r14897 | |
|---|---|---|
| 9 | 9 | #include "includes/aztarac.h" |
| 10 | 10 | |
| 11 | 11 | |
| 12 | READ16_ | |
| 12 | READ16_M | |
| 13 | 13 | { |
| 14 | aztarac_state *state = space->machine().driver_data<aztarac_state>(); | |
| 15 | return state->m_sound_status & 0x01; | |
| 14 | return m_sound_status & 0x01; | |
| 16 | 15 | } |
| 17 | 16 | |
| 18 | WRITE16_ | |
| 17 | WRITE16_M | |
| 19 | 18 | { |
| 20 | aztarac_state *state = space->machine().driver_data<aztarac_state>(); | |
| 21 | 19 | if (ACCESSING_BITS_0_7) |
| 22 | 20 | { |
| 23 | 21 | data &= 0xff; |
| 24 | state->soundlatch_w(*space, offset, data); | |
| 25 | state->m_sound_status ^= 0x21; | |
| 26 | if (state->m_sound_status & 0x20) | |
| 27 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); | |
| 22 | soundlatch_byte_w(*&space, offset, data); | |
| 23 | m_sound_status ^= 0x21; | |
| 24 | if (m_sound_status & 0x20) | |
| 25 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); | |
| 28 | 26 | } |
| 29 | 27 | } |
| 30 | 28 | |
| 31 | READ8_ | |
| 29 | READ8_M | |
| 32 | 30 | { |
| 33 | aztarac_state *state = space->machine().driver_data<aztarac_state>(); | |
| 34 | state->m_sound_status |= 0x01; | |
| 35 | state->m_sound_status &= ~0x20; | |
| 36 | return state->soundlatch_r(*space,offset); | |
| 31 | m_sound_status |= 0x01; | |
| 32 | m_sound_status &= ~0x20; | |
| 33 | return soundlatch_byte_r(*&space,offset); | |
| 37 | 34 | } |
| 38 | 35 | |
| 39 | READ8_ | |
| 36 | READ8_M | |
| 40 | 37 | { |
| 41 | aztarac_state *state = space->machine().driver_data<aztarac_state>(); | |
| 42 | return state->m_sound_status & ~0x01; | |
| 38 | return m_sound_status & ~0x01; | |
| 43 | 39 | } |
| 44 | 40 | |
| 45 | WRITE8_ | |
| 41 | WRITE8_M | |
| 46 | 42 | { |
| 47 | aztarac_state *state = space->machine().driver_data<aztarac_state>(); | |
| 48 | state->m_sound_status &= ~0x10; | |
| 43 | m_sound_status &= ~0x10; | |
| 49 | 44 | } |
| 50 | 45 | |
| 51 | 46 | INTERRUPT_GEN( aztarac_snd_timed_irq ) |
| r14896 | r14897 | |
|---|---|---|
| 15 | 15 | void mcr_sound_init(running_machine &machine, UINT8 config); |
| 16 | 16 | void mcr_sound_reset(running_machine &machine); |
| 17 | 17 | |
| 18 | WRITE8_HANDLER( ssio_data_w ); | |
| 19 | READ8_HANDLER( ssio_status_r ); | |
| 20 | READ8_HANDLER( ssio_input_port_r ); | |
| 21 | WRITE8_HANDLER( ssio_output_port_w ); | |
| 22 | 18 | void ssio_reset_w(running_machine &machine, int state); |
| 23 | void ssio_set_custom_input(int which, int mask, read8_space_func handler); | |
| 24 | void ssio_set_custom_output(int which, int mask, write8_space_func handler); | |
| 19 | void ssio_set_custom_input(int which, int mask, read8_delegate handler); | |
| 20 | void ssio_set_custom_output(int which, int mask, write8_delegate handler); | |
| 25 | 21 | |
| 26 | WRITE8_HANDLER( csdeluxe_data_w ); | |
| 27 | READ8_HANDLER( csdeluxe_status_r ); | |
| 28 | 22 | void csdeluxe_reset_w(running_machine &machine, int state); |
| 29 | 23 | |
| 30 | WRITE8_HANDLER( turbocs_data_w ); | |
| 31 | READ8_HANDLER( turbocs_status_r ); | |
| 32 | 24 | void turbocs_reset_w(running_machine &machine, int state); |
| 33 | 25 | |
| 34 | WRITE8_HANDLER( soundsgood_data_w ); | |
| 35 | READ8_HANDLER( soundsgood_status_r ); | |
| 36 | 26 | void soundsgood_reset_w(running_machine &machine, int state); |
| 37 | 27 | |
| 38 | WRITE8_HANDLER( squawkntalk_data_w ); | |
| 39 | 28 | void squawkntalk_reset_w(running_machine &machine, int state); |
| 40 | 29 | |
| 41 | 30 | |
| r14896 | r14897 | |
| 54 | 43 | /************ SSIO input ports ***************/ |
| 55 | 44 | |
| 56 | 45 | #define SSIO_INPUT_PORTS \ |
| 57 | AM_RANGE(0x00, 0x04) AM_MIRROR(0x18) AM_READ_LEGACY(ssio_input_port_r) \ | |
| 58 | AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_READ_LEGACY(ssio_status_r) \ | |
| 59 | AM_RANGE(0x00, 0x07) AM_MIRROR(0x03) AM_WRITE_LEGACY(ssio_output_port_w) \ | |
| 60 | AM_RANGE(0x1c, 0x1f) AM_WRITE_LEGACY(ssio_data_w) | |
| 46 | AM_RANGE(0x00, 0x04) AM_MIRROR(0x18) AM_READ(ssio_input_port_r) \ | |
| 47 | AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_READ(ssio_status_r) \ | |
| 48 | AM_RANGE(0x00, 0x07) AM_MIRROR(0x03) AM_WRITE(ssio_output_port_w) \ | |
| 49 | AM_RANGE(0x1c, 0x1f) AM_WRITE(ssio_data_w) | |
| 61 | 50 | |
| 62 | 51 | |
| 63 | 52 |
| r14896 | r14897 | |
|---|---|---|
| 66 | 66 | { |
| 67 | 67 | driver_device *drvstate = space->machine().driver_data<driver_device>(); |
| 68 | 68 | if ((data & 0x80) == 0) |
| 69 | drvstate->soundlatch_w(*space, 0, data & 0x7f); | |
| 69 | drvstate->soundlatch_byte_w(*space, 0, data & 0x7f); | |
| 70 | 70 | else |
| 71 | 71 | cputag_set_input_line(space->machine(), "iremsound", 0, ASSERT_LINE); |
| 72 | 72 | } |
| r14896 | r14897 | |
| 251 | 251 | { |
| 252 | 252 | AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT, |
| 253 | 253 | {470, 0, 0}, |
| 254 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 254 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 255 | 255 | DEVCB_NULL, |
| 256 | 256 | DEVCB_NULL, |
| 257 | 257 | DEVCB_DEVICE_HANDLER("irem_audio", ay8910_0_portb_w) |
| r14896 | r14897 | |
|---|---|---|
| 1226 | 1226 | * |
| 1227 | 1227 | ****************************************************************/ |
| 1228 | 1228 | |
| 1229 | ||
| 1229 | ||
| 1230 | 1230 | { |
| 1231 | 1231 | /* only provided for documentation purposes |
| 1232 | 1232 | * not actually used |
| r14896 | r14897 | |
| 1270 | 1270 | * |
| 1271 | 1271 | ****************************************************************/ |
| 1272 | 1272 | |
| 1273 | WRITE8_ | |
| 1273 | WRITE8_M | |
| 1274 | 1274 | { |
| 1275 | 1275 | if (data) |
| 1276 | cputag_set_input_line( | |
| 1276 | cputag_set_input_line( | |
| 1277 | 1277 | else |
| 1278 | cputag_set_input_line( | |
| 1278 | cputag_set_input_line( | |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| 1281 | 1281 | |
| r14896 | r14897 | |
| 1285 | 1285 | * |
| 1286 | 1286 | *************************************/ |
| 1287 | 1287 | |
| 1288 | static ADDRESS_MAP_START( dkong_sound_map, AS_PROGRAM, 8, d | |
| 1288 | static ADDRESS_MAP_START( dkong_sound_map, AS_PROGRAM, 8, dkong | |
| 1289 | 1289 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 1290 | 1290 | ADDRESS_MAP_END |
| 1291 | 1291 | |
| 1292 | static ADDRESS_MAP_START( dkong_sound_io_map, AS_IO, 8, d | |
| 1292 | static ADDRESS_MAP_START( dkong_sound_io_map, AS_IO, 8, dkong | |
| 1293 | 1293 | AM_RANGE(0x00, 0xFF) AM_DEVREAD_LEGACY("ls175.3d", dkong_tune_r) |
| 1294 | AM_WRITE | |
| 1294 | AM_WRITE | |
| 1295 | 1295 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_DEVREAD_LEGACY("ls175.3d", dkong_tune_r) |
| 1296 | AM_WRITE | |
| 1296 | AM_WRITE | |
| 1297 | 1297 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("discrete", dkong_p1_w) /* only write to dac */ |
| 1298 | 1298 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2") |
| 1299 | 1299 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5) |
| 1300 | 1300 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4) |
| 1301 | 1301 | ADDRESS_MAP_END |
| 1302 | 1302 | |
| 1303 | static ADDRESS_MAP_START( dkongjr_sound_io_map, AS_IO, 8, d | |
| 1303 | static ADDRESS_MAP_START( dkongjr_sound_io_map, AS_IO, 8, dkong | |
| 1304 | 1304 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_LATCH8_READ("ls174.3d") |
| 1305 | 1305 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("discrete", dkong_p1_w) /* only write to dac */ |
| 1306 | 1306 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2") |
| r14896 | r14897 | |
| 1308 | 1308 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4) |
| 1309 | 1309 | ADDRESS_MAP_END |
| 1310 | 1310 | |
| 1311 | static ADDRESS_MAP_START( radarscp1_sound_io_map, AS_IO, 8, d | |
| 1311 | static ADDRESS_MAP_START( radarscp1_sound_io_map, AS_IO, 8, dkong | |
| 1312 | 1312 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_DEVREAD_LEGACY("ls175.3d", latch8_r) |
| 1313 | 1313 | AM_RANGE(0x00, 0xff) AM_DEVWRITE_LEGACY("discrete", dkong_p1_w) /* DAC here */ |
| 1314 | 1314 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_LATCH8_READ("virtual_p1") |
| r14896 | r14897 | |
| 1318 | 1318 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4) |
| 1319 | 1319 | ADDRESS_MAP_END |
| 1320 | 1320 | |
| 1321 | static ADDRESS_MAP_START( dkong3_sound1_map, AS_PROGRAM, 8, d | |
| 1321 | static ADDRESS_MAP_START( dkong3_sound1_map, AS_PROGRAM, 8, dkong | |
| 1322 | 1322 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 1323 | 1323 | AM_RANGE(0x4016, 0x4016) AM_LATCH8_READ("latch1") /* overwrite default */ |
| 1324 | 1324 | AM_RANGE(0x4017, 0x4017) AM_LATCH8_READ("latch2") |
| r14896 | r14897 | |
| 1327 | 1327 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 1328 | 1328 | ADDRESS_MAP_END |
| 1329 | 1329 | |
| 1330 | static ADDRESS_MAP_START( dkong3_sound2_map, AS_PROGRAM, 8, d | |
| 1330 | static ADDRESS_MAP_START( dkong3_sound2_map, AS_PROGRAM, 8, dkong | |
| 1331 | 1331 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 1332 | 1332 | AM_RANGE(0x4016, 0x4016) AM_LATCH8_READ("latch3") /* overwrite default */ |
| 1333 | 1333 | AM_RANGE(0x4000, 0x4017) AM_DEVREAD_LEGACY("nes2", nes_psg_r) |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | * |
| 52 | 52 | *************************************/ |
| 53 | 53 | |
| 54 | READ16_ | |
| 54 | READ16_M | |
| 55 | 55 | { |
| 56 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 57 | state->m_soundflag = 0; | |
| 58 | logerror("%06X:main read from sound=%04X\n", cpu_get_previouspc(&space->device()), state->m_sounddata); | |
| 59 | return state->m_sounddata; | |
| 56 | m_soundflag = 0; | |
| 57 | logerror("%06X:main read from sound=%04X\n", cpu_get_previouspc(&space.device()), m_sounddata); | |
| 58 | return m_sounddata; | |
| 60 | 59 | } |
| 61 | 60 | |
| 62 | 61 | |
| 63 | READ16_ | |
| 62 | READ16_M | |
| 64 | 63 | { |
| 65 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 66 | return (state->m_mainflag << 15) | (state->m_soundflag << 14) | 0x1fff; | |
| 64 | return (m_mainflag << 15) | (m_soundflag << 14) | 0x1fff; | |
| 67 | 65 | } |
| 68 | 66 | |
| 69 | 67 | |
| r14896 | r14897 | |
| 76 | 74 | } |
| 77 | 75 | |
| 78 | 76 | |
| 79 | WRITE16_ | |
| 77 | WRITE16_M | |
| 80 | 78 | { |
| 81 | space->machine().scheduler().synchronize(FUNC(delayed_68k_w), data); | |
| 82 | logerror("%06X:main write to sound=%04X\n", cpu_get_previouspc(&space->device()), data); | |
| 79 | machine().scheduler().synchronize(FUNC(delayed_68k_w), data); | |
| 80 | logerror("%06X:main write to sound=%04X\n", cpu_get_previouspc(&space.device()), data); | |
| 83 | 81 | } |
| 84 | 82 | |
| 85 | 83 | |
| 86 | WRITE16_ | |
| 84 | WRITE16_M | |
| 87 | 85 | { |
| 88 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 89 | device_set_input_line(state->m_soundcpu, INPUT_LINE_RESET, ASSERT_LINE); | |
| 90 | device_set_input_line(state->m_soundcpu, INPUT_LINE_RESET, CLEAR_LINE); | |
| 91 | state->m_mainflag = state->m_soundflag = 0; | |
| 92 | update_68k_interrupts(space->machine()); | |
| 93 | logerror("%06X:Reset sound\n", cpu_get_previouspc(&space->device())); | |
| 86 | device_set_input_line(m_soundcpu, INPUT_LINE_RESET, ASSERT_LINE); | |
| 87 | device_set_input_line(m_soundcpu, INPUT_LINE_RESET, CLEAR_LINE); | |
| 88 | m_mainflag = m_soundflag = 0; | |
| 89 | update_68k_interrupts(machine()); | |
| 90 | logerror("%06X:Reset sound\n", cpu_get_previouspc(&space.device())); | |
| 94 | 91 | } |
| 95 | 92 | |
| 96 | 93 | |
| r14896 | r14897 | |
| 101 | 98 | * |
| 102 | 99 | *************************************/ |
| 103 | 100 | |
| 104 | READ16_ | |
| 101 | READ16_M | |
| 105 | 102 | { |
| 106 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 107 | state->m_mainflag = 0; | |
| 108 | update_68k_interrupts(space->machine()); | |
| 109 | logerror("%06X:sound read from main=%04X\n", cpu_get_previouspc(&space->device()), state->m_maindata); | |
| 110 | return state->m_maindata; | |
| 103 | m_mainflag = 0; | |
| 104 | update_68k_interrupts(machine()); | |
| 105 | logerror("%06X:sound read from main=%04X\n", cpu_get_previouspc(&space.device()), m_maindata); | |
| 106 | return m_maindata; | |
| 111 | 107 | } |
| 112 | 108 | |
| 113 | 109 | |
| 114 | WRITE16_ | |
| 110 | WRITE16_M | |
| 115 | 111 | { |
| 116 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 117 | COMBINE_DATA(&state->m_sounddata); | |
| 118 | state->m_soundflag = 1; | |
| 119 | logerror("%06X:sound write to main=%04X\n", cpu_get_previouspc(&space->device()), data); | |
| 112 | COMBINE_DATA(&m_sounddata); | |
| 113 | m_soundflag = 1; | |
| 114 | logerror("%06X:sound write to main=%04X\n", cpu_get_previouspc(&space.device()), data); | |
| 120 | 115 | } |
| 121 | 116 | |
| 122 | 117 | |
| r14896 | r14897 | |
| 127 | 122 | * |
| 128 | 123 | *************************************/ |
| 129 | 124 | |
| 130 | READ16_ | |
| 125 | READ16_M | |
| 131 | 126 | { |
| 132 | logerror("%06X:hdsnd68k_switches_r(%04X)\n", cpu_get_previouspc(&space | |
| 127 | logerror("%06X:hdsnd68k_switches_r(%04X)\n", cpu_get_previouspc(&space. | |
| 133 | 128 | return 0; |
| 134 | 129 | } |
| 135 | 130 | |
| 136 | 131 | |
| 137 | READ16_ | |
| 132 | READ16_M | |
| 138 | 133 | { |
| 139 | logerror("%06X:hdsnd68k_320port_r(%04X)\n", cpu_get_previouspc(&space | |
| 134 | logerror("%06X:hdsnd68k_320port_r(%04X)\n", cpu_get_previouspc(&space. | |
| 140 | 135 | return 0; |
| 141 | 136 | } |
| 142 | 137 | |
| 143 | 138 | |
| 144 | READ16_ | |
| 139 | READ16_M | |
| 145 | 140 | { |
| 146 | 141 | //FFFF 3000 R READSTAT Read Status |
| 147 | 142 | // D15 = 'Main Flag' |
| 148 | 143 | // D14 = 'Sound Flag' |
| 149 | 144 | // D13 = Test Switch |
| 150 | 145 | // D12 = 5220 Ready Flag (0=Ready) |
| 151 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 152 | logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(&space->device()), offset); | |
| 153 | return (state->m_mainflag << 15) | (state->m_soundflag << 14) | 0x2000 | 0;//((input_port_read(space->machine(), "IN0") & 0x0020) << 8) | 0; | |
| 146 | logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(&space.device()), offset); | |
| 147 | return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((input_port_read(machine(), "IN0") & 0x0020) << 8) | 0; | |
| 154 | 148 | } |
| 155 | 149 | |
| 156 | 150 | |
| r14896 | r14897 | |
| 161 | 155 | * |
| 162 | 156 | *************************************/ |
| 163 | 157 | |
| 164 | WRITE16_ | |
| 158 | WRITE16_M | |
| 165 | 159 | { |
| 166 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 167 | 160 | |
| 168 | 161 | /* bit 3 selects the value; data is ignored */ |
| 169 | 162 | data = (offset >> 3) & 1; |
| r14896 | r14897 | |
| 174 | 167 | { |
| 175 | 168 | case 0: /* SPWR - 5220 write strobe */ |
| 176 | 169 | /* data == 0 means high, 1 means low */ |
| 177 | logerror("%06X:SPWR=%d\n", cpu_get_previouspc(&space | |
| 170 | logerror("%06X:SPWR=%d\n", cpu_get_previouspc(&space. | |
| 178 | 171 | break; |
| 179 | 172 | |
| 180 | 173 | case 1: /* SPRES - 5220 hard reset */ |
| 181 | 174 | /* data == 0 means low, 1 means high */ |
| 182 | logerror("%06X:SPRES=%d\n", cpu_get_previouspc(&space | |
| 175 | logerror("%06X:SPRES=%d\n", cpu_get_previouspc(&space. | |
| 183 | 176 | break; |
| 184 | 177 | |
| 185 | 178 | case 2: /* SPRATE */ |
| 186 | 179 | /* data == 0 means 8kHz, 1 means 10kHz */ |
| 187 | logerror("%06X:SPRATE=%d\n", cpu_get_previouspc(&space | |
| 180 | logerror("%06X:SPRATE=%d\n", cpu_get_previouspc(&space. | |
| 188 | 181 | break; |
| 189 | 182 | |
| 190 | 183 | case 3: /* CRAMEN */ |
| 191 | 184 | /* data == 0 means disable 68k access to COM320, 1 means enable */ |
| 192 | | |
| 185 | | |
| 193 | 186 | break; |
| 194 | 187 | |
| 195 | 188 | case 4: /* RES320 */ |
| 196 | logerror("%06X:RES320=%d\n", cpu_get_previouspc(&space->device()), data); | |
| 197 | if (state->m_sounddsp != NULL) | |
| 198 | device_set_input_line(state->m_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE); | |
| 189 | logerror("%06X:RES320=%d\n", cpu_get_previouspc(&space.device()), data); | |
| 190 | if (m_sounddsp != NULL) | |
| 191 | device_set_input_line(m_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE); | |
| 199 | 192 | break; |
| 200 | 193 | |
| 201 | 194 | case 7: /* LED */ |
| r14896 | r14897 | |
| 204 | 197 | } |
| 205 | 198 | |
| 206 | 199 | |
| 207 | WRITE16_ | |
| 200 | WRITE16_M | |
| 208 | 201 | { |
| 209 | logerror("%06X:hdsnd68k_speech_w(%04X)=%04X\n", cpu_get_previouspc(&space | |
| 202 | logerror("%06X:hdsnd68k_speech_w(%04X)=%04X\n", cpu_get_previouspc(&space. | |
| 210 | 203 | } |
| 211 | 204 | |
| 212 | 205 | |
| 213 | WRITE16_ | |
| 206 | WRITE16_M | |
| 214 | 207 | { |
| 215 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 216 | state->m_irq68k = 0; | |
| 217 | update_68k_interrupts(space->machine()); | |
| 208 | m_irq68k = 0; | |
| 209 | update_68k_interrupts(machine()); | |
| 218 | 210 | } |
| 219 | 211 | |
| 220 | 212 | |
| r14896 | r14897 | |
| 225 | 217 | * |
| 226 | 218 | *************************************/ |
| 227 | 219 | |
| 228 | READ16_ | |
| 220 | READ16_M | |
| 229 | 221 | { |
| 230 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 231 | return state->m_sounddsp_ram[offset & 0xfff]; | |
| 222 | return m_sounddsp_ram[offset & 0xfff]; | |
| 232 | 223 | } |
| 233 | 224 | |
| 234 | 225 | |
| 235 | WRITE16_ | |
| 226 | WRITE16_M | |
| 236 | 227 | { |
| 237 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 238 | COMBINE_DATA(&state->m_sounddsp_ram[offset & 0xfff]); | |
| 228 | COMBINE_DATA(&m_sounddsp_ram[offset & 0xfff]); | |
| 239 | 229 | } |
| 240 | 230 | |
| 241 | 231 | |
| 242 | READ16_ | |
| 232 | READ16_M | |
| 243 | 233 | { |
| 244 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 245 | address_space *iospace = state->m_sounddsp->memory().space(AS_IO); | |
| 234 | address_space *iospace = m_sounddsp->memory().space(AS_IO); | |
| 246 | 235 | return iospace->read_word((offset & 7) << 1); |
| 247 | 236 | } |
| 248 | 237 | |
| 249 | 238 | |
| 250 | WRITE16_ | |
| 239 | WRITE16_M | |
| 251 | 240 | { |
| 252 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 253 | address_space *iospace = state->m_sounddsp->memory().space(AS_IO); | |
| 241 | address_space *iospace = m_sounddsp->memory().space(AS_IO); | |
| 254 | 242 | iospace->write_word((offset & 7) << 1, data); |
| 255 | 243 | } |
| 256 | 244 | |
| 257 | 245 | |
| 258 | READ16_ | |
| 246 | READ16_M | |
| 259 | 247 | { |
| 260 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 261 | 248 | |
| 262 | if (state->m_cramen) | |
| 263 | return state->m_comram[offset & 0x1ff]; | |
| 249 | if (m_cramen) | |
| 250 | return m_comram[offset & 0x1ff]; | |
| 264 | 251 | |
| 265 | logerror("%06X:hdsnd68k_320com_r(%04X) -- not allowed\n", cpu_get_previouspc(&space | |
| 252 | logerror("%06X:hdsnd68k_320com_r(%04X) -- not allowed\n", cpu_get_previouspc(&space. | |
| 266 | 253 | return 0xffff; |
| 267 | 254 | } |
| 268 | 255 | |
| 269 | 256 | |
| 270 | WRITE16_ | |
| 257 | WRITE16_M | |
| 271 | 258 | { |
| 272 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 273 | 259 | |
| 274 | if (state->m_cramen) | |
| 275 | COMBINE_DATA(&state->m_comram[offset & 0x1ff]); | |
| 260 | if (m_cramen) | |
| 261 | COMBINE_DATA(&m_comram[offset & 0x1ff]); | |
| 276 | 262 | else |
| 277 | logerror("%06X:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", cpu_get_previouspc(&space | |
| 263 | logerror("%06X:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", cpu_get_previouspc(&space. | |
| 278 | 264 | } |
| 279 | 265 | |
| 280 | 266 | |
| r14896 | r14897 | |
| 285 | 271 | * |
| 286 | 272 | *************************************/ |
| 287 | 273 | |
| 288 | READ16_ | |
| 274 | READ16_M | |
| 289 | 275 | { |
| 290 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 291 | UINT64 cycles_since_last_bio = state->m_sounddsp->total_cycles() - state->m_last_bio_cycles; | |
| 276 | UINT64 cycles_since_last_bio = m_sounddsp->total_cycles() - m_last_bio_cycles; | |
| 292 | 277 | INT32 cycles_until_bio = CYCLES_PER_BIO - cycles_since_last_bio; |
| 293 | 278 | |
| 294 | 279 | /* if we're not at the next BIO yet, advance us there */ |
| 295 | 280 | if (cycles_until_bio > 0) |
| 296 | 281 | { |
| 297 | device_adjust_icount(&space->device(), -cycles_until_bio); | |
| 298 | state->m_last_bio_cycles += CYCLES_PER_BIO; | |
| 282 | device_adjust_icount(&space.device(), -cycles_until_bio); | |
| 283 | m_last_bio_cycles += CYCLES_PER_BIO; | |
| 299 | 284 | } |
| 300 | 285 | else |
| 301 | | |
| 286 | | |
| 302 | 287 | return ASSERT_LINE; |
| 303 | 288 | } |
| 304 | 289 | |
| r14896 | r14897 | |
| 320 | 305 | } |
| 321 | 306 | |
| 322 | 307 | |
| 323 | WRITE16_ | |
| 308 | WRITE16_M | |
| 324 | 309 | { |
| 325 | 310 | /* COM port TD0-7 */ |
| 326 | logerror("%06X:hdsnddsp_comport_w=%d\n", cpu_get_previouspc(&space | |
| 311 | logerror("%06X:hdsnddsp_comport_w=%d\n", cpu_get_previouspc(&space. | |
| 327 | 312 | } |
| 328 | 313 | |
| 329 | 314 | |
| 330 | WRITE16_ | |
| 315 | WRITE16_M | |
| 331 | 316 | { |
| 332 | 317 | /* mute DAC audio, D0=1 */ |
| 333 | /* state->m_dacmute = data & 1; -- NOT STUFFED */ | |
| 334 | logerror("%06X:mute DAC=%d\n", cpu_get_previouspc(&space->device()), data); | |
| 318 | /* m_dacmute = data & 1; -- NOT STUFFED */ | |
| 319 | logerror("%06X:mute DAC=%d\n", cpu_get_previouspc(&space.device()), data); | |
| 335 | 320 | } |
| 336 | 321 | |
| 337 | 322 | |
| 338 | WRITE16_ | |
| 323 | WRITE16_M | |
| 339 | 324 | { |
| 340 | 325 | /* generate 68k IRQ */ |
| 341 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 342 | state->m_irq68k = 1; | |
| 343 | update_68k_interrupts(space->machine()); | |
| 326 | m_irq68k = 1; | |
| 327 | update_68k_interrupts(machine()); | |
| 344 | 328 | } |
| 345 | 329 | |
| 346 | 330 | |
| 347 | WRITE16_ | |
| 331 | WRITE16_M | |
| 348 | 332 | { |
| 349 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 350 | 333 | if (offset == 0) |
| 351 | 334 | { |
| 352 | 335 | /* select sound ROM block */ |
| 353 | | |
| 336 | | |
| 354 | 337 | } |
| 355 | 338 | else |
| 356 | 339 | { |
| 357 | 340 | /* sound memory address */ |
| 358 | | |
| 341 | | |
| 359 | 342 | } |
| 360 | 343 | } |
| 361 | 344 | |
| 362 | 345 | |
| 363 | READ16_ | |
| 346 | READ16_M | |
| 364 | 347 | { |
| 365 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 366 | if (state->m_sound_rom_offs < state->m_romsize) | |
| 367 | return state->m_rombase[state->m_sound_rom_offs++] << 7; | |
| 368 | state->m_sound_rom_offs++; | |
| 348 | if (m_sound_rom_offs < m_romsize) | |
| 349 | return m_rombase[m_sound_rom_offs++] << 7; | |
| 350 | m_sound_rom_offs++; | |
| 369 | 351 | return 0; |
| 370 | 352 | } |
| 371 | 353 | |
| 372 | 354 | |
| 373 | READ16_ | |
| 355 | READ16_M | |
| 374 | 356 | { |
| 375 | harddriv_state *state = space->machine().driver_data<harddriv_state>(); | |
| 376 | return state->m_comram[state->m_sound_rom_offs++ & 0x1ff]; | |
| 357 | return m_comram[m_sound_rom_offs++ & 0x1ff]; | |
| 377 | 358 | } |
| 378 | 359 | |
| 379 | 360 | |
| 380 | READ16_ | |
| 361 | READ16_M | |
| 381 | 362 | { |
| 382 | logerror("%06X:hdsnddsp_compare_r(%04X)\n", cpu_get_previouspc(&space | |
| 363 | logerror("%06X:hdsnddsp_compare_r(%04X)\n", cpu_get_previouspc(&space. | |
| 383 | 364 | return 0; |
| 384 | 365 | } |
| r14896 | r14897 | |
|---|---|---|
| 154 | 154 | { |
| 155 | 155 | m72_audio_state *state = get_safe_token(device); |
| 156 | 156 | driver_device *drvstate = device->machine().driver_data<driver_device>(); |
| 157 | drvstate->soundlatch_w(*state->space, offset, data); | |
| 157 | drvstate->soundlatch_byte_w(*state->space, offset, data); | |
| 158 | 158 | device->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT, state); |
| 159 | 159 | } |
| 160 | 160 | } |
| r14896 | r14897 | |
| 163 | 163 | { |
| 164 | 164 | m72_audio_state *state = get_safe_token(device); |
| 165 | 165 | driver_device *drvstate = device->machine().driver_data<driver_device>(); |
| 166 | drvstate->soundlatch_w(*state->space, offset, data); | |
| 166 | drvstate->soundlatch_byte_w(*state->space, offset, data); | |
| 167 | 167 | device->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT, state); |
| 168 | 168 | } |
| 169 | 169 |
| r14896 | r14897 | |
|---|---|---|
| 544 | 544 | driver_device *drvstate = space->machine().driver_data<driver_device>(); |
| 545 | 545 | device_set_input_line(state->sound_cpu, M6809_IRQ_LINE, CLEAR_LINE); |
| 546 | 546 | state->sound_int_state = 0; |
| 547 | return drvstate->soundlatch_r(*space, 0); | |
| 547 | return drvstate->soundlatch_byte_r(*space, 0); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | |
| r14896 | r14897 | |
| 552 | 552 | { |
| 553 | 553 | williams_audio_state *state = &audio; |
| 554 | 554 | driver_device *drvstate = space->machine().driver_data<driver_device>(); |
| 555 | drvstate->soundlatch2_w(*space, 0, data & 0xff); | |
| 555 | drvstate->soundlatch2_byte_w(*space, 0, data & 0xff); | |
| 556 | 556 | device_set_input_line(state->soundalt_cpu, M6809_FIRQ_LINE, ASSERT_LINE); |
| 557 | 557 | } |
| 558 | 558 | |
| r14896 | r14897 | |
| 562 | 562 | williams_audio_state *state = &audio; |
| 563 | 563 | driver_device *drvstate = space->machine().driver_data<driver_device>(); |
| 564 | 564 | device_set_input_line(state->soundalt_cpu, M6809_FIRQ_LINE, CLEAR_LINE); |
| 565 | return drvstate->soundlatch2_r(*space, 0); | |
| 565 | return drvstate->soundlatch2_byte_r(*space, 0); | |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | |
| r14896 | r14897 | |
| 619 | 619 | device_t *sound_cpu = state->sound_cpu; |
| 620 | 620 | address_space *space = sound_cpu->memory().space(AS_PROGRAM); |
| 621 | 621 | driver_device *drvstate = space->machine().driver_data<driver_device>(); |
| 622 | drvstate->soundlatch_w(*space, 0, data & 0xff); | |
| 622 | drvstate->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 623 | 623 | device_set_input_line(sound_cpu, INPUT_LINE_NMI, (data & 0x100) ? CLEAR_LINE : ASSERT_LINE); |
| 624 | 624 | if (!(data & 0x200)) |
| 625 | 625 | { |
| r14896 | r14897 | |
| 697 | 697 | self-tests to pass */ |
| 698 | 698 | space->machine().scheduler().timer_set(attotime::from_usec(10), FUNC(clear_irq_state)); |
| 699 | 699 | driver_device *drvstate = space->machine().driver_data<driver_device>(); |
| 700 | return drvstate->soundlatch_r(*space, 0); | |
| 700 | return drvstate->soundlatch_byte_r(*space, 0); | |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | |
| r14896 | r14897 | |
| 720 | 720 | device_t *sound_cpu = state->sound_cpu; |
| 721 | 721 | address_space *space = sound_cpu->memory().space(AS_PROGRAM); |
| 722 | 722 | driver_device *drvstate = space->machine().driver_data<driver_device>(); |
| 723 | drvstate->soundlatch_w(*space, 0, data & 0xff); | |
| 723 | drvstate->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 724 | 724 | if (!(data & 0x200)) |
| 725 | 725 | { |
| 726 | 726 | device_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE); |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | * |
| 63 | 63 | *************************************/ |
| 64 | 64 | |
| 65 | WRITE8_ | |
| 65 | WRITE8_M | |
| 66 | 66 | { |
| 67 | redalert_state *state = space->machine().driver_data<redalert_state>(); | |
| 68 | 67 | /* the byte is connected to port A of the AY8910 */ |
| 69 | s | |
| 68 | s | |
| 70 | 69 | |
| 71 | 70 | /* D7 is also connected to the NMI input of the CPU - |
| 72 | 71 | the NMI is actually toggled by a 74121 */ |
| 73 | 72 | if ((data & 0x80) == 0x00) |
| 74 | cputag_set_input_line( | |
| 73 | cputag_set_input_line( | |
| 75 | 74 | } |
| 76 | 75 | |
| 77 | 76 | |
| r14896 | r14897 | |
| 101 | 100 | } |
| 102 | 101 | |
| 103 | 102 | |
| 104 | ||
| 103 | ||
| 105 | 104 | { |
| 106 | redalert_state *state = space->machine().driver_data<redalert_state>(); | |
| 107 | return state->m_ay8910_latch_1; | |
| 105 | return m_ay8910_latch_1; | |
| 108 | 106 | } |
| 109 | 107 | |
| 110 | 108 | |
| 111 | ||
| 109 | ||
| 112 | 110 | { |
| 113 | redalert_state *state = space->machine().driver_data<redalert_state>(); | |
| 114 | state->m_ay8910_latch_2 = data; | |
| 111 | m_ay8910_latch_2 = data; | |
| 115 | 112 | } |
| 116 | 113 | |
| 117 | 114 | |
| r14896 | r14897 | |
| 119 | 116 | { |
| 120 | 117 | AY8910_LEGACY_OUTPUT, |
| 121 | 118 | AY8910_DEFAULT_LOADS, |
| 122 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 119 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 123 | 120 | DEVCB_NULL, /* port A/B read */ |
| 124 | 121 | DEVCB_NULL, |
| 125 | 122 | DEVCB_HANDLER(redalert_analog_w) /* port A/B write */ |
| 126 | 123 | }; |
| 127 | 124 | |
| 128 | 125 | |
| 129 | static ADDRESS_MAP_START( redalert_audio_map, AS_PROGRAM, 8, | |
| 126 | static ADDRESS_MAP_START( redalert_audio_map, AS_PROGRAM, 8, | |
| 130 | 127 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 131 | 128 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x0c00) AM_RAM |
| 132 | 129 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0ffe) AM_READNOP AM_DEVWRITE_LEGACY("aysnd", redalert_AY8910_w) |
| 133 | AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x0ffe) AM_READWRITE | |
| 130 | AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x0ffe) AM_READWRITE | |
| 134 | 131 | AM_RANGE(0x2000, 0x6fff) AM_NOP |
| 135 | 132 | AM_RANGE(0x7000, 0x77ff) AM_MIRROR(0x0800) AM_ROM |
| 136 | 133 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 155 | 152 | * |
| 156 | 153 | *************************************/ |
| 157 | 154 | |
| 158 | WRITE8_ | |
| 155 | WRITE8_M | |
| 159 | 156 | { |
| 160 | redalert_state *state = space->machine().driver_data<redalert_state>(); | |
| 161 | state->soundlatch2_w(*space, 0, (data & 0x78) >> 3); | |
| 162 | cputag_set_input_line(space->machine(), "voice", I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 157 | soundlatch2_byte_w(*&space, 0, (data & 0x78) >> 3); | |
| 158 | cputag_set_input_line(machine(), "voice", I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 163 | 159 | } |
| 164 | 160 | |
| 165 | 161 | |
| r14896 | r14897 | |
| 184 | 180 | }; |
| 185 | 181 | |
| 186 | 182 | |
| 187 | static ADDRESS_MAP_START( redalert_voice_map, AS_PROGRAM, 8, | |
| 183 | static ADDRESS_MAP_START( redalert_voice_map, AS_PROGRAM, 8, | |
| 188 | 184 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 189 | 185 | AM_RANGE(0x4000, 0x7fff) AM_NOP |
| 190 | 186 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x3c00) AM_RAM |
| 191 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x3fff) AM_READ(soundlatch2_r) AM_WRITENOP | |
| 187 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x3fff) AM_READ(soundlatch2_byte_r) AM_WRITENOP | |
| 192 | 188 | ADDRESS_MAP_END |
| 193 | 189 | |
| 194 | 190 | |
| r14896 | r14897 | |
| 282 | 278 | *************************************/ |
| 283 | 279 | |
| 284 | 280 | |
| 285 | WRITE8_ | |
| 281 | WRITE8_M | |
| 286 | 282 | { |
| 287 | redalert_state *state = space->machine().driver_data<redalert_state>(); | |
| 288 | 283 | /* the byte is connected to port A of the AY8910 */ |
| 289 | state->soundlatch_w(*space, 0, data); | |
| 290 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 284 | soundlatch_byte_w(*&space, 0, data); | |
| 285 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 291 | 286 | } |
| 292 | 287 | |
| 293 | 288 | |
| r14896 | r14897 | |
| 347 | 342 | } |
| 348 | 343 | |
| 349 | 344 | |
| 350 | static ADDRESS_MAP_START( demoneye_audio_map, AS_PROGRAM, 8, | |
| 345 | static ADDRESS_MAP_START( demoneye_audio_map, AS_PROGRAM, 8, | |
| 351 | 346 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 352 | 347 | AM_RANGE(0x0000, 0x007f) AM_RAM |
| 353 | 348 | AM_RANGE(0x0500, 0x0503) AM_DEVREADWRITE("sndpia", pia6821_device, read, write) |
| r14896 | r14897 | |
| 359 | 354 | { |
| 360 | 355 | AY8910_LEGACY_OUTPUT, |
| 361 | 356 | AY8910_DEFAULT_LOADS, |
| 362 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 357 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 363 | 358 | DEVCB_NULL, /* port A/B read */ |
| 364 | 359 | DEVCB_NULL, |
| 365 | 360 | DEVCB_NULL /* port A/B write */ |
| r14896 | r14897 | |
|---|---|---|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | READ8_ | |
| 93 | READ8_M | |
| 94 | 94 | { |
| 95 | starwars_state *state = space->machine().driver_data<starwars_state>(); | |
| 96 | riot6532_porta_in_set(state->m_riot, 0x00, 0x80); | |
| 97 | return state->m_sound_data; | |
| 95 | riot6532_porta_in_set(m_riot, 0x00, 0x80); | |
| 96 | return m_sound_data; | |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | 99 | |
| 101 | WRITE8_ | |
| 100 | WRITE8_M | |
| 102 | 101 | { |
| 103 | | |
| 102 | | |
| 104 | 103 | } |
| 105 | 104 | |
| 106 | 105 | |
| r14896 | r14897 | |
| 111 | 110 | * |
| 112 | 111 | *************************************/ |
| 113 | 112 | |
| 114 | READ8_ | |
| 113 | READ8_M | |
| 115 | 114 | { |
| 116 | starwars_state *state = space->machine().driver_data<starwars_state>(); | |
| 117 | riot6532_porta_in_set(state->m_riot, 0x00, 0x40); | |
| 118 | return state->m_main_data; | |
| 115 | riot6532_porta_in_set(m_riot, 0x00, 0x40); | |
| 116 | return m_main_data; | |
| 119 | 117 | } |
| 120 | 118 | |
| 121 | 119 | |
| 122 | READ8_ | |
| 120 | READ8_M | |
| 123 | 121 | { |
| 124 | starwars_state *state = space->machine().driver_data<starwars_state>(); | |
| 125 | return riot6532_porta_in_get(state->m_riot) & 0xc0; /* only upper two flag bits mapped */ | |
| 122 | return riot6532_porta_in_get(m_riot) & 0xc0; /* only upper two flag bits mapped */ | |
| 126 | 123 | } |
| 127 | 124 | |
| 128 | 125 | static TIMER_CALLBACK( main_callback ) |
| r14896 | r14897 | |
| 136 | 133 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); |
| 137 | 134 | } |
| 138 | 135 | |
| 139 | WRITE8_ | |
| 136 | WRITE8_M | |
| 140 | 137 | { |
| 141 | | |
| 138 | | |
| 142 | 139 | } |
| 143 | 140 | |
| 144 | 141 | |
| 145 | WRITE8_ | |
| 142 | WRITE8_M | |
| 146 | 143 | { |
| 147 | starwars_state *state = space->machine().driver_data<starwars_state>(); | |
| 148 | riot6532_porta_in_set(state->m_riot, 0x00, 0xc0); | |
| 144 | riot6532_porta_in_set(m_riot, 0x00, 0xc0); | |
| 149 | 145 | |
| 150 | 146 | /* reset sound CPU here */ |
| 151 | cputag_set_input_line( | |
| 147 | cputag_set_input_line( | |
| 152 | 148 | } |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | #define ACTIVELOW_PORT_BIT(P,A,D) ((P & (~(1 << A))) | ((D ^ 1) << A)) |
| 23 | 23 | #define ACTIVEHIGH_PORT_BIT(P,A,D) ((P & (~(1 << A))) | (D << A)) |
| 24 | 24 | |
| 25 | #define I8035_T_R(M,N) ((state->soundlatch2_r(M,0) >> (N)) & 1) | |
| 26 | #define I8035_T_W_AH(M,N,D) do { state->m_portT = ACTIVEHIGH_PORT_BIT(state->m_portT,N,D); state->soundlatch2_w(M, 0, state->m_portT); } while (0) | |
| 25 | #define I8035_T_R(M,N) ((soundlatch2_byte_r(M,0) >> (N)) & 1) | |
| 26 | #define I8035_T_W_AH(M,N,D) do { m_portT = ACTIVEHIGH_PORT_BIT(m_portT,N,D); soundlatch2_byte_w(M, 0, m_portT); } while (0) | |
| 27 | 27 | |
| 28 | #define I8035_P1_R(M) (state->soundlatch3_r(M,0)) | |
| 29 | #define I8035_P2_R(M) (state->soundlatch4_r(M,0)) | |
| 30 | #define I8035_P1_W(M,D) state->soundlatch3_w(M,0,D) | |
| 28 | #define I8035_P1_R(M) (soundlatch3_byte_r(M,0)) | |
| 29 | #define I8035_P2_R(M) (soundlatch4_byte_r(M,0)) | |
| 30 | #define I8035_P1_W(M,D) soundlatch3_byte_w(M,0,D) | |
| 31 | 31 | |
| 32 | 32 | #if (USE_8039) |
| 33 | #define I8035_P2_W(M,D) do { state->soundlatch4_w(M,0,D); } while (0) | |
| 33 | #define I8035_P2_W(M,D) do { state->soundlatch4_byte_w(M,0,D); } while (0) | |
| 34 | 34 | #else |
| 35 | #define I8035_P2_W(M,D) do { set_ea(M, ((D) & 0x20) ? 0 : 1); state->soundlatch4_w(M,0,D); } while (0) | |
| 35 | #define I8035_P2_W(M,D) do { set_ea(M, ((D) & 0x20) ? 0 : 1); state->soundlatch4_byte_w(M,0,D); } while (0) | |
| 36 | 36 | #endif |
| 37 | 37 | |
| 38 | 38 | #define I8035_P1_W_AH(M,B,D) I8035_P1_W(M,ACTIVEHIGH_PORT_BIT(I8035_P1_R(M),B,(D))) |
| r14896 | r14897 | |
| 444 | 444 | #endif |
| 445 | 445 | |
| 446 | 446 | /* FIXME: convert to latch8 */ |
| 447 | state->soundlatch_clear_w(*space, 0, 0); | |
| 448 | state->soundlatch2_clear_w(*space, 0, 0); | |
| 449 | state->soundlatch3_clear_w(*space, 0, 0); | |
| 450 | state->soundlatch4_clear_w(*space, 0, 0); | |
| 451 | I8035_P1_W(*space, 0x00); /* Input port */ | |
| 447 | state->soundlatch_clear_byte_w(*space, 0, 0); | |
| 448 | state->soundlatch2_clear_byte_w(*space, 0, 0); | |
| 449 | state->soundlatch3_clear_byte_w(*space, 0, 0); | |
| 450 | state->soundlatch4_clear_byte_w(*space, 0, 0); | |
| 451 | state->I8035_P1_W(*space, 0x00); /* Input port */ | |
| 452 | 452 | I8035_P2_W(*space, 0xff); /* Port is in high impedance state after reset */ |
| 453 | 453 | |
| 454 | 454 | state->m_last = 0; |
| r14896 | r14897 | |
| 460 | 460 | * |
| 461 | 461 | ****************************************************************/ |
| 462 | 462 | |
| 463 | ||
| 463 | ||
| 464 | 464 | { |
| 465 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 466 | return I8035_P1_R(*space); | |
| 465 | return I8035_P1_R(*&space); | |
| 467 | 466 | } |
| 468 | 467 | |
| 469 | ||
| 468 | ||
| 470 | 469 | { |
| 471 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 472 | return I8035_P2_R(*space) & 0xEF; /* Bit 4 connected to GND! */ | |
| 470 | return I8035_P2_R(*&space) & 0xEF; /* Bit 4 connected to GND! */ | |
| 473 | 471 | } |
| 474 | 472 | |
| 475 | ||
| 473 | ||
| 476 | 474 | { |
| 477 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 478 | return I8035_T_R(*space, 0); | |
| 475 | return I8035_T_R(*&space, 0); | |
| 479 | 476 | } |
| 480 | 477 | |
| 481 | ||
| 478 | ||
| 482 | 479 | { |
| 483 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 484 | return I8035_T_R(*space, 1); | |
| 480 | return I8035_T_R(*&space, 1); | |
| 485 | 481 | } |
| 486 | 482 | |
| 487 | ||
| 483 | ||
| 488 | 484 | { |
| 489 | UINT8 *SND = space->machine().region("audiocpu")->base(); | |
| 490 | UINT16 mask = space->machine().region("audiocpu")->bytes()-1; | |
| 491 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 492 | UINT8 p2 = I8035_P2_R(*space); | |
| 485 | UINT8 *SND = machine().region("audiocpu")->base(); | |
| 486 | UINT16 mask = machine().region("audiocpu")->bytes()-1; | |
| 487 | UINT8 p2 = I8035_P2_R(*&space); | |
| 493 | 488 | |
| 494 | 489 | if ((p2 >> 7) & 1) |
| 495 | return s | |
| 490 | return s | |
| 496 | 491 | else |
| 497 | 492 | return (SND[(0x1000 + (p2 & 0x0f) * 256 + offset) & mask]); |
| 498 | 493 | } |
| r14896 | r14897 | |
| 502 | 497 | discrete_sound_w(device, DS_DAC, data); |
| 503 | 498 | } |
| 504 | 499 | |
| 505 | ||
| 500 | ||
| 506 | 501 | { |
| 507 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 508 | I8035_P1_W(*space, data); | |
| 502 | I8035_P1_W(*&space, data); | |
| 509 | 503 | } |
| 510 | 504 | |
| 511 | ||
| 505 | ||
| 512 | 506 | { |
| 513 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 514 | I8035_P2_W(*space, data); | |
| 507 | mario_state *state = machine().driver_data<mario_state>(); | |
| 508 | I8035_P2_W(*&space, data); | |
| 515 | 509 | } |
| 516 | 510 | |
| 517 | 511 | /**************************************************************** |
| r14896 | r14897 | |
| 520 | 514 | * |
| 521 | 515 | ****************************************************************/ |
| 522 | 516 | |
| 523 | WRITE8_ | |
| 517 | WRITE8_M | |
| 524 | 518 | { |
| 525 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 526 | 519 | |
| 527 | if ( | |
| 520 | if ( | |
| 528 | 521 | { |
| 529 | 522 | /* setting bit 0 high then low triggers IRQ on the sound CPU */ |
| 530 | cputag_set_input_line_and_vector( | |
| 523 | cputag_set_input_line_and_vector( | |
| 531 | 524 | } |
| 532 | 525 | |
| 533 | | |
| 526 | | |
| 534 | 527 | } |
| 535 | 528 | |
| 536 | WRITE8_ | |
| 529 | WRITE8_M | |
| 537 | 530 | { |
| 538 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 539 | state->soundlatch_w(*space, offset, data); | |
| 531 | soundlatch_byte_w(*&space, offset, data); | |
| 540 | 532 | } |
| 541 | 533 | |
| 542 | 534 | /* Sound 0 and 1 are pulsed !*/ |
| r14896 | r14897 | |
| 554 | 546 | } |
| 555 | 547 | |
| 556 | 548 | /* Misc samples */ |
| 557 | WRITE8_ | |
| 549 | WRITE8_M | |
| 558 | 550 | { |
| 559 | mario_state *state = space->machine().driver_data<mario_state>(); | |
| 560 | 551 | |
| 561 | 552 | switch (offset) |
| 562 | 553 | { |
| 563 | 554 | case 0: /* death */ |
| 564 | 555 | if (data) |
| 565 | cputag_set_input_line( | |
| 556 | cputag_set_input_line( | |
| 566 | 557 | else |
| 567 | cputag_set_input_line( | |
| 558 | cputag_set_input_line( | |
| 568 | 559 | break; |
| 569 | 560 | case 1: /* get coin */ |
| 570 | I8035_T_W_AH(*space, 0,data & 1); | |
| 561 | I8035_T_W_AH(*&space, 0,data & 1); | |
| 571 | 562 | break; |
| 572 | 563 | case 2: /* ice */ |
| 573 | I8035_T_W_AH(*space, 1, data & 1); | |
| 564 | I8035_T_W_AH(*&space, 1, data & 1); | |
| 574 | 565 | break; |
| 575 | 566 | case 3: /* crab */ |
| 576 | I8035_P1_W_AH(*space, 0, data & 1); | |
| 567 | I8035_P1_W_AH(*&space, 0, data & 1); | |
| 577 | 568 | break; |
| 578 | 569 | case 4: /* turtle */ |
| 579 | I8035_P1_W_AH(*space, 1, data & 1); | |
| 570 | I8035_P1_W_AH(*&space, 1, data & 1); | |
| 580 | 571 | break; |
| 581 | 572 | case 5: /* fly */ |
| 582 | I8035_P1_W_AH(*space, 2, data & 1); | |
| 573 | I8035_P1_W_AH(*&space, 2, data & 1); | |
| 583 | 574 | break; |
| 584 | 575 | case 6: /* coin */ |
| 585 | I8035_P1_W_AH(*space, 3, data & 1); | |
| 576 | I8035_P1_W_AH(*&space, 3, data & 1); | |
| 586 | 577 | break; |
| 587 | 578 | case 7: /* skid */ |
| 588 | discrete_sound_w( | |
| 579 | discrete_sound_w( | |
| 589 | 580 | break; |
| 590 | 581 | } |
| 591 | 582 | } |
| r14896 | r14897 | |
| 596 | 587 | * |
| 597 | 588 | *************************************/ |
| 598 | 589 | |
| 599 | static ADDRESS_MAP_START( mario_sound_map, AS_PROGRAM, 8, | |
| 590 | static ADDRESS_MAP_START( mario_sound_map, AS_PROGRAM, 8, mario | |
| 600 | 591 | AM_RANGE(0x0000, 0x07ff) AM_ROMBANK("bank1") AM_REGION("audiocpu", 0) |
| 601 | 592 | AM_RANGE(0x0800, 0x0fff) AM_ROM |
| 602 | 593 | ADDRESS_MAP_END |
| 603 | 594 | |
| 604 | static ADDRESS_MAP_START( mario_sound_io_map, AS_IO, 8, driver_device ) | |
| 605 | AM_RANGE(0x00, 0xff) AM_READ_LEGACY(mario_sh_tune_r) AM_DEVWRITE_LEGACY("discrete", mario_sh_sound_w) | |
| 606 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE_LEGACY(mario_sh_p1_r, mario_sh_p1_w) | |
| 607 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE_LEGACY(mario_sh_p2_r, mario_sh_p2_w) | |
| 608 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ_LEGACY(mario_sh_t0_r) | |
| 609 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_LEGACY(mario_sh_t1_r) | |
| 595 | static ADDRESS_MAP_START( mario_sound_io_map, AS_IO, 8, mario_state ) | |
| 596 | AM_RANGE(0x00, 0xff) AM_READ(mario_sh_tune_r) AM_DEVWRITE_LEGACY("discrete", mario_sh_sound_w) | |
| 597 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(mario_sh_p1_r, mario_sh_p1_w) | |
| 598 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(mario_sh_p2_r, mario_sh_p2_w) | |
| 599 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(mario_sh_t0_r) | |
| 600 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(mario_sh_t1_r) | |
| 610 | 601 | ADDRESS_MAP_END |
| 611 | 602 | |
| 612 | static ADDRESS_MAP_START( masao_sound_map, AS_PROGRAM, 8, | |
| 603 | static ADDRESS_MAP_START( masao_sound_map, AS_PROGRAM, 8, mario | |
| 613 | 604 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 614 | 605 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 615 | 606 | AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w) |
| r14896 | r14897 | |
| 626 | 617 | { |
| 627 | 618 | AY8910_LEGACY_OUTPUT, |
| 628 | 619 | AY8910_DEFAULT_LOADS, |
| 629 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 620 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 630 | 621 | DEVCB_NULL, |
| 631 | 622 | DEVCB_NULL, |
| 632 | 623 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 162 | 162 | MACHINE_CONFIG_END |
| 163 | 163 | |
| 164 | 164 | |
| 165 | WRITE8_ | |
| 165 | WRITE8_M | |
| 166 | 166 | { |
| 167 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 168 | UINT8 rising_bits = data & ~state->m_port_1_last; | |
| 167 | UINT8 rising_bits = data & ~m_port_1_last; | |
| 169 | 168 | |
| 170 | 169 | /* if (data & 0x01) enable SHIP HIT sound */ |
| 171 | if (rising_bits & 0x01) | |
| 170 | if (rising_bits & 0x01) | |
| 172 | 171 | |
| 173 | 172 | /* if (data & 0x02) enable TORPEDO sound */ |
| 174 | if (rising_bits & 0x02) | |
| 173 | if (rising_bits & 0x02) | |
| 175 | 174 | |
| 176 | 175 | /* if (data & 0x04) enable DIVE sound */ |
| 177 | if (rising_bits & 0x04) | |
| 176 | if (rising_bits & 0x04) | |
| 178 | 177 | |
| 179 | 178 | /* if (data & 0x08) enable SONAR sound */ |
| 180 | if (rising_bits & 0x08) | |
| 179 | if (rising_bits & 0x08) | |
| 181 | 180 | |
| 182 | 181 | /* if (data & 0x10) enable MINE HIT sound */ |
| 183 | if (rising_bits & 0x10) | |
| 182 | if (rising_bits & 0x10) | |
| 184 | 183 | |
| 185 | coin_counter_w( | |
| 184 | coin_counter_w( | |
| 186 | 185 | |
| 187 | 186 | /* D6 and D7 are not connected */ |
| 188 | 187 | |
| 189 | | |
| 188 | | |
| 190 | 189 | } |
| 191 | 190 | |
| 192 | 191 | |
| r14896 | r14897 | |
| 226 | 225 | MACHINE_CONFIG_END |
| 227 | 226 | |
| 228 | 227 | |
| 229 | WRITE8_ | |
| 228 | WRITE8_M | |
| 230 | 229 | { |
| 231 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 232 | 230 | |
| 233 | 231 | /* D0 and D1 are just tied to 1k resistors */ |
| 234 | 232 | |
| 235 | coin_counter_w( | |
| 233 | coin_counter_w( | |
| 236 | 234 | |
| 237 | 235 | /* the 74175 latches and inverts the top 4 bits */ |
| 238 | 236 | switch ((~data >> 4) & 0x0f) |
| r14896 | r14897 | |
| 242 | 240 | |
| 243 | 241 | case 0x01: |
| 244 | 242 | /* enable LEFT SHOOT sound (left speaker) */ |
| 245 | | |
| 243 | | |
| 246 | 244 | break; |
| 247 | 245 | |
| 248 | 246 | case 0x02: |
| 249 | 247 | /* enable RIGHT SHOOT sound (right speaker) */ |
| 250 | | |
| 248 | | |
| 251 | 249 | break; |
| 252 | 250 | |
| 253 | 251 | case 0x03: |
| 254 | 252 | /* enable LEFT HIT sound (left speaker) */ |
| 255 | | |
| 253 | | |
| 256 | 254 | break; |
| 257 | 255 | |
| 258 | 256 | case 0x04: |
| 259 | 257 | /* enable RIGHT HIT sound (right speaker) */ |
| 260 | | |
| 258 | | |
| 261 | 259 | break; |
| 262 | 260 | |
| 263 | 261 | default: |
| 264 | logerror("%04x: Unknown sh port write %02x\n", cpu_get_pc(&space | |
| 262 | logerror("%04x: Unknown sh port write %02x\n", cpu_get_pc(&space. | |
| 265 | 263 | break; |
| 266 | 264 | } |
| 267 | 265 | } |
| r14896 | r14897 | |
| 369 | 367 | MACHINE_CONFIG_END |
| 370 | 368 | |
| 371 | 369 | |
| 372 | WRITE8_ | |
| 370 | WRITE8_M | |
| 373 | 371 | { |
| 374 | 372 | /* set ENGINE SOUND FREQ(data & 0x0f) the value written is |
| 375 | 373 | the gas pedal position */ |
| r14896 | r14897 | |
| 382 | 380 | } |
| 383 | 381 | |
| 384 | 382 | |
| 385 | WRITE8_ | |
| 383 | WRITE8_M | |
| 386 | 384 | { |
| 387 | 385 | /* if (data & 0x01) enable BOOM sound */ |
| 388 | 386 | |
| r14896 | r14897 | |
| 394 | 392 | before it appears again, not sure what |
| 395 | 393 | it is supposed to sound like) */ |
| 396 | 394 | |
| 397 | coin_counter_w( | |
| 395 | coin_counter_w( | |
| 398 | 396 | |
| 399 | 397 | /* D4, D6 and D7 are not connected */ |
| 400 | 398 | } |
| r14896 | r14897 | |
| 1582 | 1580 | MACHINE_CONFIG_END |
| 1583 | 1581 | |
| 1584 | 1582 | |
| 1585 | WRITE8_ | |
| 1583 | WRITE8_M | |
| 1586 | 1584 | { |
| 1587 | 1585 | /* note that the schematics shows the left and right explosions |
| 1588 | 1586 | reversed (D5=R, D7=L), but the software confirms that |
| 1589 | 1587 | ours is right */ |
| 1590 | 1588 | |
| 1591 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 1592 | UINT8 rising_bits = data & ~state->m_port_1_last; | |
| 1589 | UINT8 rising_bits = data & ~m_port_1_last; | |
| 1593 | 1590 | |
| 1594 | 1591 | /* D0 and D1 are not connected */ |
| 1595 | 1592 | |
| 1596 | coin_counter_w( | |
| 1593 | coin_counter_w( | |
| 1597 | 1594 | |
| 1598 | | |
| 1595 | | |
| 1599 | 1596 | |
| 1600 | 1597 | /* if (data & 0x10) enable RIGHT MISSILE sound (goes to right speaker) */ |
| 1601 | if (rising_bits & 0x10) | |
| 1598 | if (rising_bits & 0x10) | |
| 1602 | 1599 | |
| 1603 | 1600 | /* if (data & 0x20) enable LEFT EXPLOSION sound (goes to left speaker) */ |
| 1604 | 1601 | output_set_value("L_EXP_LIGHT", (data >> 5) & 0x01); |
| 1605 | if (rising_bits & 0x20) | |
| 1602 | if (rising_bits & 0x20) | |
| 1606 | 1603 | |
| 1607 | 1604 | /* if (data & 0x40) enable LEFT MISSILE sound (goes to left speaker) */ |
| 1608 | if (rising_bits & 0x40) | |
| 1605 | if (rising_bits & 0x40) | |
| 1609 | 1606 | |
| 1610 | 1607 | /* if (data & 0x80) enable RIGHT EXPLOSION sound (goes to right speaker) */ |
| 1611 | 1608 | output_set_value("R_EXP_LIGHT", (data >> 7) & 0x01); |
| 1612 | if (rising_bits & 0x80) | |
| 1609 | if (rising_bits & 0x80) | |
| 1613 | 1610 | |
| 1614 | | |
| 1611 | | |
| 1615 | 1612 | } |
| 1616 | 1613 | |
| 1617 | 1614 | |
| 1618 | WRITE8_ | |
| 1615 | WRITE8_M | |
| 1619 | 1616 | { |
| 1620 | 1617 | /* set AIRPLANE/COPTER/JET PAN(data & 0x07) */ |
| 1621 | 1618 | |
| r14896 | r14897 | |
| 1625 | 1622 | } |
| 1626 | 1623 | |
| 1627 | 1624 | |
| 1628 | WRITE8_ | |
| 1625 | WRITE8_M | |
| 1629 | 1626 | { |
| 1630 | 1627 | /* if (data & 0x01) enable AIRPLANE (bi-plane) sound (goes to AIRPLANE/COPTER/JET panning circuit) */ |
| 1631 | 1628 | |
| r14896 | r14897 | |
| 1679 | 1676 | MACHINE_CONFIG_END |
| 1680 | 1677 | |
| 1681 | 1678 | |
| 1682 | WRITE8_ | |
| 1679 | WRITE8_M | |
| 1683 | 1680 | { |
| 1684 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 1685 | UINT8 rising_bits = data & ~state->m_port_1_last; | |
| 1681 | UINT8 rising_bits = data & ~m_port_1_last; | |
| 1686 | 1682 | |
| 1687 | 1683 | /* D0 and D1 are not connected */ |
| 1688 | 1684 | |
| 1689 | coin_counter_w( | |
| 1685 | coin_counter_w( | |
| 1690 | 1686 | |
| 1691 | | |
| 1687 | | |
| 1692 | 1688 | |
| 1693 | 1689 | /* if (data & 0x10) enable LEFT PLAYER SHOT sound (goes to left speaker) */ |
| 1694 | if (rising_bits & 0x10) | |
| 1690 | if (rising_bits & 0x10) | |
| 1695 | 1691 | |
| 1696 | 1692 | /* if (data & 0x20) enable RIGHT PLAYER SHOT sound (goes to right speaker) */ |
| 1697 | if (rising_bits & 0x20) | |
| 1693 | if (rising_bits & 0x20) | |
| 1698 | 1694 | |
| 1699 | 1695 | /* if (data & 0x40) enable LEFT PLAYER EXPLOSION sound via 300K res (goes to left speaker) */ |
| 1700 | if (rising_bits & 0x40) | |
| 1696 | if (rising_bits & 0x40) | |
| 1701 | 1697 | |
| 1702 | 1698 | /* if (data & 0x80) enable RIGHT PLAYER EXPLOSION sound via 300K res (goes to right speaker) */ |
| 1703 | if (rising_bits & 0x80) | |
| 1699 | if (rising_bits & 0x80) | |
| 1704 | 1700 | |
| 1705 | | |
| 1701 | | |
| 1706 | 1702 | } |
| 1707 | 1703 | |
| 1708 | 1704 | |
| 1709 | WRITE8_ | |
| 1705 | WRITE8_M | |
| 1710 | 1706 | { |
| 1711 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 1712 | UINT8 rising_bits = data & ~state->m_port_2_last; | |
| 1707 | UINT8 rising_bits = data & ~m_port_2_last; | |
| 1713 | 1708 | |
| 1714 | 1709 | /* if (data & 0x01) enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */ |
| 1715 | if (rising_bits & 0x01) | |
| 1710 | if (rising_bits & 0x01) | |
| 1716 | 1711 | |
| 1717 | 1712 | /* if (data & 0x02) enable RIGHT PLAYER EXPLOSION sound via 510K res (goes to right speaker) */ |
| 1718 | if (rising_bits & 0x02) | |
| 1713 | if (rising_bits & 0x02) | |
| 1719 | 1714 | |
| 1720 | 1715 | /* if (data & 0x04) enable LEFT TANK MOTOR sound (goes to left speaker) */ |
| 1721 | 1716 | |
| r14896 | r14897 | |
| 1729 | 1724 | |
| 1730 | 1725 | /* D6 and D7 are not connected */ |
| 1731 | 1726 | |
| 1732 | | |
| 1727 | | |
| 1733 | 1728 | } |
| 1734 | 1729 | |
| 1735 | 1730 | |
| r14896 | r14897 | |
| 1940 | 1935 | MACHINE_CONFIG_END |
| 1941 | 1936 | |
| 1942 | 1937 | |
| 1943 | WRITE8_ | |
| 1938 | WRITE8_M | |
| 1944 | 1939 | { |
| 1945 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 1946 | coin_counter_w(space->machine(), 0, (data >> 0) & 0x01); | |
| 1940 | coin_counter_w(machine(), 0, (data >> 0) & 0x01); | |
| 1947 | 1941 | |
| 1948 | | |
| 1942 | | |
| 1949 | 1943 | |
| 1950 | 1944 | /* D2-D7 are not connected */ |
| 1951 | 1945 | } |
| r14896 | r14897 | |
| 3338 | 3332 | MACHINE_CONFIG_END |
| 3339 | 3333 | |
| 3340 | 3334 | |
| 3341 | WRITE8_ | |
| 3335 | WRITE8_M | |
| 3342 | 3336 | { |
| 3343 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 3344 | UINT8 rising_bits = data & ~state->m_port_1_last; | |
| 3337 | UINT8 rising_bits = data & ~m_port_1_last; | |
| 3345 | 3338 | |
| 3346 | 3339 | /* if (data & 0x01) enable PLAYER SHOT sound */ |
| 3347 | if (rising_bits & 0x01) | |
| 3340 | if (rising_bits & 0x01) | |
| 3348 | 3341 | |
| 3349 | 3342 | /* if (data & 0x02) enable ENEMY SHOT sound */ |
| 3350 | 3343 | |
| 3351 | space->machine().sound().system_mute(!(data & 0x20)); | |
| 3352 | space->machine().sound().system_enable((data >> 2) & 0x01); | |
| 3344 | machine().sound().system_mute(!(data & 0x20)); | |
| 3345 | machine().sound().system_enable((data >> 2) & 0x01); | |
| 3353 | 3346 | |
| 3354 | coin_counter_w( | |
| 3347 | coin_counter_w( | |
| 3355 | 3348 | |
| 3356 | 3349 | /* if (data & 0x10) enable RADAR sound */ |
| 3357 | 3350 | |
| 3358 | 3351 | /* D5-D7 are not connected */ |
| 3359 | 3352 | |
| 3360 | | |
| 3353 | | |
| 3361 | 3354 | } |
| 3362 | 3355 | |
| 3363 | 3356 | |
| 3364 | WRITE8_ | |
| 3357 | WRITE8_M | |
| 3365 | 3358 | { |
| 3366 | mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>(); | |
| 3367 | UINT8 rising_bits = data & ~state->m_port_2_last; | |
| 3359 | UINT8 rising_bits = data & ~m_port_2_last; | |
| 3368 | 3360 | |
| 3369 | 3361 | /* D0-D2 are not connected */ |
| 3370 | 3362 | |
| 3371 | 3363 | /* if (data & 0x08) enable EXPLOSION sound */ |
| 3372 | if (rising_bits & 0x08) | |
| 3364 | if (rising_bits & 0x08) | |
| 3373 | 3365 | |
| 3374 | 3366 | output_set_value("EXPLAMP", (data >> 4) & 0x01); |
| 3375 | 3367 | |
| 3376 | 3368 | /* set JET SOUND FREQ((data >> 5) & 0x07) 0, if no jet sound */ |
| 3377 | 3369 | |
| 3378 | | |
| 3370 | | |
| 3379 | 3371 | } |
| 3380 | 3372 | |
| 3381 | 3373 | |
| r14896 | r14897 | |
| 3488 | 3480 | } |
| 3489 | 3481 | |
| 3490 | 3482 | |
| 3491 | WRITE8_ | |
| 3483 | WRITE8_M | |
| 3492 | 3484 | { |
| 3493 | 3485 | /* set BALL ROLLING SOUND FREQ(data & 0x0f) |
| 3494 | 3486 | 0, if no rolling, 0x08 used during ball return */ |
| r14896 | r14897 | |
| 3502 | 3494 | } |
| 3503 | 3495 | |
| 3504 | 3496 | |
| 3505 | WRITE8_ | |
| 3497 | WRITE8_M | |
| 3506 | 3498 | { |
| 3507 | 3499 | /* regardless of the data, enable BALL HITS PIN 1 sound |
| 3508 | 3500 | (top circuit on the schematics) */ |
| 3509 | 3501 | } |
| 3510 | 3502 | |
| 3511 | 3503 | |
| 3512 | WRITE8_ | |
| 3504 | WRITE8_M | |
| 3513 | 3505 | { |
| 3514 | 3506 | /* regardless of the data, enable BALL HITS PIN 2 sound |
| 3515 | 3507 | (bottom circuit on the schematics) */ |
| 3516 | 3508 | } |
| 3517 | 3509 | |
| 3518 | 3510 | |
| 3519 | WRITE8_ | |
| 3511 | WRITE8_M | |
| 3520 | 3512 | { |
| 3521 | 3513 | /* not sure, appears to me trigerred alongside the two |
| 3522 | 3514 | BALL HITS PIN sounds */ |
| 3523 | 3515 | } |
| 3524 | 3516 | |
| 3525 | 3517 | |
| 3526 | WRITE8_ | |
| 3518 | WRITE8_M | |
| 3527 | 3519 | { |
| 3528 | 3520 | /* D0 is not connected */ |
| 3529 | 3521 |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | m_video_enable = data & 0x40; |
| 32 | 32 | |
| 33 | 33 | /* bit 7 flips screen */ |
| 34 | flip_screen_set( | |
| 34 | flip_screen_set( | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | WRITE8_MEMBER(bublbobl_state::tokio_bankswitch_w) |
| r14896 | r14897 | |
| 45 | 45 | WRITE8_MEMBER(bublbobl_state::tokio_videoctrl_w) |
| 46 | 46 | { |
| 47 | 47 | /* bit 7 flips screen */ |
| 48 | flip_screen_set( | |
| 48 | flip_screen_set( | |
| 49 | 49 | |
| 50 | 50 | /* other bits unknown */ |
| 51 | 51 | } |
| r14896 | r14897 | |
| 98 | 98 | |
| 99 | 99 | WRITE8_MEMBER(bublbobl_state::bublbobl_sound_command_w) |
| 100 | 100 | { |
| 101 | soundlatch_w(space, offset, data); | |
| 101 | soundlatch_byte_w(space, offset, data); | |
| 102 | 102 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 103 | 103 | } |
| 104 | 104 |
| r14896 | r14897 | |
|---|---|---|
| 616 | 616 | break; |
| 617 | 617 | |
| 618 | 618 | case SOUND_YAWDIM: |
| 619 | soundlatch_w(space, 0, data); | |
| 619 | soundlatch_byte_w(space, 0, data); | |
| 620 | 620 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 621 | 621 | break; |
| 622 | 622 | } |
| r14896 | r14897 | |
|---|---|---|
| 299 | 299 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | /* Fake remapping of ASIC commands to the ones used by KOVSH due to the lack of the real ARM rom for this set */ | |
| 303 | WRITE16_HANDLER( kovshp_asic27a_write_word ) | |
| 304 | { | |
| 305 | pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>(); | |
| 306 | ||
| 307 | switch (offset) | |
| 308 | { | |
| 309 | case 0: | |
| 310 | state->m_pgm_arm_type1_lowlatch_68k_w = data; | |
| 311 | return; | |
| 312 | ||
| 313 | case 1: | |
| 314 | { | |
| 315 | unsigned char asic_key = data >> 8; | |
| 316 | unsigned char asic_cmd = (data & 0xff) ^ asic_key; | |
| 317 | ||
| 318 | switch (asic_cmd) | |
| 319 | { | |
| 320 | case 0x9a: asic_cmd = 0x99; break; // kovshxas | |
| 321 | ||
| 322 | case 0x38: asic_cmd = 0xad; break; | |
| 323 | case 0x43: asic_cmd = 0xca; break; | |
| 324 | case 0x56: asic_cmd = 0xac; break; | |
| 325 | case 0x73: asic_cmd = 0x93; break; | |
| 326 | case 0x84: asic_cmd = 0xb3; break; | |
| 327 | case 0x87: asic_cmd = 0xb1; break; | |
| 328 | case 0x89: asic_cmd = 0xb6; break; | |
| 329 | case 0x93: asic_cmd = 0x73; break; | |
| 330 | case 0xa5: asic_cmd = 0xa9; break; | |
| 331 | case 0xac: asic_cmd = 0x56; break; | |
| 332 | case 0xad: asic_cmd = 0x38; break; | |
| 333 | case 0xb1: asic_cmd = 0x87; break; | |
| 334 | case 0xb3: asic_cmd = 0x84; break; | |
| 335 | case 0xb4: asic_cmd = 0x90; break; | |
| 336 | case 0xb6: asic_cmd = 0x89; break; | |
| 337 | case 0xc5: asic_cmd = 0x8c; break; | |
| 338 | case 0xca: asic_cmd = 0x43; break; | |
| 339 | case 0xcc: asic_cmd = 0xf0; break; | |
| 340 | case 0xd0: asic_cmd = 0xe0; break; | |
| 341 | case 0xe0: asic_cmd = 0xd0; break; | |
| 342 | case 0xe7: asic_cmd = 0x70; break; | |
| 343 | case 0xed: asic_cmd = 0xcb; break; | |
| 344 | case 0xf0: asic_cmd = 0xcc; break; | |
| 345 | case 0xf1: asic_cmd = 0xf5; break; | |
| 346 | case 0xf2: asic_cmd = 0xf1; break; | |
| 347 | case 0xf4: asic_cmd = 0xf2; break; | |
| 348 | case 0xf5: asic_cmd = 0xf4; break; | |
| 349 | case 0xfc: asic_cmd = 0xc0; break; | |
| 350 | case 0xfe: asic_cmd = 0xc3; break; | |
| 351 | ||
| 352 | case 0xa6: asic_cmd = 0xa9; break; | |
| 353 | case 0xaa: asic_cmd = 0x56; break; | |
| 354 | case 0xf8: asic_cmd = 0xf3; break; | |
| 355 | } | |
| 356 | ||
| 357 | state->m_pgm_arm_type1_highlatch_68k_w = asic_cmd ^ (asic_key | (asic_key << 8)); | |
| 358 | } | |
| 359 | return; | |
| 360 | } | |
| 361 | } | |
| 362 | ||
| 363 | ||
| 302 | 364 | DRIVER_INIT( kovshp ) |
| 303 | 365 | { |
| 304 | 366 | pgm_basic_init(machine); |
| 305 | 367 | pgm_kovshp_decrypt(machine); |
| 306 | 368 | pgm_arm7_type1_latch_init(machine); |
| 307 | /* we only have a china internal ROM dumped for now.. allow region to be changed for debugging (to ensure all alt titles / regions can be seen) */ | |
| 308 | 369 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); |
| 370 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
| 309 | 371 | } |
| 310 | 372 | |
| 373 | ||
| 374 | ||
| 311 | 375 | /* bootleg inits */ |
| 312 | 376 | |
| 377 | DRIVER_INIT( kovshxas ) | |
| 378 | { | |
| 379 | pgm_basic_init(machine); | |
| 380 | // pgm_kovshp_decrypt(machine); | |
| 381 | pgm_arm7_type1_latch_init(machine); | |
| 382 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); | |
| 383 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
| 384 | } | |
| 385 | ||
| 313 | 386 | static void pgm_decode_kovlsqh2_tiles( running_machine &machine ) |
| 314 | 387 | { |
| 315 | 388 | int i, j; |
| r14896 | r14897 | |
| 411 | 484 | pgm_decode_kovlsqh2_samples(machine); |
| 412 | 485 | pgm_basic_init(machine); |
| 413 | 486 | pgm_arm7_type1_latch_init(machine); |
| 414 | /* we only have a china internal ROM dumped for now.. allow region to be changed for debugging (to ensure all alt titles / regions can be seen) */ | |
| 415 | 487 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0008, 0x4f0009, FUNC(kovsh_fake_region_r)); |
| 488 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x500000, 0x500005, FUNC(kovshp_asic27a_write_word)); | |
| 416 | 489 | } |
| 417 | 490 | |
| 418 | 491 | DRIVER_INIT( kovqhsgs ) |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | maple_device::device_start(); |
| 102 | 102 | cpu = subdevice<z80_device>("mie"); |
| 103 | 103 | timer = timer_alloc(0); |
| 104 | cpu->set_irq_callback(irq_callback_1); | |
| 104 | cpu->set_irq_acknowledge_callback(irq_callback_1); | |
| 105 | 105 | jvs = machine().device<mie_jvs_device>(jvs_name); |
| 106 | 106 | |
| 107 | 107 | save_item(NAME(gpiodir)); |
| r14896 | r14897 | |
|---|---|---|
| 111 | 111 | driver_device *state = space->machine().driver_data<driver_device>(); |
| 112 | 112 | if (offset == (0x150 / 2)) |
| 113 | 113 | { |
| 114 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 114 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 115 | 115 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 116 | 116 | return; |
| 117 | 117 | } |
| r14896 | r14897 | |
| 231 | 231 | driver_device *state = space->machine().driver_data<driver_device>(); |
| 232 | 232 | if (offset == (0x64 / 2)) |
| 233 | 233 | { |
| 234 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 234 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 235 | 235 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 236 | 236 | } |
| 237 | 237 | |
| r14896 | r14897 | |
| 422 | 422 | driver_device *state = space->machine().driver_data<driver_device>(); |
| 423 | 423 | if (offset == (0x64 / 2)) |
| 424 | 424 | { |
| 425 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 425 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 426 | 426 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 427 | 427 | return; |
| 428 | 428 | } |
| r14896 | r14897 | |
| 610 | 610 | driver_device *state = space->machine().driver_data<driver_device>(); |
| 611 | 611 | if (offset == (0xa8 / 2)) |
| 612 | 612 | { |
| 613 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 613 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 614 | 614 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 615 | 615 | return; |
| 616 | 616 | } |
| r14896 | r14897 | |
| 674 | 674 | |
| 675 | 675 | if (offset == (0x10a >> 1)) |
| 676 | 676 | { |
| 677 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 677 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 678 | 678 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 679 | 679 | return; |
| 680 | 680 | } |
| r14896 | r14897 | |
| 794 | 794 | driver_device *state = space->machine().driver_data<driver_device>(); |
| 795 | 795 | if (offset == (0xa8 / 2)) |
| 796 | 796 | { |
| 797 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 797 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 798 | 798 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 799 | 799 | return; |
| 800 | 800 | } |
| r14896 | r14897 | |
| 1225 | 1225 | const int maskport=0x6c0; |
| 1226 | 1226 | if (writeport == sndport) |
| 1227 | 1227 | { |
| 1228 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 1228 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 1229 | 1229 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 1230 | 1230 | return; |
| 1231 | 1231 | } |
| r14896 | r14897 | |
| 1755 | 1755 | driver_device *state = space->machine().driver_data<driver_device>(); |
| 1756 | 1756 | if (offset == (0x380 / 2)) |
| 1757 | 1757 | { |
| 1758 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 1758 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 1759 | 1759 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); |
| 1760 | 1760 | return; |
| 1761 | 1761 | } |
| r14896 | r14897 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "audio/mcr.h" |
| 9 | #include "includes/mcr.h" | |
| 9 | 10 | #include "includes/mcr68.h" |
| 10 | 11 | |
| 11 | 12 | #define VERBOSE 0 |
| r14896 | r14897 | |
| 295 | 296 | { |
| 296 | 297 | mcr68_state *drvstate = device->machine().driver_data<mcr68_state>(); |
| 297 | 298 | address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 298 | csdeluxe_data_w(space, 0, (state << 4) | drvstate->m_zwackery_sound_data); | |
| 299 | drvstate->csdeluxe_data_w(*space, 0, (state << 4) | drvstate->m_zwackery_sound_data); | |
| 299 | 300 | } |
| 300 | 301 | |
| 301 | 302 |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | decocass_state *state = space->machine().driver_data<decocass_state>(); |
| 63 | 63 | LOG(2,("CPU %s sound command -> $%02x\n", space->device().tag(), data)); |
| 64 | state->soundlatch_w(*space, 0, data); | |
| 64 | state->soundlatch_byte_w(*space, 0, data); | |
| 65 | 65 | state->m_sound_ack |= 0x80; |
| 66 | 66 | /* remove snd cpu data ack bit. i don't see it in the schems, but... */ |
| 67 | 67 | state->m_sound_ack &= ~0x40; |
| r14896 | r14897 | |
| 71 | 71 | READ8_HANDLER( decocass_sound_data_r ) |
| 72 | 72 | { |
| 73 | 73 | decocass_state *state = space->machine().driver_data<decocass_state>(); |
| 74 | UINT8 data = state->soundlatch2_r(*space, 0); | |
| 74 | UINT8 data = state->soundlatch2_byte_r(*space, 0); | |
| 75 | 75 | LOG(2,("CPU %s sound data <- $%02x\n", space->device().tag(), data)); |
| 76 | 76 | return data; |
| 77 | 77 | } |
| r14896 | r14897 | |
| 88 | 88 | { |
| 89 | 89 | decocass_state *state = space->machine().driver_data<decocass_state>(); |
| 90 | 90 | LOG(2,("CPU %s sound data -> $%02x\n", space->device().tag(), data)); |
| 91 | state->soundlatch2_w(*space, 0, data); | |
| 91 | state->soundlatch2_byte_w(*space, 0, data); | |
| 92 | 92 | state->m_sound_ack |= 0x40; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | READ8_HANDLER( decocass_sound_command_r ) |
| 96 | 96 | { |
| 97 | 97 | decocass_state *state = space->machine().driver_data<decocass_state>(); |
| 98 | UINT8 data = state->soundlatch_r(*space, 0); | |
| 98 | UINT8 data = state->soundlatch_byte_r(*space, 0); | |
| 99 | 99 | LOG(4,("CPU %s sound command <- $%02x\n", space->device().tag(), data)); |
| 100 | 100 | device_set_input_line(state->m_audiocpu, M6502_IRQ_LINE, CLEAR_LINE); |
| 101 | 101 | state->m_sound_ack &= ~0x80; |
| r14896 | r14897 | |
|---|---|---|
| 1236 | 1236 | WRITE8_MEMBER(leland_state::leland_gated_paletteram_w) |
| 1237 | 1237 | { |
| 1238 | 1238 | if (m_wcol_enable) |
| 1239 | paletteram_BBGGGRRR_w(space, offset, data); | |
| 1239 | paletteram_BBGGGRRR_byte_w(space, offset, data); | |
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | 1242 | |
| r14896 | r14897 | |
| 1251 | 1251 | WRITE8_MEMBER(leland_state::ataxx_paletteram_and_misc_w) |
| 1252 | 1252 | { |
| 1253 | 1253 | if (m_wcol_enable) |
| 1254 | paletteram_xxxxRRRRGGGGBBBB_le_w(space, offset, data); | |
| 1254 | paletteram_xxxxRRRRGGGGBBBB_byte_le_w(space, offset, data); | |
| 1255 | 1255 | else if (offset == 0x7f8 || offset == 0x7f9) |
| 1256 | 1256 | leland_master_video_addr_w(space, offset - 0x7f8, data); |
| 1257 | 1257 | else if (offset == 0x7fc) |
| r14896 | r14897 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | |
| 3 | t | |
| 4 | 4 | |
| 5 | | |
| 5 | | |
| 6 | 6 | |
| 7 | Right now, this is an *extremely* basic ticket dispenser. | |
| 8 | TODO: Active Bit may not be Bit 7 in all applications. | |
| 9 | Add a ticket dispenser interface instead of passing a bunch | |
| 10 | of arguments to ticket_dispenser_init. | |
| 7 | **************************************************************************** | |
| 8 | ||
| 9 | Copyright Aaron Giles | |
| 10 | All rights reserved. | |
| 11 | ||
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | ***************************************************************************/ |
| 12 | 39 | |
| 13 | 40 | #include "emu.h" |
| 14 | 41 | #include "machine/ticket.h" |
| 15 | 42 | |
| 43 | ||
| 44 | //************************************************************************** | |
| 45 | // DEBUGGING | |
| 46 | //************************************************************************** | |
| 47 | ||
| 16 | 48 | #define DEBUG_TICKET 0 |
| 17 | 49 | #define LOG(x) do { if (DEBUG_TICKET) logerror x; } while (0) |
| 18 | 50 | |
| 19 | 51 | |
| 20 | typedef struct _ticket_state ticket_state; | |
| 21 | struct _ticket_state | |
| 52 | ||
| 53 | //************************************************************************** | |
| 54 | // GLOBAL VARIABLES | |
| 55 | //************************************************************************** | |
| 56 | ||
| 57 | // device type definition | |
| 58 | const device_type TICKET_DISPENSER = &device_creator<ticket_dispenser_device>; | |
| 59 | ||
| 60 | ||
| 61 | ||
| 62 | //************************************************************************** | |
| 63 | // LIVE DEVICE | |
| 64 | //************************************************************************** | |
| 65 | ||
| 66 | //------------------------------------------------- | |
| 67 | // speaker_device - constructor | |
| 68 | //------------------------------------------------- | |
| 69 | ||
| 70 | ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 71 | : device_t(mconfig, TICKET_DISPENSER, "Ticket Dispenser", tag, owner, clock), | |
| 72 | m_motor_sense(TICKET_MOTOR_ACTIVE_LOW), | |
| 73 | m_status_sense(TICKET_STATUS_ACTIVE_LOW), | |
| 74 | m_period(attotime::from_msec(100)), | |
| 75 | m_active_bit(0x80), | |
| 76 | m_motoron(0), | |
| 77 | m_ticketdispensed(0), | |
| 78 | m_ticketnotdispensed(0), | |
| 79 | m_status(0), | |
| 80 | m_power(0), | |
| 81 | m_timer(NULL) | |
| 22 | 82 | { |
| 23 | int m_active_bit; | |
| 24 | int m_time_msec; | |
| 25 | int m_motoron; | |
| 26 | int m_ticketdispensed; | |
| 27 | int m_ticketnotdispensed; | |
| 83 | } | |
| 28 | 84 | |
| 29 | UINT8 m_status; | |
| 30 | UINT8 m_power; | |
| 31 | emu_timer *m_timer; | |
| 32 | }; | |
| 33 | 85 | |
| 34 | INLINE ticket_state *get_safe_token(device_t *device) | |
| 86 | //------------------------------------------------- | |
| 87 | // ~ticket_dispenser_device - destructor | |
| 88 | //------------------------------------------------- | |
| 89 | ||
| 90 | ticket_dispenser_device::~ticket_dispenser_device() | |
| 35 | 91 | { |
| 36 | assert(device != NULL); | |
| 37 | assert(device->type() == TICKET_DISPENSER); | |
| 38 | ||
| 39 | return (ticket_state *)downcast<legacy_device_base *>(device)->token(); | |
| 40 | 92 | } |
| 41 | 93 | |
| 42 | 94 | |
| 43 | static TIMER_CALLBACK( ticket_dispenser_toggle ) | |
| 95 | //************************************************************************** | |
| 96 | // CONFIGURATION HELPERS | |
| 97 | //************************************************************************** | |
| 98 | ||
| 99 | //------------------------------------------------- | |
| 100 | // static_set_period - configure the clock period | |
| 101 | // for dispensing | |
| 102 | //------------------------------------------------- | |
| 103 | ||
| 104 | void ticket_dispenser_device::static_set_period(device_t &device, attotime period) | |
| 44 | 105 | { |
| 45 | ticket_state *state = get_safe_token((device_t *)ptr); | |
| 106 | downcast<ticket_dispenser_device &>(device).m_period = period; | |
| 107 | } | |
| 46 | 108 | |
| 47 | /* If we still have power, keep toggling ticket states. */ | |
| 48 | if (state->m_power) | |
| 49 | { | |
| 50 | state->m_status ^= state->m_active_bit; | |
| 51 | LOG(("Ticket Status Changed to %02X\n", state->m_status)); | |
| 52 | state->m_timer->adjust(attotime::from_msec(state->m_time_msec)); | |
| 53 | } | |
| 54 | 109 | |
| 55 | if (state->m_status == state->m_ticketdispensed) | |
| 56 | { | |
| 57 | set_led_status(machine, 2,1); | |
| 58 | increment_dispensed_tickets(machine, 1); | |
| 110 | //------------------------------------------------- | |
| 111 | // static_set_senses - configure the senses of | |
| 112 | // the motor and status bits | |
| 113 | //------------------------------------------------- | |
| 59 | 114 | |
| 60 | LOG(("Ticket Dispensed\n")); | |
| 61 | } | |
| 62 | else | |
| 63 | { | |
| 64 | set_led_status(machine, 2,0); | |
| 65 | } | |
| 115 | void ticket_dispenser_device::static_set_senses(device_t &device, UINT8 motor_sense, UINT8 status_sense) | |
| 116 | { | |
| 117 | ticket_dispenser_device &ticket = downcast<ticket_dispenser_device &>(device); | |
| 118 | ticket.m_motor_sense = motor_sense; | |
| 119 | ticket.m_status_sense = status_sense; | |
| 66 | 120 | } |
| 67 | 121 | |
| 68 | 122 | |
| 69 | READ8_DEVICE_HANDLER( ticket_dispenser_r ) | |
| 123 | ||
| 124 | //************************************************************************** | |
| 125 | // READ/WRITE HANDLERS | |
| 126 | //************************************************************************** | |
| 127 | ||
| 128 | //------------------------------------------------- | |
| 129 | // read - read the status line via the active bit | |
| 130 | //------------------------------------------------- | |
| 131 | ||
| 132 | READ8_MEMBER( ticket_dispenser_device::read ) | |
| 70 | 133 | { |
| 71 | ticket_state *state = get_safe_token(device); | |
| 72 | LOG(("%s: Ticket Status Read = %02X\n", device->machine().describe_context(), state->m_status)); | |
| 73 | return state->m_status; | |
| 134 | LOG(("%s: Ticket Status Read = %02X\n", machine().describe_context(), m_status)); | |
| 135 | return m_status; | |
| 74 | 136 | } |
| 75 | 137 | |
| 76 | 138 | |
| 77 | READ_LINE_DEVICE_HANDLER( ticket_dispenser_line_r ) | |
| 139 | //------------------------------------------------- | |
| 140 | // line_r - read the status line as a proper line | |
| 141 | //------------------------------------------------- | |
| 142 | ||
| 143 | READ_LINE_MEMBER( ticket_dispenser_device::line_r ) | |
| 78 | 144 | { |
| 79 | ticket_state *state = get_safe_token(device); | |
| 80 | return state->m_status ? 1 : 0; | |
| 145 | return m_status ? 1 : 0; | |
| 81 | 146 | } |
| 82 | 147 | |
| 83 | 148 | |
| 84 | WRITE8_DEVICE_HANDLER( ticket_dispenser_w ) | |
| 149 | //------------------------------------------------- | |
| 150 | // write - write the control line via the active | |
| 151 | // bit | |
| 152 | //------------------------------------------------- | |
| 153 | ||
| 154 | WRITE8_MEMBER( ticket_dispenser_device::write ) | |
| 85 | 155 | { |
| 86 | ticket_state *state = get_safe_token(device); | |
| 87 | ||
| 88 | /* On an activate signal, start dispensing! */ | |
| 89 | if ((data & state->m_active_bit) == state->m_motoron) | |
| 156 | // On an activate signal, start dispensing! | |
| 157 | if ((data & m_active_bit) == m_motoron) | |
| 90 | 158 | { |
| 91 | if (! | |
| 159 | if (! | |
| 92 | 160 | { |
| 93 | LOG(("%s: Ticket Power On\n", device->machine().describe_context())); | |
| 94 | state->m_timer->adjust(attotime::from_msec(state->m_time_msec)); | |
| 95 | state->m_power = 1; | |
| 96 | ||
| 97 | state->m_status = state->m_ticketnotdispensed; | |
| 161 | LOG(("%s: Ticket Power On\n", machine().describe_context())); | |
| 162 | m_timer->adjust(m_period); | |
| 163 | m_power = 1; | |
| 164 | m_status = m_ticketnotdispensed; | |
| 98 | 165 | } |
| 99 | 166 | } |
| 100 | 167 | else |
| 101 | 168 | { |
| 102 | if ( | |
| 169 | if ( | |
| 103 | 170 | { |
| 104 | LOG(("%s: Ticket Power Off\n", device->machine().describe_context())); | |
| 105 | state->m_timer->adjust(attotime::never); | |
| 106 | set_led_status(device->machine(), 2,0); | |
| 107 | state->m_power = 0; | |
| 171 | LOG(("%s: Ticket Power Off\n", machine().describe_context())); | |
| 172 | m_timer->adjust(attotime::never); | |
| 173 | set_led_status(machine(), 2,0); | |
| 174 | m_power = 0; | |
| 108 | 175 | } |
| 109 | 176 | } |
| 110 | 177 | } |
| 111 | 178 | |
| 112 | 179 | |
| 113 | 180 | |
| 114 | /*************************************************************************** | |
| 115 | DEVICE INTERFACE | |
| 116 | ***************************************************************************/ | |
| 181 | //************************************************************************** | |
| 182 | // DEVICE INTERFACE | |
| 183 | //************************************************************************** | |
| 117 | 184 | |
| 118 | /*------------------------------------------------- | |
| 119 | device start callback | |
| 120 | -------------------------------------------------*/ | |
| 185 | //------------------------------------------------- | |
| 186 | // device_start - handle device startup | |
| 187 | //------------------------------------------------- | |
| 121 | 188 | |
| 122 | ||
| 189 | vo | |
| 123 | 190 | { |
| 124 | const ticket_config *config = (const ticket_config *)downcast<const legacy_device_base *>(device)->inline_config(); | |
| 125 | ticket_state *state = get_safe_token(device); | |
| 191 | m_active_bit = 0x80; | |
| 192 | m_motoron = (m_motor_sense == TICKET_MOTOR_ACTIVE_HIGH) ? m_active_bit : 0; | |
| 193 | m_ticketdispensed = (m_status_sense == TICKET_STATUS_ACTIVE_HIGH) ? m_active_bit : 0; | |
| 194 | m_ticketnotdispensed = m_ticketdispensed ^ m_active_bit; | |
| 126 | 195 | |
| 127 | | |
| 196 | m_ | |
| 128 | 197 | |
| 129 | /* initialize the state */ | |
| 130 | state->m_active_bit = 0x80; | |
| 131 | state->m_time_msec = device->clock(); | |
| 132 | state->m_motoron = config->motorhigh ? state->m_active_bit : 0; | |
| 133 | state->m_ticketdispensed = config->statushigh ? state->m_active_bit : 0; | |
| 134 | state->m_ticketnotdispensed = state->m_ticketdispensed ^ state->m_active_bit; | |
| 135 | ||
| 136 | state->m_timer = device->machine().scheduler().timer_alloc(FUNC(ticket_dispenser_toggle), (void *)device); | |
| 137 | ||
| 138 | device->save_item(NAME(state->m_status)); | |
| 139 | device->save_item(NAME(state->m_power)); | |
| 198 | save_item(NAME(m_status)); | |
| 199 | save_item(NAME(m_power)); | |
| 140 | 200 | } |
| 141 | 201 | |
| 142 | 202 | |
| 143 | /*------------------------------------------------- | |
| 144 | device reset callback | |
| 145 | -------------------------------------------------*/ | |
| 203 | //------------------------------------------------- | |
| 204 | // device_reset - handle device startup | |
| 205 | //------------------------------------------------- | |
| 146 | 206 | |
| 147 | ||
| 207 | vo | |
| 148 | 208 | { |
| 149 | ticket_state *state = get_safe_token(device); | |
| 150 | state->m_status = state->m_ticketnotdispensed; | |
| 151 | state->m_power = 0x00; | |
| 209 | m_status = m_ticketnotdispensed; | |
| 210 | m_power = 0x00; | |
| 152 | 211 | } |
| 153 | 212 | |
| 154 | 213 | |
| 155 | /*------------------------------------------------- | |
| 156 | device definition | |
| 157 | -------------------------------------------------*/ | |
| 214 | //------------------------------------------------- | |
| 215 | // device_timer - handle timer callbacks | |
| 216 | //------------------------------------------------- | |
| 158 | 217 | |
| 159 | static const char DEVTEMPLATE_SOURCE[] = __FILE__; | |
| 218 | void ticket_dispenser_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
| 219 | { | |
| 220 | // if we still have power, keep toggling ticket states | |
| 221 | if (m_power) | |
| 222 | { | |
| 223 | m_status ^= m_active_bit; | |
| 224 | LOG(("Ticket Status Changed to %02X\n", m_status)); | |
| 225 | m_timer->adjust(m_period); | |
| 226 | } | |
| 160 | 227 | |
| 161 | #define DEVTEMPLATE_ID(p,s) p##ticket##s | |
| 162 | #define DEVTEMPLATE_FEATURES DT_HAS_START | DT_HAS_RESET | DT_HAS_INLINE_CONFIG | |
| 163 | #define DEVTEMPLATE_NAME "Ticket Dispenser" | |
| 164 | #define DEVTEMPLATE_FAMILY "Generic" | |
| 165 | #include "devtempl.h" | |
| 166 | ||
| 167 | ||
| 168 | DEFINE_LEGACY_DEVICE(TICKET_DISPENSER, ticket); | |
| 228 | // update LED status (fixme: should map to an output) | |
| 229 | set_led_status(machine(), 2, (m_status == m_ticketdispensed)); | |
| 230 | ||
| 231 | // if we just dispensed, increment global count | |
| 232 | if (m_status == m_ticketdispensed) | |
| 233 | { | |
| 234 | increment_dispensed_tickets(machine(), 1); | |
| 235 | LOG(("Ticket Dispensed\n")); | |
| 236 | } | |
| 237 | } |
| r14896 | r14897 | |
|---|---|---|
| 162 | 162 | DEVCB_NULL, /* Port A read */ |
| 163 | 163 | DEVCB_NULL, /* Port B read */ |
| 164 | 164 | DEVCB_NULL, /* Port C read */ |
| 165 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), /* Port A write */ | |
| 165 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ | |
| 166 | 166 | DEVCB_HANDLER(scramble_sh_irqtrigger_w), /* Port B write */ |
| 167 | 167 | DEVCB_NULL /* Port C write */ |
| 168 | 168 | }; |
| r14896 | r14897 | |
| 173 | 173 | DEVCB_NULL, /* Port A read */ |
| 174 | 174 | DEVCB_NULL, /* Port B read */ |
| 175 | 175 | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 176 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), /* Port A write */ | |
| 176 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ | |
| 177 | 177 | DEVCB_HANDLER(scramble_sh_irqtrigger_w), /* Port B write */ |
| 178 | 178 | DEVCB_NULL /* Port C write */ |
| 179 | 179 | }; |
| r14896 | r14897 | |
| 184 | 184 | DEVCB_NULL, /* Port A read */ |
| 185 | 185 | DEVCB_NULL, /* Port B read */ |
| 186 | 186 | DEVCB_HANDLER(scramble_protection_r), /* Port C read */ |
| 187 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), /* Port A write */ | |
| 187 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ | |
| 188 | 188 | DEVCB_HANDLER(scramble_sh_irqtrigger_w), /* Port B write */ |
| 189 | 189 | DEVCB_HANDLER(scramble_protection_w) /* Port C write */ |
| 190 | 190 | }; |
| r14896 | r14897 | |
| 195 | 195 | DEVCB_NULL, /* Port A read */ |
| 196 | 196 | DEVCB_NULL, /* Port B read */ |
| 197 | 197 | DEVCB_NULL, /* Port C read */ |
| 198 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), /* Port A write */ | |
| 198 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ | |
| 199 | 199 | DEVCB_HANDLER(mrkougar_sh_irqtrigger_w), /* Port B write */ |
| 200 | 200 | DEVCB_NULL /* Port C write */ |
| 201 | 201 | }; |
| r14896 | r14897 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | |
| 3 | | |
| 4 | 4 | |
| 5 | Generic ticket dispensing device. | |
| 6 | ||
| 7 | **************************************************************************** | |
| 8 | ||
| 9 | Copyright Aaron Giles | |
| 10 | All rights reserved. | |
| 11 | ||
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 5 | 38 | ***************************************************************************/ |
| 6 | 39 | |
| 7 | # | |
| 40 | #pragma onc | |
| 8 | 41 | |
| 9 | 42 | |
| 10 | #define TICKET_MOTOR_ACTIVE_LOW 0 /* Ticket motor is triggered by D7=0 */ | |
| 11 | #define TICKET_MOTOR_ACTIVE_HIGH 1 /* Ticket motor is triggered by D7=1 */ | |
| 43 | //************************************************************************** | |
| 44 | // GLOBAL VARIABLES | |
| 45 | //************************************************************************** | |
| 12 | 46 | |
| 13 | #define TICKET_STATUS_ACTIVE_LOW 0 /* Ticket is done dispensing when D7=0 */ | |
| 14 | #define TICKET_STATUS_ACTIVE_HIGH 1 /* Ticket is done dispensing when D7=1 */ | |
| 47 | // device type definition | |
| 48 | extern const device_type TICKET_DISPENSER; | |
| 15 | 49 | |
| 16 | 50 | |
| 17 | 51 | |
| 18 | typedef struct _ticket_config ticket_config; | |
| 19 | struct _ticket_config | |
| 52 | //************************************************************************** | |
| 53 | // DEVICE CONFIGURATION MACROS | |
| 54 | //************************************************************************** | |
| 55 | ||
| 56 | // add/remove speakers | |
| 57 | #define MCFG_TICKET_DISPENSER_ADD(_tag, _period_in_msec, _motor_sense, _status_sense) \ | |
| 58 | MCFG_DEVICE_ADD(_tag, TICKET_DISPENSER, 0) \ | |
| 59 | ticket_dispenser_device::static_set_period(*device, _period_in_msec); \ | |
| 60 | ticket_dispenser_device::static_set_senses(*device, _motor_sense, _status_sense); \ | |
| 61 | ||
| 62 | ||
| 63 | ||
| 64 | //************************************************************************** | |
| 65 | // CONSTANTS | |
| 66 | //************************************************************************** | |
| 67 | ||
| 68 | const UINT8 TICKET_MOTOR_ACTIVE_LOW = 0; /* Ticket motor is triggered by D7=0 */ | |
| 69 | const UINT8 TICKET_MOTOR_ACTIVE_HIGH = 1; /* Ticket motor is triggered by D7=1 */ | |
| 70 | ||
| 71 | const UINT8 TICKET_STATUS_ACTIVE_LOW = 0; /* Ticket is done dispensing when D7=0 */ | |
| 72 | const UINT8 TICKET_STATUS_ACTIVE_HIGH = 1; /* Ticket is done dispensing when D7=1 */ | |
| 73 | ||
| 74 | ||
| 75 | ||
| 76 | //************************************************************************** | |
| 77 | // TYPE DEFINITIONS | |
| 78 | //************************************************************************** | |
| 79 | ||
| 80 | // ======================> ticket_dispenser_device | |
| 81 | ||
| 82 | class ticket_dispenser_device : public device_t | |
| 20 | 83 | { |
| 21 | UINT8 motorhigh; | |
| 22 | UINT8 statushigh; | |
| 23 | }; | |
| 84 | public: | |
| 85 | // construction/destruction | |
| 86 | ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 87 | virtual ~ticket_dispenser_device(); | |
| 24 | 88 | |
| 89 | // inline configuration helpers | |
| 90 | static void static_set_period(device_t &device, attotime period); | |
| 91 | static void static_set_senses(device_t &device, UINT8 motor_sense, UINT8 status_sense); | |
| 25 | 92 | |
| 26 | #define MCFG_TICKET_DISPENSER_ADD(_tag, _clock, _motorhigh, _statushigh) \ | |
| 27 | MCFG_DEVICE_ADD(_tag, TICKET_DISPENSER, _clock) \ | |
| 28 | MCFG_DEVICE_CONFIG_DATA32(ticket_config, motorhigh, _motorhigh) \ | |
| 29 | MCFG_DEVICE_CONFIG_DATA32(ticket_config, statushigh, _statushigh) | |
| 93 | // read/write handlers | |
| 94 | DECLARE_READ8_MEMBER( read ); | |
| 95 | DECLARE_READ_LINE_MEMBER( line_r ); | |
| 96 | DECLARE_WRITE8_MEMBER( write ); | |
| 30 | 97 | |
| 98 | protected: | |
| 99 | // device-level overrides | |
| 100 | virtual void device_start() ATTR_COLD; | |
| 101 | virtual void device_reset() ATTR_COLD; | |
| 102 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 31 | 103 | |
| 32 | READ8_DEVICE_HANDLER( ticket_dispenser_r ); | |
| 33 | WRITE8_DEVICE_HANDLER( ticket_dispenser_w ); | |
| 104 | // configuration state | |
| 105 | UINT8 m_motor_sense; | |
| 106 | UINT8 m_status_sense; | |
| 107 | attotime m_period; | |
| 108 | ||
| 109 | // active state | |
| 110 | UINT8 m_active_bit; | |
| 111 | UINT8 m_motoron; | |
| 112 | UINT8 m_ticketdispensed; | |
| 113 | UINT8 m_ticketnotdispensed; | |
| 34 | 114 | |
| 35 | READ_LINE_DEVICE_HANDLER( ticket_dispenser_line_r ); | |
| 36 | ||
| 37 | DECLARE_LEGACY_DEVICE(TICKET_DISPENSER, ticket); | |
| 115 | UINT8 m_status; | |
| 116 | UINT8 m_power; | |
| 117 | emu_timer *m_timer; | |
| 118 | }; |
| r14896 | r14897 | |
|---|---|---|
| 122 | 122 | const pia6821_interface lottofun_pia_0_intf = |
| 123 | 123 | { |
| 124 | 124 | /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN0"), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, |
| 125 | /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DEVICE_ | |
| 125 | /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DEVICE_M | |
| 126 | 126 | /*irqs : A/B */ DEVCB_NULL, DEVCB_NULL |
| 127 | 127 | }; |
| 128 | 128 |
| r14896 | r14897 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | WRITE16_MEMBER(wrally_state::wrally_flipscreen_w) |
| 30 | 30 | { |
| 31 | flip_screen_set( | |
| 31 | flip_screen_set( | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | WRITE16_MEMBER(wrally_state::OKIM6295_bankswitch_w) |
| r14896 | r14897 | |
|---|---|---|
| 1534 | 1534 | |
| 1535 | 1535 | switch(offset) |
| 1536 | 1536 | { |
| 1537 | case (0x01a/2): { flip_screen_set( | |
| 1537 | case (0x01a/2): { state->flip_screen_set( | |
| 1538 | 1538 | case (0x01c/2): { state->m_layer_disable = seibu_vregs[offset]; break; } |
| 1539 | 1539 | case (0x020/2): { state->m_scrollram16[0] = seibu_vregs[offset]; break; } |
| 1540 | 1540 | case (0x022/2): { state->m_scrollram16[1] = seibu_vregs[offset]; break; } |
| r14896 | r14897 | |
| 1713 | 1713 | |
| 1714 | 1714 | case (0x740/2): |
| 1715 | 1715 | { |
| 1716 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 1716 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 1717 | 1717 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE ); |
| 1718 | 1718 | break; |
| 1719 | 1719 | } |
| r14896 | r14897 | |
|---|---|---|
| 149 | 149 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 150 | 150 | break; |
| 151 | 151 | case 0x02: /* Sound command number */ |
| 152 | soundlatch_w(space, offset, data); | |
| 152 | soundlatch_byte_w(space, offset, data); | |
| 153 | 153 | break; |
| 154 | 154 | case 0x03: /* Bankswitch + coin counters + priority*/ |
| 155 | 155 | ajax_bankswitch_w(space, 0, data); |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | int m_video_disable; |
| 17 | 17 | UINT16 * m_sync_data; |
| 18 | 18 | int m_last_offset; |
| 19 | DECLARE_READ16_MEMBER(special_port1_r); | |
| 20 | DECLARE_READ16_MEMBER(adc_r); | |
| 21 | DECLARE_WRITE16_MEMBER(eprom_latch_w); | |
| 22 | DECLARE_READ16_MEMBER(sync_r); | |
| 23 | DECLARE_WRITE16_MEMBER(sync_w); | |
| 19 | 24 | }; |
| 20 | 25 | |
| 21 | 26 |
| r14896 | r14897 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | UINT16 * m_bitmap; |
| 16 | 16 | UINT8 m_has_mo; |
| 17 | DECLARE_WRITE16_MEMBER(latch_w); | |
| 17 | 18 | }; |
| 18 | 19 | |
| 19 | 20 |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | DECLARE_WRITE8_MEMBER(senjyo_bg2videoram_w); |
| 50 | 50 | DECLARE_WRITE8_MEMBER(senjyo_bg3videoram_w); |
| 51 | 51 | DECLARE_WRITE8_MEMBER(senjyo_bgstripes_w); |
| 52 | DECLARE_WRITE8_MEMBER(senjyo_volume_w); | |
| 52 | 53 | }; |
| 53 | 54 | |
| 54 | 55 | |
| r14896 | r14897 | |
| 59 | 60 | extern const z80ctc_interface senjyo_ctc_intf; |
| 60 | 61 | |
| 61 | 62 | SAMPLES_START( senjyo_sh_start ); |
| 62 | WRITE8_HANDLER( senjyo_volume_w ); | |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | /*----------- defined in video/senjyo.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | UINT8 m_ic_h3_data; |
| 28 | 28 | DECLARE_READ8_MEMBER(copsnrob_misc_r); |
| 29 | 29 | DECLARE_WRITE8_MEMBER(copsnrob_misc2_w); |
| 30 | DECLARE_WRITE8_MEMBER(copsnrob_misc_w); | |
| 30 | 31 | }; |
| 31 | 32 | |
| 32 | 33 | |
| r14896 | r14897 | |
| 43 | 44 | /*----------- defined in audio/copsnrob.c -----------*/ |
| 44 | 45 | |
| 45 | 46 | DISCRETE_SOUND_EXTERN( copsnrob ); |
| 46 | WRITE8_HANDLER( copsnrob_misc_w ); |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | required_device<cpu_device> m_maincpu; |
| 27 | 27 | required_device<cpu_device> m_subcpu; |
| 28 | DECLARE_WRITE8_MEMBER(galpani2_mcu_init_w); | |
| 29 | DECLARE_WRITE8_MEMBER(galpani2_mcu_nmi1_w); | |
| 30 | DECLARE_WRITE8_MEMBER(galpani2_mcu_nmi2_w); | |
| 31 | DECLARE_WRITE8_MEMBER(galpani2_coin_lockout_w); | |
| 32 | DECLARE_READ16_MEMBER(galpani2_bankedrom_r); | |
| 28 | 33 | }; |
| 29 | 34 | |
| 30 | 35 |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | DECLARE_WRITE32_MEMBER(video_dma_address_w); |
| 56 | 56 | DECLARE_CUSTOM_INPUT_MEMBER(ejsakura_keyboard_r); |
| 57 | 57 | DECLARE_CUSTOM_INPUT_MEMBER(ejanhs_encode); |
| 58 | DECLARE_READ32_MEMBER(sb_coin_r); | |
| 59 | DECLARE_WRITE8_MEMBER(sb_coin_w); | |
| 60 | DECLARE_READ32_MEMBER(sound_fifo_r); | |
| 61 | DECLARE_WRITE32_MEMBER(sound_fifo_w); | |
| 62 | DECLARE_READ32_MEMBER(sound_fifo_status_r); | |
| 63 | DECLARE_READ32_MEMBER(spi_int_r); | |
| 64 | DECLARE_READ32_MEMBER(spi_unknown_r); | |
| 65 | DECLARE_WRITE32_MEMBER(z80_prg_fifo_w); | |
| 66 | DECLARE_WRITE32_MEMBER(z80_enable_w); | |
| 67 | DECLARE_READ32_MEMBER(spi_controls1_r); | |
| 68 | DECLARE_READ32_MEMBER(spi_controls2_r); | |
| 69 | DECLARE_READ8_MEMBER(z80_soundfifo_r); | |
| 70 | DECLARE_WRITE8_MEMBER(z80_soundfifo_w); | |
| 71 | DECLARE_READ8_MEMBER(z80_soundfifo_status_r); | |
| 72 | DECLARE_WRITE8_MEMBER(z80_bank_w); | |
| 73 | DECLARE_READ8_MEMBER(z80_jp1_r); | |
| 74 | DECLARE_READ8_MEMBER(z80_coin_r); | |
| 75 | DECLARE_READ32_MEMBER(soundrom_r); | |
| 76 | DECLARE_WRITE32_MEMBER(input_select_w); | |
| 77 | DECLARE_READ32_MEMBER(senkyu_speedup_r); | |
| 78 | DECLARE_READ32_MEMBER(senkyua_speedup_r); | |
| 79 | DECLARE_READ32_MEMBER(batlball_speedup_r); | |
| 80 | DECLARE_READ32_MEMBER(rdft_speedup_r); | |
| 81 | DECLARE_READ32_MEMBER(viprp1_speedup_r); | |
| 82 | DECLARE_READ32_MEMBER(viprp1o_speedup_r); | |
| 83 | DECLARE_READ32_MEMBER(rf2_speedup_r); | |
| 84 | DECLARE_READ32_MEMBER(rfjet_speedup_r); | |
| 58 | 85 | }; |
| 59 | 86 | |
| 60 | 87 |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | DECLARE_WRITE8_MEMBER(jedi_vscroll_w); |
| 56 | 56 | DECLARE_WRITE8_MEMBER(jedi_hscroll_w); |
| 57 | 57 | DECLARE_CUSTOM_INPUT_MEMBER(jedi_audio_comm_stat_r); |
| 58 | DECLARE_WRITE8_MEMBER(irq_ack_w); | |
| 59 | DECLARE_WRITE8_MEMBER(jedi_audio_reset_w); | |
| 60 | DECLARE_WRITE8_MEMBER(jedi_audio_latch_w); | |
| 61 | DECLARE_READ8_MEMBER(audio_latch_r); | |
| 62 | DECLARE_READ8_MEMBER(jedi_audio_ack_latch_r); | |
| 63 | DECLARE_WRITE8_MEMBER(audio_ack_latch_w); | |
| 64 | DECLARE_WRITE8_MEMBER(speech_strobe_w); | |
| 65 | DECLARE_READ8_MEMBER(speech_ready_r); | |
| 66 | DECLARE_WRITE8_MEMBER(speech_reset_w); | |
| 58 | 67 | }; |
| 59 | 68 | |
| 60 | 69 | |
| r14896 | r14897 | |
| 62 | 71 | |
| 63 | 72 | MACHINE_CONFIG_EXTERN( jedi_audio ); |
| 64 | 73 | |
| 65 | WRITE8_HANDLER( jedi_audio_reset_w ); | |
| 66 | WRITE8_HANDLER( jedi_audio_latch_w ); | |
| 67 | READ8_HANDLER( jedi_audio_ack_latch_r ); | |
| 68 | 74 | |
| 69 | 75 | |
| 70 | 76 | /*----------- defined in video/jedi.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 29 | 29 | UINT8 m_funcube_serial_fifo[4]; |
| 30 | 30 | UINT8 m_funcube_serial_count; |
| 31 | 31 | DECLARE_WRITE16_MEMBER(seta2_vregs_w); |
| 32 | DECLARE_WRITE16_MEMBER(seta2_sound_bank_w); | |
| 33 | DECLARE_WRITE16_MEMBER(grdians_lockout_w); | |
| 34 | DECLARE_READ16_MEMBER(mj4simai_p1_r); | |
| 35 | DECLARE_READ16_MEMBER(mj4simai_p2_r); | |
| 36 | DECLARE_WRITE16_MEMBER(mj4simai_keyboard_w); | |
| 37 | DECLARE_READ16_MEMBER(pzlbowl_protection_r); | |
| 38 | DECLARE_READ16_MEMBER(pzlbowl_coins_r); | |
| 39 | DECLARE_WRITE16_MEMBER(pzlbowl_coin_counter_w); | |
| 40 | DECLARE_WRITE16_MEMBER(reelquak_leds_w); | |
| 41 | DECLARE_WRITE16_MEMBER(reelquak_coin_w); | |
| 42 | DECLARE_WRITE16_MEMBER(samshoot_coin_w); | |
| 43 | DECLARE_READ32_MEMBER(funcube_nvram_dword_r); | |
| 44 | DECLARE_WRITE32_MEMBER(funcube_nvram_dword_w); | |
| 45 | DECLARE_WRITE16_MEMBER(spriteram16_word_w); | |
| 46 | DECLARE_READ16_MEMBER(spriteram16_word_r); | |
| 47 | DECLARE_WRITE32_MEMBER(coldfire_regs_w); | |
| 48 | DECLARE_READ32_MEMBER(coldfire_regs_r); | |
| 49 | DECLARE_READ32_MEMBER(funcube_debug_r); | |
| 50 | DECLARE_READ8_MEMBER(funcube_coins_r); | |
| 51 | DECLARE_READ8_MEMBER(funcube_serial_r); | |
| 52 | DECLARE_WRITE8_MEMBER(funcube_leds_w); | |
| 53 | DECLARE_READ8_MEMBER(funcube_outputs_r); | |
| 54 | DECLARE_WRITE8_MEMBER(funcube_outputs_w); | |
| 32 | 55 | }; |
| 33 | 56 | |
| 34 | 57 | /*----------- defined in video/seta2.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | UINT8 m_nmi_mask; |
| 33 | 33 | UINT8 m_sound_nmi_mask; |
| 34 | DECLARE_READ8_MEMBER(fastfred_custom_io_r); | |
| 35 | DECLARE_READ8_MEMBER(flyboy_custom1_io_r); | |
| 36 | DECLARE_READ8_MEMBER(flyboy_custom2_io_r); | |
| 37 | DECLARE_READ8_MEMBER(jumpcoas_custom_io_r); | |
| 38 | DECLARE_READ8_MEMBER(boggy84_custom_io_r); | |
| 39 | DECLARE_WRITE8_MEMBER(imago_dma_irq_w); | |
| 40 | DECLARE_WRITE8_MEMBER(imago_sprites_bank_w); | |
| 41 | DECLARE_WRITE8_MEMBER(imago_sprites_dma_w); | |
| 42 | DECLARE_READ8_MEMBER(imago_sprites_offset_r); | |
| 43 | DECLARE_WRITE8_MEMBER(nmi_mask_w); | |
| 44 | DECLARE_WRITE8_MEMBER(sound_nmi_mask_w); | |
| 34 | 45 | }; |
| 35 | 46 | |
| 36 | 47 |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | DECLARE_CUSTOM_INPUT_MEMBER(astrof_p1_controls_r); |
| 52 | 52 | DECLARE_CUSTOM_INPUT_MEMBER(astrof_p2_controls_r); |
| 53 | 53 | DECLARE_CUSTOM_INPUT_MEMBER(tomahawk_controls_r); |
| 54 | DECLARE_WRITE8_MEMBER(astrof_audio_1_w); | |
| 55 | DECLARE_WRITE8_MEMBER(astrof_audio_2_w); | |
| 56 | DECLARE_WRITE8_MEMBER(spfghmk2_audio_w); | |
| 57 | DECLARE_WRITE8_MEMBER(tomahawk_audio_w); | |
| 54 | 58 | }; |
| 55 | 59 | |
| 56 | 60 | /*----------- defined in audio/astrof.c -----------*/ |
| 57 | 61 | |
| 58 | 62 | MACHINE_CONFIG_EXTERN( astrof_audio ); |
| 59 | WRITE8_HANDLER( astrof_audio_1_w ); | |
| 60 | WRITE8_HANDLER( astrof_audio_2_w ); | |
| 61 | 63 | |
| 62 | 64 | MACHINE_CONFIG_EXTERN( spfghmk2_audio ); |
| 63 | WRITE8_HANDLER( spfghmk2_audio_w ); | |
| 64 | 65 | |
| 65 | 66 | MACHINE_CONFIG_EXTERN( tomahawk_audio ); |
| 66 | WRITE8_HANDLER( tomahawk_audio_w ); |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | bitmap_ind16 m_sprites_bitmap; |
| 14 | 14 | UINT16 *m_spriteram; |
| 15 | 15 | size_t m_spriteram_size; |
| 16 | DECLARE_WRITE16_MEMBER(galpanic_6295_bankswitch_w); | |
| 17 | DECLARE_WRITE16_MEMBER(galpanica_6295_bankswitch_w); | |
| 18 | DECLARE_WRITE16_MEMBER(galpanica_misc_w); | |
| 19 | DECLARE_WRITE16_MEMBER(galpanic_coin_w); | |
| 20 | DECLARE_WRITE16_MEMBER(galpanic_bgvideoram_mirror_w); | |
| 21 | DECLARE_READ16_MEMBER(comad_timer_r); | |
| 22 | DECLARE_READ16_MEMBER(zipzap_random_read); | |
| 16 | 23 | }; |
| 17 | 24 | |
| 18 | 25 |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | 14 | |
| 15 | 15 | int m_cur[2]; |
| 16 | DECLARE_READ16_MEMBER(shuuz_atarivc_r); | |
| 17 | DECLARE_WRITE16_MEMBER(shuuz_atarivc_w); | |
| 18 | DECLARE_WRITE16_MEMBER(latch_w); | |
| 19 | DECLARE_READ16_MEMBER(leta_r); | |
| 20 | DECLARE_READ16_MEMBER(special_port0_r); | |
| 16 | 21 | }; |
| 17 | 22 | |
| 18 | 23 |
| r14896 | r14897 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | UINT8 m_whichport; |
| 25 | 25 | UINT16 *m_spriteram; |
| 26 | DECLARE_WRITE16_MEMBER(nvram_recall_w); | |
| 27 | DECLARE_WRITE8_MEMBER(digital_w); | |
| 28 | DECLARE_READ16_MEMBER(analog_r); | |
| 29 | DECLARE_WRITE16_MEMBER(analog_w); | |
| 30 | DECLARE_WRITE16_MEMBER(foodf_paletteram_w); | |
| 31 | void foodf_set_flip(int flip); | |
| 26 | 32 | }; |
| 27 | 33 | |
| 28 | 34 | |
| 29 | 35 | /*----------- defined in video/foodf.c -----------*/ |
| 30 | 36 | |
| 31 | WRITE16_HANDLER( foodf_paletteram_w ); | |
| 32 | ||
| 33 | void foodf_set_flip(foodf_state *state, int flip); | |
| 34 | 37 | VIDEO_START( foodf ); |
| 35 | 38 | SCREEN_UPDATE_IND16( foodf ); |
| r14896 | r14897 | |
|---|---|---|
| 223 | 223 | DECLARE_WRITE8_MEMBER(radarscp_grid_color_w); |
| 224 | 224 | DECLARE_WRITE8_MEMBER(dkong_flipscreen_w); |
| 225 | 225 | DECLARE_WRITE8_MEMBER(dkong_spritebank_w); |
| 226 | DECLARE_WRITE8_MEMBER(dkong_voice_w); | |
| 227 | DECLARE_WRITE8_MEMBER(dkong_audio_irq_w); | |
| 226 | 228 | }; |
| 227 | 229 | |
| 228 | 230 | /*----------- defined in video/dkong.c -----------*/ |
| r14896 | r14897 | |
| 241 | 243 | |
| 242 | 244 | /*----------- defined in audio/dkong.c -----------*/ |
| 243 | 245 | |
| 244 | WRITE8_HANDLER( dkong_audio_irq_w ); | |
| 245 | 246 | |
| 246 | 247 | MACHINE_CONFIG_EXTERN( radarscp_audio ); |
| 247 | 248 | MACHINE_CONFIG_EXTERN( dkong2b_audio ); |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | UINT8 m_vindctr2_screen_refresh; |
| 17 | 17 | UINT8 m_playfield_tile_bank; |
| 18 | 18 | UINT8 m_playfield_color_bank; |
| 19 | DECLARE_READ16_MEMBER(port4_r); | |
| 20 | DECLARE_WRITE16_MEMBER(sound_reset_w); | |
| 21 | DECLARE_READ8_MEMBER(switch_6502_r); | |
| 22 | DECLARE_WRITE8_MEMBER(sound_ctl_w); | |
| 23 | DECLARE_WRITE8_MEMBER(mixer_w); | |
| 19 | 24 | }; |
| 20 | 25 | |
| 21 | 26 |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | DECLARE_READ8_MEMBER(panther_interrupt_clear_r); |
| 27 | 27 | DECLARE_READ8_MEMBER(panther_unk_r); |
| 28 | 28 | DECLARE_WRITE8_MEMBER(redalert_bitmap_videoram_w); |
| 29 | DECLARE_WRITE8_MEMBER(redalert_audio_command_w); | |
| 30 | DECLARE_READ8_MEMBER(redalert_ay8910_latch_1_r); | |
| 31 | DECLARE_WRITE8_MEMBER(redalert_ay8910_latch_2_w); | |
| 32 | DECLARE_WRITE8_MEMBER(redalert_voice_command_w); | |
| 33 | DECLARE_WRITE8_MEMBER(demoneye_audio_command_w); | |
| 29 | 34 | }; |
| 30 | 35 | |
| 31 | 36 | |
| 32 | 37 | /*----------- defined in audio/redalert.c -----------*/ |
| 33 | 38 | |
| 34 | WRITE8_HANDLER( redalert_audio_command_w ); | |
| 35 | WRITE8_HANDLER( redalert_voice_command_w ); | |
| 36 | 39 | |
| 37 | WRITE8_HANDLER( demoneye_audio_command_w ); | |
| 38 | 40 | |
| 39 | 41 | MACHINE_CONFIG_EXTERN( redalert_audio ); |
| 40 | 42 | MACHINE_CONFIG_EXTERN( ww3_audio ); |
| r14896 | r14897 | |
|---|---|---|
| 1 | class mcr3_state : public | |
| 1 | class mcr3_state : public mcr | |
| 2 | 2 | { |
| 3 | 3 | public: |
| 4 | 4 | mcr3_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | : | |
| 5 | : mcr | |
| 6 | 6 | |
| 7 | 7 | UINT8 *m_videoram; |
| 8 | 8 | UINT8 *m_spriteram; |
| r14896 | r14897 | |
| 27 | 27 | DECLARE_WRITE8_MEMBER(spyhunt_videoram_w); |
| 28 | 28 | DECLARE_WRITE8_MEMBER(spyhunt_alpharam_w); |
| 29 | 29 | DECLARE_WRITE8_MEMBER(spyhunt_scroll_value_w); |
| 30 | DECLARE_WRITE8_MEMBER(mcrmono_control_port_w); | |
| 31 | DECLARE_READ8_MEMBER(demoderm_ip1_r); | |
| 32 | DECLARE_READ8_MEMBER(demoderm_ip2_r); | |
| 33 | DECLARE_WRITE8_MEMBER(demoderm_op6_w); | |
| 34 | DECLARE_READ8_MEMBER(maxrpm_ip1_r); | |
| 35 | DECLARE_READ8_MEMBER(maxrpm_ip2_r); | |
| 36 | DECLARE_WRITE8_MEMBER(maxrpm_op5_w); | |
| 37 | DECLARE_WRITE8_MEMBER(maxrpm_op6_w); | |
| 38 | DECLARE_READ8_MEMBER(rampage_ip4_r); | |
| 39 | DECLARE_WRITE8_MEMBER(rampage_op6_w); | |
| 40 | DECLARE_READ8_MEMBER(powerdrv_ip2_r); | |
| 41 | DECLARE_WRITE8_MEMBER(powerdrv_op5_w); | |
| 42 | DECLARE_WRITE8_MEMBER(powerdrv_op6_w); | |
| 43 | DECLARE_READ8_MEMBER(stargrds_ip0_r); | |
| 44 | DECLARE_WRITE8_MEMBER(stargrds_op5_w); | |
| 45 | DECLARE_WRITE8_MEMBER(stargrds_op6_w); | |
| 46 | DECLARE_READ8_MEMBER(spyhunt_ip1_r); | |
| 47 | DECLARE_READ8_MEMBER(spyhunt_ip2_r); | |
| 48 | DECLARE_WRITE8_MEMBER(spyhunt_op4_w); | |
| 49 | DECLARE_READ8_MEMBER(turbotag_ip2_r); | |
| 50 | DECLARE_READ8_MEMBER(turbotag_kludge_r); | |
| 30 | 51 | }; |
| 31 | 52 | |
| 32 | 53 |
| r14896 | r14897 | |
|---|---|---|
| 107 | 107 | DECLARE_CUSTOM_INPUT_MEMBER(invaders_in0_control_r); |
| 108 | 108 | DECLARE_CUSTOM_INPUT_MEMBER(invaders_in1_control_r); |
| 109 | 109 | DECLARE_CUSTOM_INPUT_MEMBER(invaders_in2_control_r); |
| 110 | DECLARE_WRITE8_MEMBER(seawolf_audio_w); | |
| 111 | DECLARE_WRITE8_MEMBER(gunfight_audio_w); | |
| 112 | DECLARE_WRITE8_MEMBER(zzzap_audio_1_w); | |
| 113 | DECLARE_WRITE8_MEMBER(zzzap_audio_2_w); | |
| 114 | DECLARE_WRITE8_MEMBER(gmissile_audio_1_w); | |
| 115 | DECLARE_WRITE8_MEMBER(gmissile_audio_2_w); | |
| 116 | DECLARE_WRITE8_MEMBER(gmissile_audio_3_w); | |
| 117 | DECLARE_WRITE8_MEMBER(m4_audio_1_w); | |
| 118 | DECLARE_WRITE8_MEMBER(m4_audio_2_w); | |
| 119 | DECLARE_WRITE8_MEMBER(clowns_audio_1_w); | |
| 120 | DECLARE_WRITE8_MEMBER(phantom2_audio_1_w); | |
| 121 | DECLARE_WRITE8_MEMBER(phantom2_audio_2_w); | |
| 122 | DECLARE_WRITE8_MEMBER(bowler_audio_2_w); | |
| 123 | DECLARE_WRITE8_MEMBER(bowler_audio_3_w); | |
| 124 | DECLARE_WRITE8_MEMBER(bowler_audio_4_w); | |
| 125 | DECLARE_WRITE8_MEMBER(bowler_audio_5_w); | |
| 126 | DECLARE_WRITE8_MEMBER(bowler_audio_6_w); | |
| 110 | 127 | }; |
| 111 | 128 | |
| 112 | 129 | |
| r14896 | r14897 | |
| 169 | 186 | WRITE8_DEVICE_HANDLER( midway_tone_generator_hi_w ); |
| 170 | 187 | |
| 171 | 188 | MACHINE_CONFIG_EXTERN( seawolf_audio ); |
| 172 | WRITE8_HANDLER( seawolf_audio_w ); | |
| 173 | 189 | |
| 174 | 190 | MACHINE_CONFIG_EXTERN( gunfight_audio ); |
| 175 | WRITE8_HANDLER( gunfight_audio_w ); | |
| 176 | 191 | |
| 177 | 192 | MACHINE_CONFIG_EXTERN( tornbase_audio ); |
| 178 | 193 | WRITE8_DEVICE_HANDLER( tornbase_audio_w ); |
| 179 | 194 | |
| 180 | 195 | MACHINE_CONFIG_EXTERN( zzzap_audio ); |
| 181 | WRITE8_HANDLER( zzzap_audio_1_w ); | |
| 182 | WRITE8_HANDLER( zzzap_audio_2_w ); | |
| 183 | 196 | |
| 184 | 197 | MACHINE_CONFIG_EXTERN( maze_audio ); |
| 185 | 198 | void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state); |
| r14896 | r14897 | |
| 198 | 211 | WRITE8_DEVICE_HANDLER( dplay_audio_w ); |
| 199 | 212 | |
| 200 | 213 | MACHINE_CONFIG_EXTERN( gmissile_audio ); |
| 201 | WRITE8_HANDLER( gmissile_audio_1_w ); | |
| 202 | WRITE8_HANDLER( gmissile_audio_2_w ); | |
| 203 | WRITE8_HANDLER( gmissile_audio_3_w ); | |
| 204 | 214 | |
| 205 | 215 | MACHINE_CONFIG_EXTERN( m4_audio ); |
| 206 | WRITE8_HANDLER( m4_audio_1_w ); | |
| 207 | WRITE8_HANDLER( m4_audio_2_w ); | |
| 208 | 216 | |
| 209 | 217 | MACHINE_CONFIG_EXTERN( clowns_audio ); |
| 210 | WRITE8_HANDLER( clowns_audio_1_w ); | |
| 211 | 218 | WRITE8_DEVICE_HANDLER( clowns_audio_2_w ); |
| 212 | 219 | |
| 213 | 220 | MACHINE_CONFIG_EXTERN( spacwalk_audio ); |
| r14896 | r14897 | |
| 227 | 234 | WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w ); |
| 228 | 235 | |
| 229 | 236 | MACHINE_CONFIG_EXTERN( phantom2_audio ); |
| 230 | WRITE8_HANDLER( phantom2_audio_1_w ); | |
| 231 | WRITE8_HANDLER( phantom2_audio_2_w ); | |
| 232 | 237 | |
| 233 | 238 | MACHINE_CONFIG_EXTERN( bowler_audio ); |
| 234 | 239 | WRITE8_DEVICE_HANDLER( bowler_audio_1_w ); |
| 235 | WRITE8_HANDLER( bowler_audio_2_w ); | |
| 236 | WRITE8_HANDLER( bowler_audio_3_w ); | |
| 237 | WRITE8_HANDLER( bowler_audio_4_w ); | |
| 238 | WRITE8_HANDLER( bowler_audio_5_w ); | |
| 239 | WRITE8_HANDLER( bowler_audio_6_w ); | |
| 240 | 240 | |
| 241 | 241 | MACHINE_CONFIG_EXTERN( invaders_samples_audio ); |
| 242 | 242 | MACHINE_CONFIG_EXTERN( invaders_audio ); |
| r14896 | r14897 | |
|---|---|---|
| 96 | 96 | DECLARE_CUSTOM_INPUT_MEMBER(kingball_muxbit_r); |
| 97 | 97 | DECLARE_CUSTOM_INPUT_MEMBER(kingball_noise_r); |
| 98 | 98 | DECLARE_CUSTOM_INPUT_MEMBER(moonwar_dial_r); |
| 99 | DECLARE_WRITE8_MEMBER(irq_enable_w); | |
| 100 | DECLARE_WRITE8_MEMBER(start_lamp_w); | |
| 101 | DECLARE_WRITE8_MEMBER(coin_lock_w); | |
| 102 | DECLARE_WRITE8_MEMBER(coin_count_0_w); | |
| 103 | DECLARE_WRITE8_MEMBER(coin_count_1_w); | |
| 104 | DECLARE_READ8_MEMBER(konami_ay8910_r); | |
| 105 | DECLARE_WRITE8_MEMBER(konami_ay8910_w); | |
| 106 | DECLARE_WRITE8_MEMBER(konami_sound_filter_w); | |
| 107 | DECLARE_READ8_MEMBER(theend_ppi8255_r); | |
| 108 | DECLARE_WRITE8_MEMBER(theend_ppi8255_w); | |
| 109 | DECLARE_WRITE8_MEMBER(explorer_sound_control_w); | |
| 110 | DECLARE_READ8_MEMBER(sfx_sample_io_r); | |
| 111 | DECLARE_WRITE8_MEMBER(sfx_sample_io_w); | |
| 112 | DECLARE_READ8_MEMBER(monsterz_protection_r); | |
| 113 | DECLARE_READ8_MEMBER(frogger_ppi8255_r); | |
| 114 | DECLARE_WRITE8_MEMBER(frogger_ppi8255_w); | |
| 115 | DECLARE_READ8_MEMBER(frogger_ay8910_r); | |
| 116 | DECLARE_WRITE8_MEMBER(frogger_ay8910_w); | |
| 117 | DECLARE_WRITE8_MEMBER(froggrmc_sound_control_w); | |
| 118 | DECLARE_READ8_MEMBER(frogf_ppi8255_r); | |
| 119 | DECLARE_WRITE8_MEMBER(frogf_ppi8255_w); | |
| 120 | DECLARE_READ8_MEMBER(turtles_ppi8255_0_r); | |
| 121 | DECLARE_READ8_MEMBER(turtles_ppi8255_1_r); | |
| 122 | DECLARE_WRITE8_MEMBER(turtles_ppi8255_0_w); | |
| 123 | DECLARE_WRITE8_MEMBER(turtles_ppi8255_1_w); | |
| 124 | DECLARE_READ8_MEMBER(scorpion_ay8910_r); | |
| 125 | DECLARE_WRITE8_MEMBER(scorpion_ay8910_w); | |
| 126 | DECLARE_READ8_MEMBER(scorpion_digitalker_intr_r); | |
| 127 | DECLARE_WRITE8_MEMBER(zigzag_bankswap_w); | |
| 128 | DECLARE_WRITE8_MEMBER(zigzag_ay8910_w); | |
| 129 | DECLARE_WRITE8_MEMBER(kingball_speech_dip_w); | |
| 130 | DECLARE_WRITE8_MEMBER(kingball_sound1_w); | |
| 131 | DECLARE_WRITE8_MEMBER(kingball_sound2_w); | |
| 132 | DECLARE_WRITE8_MEMBER(mshuttle_ay8910_cs_w); | |
| 133 | DECLARE_WRITE8_MEMBER(mshuttle_ay8910_control_w); | |
| 134 | DECLARE_WRITE8_MEMBER(mshuttle_ay8910_data_w); | |
| 135 | DECLARE_READ8_MEMBER(mshuttle_ay8910_data_r); | |
| 136 | DECLARE_READ8_MEMBER(jumpbug_protection_r); | |
| 137 | DECLARE_WRITE8_MEMBER(checkman_sound_command_w); | |
| 138 | DECLARE_READ8_MEMBER(checkmaj_protection_r); | |
| 139 | DECLARE_READ8_MEMBER(dingo_3000_r); | |
| 140 | DECLARE_READ8_MEMBER(dingo_3035_r); | |
| 141 | DECLARE_READ8_MEMBER(dingoe_3001_r); | |
| 142 | DECLARE_WRITE8_MEMBER(tenspot_unk_6000_w); | |
| 143 | DECLARE_WRITE8_MEMBER(tenspot_unk_8000_w); | |
| 144 | DECLARE_WRITE8_MEMBER(tenspot_unk_e000_w); | |
| 145 | DECLARE_WRITE8_MEMBER(artic_gfxbank_w); | |
| 146 | DECLARE_READ8_MEMBER(tenspot_dsw_read); | |
| 99 | 147 | }; |
| 100 | 148 | |
| 101 | 149 |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | required_device<cpu_device> m_mcu; |
| 38 | 38 | DECLARE_READ32_MEMBER(randgen_r); |
| 39 | 39 | DECLARE_WRITE32_MEMBER(srand_w); |
| 40 | DECLARE_WRITE32_MEMBER(namconb1_cpureg_w); | |
| 41 | DECLARE_WRITE32_MEMBER(namconb2_cpureg_w); | |
| 42 | DECLARE_READ32_MEMBER(namconb_cpureg_r); | |
| 43 | DECLARE_READ32_MEMBER(custom_key_r); | |
| 44 | DECLARE_READ32_MEMBER(gunbulet_gun_r); | |
| 45 | DECLARE_READ32_MEMBER(namconb_share_r); | |
| 46 | DECLARE_WRITE32_MEMBER(namconb_share_w); | |
| 47 | DECLARE_WRITE16_MEMBER(nbmcu_shared_w); | |
| 48 | DECLARE_READ8_MEMBER(port6_r); | |
| 49 | DECLARE_WRITE8_MEMBER(port6_w); | |
| 50 | DECLARE_READ8_MEMBER(port7_r); | |
| 51 | DECLARE_READ8_MEMBER(dac7_r); | |
| 52 | DECLARE_READ8_MEMBER(dac6_r); | |
| 53 | DECLARE_READ8_MEMBER(dac5_r); | |
| 54 | DECLARE_READ8_MEMBER(dac4_r); | |
| 55 | DECLARE_READ8_MEMBER(dac3_r); | |
| 56 | DECLARE_READ8_MEMBER(dac2_r); | |
| 57 | DECLARE_READ8_MEMBER(dac1_r); | |
| 58 | DECLARE_READ8_MEMBER(dac0_r); | |
| 40 | 59 | }; |
| 41 | 60 | |
| 42 | 61 |
| r14896 | r14897 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | UINT16 * m_bitmap; |
| 17 | 17 | UINT8 m_has_mo; |
| 18 | DECLARE_WRITE16_MEMBER(latch_w); | |
| 18 | 19 | }; |
| 19 | 20 | |
| 20 | 21 | /*----------- defined in video/arcadecl.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 72 | 72 | DECLARE_CUSTOM_INPUT_MEMBER(_1c00000_r); |
| 73 | 73 | DECLARE_CUSTOM_INPUT_MEMBER(_1c0001c_r); |
| 74 | 74 | DECLARE_CUSTOM_INPUT_MEMBER(rchase2_devices_r); |
| 75 | DECLARE_READ32_MEMBER(timers_r); | |
| 76 | DECLARE_WRITE32_MEMBER(timers_w); | |
| 77 | DECLARE_WRITE32_MEMBER(pal32_w); | |
| 78 | DECLARE_WRITE32_MEMBER(ctrl0_w); | |
| 79 | DECLARE_WRITE32_MEMBER(analog_2b_w); | |
| 80 | DECLARE_READ32_MEMBER(fifoctl_r); | |
| 81 | DECLARE_READ32_MEMBER(videoctl_r); | |
| 82 | DECLARE_WRITE32_MEMBER(rchase2_devices_w); | |
| 83 | DECLARE_WRITE32_MEMBER(srallyc_devices_w); | |
| 84 | DECLARE_READ32_MEMBER(copro_prg_r); | |
| 85 | DECLARE_WRITE32_MEMBER(copro_prg_w); | |
| 86 | DECLARE_WRITE32_MEMBER(copro_ctl1_w); | |
| 87 | DECLARE_WRITE32_MEMBER(copro_function_port_w); | |
| 88 | DECLARE_READ32_MEMBER(copro_fifo_r); | |
| 89 | DECLARE_WRITE32_MEMBER(copro_fifo_w); | |
| 90 | DECLARE_WRITE32_MEMBER(copro_sharc_iop_w); | |
| 91 | DECLARE_WRITE32_MEMBER(geo_ctl1_w); | |
| 92 | DECLARE_WRITE32_MEMBER(geo_sharc_ctl1_w); | |
| 93 | DECLARE_READ32_MEMBER(geo_sharc_fifo_r); | |
| 94 | DECLARE_WRITE32_MEMBER(geo_sharc_fifo_w); | |
| 95 | DECLARE_WRITE32_MEMBER(geo_sharc_iop_w); | |
| 96 | DECLARE_READ32_MEMBER(geo_prg_r); | |
| 97 | DECLARE_WRITE32_MEMBER(geo_prg_w); | |
| 98 | DECLARE_READ32_MEMBER(geo_r); | |
| 99 | DECLARE_WRITE32_MEMBER(geo_w); | |
| 100 | DECLARE_READ32_MEMBER(hotd_unk_r); | |
| 101 | DECLARE_READ32_MEMBER(sonic_unk_r); | |
| 102 | DECLARE_READ32_MEMBER(daytona_unk_r); | |
| 103 | DECLARE_READ32_MEMBER(desert_unk_r); | |
| 104 | DECLARE_READ32_MEMBER(model2_irq_r); | |
| 105 | DECLARE_WRITE32_MEMBER(model2_irq_w); | |
| 106 | DECLARE_READ32_MEMBER(model2_serial_r); | |
| 107 | DECLARE_WRITE32_MEMBER(model2o_serial_w); | |
| 108 | DECLARE_WRITE32_MEMBER(model2_serial_w); | |
| 109 | DECLARE_READ32_MEMBER(model2_prot_r); | |
| 110 | DECLARE_WRITE32_MEMBER(model2_prot_w); | |
| 111 | DECLARE_READ32_MEMBER(maxx_r); | |
| 112 | DECLARE_READ32_MEMBER(network_r); | |
| 113 | DECLARE_WRITE32_MEMBER(network_w); | |
| 114 | DECLARE_WRITE32_MEMBER(copro_w); | |
| 115 | DECLARE_WRITE32_MEMBER(mode_w); | |
| 116 | DECLARE_WRITE32_MEMBER(model2o_tex_w0); | |
| 117 | DECLARE_WRITE32_MEMBER(model2o_tex_w1); | |
| 118 | DECLARE_WRITE32_MEMBER(model2o_luma_w); | |
| 119 | DECLARE_WRITE32_MEMBER(model2_3d_zclip_w); | |
| 120 | DECLARE_READ16_MEMBER(m1_snd_68k_latch_r); | |
| 121 | DECLARE_READ16_MEMBER(m1_snd_v60_ready_r); | |
| 122 | DECLARE_WRITE16_MEMBER(m1_snd_68k_latch1_w); | |
| 123 | DECLARE_WRITE16_MEMBER(m1_snd_68k_latch2_w); | |
| 124 | DECLARE_WRITE16_MEMBER(model2snd_ctrl); | |
| 125 | DECLARE_READ32_MEMBER(copro_sharc_input_fifo_r); | |
| 126 | DECLARE_WRITE32_MEMBER(copro_sharc_output_fifo_w); | |
| 127 | DECLARE_READ32_MEMBER(copro_sharc_buffer_r); | |
| 128 | DECLARE_WRITE32_MEMBER(copro_sharc_buffer_w); | |
| 129 | DECLARE_READ32_MEMBER(copro_tgp_buffer_r); | |
| 130 | DECLARE_WRITE32_MEMBER(copro_tgp_buffer_w); | |
| 131 | DECLARE_READ8_MEMBER(driveio_port_r); | |
| 132 | DECLARE_WRITE8_MEMBER(driveio_port_w); | |
| 133 | DECLARE_READ8_MEMBER(driveio_port_str_r); | |
| 134 | DECLARE_READ32_MEMBER(jaleco_network_r); | |
| 135 | DECLARE_WRITE32_MEMBER(jaleco_network_w); | |
| 136 | void push_geo_data(UINT32 data); | |
| 75 | 137 | }; |
| 76 | 138 | |
| 77 | 139 |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | DECLARE_READ8_MEMBER(blockade_input_port_0_r); |
| 19 | 19 | DECLARE_WRITE8_MEMBER(blockade_coin_latch_w); |
| 20 | 20 | DECLARE_WRITE8_MEMBER(blockade_videoram_w); |
| 21 | DECLARE_WRITE8_MEMBER(blockade_env_on_w); | |
| 22 | DECLARE_WRITE8_MEMBER(blockade_env_off_w); | |
| 21 | 23 | }; |
| 22 | 24 | |
| 23 | 25 | |
| r14896 | r14897 | |
| 33 | 35 | DISCRETE_SOUND_EXTERN( blockade ); |
| 34 | 36 | |
| 35 | 37 | WRITE8_DEVICE_HANDLER( blockade_sound_freq_w ); |
| 36 | WRITE8_HANDLER( blockade_env_on_w ); | |
| 37 | WRITE8_HANDLER( blockade_env_off_w ); |
| r14896 | r14897 | |
|---|---|---|
| 66 | 66 | DECLARE_WRITE8_MEMBER(pignewt_back_port_w); |
| 67 | 67 | DECLARE_WRITE8_MEMBER(sindbadm_videoram_w); |
| 68 | 68 | DECLARE_WRITE8_MEMBER(sindbadm_back_port_w); |
| 69 | DECLARE_WRITE8_MEMBER(astrob_sound_w); | |
| 70 | DECLARE_WRITE8_MEMBER(spaceod_sound_w); | |
| 71 | DECLARE_READ8_MEMBER(n7751_rom_r); | |
| 72 | DECLARE_READ8_MEMBER(n7751_command_r); | |
| 73 | DECLARE_READ8_MEMBER(n7751_t1_r); | |
| 69 | 74 | }; |
| 70 | 75 | |
| 71 | 76 | |
| r14896 | r14897 | |
| 76 | 81 | MACHINE_CONFIG_EXTERN( spaceod_sound_board ); |
| 77 | 82 | MACHINE_CONFIG_EXTERN( monsterb_sound_board ); |
| 78 | 83 | |
| 79 | WRITE8_HANDLER( astrob_sound_w ); | |
| 80 | 84 | |
| 81 | WRITE8_HANDLER( spaceod_sound_w ); | |
| 82 | 85 | |
| 83 | 86 | |
| 84 | 87 | /*----------- defined in video/segag80r.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | UINT8 m_xb; |
| 14 | 14 | DECLARE_CUSTOM_INPUT_MEMBER(darkplnt_custom_r); |
| 15 | 15 | DECLARE_CUSTOM_INPUT_MEMBER(ckongs_coinage_r); |
| 16 | DECLARE_READ8_MEMBER(hncholms_prot_r); | |
| 17 | DECLARE_READ8_MEMBER(scramble_soundram_r); | |
| 18 | DECLARE_WRITE8_MEMBER(scramble_soundram_w); | |
| 19 | DECLARE_WRITE8_MEMBER(hotshock_sh_irqtrigger_w); | |
| 20 | DECLARE_WRITE8_MEMBER(scramble_filter_w); | |
| 21 | DECLARE_WRITE8_MEMBER(frogger_filter_w); | |
| 16 | 22 | }; |
| 17 | 23 | |
| 18 | 24 | |
| r14896 | r14897 | |
| 62 | 68 | void scramble_sh_init(running_machine &machine); |
| 63 | 69 | WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback ); |
| 64 | 70 | |
| 65 | WRITE8_HANDLER( scramble_filter_w ); | |
| 66 | WRITE8_HANDLER( frogger_filter_w ); | |
| 67 | 71 | |
| 68 | 72 | READ8_DEVICE_HANDLER( scramble_portB_r ); |
| 69 | 73 | READ8_DEVICE_HANDLER( frogger_portB_r ); |
| r14896 | r14897 | |
| 72 | 76 | |
| 73 | 77 | WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w ); |
| 74 | 78 | WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w ); |
| 75 | WRITE8_HANDLER( hotshock_sh_irqtrigger_w ); | |
| 76 | 79 | |
| 77 | 80 | MACHINE_CONFIG_EXTERN( ad2083_audio ); |
| 78 | 81 |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | m_bitmapram(*this, "bitmapram"), |
| 22 | 22 | m_colorram(*this, "colorram") { } |
| 23 | 23 | |
| 24 | void machine_start_liberatr(); | |
| 25 | void video_start_liberatr(); | |
| 26 | ||
| 24 | 27 | DECLARE_WRITE8_MEMBER( led_w ); |
| 25 | 28 | DECLARE_WRITE8_MEMBER( coin_counter_w ); |
| 26 | 29 | |
| r14896 | r14897 | |
| 36 | 39 | protected: |
| 37 | 40 | struct planet; |
| 38 | 41 | |
| 39 | virtual void machine_start(); | |
| 40 | ||
| 41 | virtual void video_start(); | |
| 42 | ||
| 43 | 42 | void init_planet(planet &liberatr_planet, UINT8 *planet_rom); |
| 44 | 43 | void get_pens(pen_t *pens); |
| 45 | 44 | void draw_planet(bitmap_rgb32 &bitmap, pen_t *pens); |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | DECLARE_WRITE32_MEMBER(s1945_mcu_w); |
| 62 | 62 | DECLARE_READ32_MEMBER(s1945_mcu_r); |
| 63 | 63 | DECLARE_READ32_MEMBER(s1945_input_r); |
| 64 | DECLARE_READ32_MEMBER(paletteram32_dword_r); | |
| 65 | DECLARE_WRITE32_MEMBER(paletteram32_xRRRRRGGGGGBBBBB_dword_w); | |
| 66 | 64 | DECLARE_READ32_MEMBER(s1945bl_oki_r); |
| 67 | 65 | DECLARE_WRITE32_MEMBER(s1945bl_oki_w); |
| 68 | 66 | DECLARE_READ8_MEMBER(psikyo_soundlatch_r); |
| r14896 | r14897 | |
|---|---|---|
| 286 | 286 | DRIVER_INIT( kovshp ); |
| 287 | 287 | DRIVER_INIT( kovlsqh2 ); |
| 288 | 288 | DRIVER_INIT( kovqhsgs ); |
| 289 | DRIVER_INIT( kovshxas ); | |
| 289 | 290 | |
| 290 | ||
| 291 | 291 | /* simulations */ |
| 292 | 292 | DRIVER_INIT( ddp3 ); |
| 293 | 293 | DRIVER_INIT( ket ); |
| r14896 | r14897 | |
|---|---|---|
| 116 | 116 | DECLARE_WRITE64_MEMBER(real3d_display_list_w); |
| 117 | 117 | DECLARE_WRITE64_MEMBER(real3d_polygon_ram_w); |
| 118 | 118 | DECLARE_WRITE64_MEMBER(real3d_cmd_w); |
| 119 | DECLARE_READ64_MEMBER(mpc105_addr_r); | |
| 120 | DECLARE_WRITE64_MEMBER(mpc105_addr_w); | |
| 121 | DECLARE_READ64_MEMBER(mpc105_data_r); | |
| 122 | DECLARE_WRITE64_MEMBER(mpc105_data_w); | |
| 123 | DECLARE_READ64_MEMBER(mpc105_reg_r); | |
| 124 | DECLARE_WRITE64_MEMBER(mpc105_reg_w); | |
| 125 | DECLARE_READ64_MEMBER(mpc106_addr_r); | |
| 126 | DECLARE_WRITE64_MEMBER(mpc106_addr_w); | |
| 127 | DECLARE_READ64_MEMBER(mpc106_data_r); | |
| 128 | DECLARE_WRITE64_MEMBER(mpc106_data_w); | |
| 129 | DECLARE_READ64_MEMBER(mpc106_reg_r); | |
| 130 | DECLARE_WRITE64_MEMBER(mpc106_reg_w); | |
| 131 | DECLARE_READ64_MEMBER(scsi_r); | |
| 132 | DECLARE_WRITE64_MEMBER(scsi_w); | |
| 133 | DECLARE_READ64_MEMBER(real3d_dma_r); | |
| 134 | DECLARE_WRITE64_MEMBER(real3d_dma_w); | |
| 135 | DECLARE_READ64_MEMBER(model3_ctrl_r); | |
| 136 | DECLARE_WRITE64_MEMBER(model3_ctrl_w); | |
| 137 | DECLARE_READ64_MEMBER(model3_sys_r); | |
| 138 | DECLARE_WRITE64_MEMBER(model3_sys_w); | |
| 139 | DECLARE_READ64_MEMBER(model3_rtc_r); | |
| 140 | DECLARE_WRITE64_MEMBER(model3_rtc_w); | |
| 141 | DECLARE_READ64_MEMBER(real3d_status_r); | |
| 142 | DECLARE_WRITE8_MEMBER(model3_sound_w); | |
| 143 | DECLARE_READ64_MEMBER(network_r); | |
| 144 | DECLARE_WRITE64_MEMBER(network_w); | |
| 145 | DECLARE_READ64_MEMBER(model3_security_r); | |
| 146 | DECLARE_WRITE64_MEMBER(daytona2_rombank_w); | |
| 147 | DECLARE_WRITE16_MEMBER(model3snd_ctrl); | |
| 148 | UINT32 pci_device_get_reg(); | |
| 149 | void pci_device_set_reg(UINT32 value); | |
| 119 | 150 | }; |
| 120 | 151 | |
| 121 | 152 |
| r14896 | r14897 | |
|---|---|---|
| 8 | 8 | { } |
| 9 | 9 | |
| 10 | 10 | int mux_port; |
| 11 | UINT32 m_st0016_rom_bank; | |
| 12 | ||
| 11 | 13 | required_device<cpu_device> m_maincpu; |
| 12 | 14 | DECLARE_READ8_MEMBER(mux_r); |
| 13 | 15 | DECLARE_WRITE8_MEMBER(mux_select_w); |
| r14896 | r14897 | |
| 29 | 31 | DECLARE_READ8_MEMBER(st0016_vregs_r); |
| 30 | 32 | DECLARE_READ8_MEMBER(st0016_dma_r); |
| 31 | 33 | DECLARE_WRITE8_MEMBER(st0016_vregs_w); |
| 34 | DECLARE_WRITE8_MEMBER(st0016_rom_bank_w); | |
| 32 | 35 | }; |
| 33 | 36 | |
| 34 | 37 | #define ISMACS (st0016_game&0x80) |
| r14896 | r14897 | |
| 52 | 55 | |
| 53 | 56 | /*----------- defined in drivers/st0016.c -----------*/ |
| 54 | 57 | |
| 55 | extern UINT32 st0016_rom_bank; | |
| 56 | WRITE8_HANDLER (st0016_rom_bank_w); | |
| 57 | 58 | |
| 58 | 59 | |
| 59 | 60 | /*----------- defined in video/st0016.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | int m_ycenter; |
| 23 | 23 | DECLARE_WRITE16_MEMBER(cchasm_led_w); |
| 24 | 24 | DECLARE_WRITE16_MEMBER(cchasm_refresh_control_w); |
| 25 | DECLARE_WRITE8_MEMBER(cchasm_reset_coin_flag_w); | |
| 26 | DECLARE_READ8_MEMBER(cchasm_coin_sound_r); | |
| 27 | DECLARE_READ8_MEMBER(cchasm_soundlatch2_r); | |
| 28 | DECLARE_WRITE8_MEMBER(cchasm_soundlatch4_w); | |
| 29 | DECLARE_WRITE16_MEMBER(cchasm_io_w); | |
| 30 | DECLARE_READ16_MEMBER(cchasm_io_r); | |
| 25 | 31 | }; |
| 26 | 32 | |
| 27 | 33 | |
| r14896 | r14897 | |
| 32 | 38 | |
| 33 | 39 | extern const z80ctc_interface cchasm_ctc_intf; |
| 34 | 40 | |
| 35 | WRITE8_HANDLER( cchasm_reset_coin_flag_w ); | |
| 36 | 41 | INPUT_CHANGED( cchasm_set_coin_flag ); |
| 37 | READ8_HANDLER( cchasm_coin_sound_r ); | |
| 38 | READ8_HANDLER( cchasm_soundlatch2_r ); | |
| 39 | WRITE8_HANDLER( cchasm_soundlatch4_w ); | |
| 40 | 42 | |
| 41 | WRITE16_HANDLER( cchasm_io_w ); | |
| 42 | READ16_HANDLER( cchasm_io_r ); | |
| 43 | 43 | |
| 44 | 44 | SOUND_START( cchasm ); |
| 45 | 45 |
| r14896 | r14897 | |
|---|---|---|
| 11 | 11 | public: |
| 12 | 12 | skullxbo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | DECLARE_WRITE16_MEMBER(skullxbo_halt_until_hblank_0_w); | |
| 15 | DECLARE_READ16_MEMBER(special_port1_r); | |
| 16 | DECLARE_WRITE16_MEMBER(skullxbo_mobwr_w); | |
| 14 | 17 | }; |
| 15 | 18 | |
| 16 | 19 |
| r14896 | r14897 | |
|---|---|---|
| 48 | 48 | DECLARE_READ8_MEMBER(qb3_frame_r); |
| 49 | 49 | DECLARE_WRITE8_MEMBER(qb3_ram_bank_w); |
| 50 | 50 | DECLARE_WRITE8_MEMBER(cinemat_vector_control_w); |
| 51 | DECLARE_WRITE8_MEMBER(cinemat_sound_control_w); | |
| 52 | DECLARE_WRITE8_MEMBER(qb3_sound_w); | |
| 51 | 53 | }; |
| 52 | 54 | |
| 53 | 55 | |
| r14896 | r14897 | |
| 58 | 60 | |
| 59 | 61 | /*----------- defined in audio/cinemat.c -----------*/ |
| 60 | 62 | |
| 61 | WRITE8_HANDLER( cinemat_sound_control_w ); | |
| 62 | 63 | |
| 63 | 64 | MACHINE_CONFIG_EXTERN( spacewar_sound ); |
| 64 | 65 | MACHINE_CONFIG_EXTERN( barrier_sound ); |
| r14896 | r14897 | |
|---|---|---|
| 128 | 128 | DECLARE_READ16_MEMBER(namcos22_dspram16_r); |
| 129 | 129 | DECLARE_WRITE16_MEMBER(namcos22_dspram16_w); |
| 130 | 130 | DECLARE_CUSTOM_INPUT_MEMBER(alpine_motor_read); |
| 131 | DECLARE_READ16_MEMBER(pdp_status_r); | |
| 132 | DECLARE_READ16_MEMBER(pdp_begin_r); | |
| 133 | DECLARE_READ16_MEMBER(slave_external_ram_r); | |
| 134 | DECLARE_WRITE16_MEMBER(slave_external_ram_w); | |
| 135 | DECLARE_READ16_MEMBER(dsp_HOLD_signal_r); | |
| 136 | DECLARE_WRITE16_MEMBER(dsp_HOLD_ACK_w); | |
| 137 | DECLARE_WRITE16_MEMBER(dsp_XF_output_w); | |
| 138 | DECLARE_WRITE16_MEMBER(point_ram_idx_w); | |
| 139 | DECLARE_WRITE16_MEMBER(point_ram_loword_iw); | |
| 140 | DECLARE_WRITE16_MEMBER(point_ram_hiword_w); | |
| 141 | DECLARE_READ16_MEMBER(point_ram_loword_r); | |
| 142 | DECLARE_READ16_MEMBER(point_ram_hiword_ir); | |
| 143 | DECLARE_WRITE16_MEMBER(dsp_unk2_w); | |
| 144 | DECLARE_READ16_MEMBER(dsp_unk_port3_r); | |
| 145 | DECLARE_WRITE16_MEMBER(upload_code_to_slave_dsp_w); | |
| 146 | DECLARE_READ16_MEMBER(dsp_unk8_r); | |
| 147 | DECLARE_READ16_MEMBER(custom_ic_status_r); | |
| 148 | DECLARE_READ16_MEMBER(dsp_upload_status_r); | |
| 149 | DECLARE_READ16_MEMBER(master_external_ram_r); | |
| 150 | DECLARE_WRITE16_MEMBER(master_external_ram_w); | |
| 151 | DECLARE_WRITE16_MEMBER(slave_serial_io_w); | |
| 152 | DECLARE_READ16_MEMBER(master_serial_io_r); | |
| 153 | DECLARE_WRITE16_MEMBER(dsp_unk_porta_w); | |
| 154 | DECLARE_WRITE16_MEMBER(dsp_led_w); | |
| 155 | DECLARE_WRITE16_MEMBER(dsp_unk8_w); | |
| 156 | DECLARE_WRITE16_MEMBER(master_render_device_w); | |
| 157 | DECLARE_READ16_MEMBER(dsp_BIOZ_r); | |
| 158 | DECLARE_READ16_MEMBER(dsp_slave_port3_r); | |
| 159 | DECLARE_READ16_MEMBER(dsp_slave_port4_r); | |
| 160 | DECLARE_READ16_MEMBER(dsp_slave_port5_r); | |
| 161 | DECLARE_READ16_MEMBER(dsp_slave_port6_r); | |
| 162 | DECLARE_WRITE16_MEMBER(dsp_slave_portc_w); | |
| 163 | DECLARE_READ16_MEMBER(dsp_slave_port8_r); | |
| 164 | DECLARE_READ16_MEMBER(dsp_slave_portb_r); | |
| 165 | DECLARE_WRITE16_MEMBER(dsp_slave_portb_w); | |
| 166 | DECLARE_READ32_MEMBER(namcos22_C139_SCI_r); | |
| 167 | DECLARE_WRITE32_MEMBER(namcos22_C139_SCI_w); | |
| 168 | DECLARE_READ32_MEMBER(namcos22_system_controller_r); | |
| 169 | DECLARE_WRITE32_MEMBER(namcos22s_system_controller_w); | |
| 170 | DECLARE_WRITE32_MEMBER(namcos22_system_controller_w); | |
| 171 | DECLARE_READ32_MEMBER(namcos22_keycus_r); | |
| 172 | DECLARE_WRITE32_MEMBER(namcos22_keycus_w); | |
| 173 | DECLARE_READ32_MEMBER(namcos22_portbit_r); | |
| 174 | DECLARE_WRITE32_MEMBER(namcos22_portbit_w); | |
| 175 | DECLARE_READ32_MEMBER(namcos22_dipswitch_r); | |
| 176 | DECLARE_READ32_MEMBER(namcos22_mcuram_r); | |
| 177 | DECLARE_WRITE32_MEMBER(namcos22_mcuram_w); | |
| 178 | DECLARE_READ32_MEMBER(namcos22_gun_r); | |
| 179 | DECLARE_WRITE32_MEMBER(namcos22_cpuleds_w); | |
| 180 | DECLARE_READ32_MEMBER(alpinesa_prot_r); | |
| 181 | DECLARE_WRITE32_MEMBER(alpinesa_prot_w); | |
| 182 | DECLARE_WRITE32_MEMBER(namcos22s_nvmem_w); | |
| 183 | DECLARE_WRITE32_MEMBER(namcos22s_chipselect_w); | |
| 184 | DECLARE_READ16_MEMBER(s22mcu_shared_r); | |
| 185 | DECLARE_WRITE16_MEMBER(s22mcu_shared_w); | |
| 186 | DECLARE_WRITE8_MEMBER(mcu_port4_w); | |
| 187 | DECLARE_READ8_MEMBER(mcu_port4_r); | |
| 188 | DECLARE_WRITE8_MEMBER(mcu_port5_w); | |
| 189 | DECLARE_READ8_MEMBER(mcu_port5_r); | |
| 190 | DECLARE_WRITE8_MEMBER(mcu_port6_w); | |
| 191 | DECLARE_READ8_MEMBER(mcu_port6_r); | |
| 192 | DECLARE_WRITE8_MEMBER(mcu_port7_w); | |
| 193 | DECLARE_READ8_MEMBER(mcu_port7_r); | |
| 194 | DECLARE_WRITE8_MEMBER(propcycle_mcu_port5_w); | |
| 195 | DECLARE_READ8_MEMBER(propcycle_mcu_adc_r); | |
| 196 | DECLARE_WRITE8_MEMBER(alpine_mcu_port5_w); | |
| 197 | DECLARE_READ8_MEMBER(alpineracer_mcu_adc_r); | |
| 198 | DECLARE_READ8_MEMBER(cybrcycc_mcu_adc_r); | |
| 199 | DECLARE_READ8_MEMBER(tokyowar_mcu_adc_r); | |
| 200 | DECLARE_READ8_MEMBER(aquajet_mcu_adc_r); | |
| 201 | DECLARE_READ8_MEMBER(airco22_mcu_adc_r); | |
| 202 | DECLARE_READ8_MEMBER(mcu_port4_s22_r); | |
| 203 | DECLARE_READ16_MEMBER(mcu141_speedup_r); | |
| 204 | DECLARE_WRITE16_MEMBER(mcu_speedup_w); | |
| 205 | DECLARE_READ16_MEMBER(mcu130_speedup_r); | |
| 206 | DECLARE_READ16_MEMBER(mcuc74_speedup_r); | |
| 207 | UINT32 ReadFromCommRAM(offs_t offs ); | |
| 208 | void WriteToCommRAM(offs_t offs, UINT32 data ); | |
| 209 | void WriteToPointRAM(offs_t offs, UINT32 data ); | |
| 131 | 210 | }; |
| 132 | 211 | |
| 133 | 212 |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | 14 | |
| 15 | 15 | UINT16 m_h256; |
| 16 | DECLARE_READ16_MEMBER(special_port1_r); | |
| 16 | 17 | }; |
| 17 | 18 | |
| 18 | 19 |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | UINT8 m_bank_color_shift[MAX_GFX_ELEMENTS]; |
| 43 | 43 | |
| 44 | 44 | UINT8 m_cur[2][2]; |
| 45 | DECLARE_READ16_MEMBER(joystick_r); | |
| 46 | DECLARE_WRITE16_MEMBER(joystick_w); | |
| 47 | DECLARE_READ16_MEMBER(trakball_r); | |
| 48 | DECLARE_READ16_MEMBER(port4_r); | |
| 49 | DECLARE_READ8_MEMBER(switch_6502_r); | |
| 50 | DECLARE_WRITE8_MEMBER(led_w); | |
| 45 | 51 | }; |
| 46 | 52 | |
| 47 | 53 |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | device_t * m_rle; |
| 33 | 33 | UINT32 m_last_accesses[8]; |
| 34 | DECLARE_READ16_MEMBER(special_port2_r); | |
| 35 | DECLARE_WRITE16_MEMBER(a2d_select_w); | |
| 36 | DECLARE_READ16_MEMBER(a2d_data_r); | |
| 37 | DECLARE_WRITE16_MEMBER(io_latch_w); | |
| 38 | DECLARE_WRITE16_MEMBER(mo_command_w); | |
| 39 | DECLARE_READ16_MEMBER(roadriot_sloop_data_r); | |
| 40 | DECLARE_WRITE16_MEMBER(roadriot_sloop_data_w); | |
| 41 | DECLARE_READ16_MEMBER(guardians_sloop_data_r); | |
| 42 | DECLARE_WRITE16_MEMBER(guardians_sloop_data_w); | |
| 43 | void roadriot_sloop_tweak(int offset); | |
| 44 | void guardians_sloop_tweak(int offset); | |
| 34 | 45 | }; |
| 35 | 46 | |
| 36 | 47 |
| r14896 | r14897 | |
|---|---|---|
| 15 | 15 | UINT8 m_playfield_tile_bank; |
| 16 | 16 | UINT16 m_playfield_xscroll; |
| 17 | 17 | UINT16 m_playfield_yscroll; |
| 18 | DECLARE_READ16_MEMBER(port1_r); | |
| 18 | 19 | }; |
| 19 | 20 | |
| 20 | 21 |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | DECLARE_WRITE32_MEMBER(midvunit_paletteram_w); |
| 79 | 79 | DECLARE_WRITE32_MEMBER(midvunit_textureram_w); |
| 80 | 80 | DECLARE_READ32_MEMBER(midvunit_textureram_r); |
| 81 | DECLARE_READ32_MEMBER(port0_r); | |
| 82 | DECLARE_READ32_MEMBER(midvunit_adc_r); | |
| 83 | DECLARE_WRITE32_MEMBER(midvunit_adc_w); | |
| 84 | DECLARE_WRITE32_MEMBER(midvunit_cmos_protect_w); | |
| 85 | DECLARE_WRITE32_MEMBER(midvunit_cmos_w); | |
| 86 | DECLARE_READ32_MEMBER(midvunit_cmos_r); | |
| 87 | DECLARE_WRITE32_MEMBER(midvunit_control_w); | |
| 88 | DECLARE_WRITE32_MEMBER(crusnwld_control_w); | |
| 89 | DECLARE_WRITE32_MEMBER(midvunit_sound_w); | |
| 90 | DECLARE_READ32_MEMBER(tms32031_control_r); | |
| 91 | DECLARE_WRITE32_MEMBER(tms32031_control_w); | |
| 92 | DECLARE_READ32_MEMBER(crusnwld_serial_status_r); | |
| 93 | DECLARE_READ32_MEMBER(crusnwld_serial_data_r); | |
| 94 | DECLARE_WRITE32_MEMBER(crusnwld_serial_data_w); | |
| 95 | DECLARE_READ32_MEMBER(bit_data_r); | |
| 96 | DECLARE_WRITE32_MEMBER(bit_reset_w); | |
| 97 | DECLARE_READ32_MEMBER(offroadc_serial_status_r); | |
| 98 | DECLARE_READ32_MEMBER(offroadc_serial_data_r); | |
| 99 | DECLARE_WRITE32_MEMBER(offroadc_serial_data_w); | |
| 100 | DECLARE_READ32_MEMBER(midvplus_misc_r); | |
| 101 | DECLARE_WRITE32_MEMBER(midvplus_misc_w); | |
| 102 | DECLARE_READ32_MEMBER(generic_speedup_r); | |
| 81 | 103 | }; |
| 82 | 104 | |
| 83 | 105 |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | UINT32 m_spin_center_count; |
| 46 | 46 | |
| 47 | 47 | UINT16 m_vram[0x8000/2]; |
| 48 | DECLARE_WRITE16_MEMBER(int0_ack_w); | |
| 49 | DECLARE_WRITE16_MEMBER(int1_ack_w); | |
| 50 | DECLARE_WRITE16_MEMBER(int_enable_w); | |
| 51 | DECLARE_WRITE16_MEMBER(bankselect_w); | |
| 52 | DECLARE_READ16_MEMBER(switch_r); | |
| 53 | DECLARE_READ8_MEMBER(switch_6502_r); | |
| 54 | DECLARE_WRITE8_MEMBER(switch_6502_w); | |
| 55 | DECLARE_WRITE16_MEMBER(adc_strobe_w); | |
| 56 | DECLARE_READ16_MEMBER(adc_r); | |
| 57 | DECLARE_READ8_MEMBER(leta_r); | |
| 58 | DECLARE_WRITE8_MEMBER(mixer_w); | |
| 59 | DECLARE_WRITE8_MEMBER(sound_reset_w); | |
| 60 | DECLARE_READ16_MEMBER(sound_r); | |
| 61 | DECLARE_WRITE8_MEMBER(sound_6502_w); | |
| 62 | DECLARE_READ8_MEMBER(sound_6502_r); | |
| 63 | DECLARE_WRITE8_MEMBER(tms5220_w); | |
| 64 | DECLARE_WRITE8_MEMBER(tms5220_strobe_w); | |
| 65 | DECLARE_WRITE8_MEMBER(coincount_w); | |
| 48 | 66 | }; |
| 49 | 67 | |
| 50 | 68 |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | double m_color_weights_b[2]; |
| 43 | 43 | DECLARE_WRITE8_MEMBER(spacefb_port_0_w); |
| 44 | 44 | DECLARE_WRITE8_MEMBER(spacefb_port_2_w); |
| 45 | DECLARE_READ8_MEMBER(spacefb_audio_p2_r); | |
| 46 | DECLARE_READ8_MEMBER(spacefb_audio_t0_r); | |
| 47 | DECLARE_READ8_MEMBER(spacefb_audio_t1_r); | |
| 48 | DECLARE_WRITE8_MEMBER(spacefb_port_1_w); | |
| 45 | 49 | }; |
| 46 | 50 | |
| 47 | 51 | |
| r14896 | r14897 | |
| 49 | 53 | |
| 50 | 54 | MACHINE_CONFIG_EXTERN( spacefb_audio ); |
| 51 | 55 | |
| 52 | READ8_HANDLER( spacefb_audio_p2_r ); | |
| 53 | READ8_HANDLER( spacefb_audio_t0_r ); | |
| 54 | READ8_HANDLER( spacefb_audio_t1_r ); | |
| 55 | WRITE8_HANDLER( spacefb_port_1_w ); | |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | /*----------- defined in video/spacefb.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | DECLARE_WRITE8_MEMBER(n8080_shift_data_w); |
| 43 | 43 | DECLARE_READ8_MEMBER(n8080_shift_r); |
| 44 | 44 | DECLARE_WRITE8_MEMBER(n8080_video_control_w); |
| 45 | DECLARE_WRITE8_MEMBER(n8080_sound_1_w); | |
| 46 | DECLARE_WRITE8_MEMBER(n8080_sound_2_w); | |
| 47 | DECLARE_READ8_MEMBER(n8080_8035_p1_r); | |
| 48 | DECLARE_READ8_MEMBER(n8080_8035_t0_r); | |
| 49 | DECLARE_READ8_MEMBER(n8080_8035_t1_r); | |
| 50 | DECLARE_READ8_MEMBER(helifire_8035_t0_r); | |
| 51 | DECLARE_READ8_MEMBER(helifire_8035_t1_r); | |
| 52 | DECLARE_READ8_MEMBER(helifire_8035_external_ram_r); | |
| 53 | DECLARE_READ8_MEMBER(helifire_8035_p2_r); | |
| 54 | DECLARE_WRITE8_MEMBER(n8080_dac_w); | |
| 55 | DECLARE_WRITE8_MEMBER(helifire_dac_w); | |
| 56 | DECLARE_WRITE8_MEMBER(helifire_sound_ctrl_w); | |
| 45 | 57 | }; |
| 46 | 58 | |
| 47 | 59 | |
| r14896 | r14897 | |
| 75 | 87 | MACHINE_RESET( sheriff_sound ); |
| 76 | 88 | MACHINE_RESET( helifire_sound ); |
| 77 | 89 | |
| 78 | WRITE8_HANDLER( n8080_sound_1_w ); | |
| 79 | WRITE8_HANDLER( n8080_sound_2_w ); |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | DECLARE_WRITE16_MEMBER(seta_vram_0_w); |
| 93 | 93 | DECLARE_WRITE16_MEMBER(seta_vram_2_w); |
| 94 | 94 | DECLARE_WRITE16_MEMBER(twineagl_tilebank_w); |
| 95 | DECLARE_WRITE16_MEMBER(timer_regs_w); | |
| 96 | DECLARE_READ16_MEMBER(sharedram_68000_r); | |
| 97 | DECLARE_WRITE16_MEMBER(sharedram_68000_w); | |
| 98 | DECLARE_WRITE16_MEMBER(sub_ctrl_w); | |
| 99 | DECLARE_READ16_MEMBER(seta_dsw_r); | |
| 100 | DECLARE_READ16_MEMBER(calibr50_ip_r); | |
| 101 | DECLARE_WRITE16_MEMBER(calibr50_soundlatch_w); | |
| 102 | DECLARE_READ16_MEMBER(usclssic_dsw_r); | |
| 103 | DECLARE_READ16_MEMBER(usclssic_trackball_x_r); | |
| 104 | DECLARE_READ16_MEMBER(usclssic_trackball_y_r); | |
| 105 | DECLARE_WRITE16_MEMBER(usclssic_lockout_w); | |
| 106 | DECLARE_READ16_MEMBER(zombraid_gun_r); | |
| 107 | DECLARE_WRITE16_MEMBER(zombraid_gun_w); | |
| 108 | DECLARE_READ16_MEMBER(zingzipbl_unknown_r); | |
| 109 | DECLARE_READ16_MEMBER(keroppi_protection_r); | |
| 110 | DECLARE_READ16_MEMBER(keroppi_protection_init_r); | |
| 111 | DECLARE_READ16_MEMBER(keroppi_coin_r); | |
| 112 | DECLARE_WRITE16_MEMBER(keroppi_prize_w); | |
| 113 | DECLARE_WRITE16_MEMBER(setaroul_spriteylow_w); | |
| 114 | DECLARE_WRITE16_MEMBER(setaroul_spritectrl_w); | |
| 115 | DECLARE_WRITE16_MEMBER(setaroul_spritecode_w); | |
| 116 | DECLARE_READ16_MEMBER(setaroul_spritecode_r); | |
| 117 | DECLARE_READ16_MEMBER(krzybowl_input_r); | |
| 118 | DECLARE_WRITE16_MEMBER(msgundam_vregs_w); | |
| 119 | DECLARE_READ16_MEMBER(kiwame_nvram_r); | |
| 120 | DECLARE_WRITE16_MEMBER(kiwame_nvram_w); | |
| 121 | DECLARE_READ16_MEMBER(kiwame_input_r); | |
| 122 | DECLARE_READ16_MEMBER(thunderl_protection_r); | |
| 123 | DECLARE_WRITE16_MEMBER(thunderl_protection_w); | |
| 124 | DECLARE_READ8_MEMBER(wiggie_soundlatch_r); | |
| 125 | DECLARE_WRITE16_MEMBER(wiggie_soundlatch_w); | |
| 126 | DECLARE_WRITE16_MEMBER(utoukond_soundlatch_w); | |
| 127 | DECLARE_READ16_MEMBER(pairlove_prot_r); | |
| 128 | DECLARE_WRITE16_MEMBER(pairlove_prot_w); | |
| 129 | DECLARE_READ16_MEMBER(inttoote_dsw_r); | |
| 130 | DECLARE_READ16_MEMBER(inttoote_key_r); | |
| 131 | DECLARE_READ16_MEMBER(inttoote_700000_r); | |
| 132 | DECLARE_READ16_MEMBER(jockeyc_mux_r); | |
| 133 | DECLARE_WRITE16_MEMBER(jockeyc_mux_w); | |
| 134 | DECLARE_READ16_MEMBER(unk_r); | |
| 135 | DECLARE_WRITE8_MEMBER(sub_bankswitch_w); | |
| 136 | DECLARE_WRITE8_MEMBER(sub_bankswitch_lockout_w); | |
| 137 | DECLARE_READ8_MEMBER(ff_r); | |
| 138 | DECLARE_READ8_MEMBER(downtown_ip_r); | |
| 139 | DECLARE_WRITE8_MEMBER(calibr50_soundlatch2_w); | |
| 140 | DECLARE_READ16_MEMBER(twineagl_debug_r); | |
| 141 | DECLARE_READ16_MEMBER(twineagl_200100_r); | |
| 142 | DECLARE_WRITE16_MEMBER(twineagl_200100_w); | |
| 143 | DECLARE_READ16_MEMBER(downtown_protection_r); | |
| 144 | DECLARE_WRITE16_MEMBER(downtown_protection_w); | |
| 145 | DECLARE_READ16_MEMBER(arbalest_debug_r); | |
| 95 | 146 | }; |
| 96 | 147 | |
| 97 | 148 | /*----------- defined in video/seta.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | DECLARE_READ8_MEMBER(laserbat_input_r); |
| 64 | 64 | DECLARE_WRITE8_MEMBER(laserbat_cnteff_w); |
| 65 | 65 | DECLARE_WRITE8_MEMBER(laserbat_cntmov_w); |
| 66 | DECLARE_WRITE8_MEMBER(laserbat_csound1_w); | |
| 67 | DECLARE_WRITE8_MEMBER(laserbat_csound2_w); | |
| 66 | 68 | }; |
| 67 | 69 | |
| 68 | 70 | |
| 69 | 71 | /*----------- defined in audio/laserbat.c -----------*/ |
| 70 | 72 | |
| 71 | WRITE8_HANDLER( laserbat_csound1_w ); | |
| 72 | WRITE8_HANDLER( laserbat_csound2_w ); |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | ROM_LOAD( "95009013.bin", 0x0000, 0x0f3ee2, CRC(f324a590) SHA1(0533af3304100c99af5fdeba2773d92384101f43) ) \ |
| 20 | 20 | |
| 21 | 21 | #define sc_a40_others \ |
| 22 | ROM_REGION( 0x1000000, "ymz", ROMREGION_ERASE00 ) \ | |
| 23 | ROM_LOAD( "95008511.bin", 0x0000, 0x0ff5c3, CRC(6fac2014) SHA1(5b364406f7b5d8f4c54561e3977571e4a47273a0) ) \ | |
| 22 | 24 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| 23 | 25 | ROM_LOAD( "95890123.bin", 0x0000, 0x5000, CRC(e3f5466e) SHA1(ae2f45f79d0113e651b8cf5f655a9ceb32a3ddaa) ) \ |
| 24 | 26 | ROM_LOAD( "95890124.bin", 0x0000, 0x5000, CRC(9663025a) SHA1(097246412fd4084c1185d8dfd91e884abc5a3f8a) ) \ |
| 25 | 27 | ROM_LOAD( "95890125.bin", 0x0000, 0x5000, CRC(08d9ce06) SHA1(9087170d6c6edad735ab5a2abbc0a2191aabfd03) ) \ |
| 26 | ROM_REGION( 0x1000000, "ymz", ROMREGION_ERASE00 ) \ | |
| 27 | ROM_LOAD( "95008511.bin", 0x0000, 0x0ff5c3, CRC(6fac2014) SHA1(5b364406f7b5d8f4c54561e3977571e4a47273a0) ) \ | |
| 28 | 28 | |
| 29 | 29 | #define sc_acesh_others \ |
| 30 | 30 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| r14896 | r14897 | |
| 96 | 96 | ROM_LOAD( "95890436.bin", 0x0000, 0x5000, CRC(dc58813d) SHA1(9bad2c6cdacaa016f5239e578600f1ff03f1ed63) ) \ |
| 97 | 97 | |
| 98 | 98 | #define sc_bar7_others \ |
| 99 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 99 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) /* PR1433 BAR SEVENS SOUNDS11 */ \ | |
| 100 | 100 | ROM_LOAD( "95008409.bin", 0x0000, 0x080000, CRC(ec29c758) SHA1(ceb99fb6edcab5c5e1b0ec46d622ee0f2cdb20be) ) \ |
| 101 | ROM_REGION( 0x400000, "others1", ROMREGION_ERASE00 ) /* PR1436 TRIPLE CASINO SOUNDS11 */ \ | |
| 101 | 102 | ROM_LOAD( "95008423.bin", 0x0000, 0x100000, CRC(4cab20ee) SHA1(e27221a94e54db340eaf7fc30e722b354c85686d) ) \ |
| 102 | ROM_LOAD( "95008502.bin", 0x0000, 0x080000, CRC(d9bc2c75) SHA1(b9e637d47287a844a6ff1f0b1d1a34b48a806aad) ) \ | |
| 103 | ROM_REGION( 0x400000, "other", ROMREGION_ERASE00 ) /* shouldn't be here? - sc1/2 */ \ | |
| 103 | ROM_REGION( 0x400000, "others3", ROMREGION_ERASE00 ) /* shouldn't be here? - sc1/2 */ \ | |
| 104 | 104 | ROM_LOAD( "95751960.p1", 0x0000, 0x010000, CRC(9f944d0c) SHA1(feb8fe4ce0a8f5c4a034aafec0f5aae29a834e8d) ) \ |
| 105 | 105 | |
| 106 | #define PR1492_CAS_BAR_SEVENS_SOUNDS11 \ | |
| 107 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) /* PR1492 CAS BAR SEVENS SOUNDS11 */ \ | |
| 108 | ROM_LOAD( "95008502.bin", 0x0000, 0x080000, CRC(d9bc2c75) SHA1(b9e637d47287a844a6ff1f0b1d1a34b48a806aad) ) \ | |
| 109 | ||
| 106 | 110 | #define sc_batl_others \ |
| 107 | 111 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 108 | 112 | ROM_LOAD( "95008541.bin", 0x000000, 0x100000, CRC(a739cba8) SHA1(b968cfa18c671aaf027909961a843fc01101d68a) ) \ |
| r14896 | r14897 | |
| 183 | 187 | |
| 184 | 188 | #define sc_bull_others \ |
| 185 | 189 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 186 | ROM_LOAD( "95008520.bin", 0x0000, 0x100000, CRC(ab418ce0) SHA1(39afbd449a21a31016acaffcfb4f6d684db300e7) ) /* PR1702 BULLSEYE */ \ | |
| 187 | ROM_LOAD( "95008521.bin", 0x0000, 0x100000, CRC(7fd0f70c) SHA1(e6bf85b9e2528dac5811277ee89599e58e6358b0) ) \ | |
| 188 | ROM_LOAD( "95008544.bin", 0x0000, 0x100000, CRC(19777f20) SHA1(da0cc08b00f9ab565a0e559761adbf7bcd7c327b) ) /* PR1743 CASINO BULLSEYE */ \ | |
| 189 | ROM_LOAD( "95008575.bin", 0x0000, 0x100000, CRC(715901d2) SHA1(a7d3d0c7b9fc3eefb0df372cdf0cae7abe8bd959) ) /* PR1758 BULLSEYE TRIPLE */ \ | |
| 190 | ROM_LOAD( "95009116.bin", 0x0000, 0x100000, CRC(5a01e206) SHA1(38ee3706d9edb68d17c90bb627aa17b4f908d721) ) /* PR3318 BULLSEYE */ \ | |
| 191 | ROM_LOAD( "95009117.bin", 0x0000, 0x100000, CRC(c3623829) SHA1(92b0cf89678023bb02394699e2e214389317ec6c) ) \ | |
| 190 | ROM_LOAD( "95008520.bin", 0x000000, 0x100000, CRC(ab418ce0) SHA1(39afbd449a21a31016acaffcfb4f6d684db300e7) ) \ | |
| 191 | ROM_LOAD( "95008521.bin", 0x100000, 0x100000, CRC(7fd0f70c) SHA1(e6bf85b9e2528dac5811277ee89599e58e6358b0) ) \ | |
| 192 | 192 | |
| 193 | #define PR1743_CASINO_BULLSEYE_SOUNDS11 \ | |
| 194 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 195 | ROM_LOAD( "95008544.bin", 0x000000, 0x100000, CRC(19777f20) SHA1(da0cc08b00f9ab565a0e559761adbf7bcd7c327b) ) \ | |
| 196 | ||
| 197 | #define PR1758_BULLSEYE_TRIPLE_SOUNDS11 \ | |
| 198 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 199 | ROM_LOAD( "95008575.bin", 0x000000, 0x100000, CRC(715901d2) SHA1(a7d3d0c7b9fc3eefb0df372cdf0cae7abe8bd959) ) \ | |
| 200 | ||
| 201 | #define PR3318_BULLSEYE_SOUNDS11 \ | |
| 202 | ROM_LOAD( "95009116.bin", 0x000000, 0x100000, CRC(5a01e206) SHA1(38ee3706d9edb68d17c90bb627aa17b4f908d721) ) \ | |
| 203 | ROM_LOAD( "95009117.bin", 0x100000, 0x100000, CRC(c3623829) SHA1(92b0cf89678023bb02394699e2e214389317ec6c) ) \ | |
| 204 | ||
| 205 | ||
| 206 | ||
| 193 | 207 | #define sc_butch_others \ |
| 194 | 208 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 195 | 209 | ROM_LOAD( "95008604.bin", 0x000000, 0x100000, CRC(dede59e0) SHA1(de56b80d0a53fbb18acce2b907f48801e8fced12) ) \ |
| r14896 | r14897 | |
| 237 | 251 | ROM_LOAD( "95891125.bin", 0x0000, 0x5000, CRC(9a241a4a) SHA1(3383c31a1de5f4a0ced5e3346de7b7e1f7fdbe04) ) \ |
| 238 | 252 | ROM_LOAD( "95891126.bin", 0x0000, 0x5000, CRC(049ed616) SHA1(2c29271dfebff92b3f537dd3cc89aea53decf978) ) \ |
| 239 | 253 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 240 | ROM_LOAD( "95009017.bin", 0x0000, 0x100000, CRC(4df62a63) SHA1(1d3b7927683d45bf81c038527b57881a58657e21) ) \ | |
| 241 | ROM_LOAD( "95009018.bin", 0x0000, 0x030022, CRC(90c95f34) SHA1(a63d52b7ec202f6757ed24251e542be2409ba2a9) ) \ | |
| 254 | ROM_LOAD( "95009017.bin", 0x000000, 0x100000, CRC(4df62a63) SHA1(1d3b7927683d45bf81c038527b57881a58657e21) ) \ | |
| 255 | ROM_LOAD( "95009018.bin", 0x100000, 0x030022, CRC(90c95f34) SHA1(a63d52b7ec202f6757ed24251e542be2409ba2a9) ) \ | |
| 242 | 256 | |
| 243 | 257 | #define sc_clcas_others \ |
| 244 | 258 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| r14896 | r14897 | |
| 261 | 275 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 262 | 276 | ROM_LOAD( "95008988.bin", 0x0000, 0x0d23ea, CRC(b33581a0) SHA1(667bf4e499b50fd072313bad671ffcbd299fd97b) ) \ |
| 263 | 277 | |
| 264 | #define | |
| 278 | #define PR3502_C | |
| 265 | 279 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 266 | 280 | ROM_LOAD( "95009031.bin", 0x000000, 0x100000, CRC(58ded502) SHA1(27c05614b03b51fe4a168b8c64535ec3ca9e85c1) ) \ |
| 267 | 281 | ROM_LOAD( "95009032.bin", 0x100000, 0x100000, CRC(e1eb711a) SHA1(f6c0c10992f2aacd6f9fadc4e15d8ad5ba5b4ed8) ) \ |
| 282 | ||
| 283 | #define PR3317_COLOUR_OF_MONEY_SOUNDS11 \ | |
| 284 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 268 | 285 | ROM_LOAD( "95009124.bin", 0x000000, 0x100000, CRC(798d8d5a) SHA1(931bfca5d204c62fc834959d9babcd9488fc7f07) ) \ |
| 269 | 286 | ROM_LOAD( "95009125.bin", 0x100000, 0x100000, CRC(d6090812) SHA1(16ca4868725eff0cc4bd056d751dc7861c1e53a1) ) \ |
| 270 | 287 | |
| r14896 | r14897 | |
| 279 | 296 | ROM_LOAD( "95009036.bin", 0x100000, 0x100000, CRC(757f44b9) SHA1(61fe15024f7c7f97f865b1b666a5f837a57446a5) ) \ |
| 280 | 297 | |
| 281 | 298 | #define sc_cfpt_others \ |
| 282 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 283 | ROM_LOAD( "95008363.bin", 0x000000, 0x100000, CRC(6d211d7b) SHA1(59dbb6201aa355a585253d17302e4f8ceed9a220) ) \ | |
| 299 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) /* PR1359 CRAZY F PARTY SOUNDS11 */ \ | |
| 284 | 300 | ROM_LOAD( "95008348.bin", 0x000000, 0x100000, CRC(9c6db3d1) SHA1(f2f613326d0a8c0a1c2e1eea1e91ed34cd344f41) ) \ |
| 301 | ROM_REGION( 0x400000, "others1", ROMREGION_ERASE00 ) /* PR1359 TB CRAZY F P SOUNDS11 (topbox rom?)*/ \ | |
| 285 | 302 | ROM_LOAD( "95008349.bin", 0x100000, 0x100000, CRC(6f7716a0) SHA1(75f8fbee605b96e36e8596068dd4570928a5a02d) ) \ |
| 303 | ROM_REGION( 0x400000, "others2", ROMREGION_ERASE00 ) /* PR1359 TB CRAZY F P SOUNDS11 (alt topbox rom?) */ \ | |
| 304 | ROM_LOAD( "95008363.bin", 0x000000, 0x100000, CRC(6d211d7b) SHA1(59dbb6201aa355a585253d17302e4f8ceed9a220) ) \ | |
| 286 | 305 | |
| 287 | 306 | #define sc_cknig_others \ |
| 288 | 307 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| r14896 | r14897 | |
| 335 | 354 | |
| 336 | 355 | #define sc_cerup_others \ |
| 337 | 356 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 357 | ROM_LOAD( "cash erruption sounds", 0x000000, 0x100000, NO_DUMP ) \ | |
| 338 | 358 | |
| 339 | 359 | #define sc_cexpl_others \ |
| 340 | 360 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 361 | ROM_LOAD( "cash explosion sounds", 0x000000, 0x100000, NO_DUMP ) \ | |
| 341 | 362 | |
| 342 | 363 | #define sc_chand_others \ |
| 343 | 364 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| r14896 | r14897 | |
| 374 | 395 | |
| 375 | 396 | #define sc_clucl_others \ |
| 376 | 397 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 398 | ROM_LOAD( "clucl sounds", 0x000000, 0x100000, NO_DUMP ) \ | |
| 377 | 399 | |
| 378 | 400 | #define sc_colos_others \ |
| 379 | 401 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| r14896 | r14897 | |
| 420 | 442 | ROM_LOAD( "95890308.bin", 0x0000, 0x5000, CRC(04de60b0) SHA1(cee280d9528f9e167be1c373e7a99f1f2f1bc1c0) ) \ |
| 421 | 443 | |
| 422 | 444 | #define sc_cari_others \ |
| 423 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 424 | ROM_LOAD( "97000070.bin", 0x0000, 0x0f8526, CRC(27ba6768) SHA1(708e836f3fc35fabd0a5c8dc9cd8e9327d7bcdc7) ) \ | |
| 425 | ROM_LOAD( "95008981.bin", 0x0000, 0x0ff245, CRC(3a888f98) SHA1(b113c17acda287200fdcd734a1b384879a5e7101) ) \ | |
| 426 | ROM_LOAD( "caribbeancashsnd1.bin", 0x0000, 0x080000, CRC(89da9fc4) SHA1(d56364e2e71d03d7d8888966b64ff1fab4bfc3e9) ) \ | |
| 427 | ROM_LOAD( "caribbeancashsnd2.bin", 0x0000, 0x080000, CRC(99d33f61) SHA1(7caf3b9540372900e90a7141f14383fe06936a2e) ) \ | |
| 445 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) /* CARIBBEANSND */ \ | |
| 446 | ROM_LOAD( "97000070.bin", 0x000000, 0x0f8526, CRC(27ba6768) SHA1(708e836f3fc35fabd0a5c8dc9cd8e9327d7bcdc7) ) \ | |
| 447 | ROM_REGION( 0x400000, "others1", ROMREGION_ERASE00 ) /* CARIBBEANSND (same data?) */ \ | |
| 448 | ROM_LOAD( "caribbeancashsnd1.bin", 0x000000, 0x080000, CRC(89da9fc4) SHA1(d56364e2e71d03d7d8888966b64ff1fab4bfc3e9) ) \ | |
| 449 | ROM_LOAD( "caribbeancashsnd2.bin", 0x080000, 0x080000, CRC(99d33f61) SHA1(7caf3b9540372900e90a7141f14383fe06936a2e) ) \ | |
| 450 | ROM_REGION( 0x400000, "others2", ROMREGION_ERASE00 ) /* CABC SOUNDS */ \ | |
| 451 | ROM_LOAD( "95008981.bin", 0x000000, 0x0ff245, CRC(3a888f98) SHA1(b113c17acda287200fdcd734a1b384879a5e7101) ) \ | |
| 428 | 452 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| 429 | 453 | ROM_LOAD( "95890474.bin", 0x0000, 0x5000, CRC(bcb54114) SHA1(0236171b34f3e47db9aa253f9605ff6bd21b1460) ) \ |
| 430 | 454 | ROM_LOAD( "95890475.bin", 0x0000, 0x5000, CRC(c9230520) SHA1(5cf9c3d130f114dac633d696e0bf1bda94afb9ee) ) \ |
| r14896 | r14897 | |
| 445 | 469 | |
| 446 | 470 | #define sc_clue_others \ |
| 447 | 471 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 448 | \ | |
| 472 | ROM_LOAD( "clue sounds", 0x0000, 0x100000, NO_DUMP ) \ | |
| 449 | 473 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| 450 | 474 | ROM_LOAD( "95890356.bin", 0x0000, 0x5000, CRC(fd78e03f) SHA1(029e2fd7e9cff3793d905d192c889873ad2a0d26) ) \ |
| 451 | 475 | ROM_LOAD( "95890357.bin", 0x0000, 0x5000, CRC(88eea40b) SHA1(5a730add3f9941dfcbfa5cd8f6a6142d19065482) ) \ |
| r14896 | r14897 | |
| 468 | 492 | ROM_LOAD( "95008681.bin", 0x0000, 0x100000, CRC(7a459110) SHA1(51f0a51af485a0f4e447ee0c22f488a924e45117) ) \ |
| 469 | 493 | |
| 470 | 494 | #define sc_cfqps_others \ |
| 471 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 495 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) /* PR6813 CRAZY FRUITS SOUNDS11 */ \ | |
| 472 | 496 | ROM_LOAD( "95004101.bin", 0x000000, 0x080000, CRC(31e5785a) SHA1(8da2bd3571640b0ae23e9fdcc2235dcf9d2de122) ) \ |
| 473 | 497 | ROM_LOAD( "95004102.bin", 0x080000, 0x080000, CRC(bf059b21) SHA1(89a96c593e5385e9b40f694768986691eed4b5c5) ) \ |
| 498 | ROM_REGION( 0x400000, "others", ROMREGION_ERASE00 ) /* PR6813 CRAZY FRUITS SOUNDS11 (same data?) */ \ | |
| 474 | 499 | ROM_LOAD( "95008339.bin", 0x000000, 0x100000, CRC(bae07fa8) SHA1(a86a5d9ff6ac802bd15275f46894374317627e23) ) \ |
| 475 | \ | |
| 476 | ROM_REGION( 0x400000, "others", ROMREGION_ERASE00 ) \ | |
| 477 | ROM_LOAD( "95420324.bin", 0x0000, 0x100000, CRC(41729e8f) SHA1(adb15067f61eb2e4adf537137dd24876749da8a2) ) \ | |
| 478 | 500 | |
| 479 | 501 | #define sc_czfr_others \ |
| 480 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 481 | /* 3 different sets of sound! */ \ | |
| 502 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) /* PR6813 CRAZY FRUITS SOUNDS11 */ \ | |
| 482 | 503 | ROM_LOAD( "crazy sound 1.bin", 0x000000, 0x080000, CRC(31e5785a) SHA1(8da2bd3571640b0ae23e9fdcc2235dcf9d2de122) ) \ |
| 483 | 504 | ROM_LOAD( "crazy sound 2.bin", 0x080000, 0x080000, CRC(bf059b21) SHA1(89a96c593e5385e9b40f694768986691eed4b5c5) ) \ |
| 484 | 505 | \ |
| 506 | ROM_REGION( 0x400000, "others", ROMREGION_ERASE00 ) \ | |
| 507 | ROM_LOAD( "oki_sound_rom--ccfsnd.bin", 0x0000, 0x02196a, CRC(15e542c2) SHA1(9bd9218b7392c882f68e330619bea7996afd001e) ) /* oki sound rom, doubt it belongs here */ \ | |
| 508 | ||
| 509 | #define SOUND_95004150_CRAZY_FRUITS_PR6982 \ | |
| 485 | 510 | ROM_LOAD( "95004150.bin", 0x000000, 0x080000, CRC(7707ea0d) SHA1(efe187a4c64a3a5f8d10e21c269afbb603186ae7) ) \ |
| 486 | 511 | ROM_LOAD( "95004151.bin", 0x080000, 0x080000, CRC(54845756) SHA1(e53dfa8f836044232ee1a8006051ef586ac24d8c) ) \ |
| 487 | \ | |
| 512 | ||
| 513 | #define PR1152_CRAZY_FRUITS_SOUNDS11 \ | |
| 514 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 488 | 515 | ROM_LOAD( "95004280.sn1", 0x000000, 0x080000, CRC(44d1b0d9) SHA1(2e361a1b65955acecbc26ba47000e4ef6316a22d) ) \ |
| 489 | 516 | ROM_LOAD( "95004281.sn2", 0x080000, 0x080000, CRC(31f057f3) SHA1(a6415eee8499ada43225901dee2d12c93d494658) ) \ |
| 490 | \ | |
| 491 | ROM_REGION( 0x400000, "others", ROMREGION_ERASE00 ) \ | |
| 492 | ROM_LOAD( "ccfsnd.bin", 0x0000, 0x02196a, CRC(15e542c2) SHA1(9bd9218b7392c882f68e330619bea7996afd001e) ) /* oki sound rom, doubt it belongs here */ \ | |
| 493 | 517 | |
| 518 | ||
| 494 | 519 | #define sc_crnjw_others \ |
| 495 | 520 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 496 | 521 | ROM_LOAD( "95008469.bin", 0x0000, 0x100000, CRC(07df5a41) SHA1(56dacba05e26258e50085f78dfe965196917addf) ) /* PR1608 CROWN JEWELS SOUNDS11 */ \ |
| 497 | \ | |
| 498 | ROM_LOAD( "95009176.bin", 0x000000, 0x100000, CRC(d1db2564) SHA1(641f94108df9dffde599012018d944e3848f50ed) ) /* PR000055 CJEWELS */ \ | |
| 522 | ||
| 523 | #define PR000055_CJEWELS \ | |
| 524 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 525 | ROM_LOAD( "95009176.bin", 0x000000, 0x100000, CRC(d1db2564) SHA1(641f94108df9dffde599012018d944e3848f50ed) ) \ | |
| 499 | 526 | ROM_LOAD( "95009177.bin", 0x100000, 0x100000, CRC(e574cc1c) SHA1(760284d60d336571495da921ff666ac5725d7c19) ) \ |
| 500 | 527 | |
| 501 | 528 | #define sc_cclim_others \ |
| r14896 | r14897 | |
| 617 | 644 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 618 | 645 | ROM_LOAD( "95008293.bin", 0x0000, 0x100000, CRC(acbed8e1) SHA1(607dafa2215632d02c34e65b79bf1341b981f63b) ) \ |
| 619 | 646 | |
| 620 | #define sc_dnd_others \ | |
| 647 | /* PR1954 */ | |
| 648 | ||
| 649 | #define PR1954_CASINO_DOND_R_SOUNDS11 \ | |
| 621 | 650 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 622 | /* Regular */ \ | |
| 623 | ROM_LOAD( "95008606.bin", 0x000000, 0x100000, CRC(c63c8663) SHA1(4718baf87340fe93ccfe642a1a0cdb9d9dcac57f) ) /* 0 (1907) DOND SOUNDS 11 */ \ | |
| 624 | ROM_LOAD( "95008607.bin", 0x100000, 0x100000, CRC(a615514f) SHA1(d4ff7d4fe6f1dd1d7b00cc504f90b2921aa5e8fb) ) /* 1 */ \ | |
| 625 | \ | |
| 626 | ROM_REGION( 0x400000, "others", ROMREGION_ERASE00 ) \ | |
| 627 | /* Casino */ \ | |
| 628 | ROM_LOAD( "95008631.bin", 0x000000, 0x100000, CRC(7208854a) SHA1(a02de60cfcbafe5da4f67596ab65237f5b5f41b7) ) /* 0 (1954) DOND SOUNDS 11 */ \ | |
| 629 | \ | |
| 630 | ROM_LOAD( "95008632.bin", 0x000000, 0x100000, CRC(fd81a317) SHA1(1e597fd58aab5a7a8321dc4daf138ee07b42c094) ) /* 0 (1945) DOND SOUNDS 11 */ \ | |
| 631 | ROM_LOAD( "95008633.bin", 0x100000, 0x100000, CRC(a7a445d4) SHA1(dbb1938c33ce654c2d4aa3b6af8c210f5aad2ae3) ) /* 1 */ \ | |
| 632 | \ | |
| 633 | /* Casino */ \ | |
| 634 | ROM_LOAD( "95008661.bin", 0x000000, 0x100000, CRC(2d9ebcd5) SHA1(d824a227420cbe616aca6e2fd279af691ddfd87a) ) /* 0 (1945) DOND SOUNDS 12 */ \ | |
| 635 | \ | |
| 636 | ROM_LOAD( "95008680.bin", 0x000000, 0x100000, CRC(9bd439d1) SHA1(5e71d04e5697e92998bae28f7352ea7742cafe07) ) /* 0 (1964) DOND SOUNDS 11 */ \ | |
| 637 | \ | |
| 638 | ROM_LOAD( "95008698.bin", 0x000000, 0x100000, CRC(8eea7754) SHA1(7612c128d6c062bba3477d55aee3089e1255f61e) ) /* 0 (1964) DOND SOUNDS 12 */ \ | |
| 651 | ROM_LOAD( "95008631.bin", 0x000000, 0x100000, CRC(7208854a) SHA1(a02de60cfcbafe5da4f67596ab65237f5b5f41b7) ) \ | |
| 639 | 652 | |
| 653 | /* PR1945 */ | |
| 640 | 654 | |
| 655 | #define PR1945_CASINO_DOND_R_SOUNDS12 \ | |
| 656 | ROM_LOAD( "95008661.bin", 0x000000, 0x100000, CRC(2d9ebcd5) SHA1(d824a227420cbe616aca6e2fd279af691ddfd87a) ) \ | |
| 657 | ||
| 658 | #define PR1945_CASINO_D_O_N_D_SOUNDS11 \ | |
| 659 | ROM_LOAD( "95008632.bin", 0x000000, 0x100000, CRC(fd81a317) SHA1(1e597fd58aab5a7a8321dc4daf138ee07b42c094) ) \ | |
| 660 | ROM_LOAD( "95008633.bin", 0x100000, 0x100000, CRC(a7a445d4) SHA1(dbb1938c33ce654c2d4aa3b6af8c210f5aad2ae3) ) \ | |
| 661 | ||
| 662 | /* PR1964 */ | |
| 663 | ||
| 664 | #define PR1964_CASINO_DOND_SOUNDS11 \ | |
| 665 | ROM_LOAD( "95008680.bin", 0x000000, 0x100000, CRC(9bd439d1) SHA1(5e71d04e5697e92998bae28f7352ea7742cafe07) ) \ | |
| 666 | ||
| 667 | #define PR1964_CASINO_DOND_SOUNDS12 \ | |
| 668 | ROM_LOAD( "95008698.bin", 0x000000, 0x100000, CRC(8eea7754) SHA1(7612c128d6c062bba3477d55aee3089e1255f61e) ) \ | |
| 669 | ||
| 670 | #define PR1964_DND \ | |
| 671 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 672 | PR1964_CASINO_DOND_SOUNDS11 \ | |
| 673 | PR1964_CASINO_DOND_SOUNDS12 \ | |
| 674 | ||
| 675 | /* PR1907 */ | |
| 676 | ||
| 677 | #define PR1907_DEAL_OR_NO_DEAL_SOUNDS11 \ | |
| 678 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 679 | ROM_LOAD( "95008606.bin", 0x000000, 0x100000, CRC(c63c8663) SHA1(4718baf87340fe93ccfe642a1a0cdb9d9dcac57f) ) \ | |
| 680 | ROM_LOAD( "95008607.bin", 0x100000, 0x100000, CRC(a615514f) SHA1(d4ff7d4fe6f1dd1d7b00cc504f90b2921aa5e8fb) ) \ | |
| 681 | ||
| 682 | ||
| 683 | ||
| 641 | 684 | #define sc_dndbb_others \ |
| 642 | 685 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 643 | 686 | ROM_LOAD( "95008788.bin", 0x000000, 0x100000, CRC(51384d64) SHA1(3af87bcc7fb4881ae671d9cbb484fb6a2a534cce) ) \ |
| r14896 | r14897 | |
| 648 | 691 | ROM_LOAD( "95009158.bin", 0x000000, 0x100000, CRC(27f11b81) SHA1(f2690c2828ad09d73cb14c5c1cb53c2ad1fc7b53) ) \ |
| 649 | 692 | ROM_LOAD( "95009159.bin", 0x100000, 0x100000, CRC(95e278c8) SHA1(7d85b6dbe3ccacd6c5a5b4eb475598a3d5548ce0) ) \ |
| 650 | 693 | |
| 651 | #define sc_dndbl_others \ | |
| 652 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ | |
| 653 | 694 | |
| 654 | 695 | #define sc_dndbq_others \ |
| 655 | 696 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| r14896 | r14897 | |
| 659 | 700 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 660 | 701 | ROM_LOAD( "95008887.bin", 0x0000, 0x100000, CRC(53cb9dc5) SHA1(66cdf8624736ea5a4e239bdb81fc96366ec4623e) ) \ |
| 661 | 702 | |
| 703 | #define PR3068_BEAT_THE_BANKER_SOUNDS11 \ | |
| 704 | ROM_LOAD( "95008713.bin", 0x000000, 0x100000, CRC(7311db5e) SHA1(24a4b3f44fa6dbbe756b0acac2b513c6e92cdf26) ) \ | |
| 705 | ROM_LOAD( "95008714.bin", 0x100000, 0x100000, CRC(c6ebc845) SHA1(6a135f42940b8c44422736650e369fa12b51e0df) ) \ | |
| 706 | ||
| 707 | ||
| 662 | 708 | #define sc_dndcl_others \ |
| 663 | 709 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 664 | /* club dond */ \ | |
| 665 | 710 | ROM_LOAD( "95008629.bin", 0x000000, 0x100000, CRC(6f7cf500) SHA1(bf3db728872251116b32aa2c44f72a87d29b13d2) ) \ |
| 666 | 711 | ROM_LOAD( "95008630.bin", 0x100000, 0x100000, CRC(5dfda41e) SHA1(6d61d0eedc6a1599777f47d3880689f954f326c9) ) \ |
| 667 | ROM_REGION( 0x400000, "others", ROMREGION_ERASE00 ) \ | |
| 668 | /* beat the banker */ \ | |
| 669 | ROM_LOAD( "95008713.bin", 0x000000, 0x100000, CRC(7311db5e) SHA1(24a4b3f44fa6dbbe756b0acac2b513c6e92cdf26) ) /* R3068? */ \ | |
| 670 | ROM_LOAD( "95008714.bin", 0x100000, 0x100000, CRC(c6ebc845) SHA1(6a135f42940b8c44422736650e369fa12b51e0df) ) \ | |
| 671 | 712 | |
| 672 | 713 | #define sc_dndcr_others \ |
| 673 | 714 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| r14896 | r14897 | |
| 801 | 842 | ROM_REGION( 0x400000, "others2", ROMREGION_ERASE00 ) /* PR3071 (alt checksum, extra sound??) */ \ |
| 802 | 843 | ROM_LOAD( "95008766.bin", 0x000000, 0x100000, CRC(62accb81) SHA1(ed0456cefed2fbf9a1cfd911f871262e892a4ce8) ) /* wiyb */ \ |
| 803 | 844 | ROM_REGION( 0x400000, "others3", ROMREGION_ERASE00 ) /* PR3084 (wrong game?) */ \ |
| 804 | ROM_LOAD( "95008767.bin", 0x000000, 0x100000, CRC(0aa49d8a) SHA1(a2baffc495656f0b5426b720cac298a78774b7fa) ) /* super slam?? */ \ | |
| 845 | ROM_LOAD( "95008767.bin", 0x000000, 0x100000, CRC(0aa49d8a) SHA1(a2baffc495656f0b5426b720cac298a78774b7fa) ) /* super slam?? */ \ | |
| 805 | 846 | |
| 806 | 847 | #define sc_dndpg_others \ |
| 807 | 848 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| r14896 | r14897 | |
| 1052 | 1093 | |
| 1053 | 1094 | #define sc_gd_others \ |
| 1054 | 1095 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1096 | /* PR1016 GOLD DIG SOUNDS11 */ \ | |
| 1055 | 1097 | ROM_LOAD( "95008187.bin", 0x000000, 0x100000, CRC(1fbbc7cc) SHA1(6e19b582a3654bbbcf65b8f42bd556029f43e8cb) ) \ |
| 1056 | 1098 | ROM_LOAD( "95008188.bin", 0x100000, 0x100000, CRC(a74b23a7) SHA1(f7948edfb5524eaf80039c07ca7a9f76883f5a6f) ) \ |
| 1099 | /* PR3509 GOLD DIGGER SOUNDS11 */ \ | |
| 1057 | 1100 | ROM_LOAD( "95009061.bin", 0x000000, 0x100000, CRC(c4cad720) SHA1(ce67af8d9e0b2f4f79d38b7a01dfc5ff7323e162) ) \ |
| 1058 | 1101 | ROM_LOAD( "95009062.bin", 0x100000, 0x100000, CRC(509761d3) SHA1(6a133cc33bac6a1696de98a4961572a86cefc1c8) ) \ |
| 1059 | 1102 | |
| r14896 | r14897 | |
| 1102 | 1145 | |
| 1103 | 1146 | #define sc_hapnt_others \ |
| 1104 | 1147 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1148 | /* PR1306 HAPPY NOTES SOUNDS11 */ \ | |
| 1105 | 1149 | ROM_LOAD( "95008290.bin", 0x000000, 0x100000, CRC(427fc43d) SHA1(c63154c7f2bb3e7ec78e31268a8040d0eb131f2f) ) \ |
| 1150 | /* PR1327 CAS_HAPPY_NOTES SOUNDS11 */ \ | |
| 1106 | 1151 | ROM_LOAD( "95008312.bin", 0x100000, 0x100000, CRC(cf33e14d) SHA1(33382be257a145784d9de7050b5c90f725241de4) ) \ |
| 1107 | 1152 | |
| 1108 | 1153 | #define sc_hfcl_others \ |
| r14896 | r14897 | |
| 1136 | 1181 | |
| 1137 | 1182 | #define sc_hotwd_others \ |
| 1138 | 1183 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1184 | /* PR1311 HOT WAD SOUNDS11 */ \ | |
| 1139 | 1185 | ROM_LOAD( "95008309.bin", 0x000000, 0x100000, CRC(8cd75778) SHA1(5d75c10b32477faa24c73ad03de75914385787f6) ) \ |
| 1140 | ROM_LOAD( "95008334.bin", 0x100000, 0x100000, CRC(0c334241) SHA1(3e5bde03330a5684a2a40fa94b33345039cd3755) ) \ | |
| 1186 | ROM_REGION( 0x400000, "others", ROMREGION_ERASE00 ) \ | |
| 1187 | /* PR1367 CRAZYSLOTS SOUNDS11 */ \ | |
| 1188 | ROM_LOAD( "95008334.bin", 0x000000, 0x100000, CRC(0c334241) SHA1(3e5bde03330a5684a2a40fa94b33345039cd3755) ) \ | |
| 1141 | 1189 | |
| 1142 | 1190 | #define sc_celeb_others \ |
| 1143 | 1191 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| r14896 | r14897 | |
| 1288 | 1336 | |
| 1289 | 1337 | #define sc_monsp_others \ |
| 1290 | 1338 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1339 | /* 95004291 MONEYSPINNER PR1158 */ \ | |
| 1291 | 1340 | ROM_LOAD( "95004291.snd", 0x000000, 0x080000, CRC(0ea304f7) SHA1(3d524e108cd12e83956fec3997316a92a9e0898d) ) \ |
| 1341 | /* PR1026 MONEY SPIN SOUNDS11 */ \ | |
| 1292 | 1342 | ROM_LOAD( "95008183.bin", 0x000000, 0x080000, CRC(ab29f841) SHA1(908603184c3f7ead278dabd224d60e5362cdafbe) ) \ |
| 1293 | 1343 | ROM_LOAD( "95008184.bin", 0x080000, 0x080000, CRC(45ef95ea) SHA1(1e1126b542621e723eaf6e38918162fe701247e0) ) \ |
| 1294 | 1344 | |
| 1295 | 1345 | #define sc_monop_others \ |
| 1296 | 1346 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1347 | /* MONO SOUNDS */ \ | |
| 1297 | 1348 | ROM_LOAD( "95008391.bin", 0x0000, 0x0ec7b3, CRC(fad36ca8) SHA1(67918353945429183befba56ab891a1d138f2e8b) ) \ |
| 1349 | /* MPDX SOUNDS */ \ | |
| 1298 | 1350 | ROM_LOAD( "95008514.bin", 0x0000, 0x0ed840, CRC(2608cbde) SHA1(4831570fbc825592781e6473173d6ec911a0054d) ) \ |
| 1299 | 1351 | |
| 1300 | 1352 | #define sc_mmm_others \ |
| r14896 | r14897 | |
| 1348 | 1400 | |
| 1349 | 1401 | #define sc_mcas_others \ |
| 1350 | 1402 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1403 | /* MONO SOUNDS */ \ | |
| 1351 | 1404 | ROM_LOAD( "95008436.bin", 0x0000, 0x0e6369, CRC(32e8df77) SHA1(fa044287970d4e54af53ff492eabc50afa9a7a92) ) \ |
| 1405 | /* MONO SOUNDS */ \ | |
| 1352 | 1406 | ROM_LOAD( "95008991.bin", 0x0000, 0x0ec7b3, CRC(fad36ca8) SHA1(67918353945429183befba56ab891a1d138f2e8b) ) \ |
| 1353 | 1407 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| 1354 | 1408 | ROM_LOAD( "95890727.bin", 0x0000, 0x5000, CRC(10ec3f00) SHA1(986bfce992e113bab26eea8d1981905a54367b94) ) \ |
| r14896 | r14897 | |
| 1361 | 1415 | ROM_LOAD( "95890713.bin", 0x0000, 0x5000, CRC(f0bb40b7) SHA1(33c19dab3086cdeae4f503fbf3f3cc5f0dad98c4) ) \ |
| 1362 | 1416 | ROM_LOAD( "95890714.bin", 0x0000, 0x5000, CRC(33e16227) SHA1(87efc1a046ef6af0b72cc76a6ee393a4d1ddbce3) ) \ |
| 1363 | 1417 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1418 | /* PR1706 WHEEL OF WEALTH SOUNDS11 */ \ | |
| 1364 | 1419 | ROM_LOAD( "95008550.bin", 0x000000, 0x100000, CRC(db6343bf) SHA1(e4d702020af67aa5be0560027706c1cbf34296fa) ) \ |
| 1420 | /* 95008551 STEPITS5 PR1666 */ \ | |
| 1365 | 1421 | ROM_LOAD( "95008551.bin", 0x100000, 0x100000, CRC(2d89a52a) SHA1(244101df7f6beae545f9b823750f908f532ac1e4) ) \ |
| 1422 | /* WOW SOUNDS */ \ | |
| 1366 | 1423 | ROM_LOAD( "95008850.bin", 0x000000, 0x0af41f, CRC(8ca16e09) SHA1(9b494ad6946c2c7bbfad6591e62fa699fd53b6dc) ) \ |
| 1424 | /* WOWT SOUNDS */ \ | |
| 1367 | 1425 | ROM_LOAD( "95008869.bin", 0x000000, 0x0b9d9d, CRC(f3ef3bbb) SHA1(92f9835e96c4fc444a451e97b2b8a7b66e5794b7) ) \ |
| 1368 | 1426 | |
| 1369 | 1427 | #define sc_nmare_others \ |
| 1370 | 1428 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1429 | /* PR3002 ELM STREET SOUNDS11 */ \ | |
| 1371 | 1430 | ROM_LOAD( "95008664.bin", 0x000000, 0x100000, CRC(54d245d7) SHA1(503db10681bc1d6cf1cffb2a6f818c5d912a7f56) ) \ |
| 1372 | 1431 | ROM_LOAD( "95008665.bin", 0x100000, 0x100000, CRC(79a00527) SHA1(b8207d3a81e97b2233fea1df883a4128388570e4) ) \ |
| 1432 | /* PR3002 ELM STREET SOUNDS11 (alt checksum..) */ \ | |
| 1373 | 1433 | ROM_LOAD( "95008703.bin", 0x000000, 0x100000, CRC(5c095089) SHA1(ffba71efccf4679c2b29ab620e67f3fa45ff19d4) ) \ |
| 1374 | 1434 | ROM_LOAD( "95008704.bin", 0x100000, 0x100000, CRC(61e5d6f4) SHA1(6d221e0b3dce7507253bb7f07d99d03025d813cb) ) \ |
| 1375 | 1435 | |
| r14896 | r14897 | |
| 1417 | 1477 | |
| 1418 | 1478 | #define sc_pp_others \ |
| 1419 | 1479 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1480 | /* PINK PANTHER SOUNDS */ \ | |
| 1420 | 1481 | ROM_LOAD( "95008942.bin", 0x0000, 0x0ebc96, CRC(42765fbc) SHA1(ab5b9240a8e71695897fd55a1385b64f63ce52c8) ) \ |
| 1482 | /* SD_PANTHER SNDS */ \ | |
| 1421 | 1483 | ROM_LOAD( "95008948.bin", 0x0000, 0x08b98b, CRC(35e995c5) SHA1(9d12a3002423e9434bcd76fe13f9fc0891354e40) ) \ |
| 1484 | /* PINKP SOUNDS */ \ | |
| 1422 | 1485 | ROM_LOAD( "95008953.bin", 0x0000, 0x0fabc8, CRC(12d96e7a) SHA1(4f5179b5817e471b891f377f0bec81dcb4a2077c) ) \ |
| 1423 | 1486 | \ |
| 1424 | 1487 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| r14896 | r14897 | |
| 1440 | 1503 | |
| 1441 | 1504 | #define sc_ppdym_others \ |
| 1442 | 1505 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1506 | /* DYMN SOUNDS */ \ | |
| 1443 | 1507 | ROM_LOAD( "95008984.bin", 0x0000, 0x0e6770, CRC(8257c559) SHA1(9088fd4d28ad9701767a2a255164e7201410c33a) ) \ |
| 1508 | /* DYMT SOUNDS */ \ | |
| 1444 | 1509 | ROM_LOAD( "95008989.bin", 0x0000, 0x0e6770, CRC(fb60e407) SHA1(50f7ed9d2106db2f1e746081d7ca768177e7680c) ) \ |
| 1445 | 1510 | ROM_REGION( 0x5000, "pics", 0 ) \ |
| 1446 | 1511 | ROM_LOAD( "95890483.bin", 0x0000, 0x5000, CRC(0ee68077) SHA1(163a46b16da238123cd542a62119dbaa726fca1b) ) \ |
| r14896 | r14897 | |
| 1506 | 1571 | |
| 1507 | 1572 | #define sc_rhx_others \ |
| 1508 | 1573 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1574 | /* REDX SOUNDS */ \ | |
| 1509 | 1575 | ROM_LOAD( "95008331.bin", 0x000000, 0x100000, CRC(b41748dd) SHA1(458409a4d2f6444af564ebe28d80e110fdb845b6) ) \ |
| 1576 | /* RHRL SOUNDS */ \ | |
| 1510 | 1577 | ROM_LOAD( "95008927.bin", 0x100000, 0x0f1c08, CRC(38fccc48) SHA1(9ef11b3fbe3bbd3c5b74cee2c35581f3e41cb372) ) \ |
| 1511 | 1578 | |
| 1512 | 1579 | #define sc_rhxcl_others \ |
| r14896 | r14897 | |
| 1751 | 1818 | |
| 1752 | 1819 | #define sc_wacky_others \ |
| 1753 | 1820 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1821 | /* PR3330 WACKY RACES SOUNDS11 */ \ | |
| 1754 | 1822 | ROM_LOAD( "95008834.bin", 0x000000, 0x100000, CRC(def73602) SHA1(681aafa4c035fdbb0f03e92fa56d31c13e27ca59) ) \ |
| 1755 | 1823 | ROM_LOAD( "95008835.bin", 0x100000, 0x100000, CRC(9a10ff4f) SHA1(903e43d9db726dc5ee92abaf23b61454611064b1) ) \ |
| 1824 | /* PR3330 WACKY RACES SOUNDS12 */ \ | |
| 1756 | 1825 | ROM_LOAD( "95009128.bin", 0x000000, 0x100000, CRC(d9883f0c) SHA1(3cfeb470248a9d5d6b653175c16f88c54d51fceb) ) \ |
| 1757 | 1826 | ROM_LOAD( "95009129.bin", 0x100000, 0x100000, CRC(969f418a) SHA1(ca65dfa23f9e6a516bc65baa8ddd80faa530af1f) ) \ |
| 1758 | 1827 | |
| r14896 | r14897 | |
| 1790 | 1859 | |
| 1791 | 1860 | #define sc_gball_pthers \ |
| 1792 | 1861 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1862 | /* PR1034 GOLDEN BALLS SOUNDS11 */ \ | |
| 1793 | 1863 | ROM_LOAD( "95008161.bin", 0x000000, 0x080000, CRC(ecd13fd9) SHA1(51d11b9133d4e840ce9afd7cf716520ea0fc0343) ) \ |
| 1794 | 1864 | ROM_LOAD( "95008162.bin", 0x080000, 0x080000, CRC(b4b4a5c5) SHA1(d0748decfaee7da52d2f6a4bc0877be4243ed6fb) ) \ |
| 1865 | /* PR1604 GOLDEN BALLS SOUNDS12 */ \ | |
| 1795 | 1866 | ROM_LOAD( "95008465.bin", 0x000000, 0x100000, CRC(5d1fa2c9) SHA1(c12de2b89f0bcb8f1b35630fffd205fd9d5b9777) ) \ |
| 1796 | 1867 | ROM_LOAD( "95008466.bin", 0x100000, 0x100000, CRC(418068ab) SHA1(342939e9bcc1d213bc2f52666cc3765442e18635) ) \ |
| 1797 | 1868 | |
| r14896 | r14897 | |
| 1826 | 1897 | |
| 1827 | 1898 | #define sc_hellb_others \ |
| 1828 | 1899 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) \ |
| 1900 | /* 95004211 HELLS BELLS PR6945 */ \ | |
| 1829 | 1901 | ROM_LOAD( "95004211.bin", 0x0000, 0x080000, CRC(2e729642) SHA1(c8dcdce52f930b3fa894c46907691a28a5499a16) ) \ |
| 1902 | /* PR1402 HELLS BELLS SOUNDS11 */ \ | |
| 1830 | 1903 | ROM_LOAD( "95008341.bin", 0x0000, 0x100000, CRC(486e5395) SHA1(0ad68f271f4839d50a790b7f4427e1f1f1933bd4) ) \ |
| 1831 | 1904 | |
| 1832 | 1905 | #define sc_leg_others \ |
| r14896 | r14897 | |
|---|---|---|
| 15 | 15 | UINT16 m_latch_data; |
| 16 | 16 | |
| 17 | 17 | UINT8 m_alpha_tile_bank; |
| 18 | DECLARE_READ16_MEMBER(batman_atarivc_r); | |
| 19 | DECLARE_WRITE16_MEMBER(batman_atarivc_w); | |
| 20 | DECLARE_READ16_MEMBER(special_port2_r); | |
| 21 | DECLARE_WRITE16_MEMBER(latch_w); | |
| 18 | 22 | }; |
| 19 | 23 | |
| 20 | 24 |
| r14896 | r14897 | |
|---|---|---|
| 120 | 120 | legacy_cpu_device* m_audiocpu; |
| 121 | 121 | |
| 122 | 122 | bitmap_rgb32 m_tmpbitmap; |
| 123 | DECLARE_READ8_MEMBER(stv_ioga_r); | |
| 124 | DECLARE_WRITE8_MEMBER(stv_ioga_w); | |
| 125 | DECLARE_READ8_MEMBER(critcrsh_ioga_r); | |
| 126 | DECLARE_READ8_MEMBER(magzun_ioga_r); | |
| 127 | DECLARE_WRITE8_MEMBER(magzun_ioga_w); | |
| 128 | DECLARE_READ8_MEMBER(stvmp_ioga_r); | |
| 129 | DECLARE_WRITE8_MEMBER(stvmp_ioga_w); | |
| 130 | DECLARE_READ32_MEMBER(stv_ioga_r32); | |
| 131 | DECLARE_WRITE32_MEMBER(stv_ioga_w32); | |
| 132 | DECLARE_READ32_MEMBER(critcrsh_ioga_r32); | |
| 133 | DECLARE_READ32_MEMBER(stvmp_ioga_r32); | |
| 134 | DECLARE_WRITE32_MEMBER(stvmp_ioga_w32); | |
| 135 | DECLARE_READ32_MEMBER(magzun_ioga_r32); | |
| 136 | DECLARE_WRITE32_MEMBER(magzun_ioga_w32); | |
| 137 | DECLARE_READ32_MEMBER(magzun_hef_hack_r); | |
| 138 | DECLARE_READ32_MEMBER(magzun_rx_hack_r); | |
| 139 | DECLARE_READ32_MEMBER(astrass_hack_r); | |
| 123 | 140 | }; |
| 124 | 141 | |
| 125 | 142 | #define MASTER_CLOCK_352 57272720 |
| r14896 | r14897 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | tilemap_t *m_bg_tilemap; |
| 16 | 16 | bitmap_ind16 m_temp_bitmap; |
| 17 | DECLARE_WRITE8_MEMBER(galaxia_video_w); | |
| 18 | DECLARE_WRITE8_MEMBER(galaxia_scroll_w); | |
| 19 | DECLARE_WRITE8_MEMBER(galaxia_ctrlport_w); | |
| 20 | DECLARE_WRITE8_MEMBER(galaxia_dataport_w); | |
| 21 | DECLARE_READ8_MEMBER(galaxia_collision_r); | |
| 22 | DECLARE_READ8_MEMBER(galaxia_collision_clear); | |
| 17 | 23 | }; |
| 18 | 24 | |
| 19 | 25 |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | DECLARE_WRITE8_MEMBER(coin_count_w); |
| 36 | 36 | DECLARE_WRITE8_MEMBER(unknown_w); |
| 37 | 37 | DECLARE_CUSTOM_INPUT_MEMBER(elim4_joint_coin_r); |
| 38 | DECLARE_WRITE8_MEMBER(elim1_sh_w); | |
| 39 | DECLARE_WRITE8_MEMBER(elim2_sh_w); | |
| 40 | DECLARE_WRITE8_MEMBER(zektor1_sh_w); | |
| 41 | DECLARE_WRITE8_MEMBER(zektor2_sh_w); | |
| 42 | DECLARE_WRITE8_MEMBER(spacfury1_sh_w); | |
| 43 | DECLARE_WRITE8_MEMBER(spacfury2_sh_w); | |
| 38 | 44 | }; |
| 39 | 45 | |
| 40 | 46 | |
| 41 | 47 | /*----------- defined in audio/segag80v.c -----------*/ |
| 42 | 48 | |
| 43 | WRITE8_HANDLER( elim1_sh_w ); | |
| 44 | WRITE8_HANDLER( elim2_sh_w ); | |
| 45 | WRITE8_HANDLER( spacfury1_sh_w ); | |
| 46 | WRITE8_HANDLER( spacfury2_sh_w ); | |
| 47 | WRITE8_HANDLER( zektor1_sh_w ); | |
| 48 | WRITE8_HANDLER( zektor2_sh_w ); | |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | /*----------- defined in video/segag80v.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | DECLARE_WRITE8_MEMBER(bosco_latch_w); |
| 38 | 38 | DECLARE_WRITE8_MEMBER(galaga_videoram_w); |
| 39 | 39 | DECLARE_WRITE8_MEMBER(gatsbee_bank_w); |
| 40 | DECLARE_CUSTOM_INPUT_MEMBER(shifted_port_r); | |
| 41 | 40 | }; |
| 42 | 41 | |
| 43 | 42 | class xevious_state : public galaga_state |
| r14896 | r14897 | |
| 92 | 91 | UINT8 m_tx_color_mode; |
| 93 | 92 | UINT8 m_bg_disable; |
| 94 | 93 | UINT8 m_bg_color_bank; |
| 94 | DECLARE_CUSTOM_INPUT_MEMBER(shifted_port_r); | |
| 95 | 95 | }; |
| 96 | 96 | |
| 97 | 97 |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | device_t *m_speaker; |
| 35 | 35 | DECLARE_CUSTOM_INPUT_MEMBER(sflush_80_r); |
| 36 | DECLARE_READ8_MEMBER(indianbt_r); | |
| 37 | DECLARE_WRITE8_MEMBER(steelwkr_sh_port_3_w); | |
| 38 | DECLARE_WRITE8_MEMBER(invadpt2_sh_port_1_w); | |
| 39 | DECLARE_WRITE8_MEMBER(invadpt2_sh_port_2_w); | |
| 40 | DECLARE_WRITE8_MEMBER(spcewars_sh_port_w); | |
| 41 | DECLARE_WRITE8_MEMBER(lrescue_sh_port_1_w); | |
| 42 | DECLARE_WRITE8_MEMBER(lrescue_sh_port_2_w); | |
| 43 | DECLARE_WRITE8_MEMBER(cosmo_sh_port_2_w); | |
| 44 | DECLARE_WRITE8_MEMBER(ballbomb_sh_port_1_w); | |
| 45 | DECLARE_WRITE8_MEMBER(ballbomb_sh_port_2_w); | |
| 46 | DECLARE_WRITE8_MEMBER(indianbt_sh_port_1_w); | |
| 47 | DECLARE_WRITE8_MEMBER(indianbt_sh_port_2_w); | |
| 48 | DECLARE_WRITE8_MEMBER(schaser_sh_port_1_w); | |
| 49 | DECLARE_WRITE8_MEMBER(schaser_sh_port_2_w); | |
| 50 | DECLARE_WRITE8_MEMBER(rollingc_sh_port_w); | |
| 51 | DECLARE_WRITE8_MEMBER(invrvnge_sh_port_w); | |
| 52 | DECLARE_WRITE8_MEMBER(lupin3_sh_port_1_w); | |
| 53 | DECLARE_WRITE8_MEMBER(lupin3_sh_port_2_w); | |
| 54 | DECLARE_WRITE8_MEMBER(schasercv_sh_port_1_w); | |
| 55 | DECLARE_WRITE8_MEMBER(schasercv_sh_port_2_w); | |
| 56 | DECLARE_WRITE8_MEMBER(yosakdon_sh_port_1_w); | |
| 57 | DECLARE_WRITE8_MEMBER(yosakdon_sh_port_2_w); | |
| 58 | DECLARE_WRITE8_MEMBER(shuttlei_sh_port_1_w); | |
| 59 | DECLARE_WRITE8_MEMBER(shuttlei_sh_port_2_w); | |
| 36 | 60 | }; |
| 37 | 61 | |
| 38 | 62 | |
| r14896 | r14897 | |
| 40 | 64 | |
| 41 | 65 | MACHINE_START( extra_8080bw_sh ); |
| 42 | 66 | |
| 43 | WRITE8_HANDLER( invadpt2_sh_port_1_w ); | |
| 44 | WRITE8_HANDLER( invadpt2_sh_port_2_w ); | |
| 45 | 67 | |
| 46 | WRITE8_HANDLER( spcewars_sh_port_w ); | |
| 47 | 68 | |
| 48 | WRITE8_HANDLER( lrescue_sh_port_1_w ); | |
| 49 | WRITE8_HANDLER( lrescue_sh_port_2_w ); | |
| 50 | 69 | extern const samples_interface lrescue_samples_interface; |
| 51 | 70 | |
| 52 | WRITE8_HANDLER( cosmo_sh_port_2_w ); | |
| 53 | 71 | |
| 54 | WRITE8_HANDLER( ballbomb_sh_port_1_w ); | |
| 55 | WRITE8_HANDLER( ballbomb_sh_port_2_w ); | |
| 56 | 72 | |
| 57 | WRITE8_HANDLER( indianbt_sh_port_1_w ); | |
| 58 | WRITE8_HANDLER( indianbt_sh_port_2_w ); | |
| 59 | 73 | WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w ); |
| 60 | 74 | DISCRETE_SOUND_EXTERN( indianbt ); |
| 61 | 75 | |
| r14896 | r14897 | |
| 66 | 80 | |
| 67 | 81 | MACHINE_RESET( schaser_sh ); |
| 68 | 82 | MACHINE_START( schaser_sh ); |
| 69 | WRITE8_HANDLER( schaser_sh_port_1_w ); | |
| 70 | WRITE8_HANDLER( schaser_sh_port_2_w ); | |
| 71 | 83 | extern const sn76477_interface schaser_sn76477_interface; |
| 72 | 84 | DISCRETE_SOUND_EXTERN( schaser ); |
| 73 | 85 | |
| 74 | WRITE8_HANDLER( rollingc_sh_port_w ); | |
| 75 | 86 | |
| 76 | WRITE8_HANDLER( invrvnge_sh_port_w ); | |
| 77 | 87 | |
| 78 | WRITE8_HANDLER( lupin3_sh_port_1_w ); | |
| 79 | WRITE8_HANDLER( lupin3_sh_port_2_w ); | |
| 80 | 88 | |
| 81 | WRITE8_HANDLER( schasercv_sh_port_1_w ); | |
| 82 | WRITE8_HANDLER( schasercv_sh_port_2_w ); | |
| 83 | 89 | |
| 84 | WRITE8_HANDLER( yosakdon_sh_port_1_w ); | |
| 85 | WRITE8_HANDLER( yosakdon_sh_port_2_w ); | |
| 86 | 90 | |
| 87 | WRITE8_HANDLER( shuttlei_sh_port_1_w ); | |
| 88 | WRITE8_HANDLER( shuttlei_sh_port_2_w ); | |
| 89 | 91 | |
| 90 | 92 | |
| 91 | 93 | /*----------- defined in video/8080bw.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | UINT8 m_effectcontrol; |
| 17 | 17 | UINT8 m_page; |
| 18 | 18 | UINT8 m_io_page; |
| 19 | DECLARE_WRITE8_MEMBER(video_page_select_w); | |
| 20 | DECLARE_WRITE8_MEMBER(io_page_select_w); | |
| 21 | DECLARE_WRITE8_MEMBER(quasar_video_w); | |
| 22 | DECLARE_READ8_MEMBER(quasar_IO_r); | |
| 23 | DECLARE_WRITE8_MEMBER(quasar_bullet_w); | |
| 24 | DECLARE_WRITE8_MEMBER(quasar_sh_command_w); | |
| 25 | DECLARE_READ8_MEMBER(quasar_sh_command_r); | |
| 26 | DECLARE_READ8_MEMBER(audio_t1_r); | |
| 19 | 27 | }; |
| 20 | 28 | |
| 21 | 29 |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | DECLARE_WRITE16_MEMBER(buggyboy_gas_w); |
| 141 | 141 | DECLARE_WRITE16_MEMBER(buggyboy_sky_w); |
| 142 | 142 | DECLARE_WRITE16_MEMBER(buggyboy_scolst_w); |
| 143 | DECLARE_WRITE16_MEMBER(z80_busreq_w); | |
| 144 | DECLARE_WRITE16_MEMBER(resume_math_w); | |
| 145 | DECLARE_WRITE16_MEMBER(halt_math_w); | |
| 146 | DECLARE_WRITE8_MEMBER(z80_intreq_w); | |
| 147 | DECLARE_READ16_MEMBER(z80_shared_r); | |
| 148 | DECLARE_WRITE16_MEMBER(z80_shared_w); | |
| 149 | DECLARE_READ16_MEMBER(dipswitches_r); | |
| 150 | DECLARE_WRITE8_MEMBER(ts_w); | |
| 151 | DECLARE_READ8_MEMBER(ts_r); | |
| 152 | DECLARE_WRITE8_MEMBER(tx1_ppi_latch_w); | |
| 153 | DECLARE_READ8_MEMBER(bb_analog_r); | |
| 154 | DECLARE_READ8_MEMBER(bbjr_analog_r); | |
| 143 | 155 | }; |
| 144 | 156 | |
| 145 | 157 |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | 14 | |
| 15 | 15 | UINT16 * m_priorityram; |
| 16 | DECLARE_WRITE16_MEMBER(blstroid_halt_until_hblank_0_w); | |
| 17 | DECLARE_READ16_MEMBER(inputs_r); | |
| 16 | 18 | }; |
| 17 | 19 | |
| 18 | 20 |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | DECLARE_WRITE8_MEMBER(gotya_videoram_w); |
| 26 | 26 | DECLARE_WRITE8_MEMBER(gotya_colorram_w); |
| 27 | 27 | DECLARE_WRITE8_MEMBER(gotya_video_control_w); |
| 28 | DECLARE_WRITE8_MEMBER(gotya_soundlatch_w); | |
| 28 | 29 | }; |
| 29 | 30 | |
| 30 | 31 | |
| 31 | 32 | /*----------- defined in audio/gotya.c -----------*/ |
| 32 | 33 | |
| 33 | WRITE8_HANDLER( gotya_soundlatch_w ); | |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | /*----------- defined in video/gotya.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | DECLARE_READ16_MEMBER(nvram_r); |
| 20 | 20 | DECLARE_READ16_MEMBER(joystick_r); |
| 21 | 21 | DECLARE_WRITE16_MEMBER(aztarac_ubr_w); |
| 22 | DECLARE_READ16_MEMBER(aztarac_sound_r); | |
| 23 | DECLARE_WRITE16_MEMBER(aztarac_sound_w); | |
| 24 | DECLARE_READ8_MEMBER(aztarac_snd_command_r); | |
| 25 | DECLARE_READ8_MEMBER(aztarac_snd_status_r); | |
| 26 | DECLARE_WRITE8_MEMBER(aztarac_snd_status_w); | |
| 22 | 27 | }; |
| 23 | 28 | |
| 24 | 29 | /*----------- defined in audio/aztarac.c -----------*/ |
| 25 | 30 | |
| 26 | READ16_HANDLER( aztarac_sound_r ); | |
| 27 | WRITE16_HANDLER( aztarac_sound_w ); | |
| 28 | 31 | |
| 29 | READ8_HANDLER( aztarac_snd_command_r ); | |
| 30 | READ8_HANDLER( aztarac_snd_status_r ); | |
| 31 | WRITE8_HANDLER( aztarac_snd_status_w ); | |
| 32 | 32 | |
| 33 | 33 | INTERRUPT_GEN( aztarac_snd_timed_irq ); |
| 34 | 34 |
| r14896 | r14897 | |
|---|---|---|
| 168 | 168 | |
| 169 | 169 | INT8 m_gfx_finescroll; |
| 170 | 170 | UINT8 m_gfx_palettebank; |
| 171 | DECLARE_READ16_MEMBER(steeltal_dummy_r); | |
| 172 | DECLARE_READ16_MEMBER(hd68k_snd_data_r); | |
| 173 | DECLARE_READ16_MEMBER(hd68k_snd_status_r); | |
| 174 | DECLARE_WRITE16_MEMBER(hd68k_snd_data_w); | |
| 175 | DECLARE_WRITE16_MEMBER(hd68k_snd_reset_w); | |
| 176 | DECLARE_READ16_MEMBER(hdsnd68k_data_r); | |
| 177 | DECLARE_WRITE16_MEMBER(hdsnd68k_data_w); | |
| 178 | DECLARE_READ16_MEMBER(hdsnd68k_switches_r); | |
| 179 | DECLARE_READ16_MEMBER(hdsnd68k_320port_r); | |
| 180 | DECLARE_READ16_MEMBER(hdsnd68k_status_r); | |
| 181 | DECLARE_WRITE16_MEMBER(hdsnd68k_latches_w); | |
| 182 | DECLARE_WRITE16_MEMBER(hdsnd68k_speech_w); | |
| 183 | DECLARE_WRITE16_MEMBER(hdsnd68k_irqclr_w); | |
| 184 | DECLARE_READ16_MEMBER(hdsnd68k_320ram_r); | |
| 185 | DECLARE_WRITE16_MEMBER(hdsnd68k_320ram_w); | |
| 186 | DECLARE_READ16_MEMBER(hdsnd68k_320ports_r); | |
| 187 | DECLARE_WRITE16_MEMBER(hdsnd68k_320ports_w); | |
| 188 | DECLARE_READ16_MEMBER(hdsnd68k_320com_r); | |
| 189 | DECLARE_WRITE16_MEMBER(hdsnd68k_320com_w); | |
| 190 | DECLARE_READ16_MEMBER(hdsnddsp_get_bio); | |
| 191 | DECLARE_WRITE16_MEMBER(hdsnddsp_comport_w); | |
| 192 | DECLARE_WRITE16_MEMBER(hdsnddsp_mute_w); | |
| 193 | DECLARE_WRITE16_MEMBER(hdsnddsp_gen68kirq_w); | |
| 194 | DECLARE_WRITE16_MEMBER(hdsnddsp_soundaddr_w); | |
| 195 | DECLARE_READ16_MEMBER(hdsnddsp_rom_r); | |
| 196 | DECLARE_READ16_MEMBER(hdsnddsp_comram_r); | |
| 197 | DECLARE_READ16_MEMBER(hdsnddsp_compare_r); | |
| 171 | 198 | }; |
| 172 | 199 | |
| 173 | 200 | |
| r14896 | r14897 | |
| 296 | 323 | |
| 297 | 324 | void hdsnd_init(running_machine &machine); |
| 298 | 325 | |
| 299 | READ16_HANDLER( hd68k_snd_data_r ); | |
| 300 | READ16_HANDLER( hd68k_snd_status_r ); | |
| 301 | WRITE16_HANDLER( hd68k_snd_data_w ); | |
| 302 | WRITE16_HANDLER( hd68k_snd_reset_w ); | |
| 303 | 326 | |
| 304 | READ16_HANDLER( hdsnd68k_data_r ); | |
| 305 | WRITE16_HANDLER( hdsnd68k_data_w ); | |
| 306 | 327 | |
| 307 | READ16_HANDLER( hdsnd68k_switches_r ); | |
| 308 | READ16_HANDLER( hdsnd68k_320port_r ); | |
| 309 | READ16_HANDLER( hdsnd68k_status_r ); | |
| 310 | 328 | |
| 311 | WRITE16_HANDLER( hdsnd68k_latches_w ); | |
| 312 | WRITE16_HANDLER( hdsnd68k_speech_w ); | |
| 313 | WRITE16_HANDLER( hdsnd68k_irqclr_w ); | |
| 314 | 329 | |
| 315 | READ16_HANDLER( hdsnd68k_320ram_r ); | |
| 316 | WRITE16_HANDLER( hdsnd68k_320ram_w ); | |
| 317 | READ16_HANDLER( hdsnd68k_320ports_r ); | |
| 318 | WRITE16_HANDLER( hdsnd68k_320ports_w ); | |
| 319 | READ16_HANDLER( hdsnd68k_320com_r ); | |
| 320 | WRITE16_HANDLER( hdsnd68k_320com_w ); | |
| 321 | 330 | |
| 322 | READ16_HANDLER( hdsnddsp_get_bio ); | |
| 323 | 331 | |
| 324 | 332 | WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w ); |
| 325 | WRITE16_HANDLER( hdsnddsp_comport_w ); | |
| 326 | WRITE16_HANDLER( hdsnddsp_mute_w ); | |
| 327 | WRITE16_HANDLER( hdsnddsp_gen68kirq_w ); | |
| 328 | WRITE16_HANDLER( hdsnddsp_soundaddr_w ); | |
| 329 | 333 | |
| 330 | READ16_HANDLER( hdsnddsp_rom_r ); | |
| 331 | READ16_HANDLER( hdsnddsp_comram_r ); | |
| 332 | READ16_HANDLER( hdsnddsp_compare_r ); | |
| 333 | 334 | |
| 334 | 335 | |
| 335 | 336 | /*----------- defined in video/harddriv.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 29 | 29 | UINT16 m_playfield_yscroll; |
| 30 | 30 | |
| 31 | 31 | device_t * m_rle; |
| 32 | DECLARE_WRITE16_MEMBER(mo_control_w); | |
| 33 | DECLARE_WRITE16_MEMBER(mo_command_w); | |
| 34 | DECLARE_READ16_MEMBER(special_port0_r); | |
| 35 | DECLARE_WRITE16_MEMBER(a2d_select_w); | |
| 36 | DECLARE_READ16_MEMBER(a2d_data_r); | |
| 37 | DECLARE_READ16_MEMBER(pitfightb_cheap_slapstic_r); | |
| 38 | void update_bank(int bank); | |
| 32 | 39 | }; |
| 33 | 40 | |
| 34 | 41 | |
| 35 | 42 | /*----------- defined in video/atarig1.c -----------*/ |
| 36 | 43 | |
| 37 | WRITE16_HANDLER( atarig1_mo_control_w ); | |
| 38 | 44 | |
| 39 | 45 | VIDEO_START( atarig1 ); |
| 40 | 46 | SCREEN_VBLANK( atarig1 ); |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | double m_brightness; |
| 18 | 18 | bitmap_ind16 m_pfbitmap; |
| 19 | DECLARE_WRITE16_MEMBER(interrupt_scan_w); | |
| 20 | DECLARE_READ16_MEMBER(special_port1_r); | |
| 19 | 21 | }; |
| 20 | 22 | |
| 21 | 23 |
| r14896 | r14897 | |
|---|---|---|
| 10 | 10 | attotime period; |
| 11 | 11 | }; |
| 12 | 12 | |
| 13 | class mcr68_state : public | |
| 13 | class mcr68_state : public mcr | |
| 14 | 14 | { |
| 15 | 15 | public: |
| 16 | 16 | mcr68_state(const machine_config &mconfig, device_type type, const char *tag) |
| 17 | : | |
| 17 | : mcr | |
| 18 | 18 | |
| 19 | 19 | UINT16 *m_videoram; |
| 20 | 20 | UINT16 m_control_word; |
| r14896 | r14897 | |
|---|---|---|
| 23 | 23 | DECLARE_WRITE8_MEMBER(gsword_charbank_w); |
| 24 | 24 | DECLARE_WRITE8_MEMBER(gsword_videoctrl_w); |
| 25 | 25 | DECLARE_WRITE8_MEMBER(gsword_scroll_w); |
| 26 | DECLARE_READ8_MEMBER(gsword_hack_r); | |
| 27 | DECLARE_WRITE8_MEMBER(adpcm_soundcommand_w); | |
| 26 | 28 | }; |
| 27 | 29 | |
| 28 | 30 |
| r14896 | r14897 | |
|---|---|---|
| 66 | 66 | DECLARE_WRITE8_MEMBER(mario_palettebank_w); |
| 67 | 67 | DECLARE_WRITE8_MEMBER(mario_scroll_w); |
| 68 | 68 | DECLARE_WRITE8_MEMBER(mario_flip_w); |
| 69 | DECLARE_READ8_MEMBER(mario_sh_p1_r); | |
| 70 | DECLARE_READ8_MEMBER(mario_sh_p2_r); | |
| 71 | DECLARE_READ8_MEMBER(mario_sh_t0_r); | |
| 72 | DECLARE_READ8_MEMBER(mario_sh_t1_r); | |
| 73 | DECLARE_READ8_MEMBER(mario_sh_tune_r); | |
| 74 | DECLARE_WRITE8_MEMBER(mario_sh_p1_w); | |
| 75 | DECLARE_WRITE8_MEMBER(mario_sh_p2_w); | |
| 76 | DECLARE_WRITE8_MEMBER(masao_sh_irqtrigger_w); | |
| 77 | DECLARE_WRITE8_MEMBER(mario_sh_tuneselect_w); | |
| 78 | DECLARE_WRITE8_MEMBER(mario_sh3_w); | |
| 69 | 79 | }; |
| 70 | 80 | |
| 71 | 81 | /*----------- defined in video/mario.c -----------*/ |
| r14896 | r14897 | |
| 80 | 90 | |
| 81 | 91 | WRITE8_DEVICE_HANDLER( mario_sh1_w ); |
| 82 | 92 | WRITE8_DEVICE_HANDLER( mario_sh2_w ); |
| 83 | WRITE8_HANDLER( mario_sh3_w ); | |
| 84 | 93 | |
| 85 | WRITE8_HANDLER( mario_sh_tuneselect_w ); | |
| 86 | WRITE8_HANDLER( masao_sh_irqtrigger_w ); | |
| 87 | 94 | |
| 88 | 95 | MACHINE_CONFIG_EXTERN( mario_audio ); |
| 89 | 96 | MACHINE_CONFIG_EXTERN( masao_audio ); |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | void (*m_input_hack)(running_machine &machine); |
| 27 | 27 | int m_oldstate[2]; |
| 28 | 28 | DECLARE_CUSTOM_INPUT_MEMBER(cubo_input); |
| 29 | DECLARE_WRITE32_MEMBER(aga_overlay_w); | |
| 29 | 30 | }; |
| 30 | 31 | |
| 31 | 32 | /*----------- defined in machine/cd32.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 100 | 100 | DECLARE_WRITE32_MEMBER(micro3d_alt_fifo_w); |
| 101 | 101 | DECLARE_READ32_MEMBER(micro3d_pipe_r); |
| 102 | 102 | DECLARE_CUSTOM_INPUT_MEMBER(botssa_hwchk_r); |
| 103 | DECLARE_WRITE8_MEMBER(micro3d_snd_dac_a); | |
| 104 | DECLARE_WRITE8_MEMBER(micro3d_snd_dac_b); | |
| 105 | DECLARE_WRITE8_MEMBER(micro3d_sound_io_w); | |
| 106 | DECLARE_READ8_MEMBER(micro3d_sound_io_r); | |
| 103 | 107 | }; |
| 104 | 108 | |
| 105 | 109 | typedef struct _micro3d_vtx_ |
| r14896 | r14897 | |
| 129 | 133 | /*----------- defined in audio/micro3d.c -----------*/ |
| 130 | 134 | |
| 131 | 135 | WRITE8_DEVICE_HANDLER( micro3d_upd7759_w ); |
| 132 | WRITE8_HANDLER( micro3d_snd_dac_a ); | |
| 133 | WRITE8_HANDLER( micro3d_snd_dac_b ); | |
| 134 | READ8_HANDLER( micro3d_sound_io_r ); | |
| 135 | WRITE8_HANDLER( micro3d_sound_io_w ); | |
| 136 | 136 | |
| 137 | 137 | void micro3d_noise_sh_w(running_machine &machine, UINT8 data); |
| 138 | 138 |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | UINT8 m_sound_data_from_6502; |
| 27 | 27 | UINT8 m_sound_data_from_68k_ready; |
| 28 | 28 | UINT8 m_sound_data_from_6502_ready; |
| 29 | DECLARE_READ16_MEMBER(special_port0_r); | |
| 30 | DECLARE_READ16_MEMBER(special_port2_r); | |
| 31 | DECLARE_READ16_MEMBER(sound_state_r); | |
| 32 | DECLARE_WRITE16_MEMBER(p2_reset_w); | |
| 33 | DECLARE_READ8_MEMBER(cyberbal_special_port3_r); | |
| 34 | DECLARE_READ8_MEMBER(cyberbal_sound_6502_stat_r); | |
| 35 | DECLARE_WRITE8_MEMBER(cyberbal_sound_bank_select_w); | |
| 36 | DECLARE_READ8_MEMBER(cyberbal_sound_68k_6502_r); | |
| 37 | DECLARE_WRITE8_MEMBER(cyberbal_sound_68k_6502_w); | |
| 38 | DECLARE_WRITE16_MEMBER(cyberbal_io_68k_irq_ack_w); | |
| 39 | DECLARE_READ16_MEMBER(cyberbal_sound_68k_r); | |
| 40 | DECLARE_WRITE16_MEMBER(cyberbal_sound_68k_w); | |
| 41 | DECLARE_WRITE16_MEMBER(cyberbal_sound_68k_dac_w); | |
| 29 | 42 | }; |
| 30 | 43 | |
| 31 | 44 | |
| r14896 | r14897 | |
| 36 | 49 | |
| 37 | 50 | INTERRUPT_GEN( cyberbal_sound_68k_irq_gen ); |
| 38 | 51 | |
| 39 | READ8_HANDLER( cyberbal_special_port3_r ); | |
| 40 | READ8_HANDLER( cyberbal_sound_6502_stat_r ); | |
| 41 | READ8_HANDLER( cyberbal_sound_68k_6502_r ); | |
| 42 | WRITE8_HANDLER( cyberbal_sound_bank_select_w ); | |
| 43 | WRITE8_HANDLER( cyberbal_sound_68k_6502_w ); | |
| 44 | 52 | |
| 45 | READ16_HANDLER( cyberbal_sound_68k_r ); | |
| 46 | WRITE16_HANDLER( cyberbal_io_68k_irq_ack_w ); | |
| 47 | WRITE16_HANDLER( cyberbal_sound_68k_w ); | |
| 48 | WRITE16_HANDLER( cyberbal_sound_68k_dac_w ); | |
| 49 | 53 | |
| 50 | 54 | |
| 51 | 55 | /*----------- defined in video/cyberbal.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 84 | 84 | DECLARE_WRITE16_MEMBER(lockon_obj_4000_w); |
| 85 | 85 | DECLARE_WRITE16_MEMBER(lockon_fb_clut_w); |
| 86 | 86 | DECLARE_WRITE16_MEMBER(lockon_rotate_w); |
| 87 | DECLARE_WRITE16_MEMBER(adrst_w); | |
| 88 | DECLARE_READ16_MEMBER(main_gnd_r); | |
| 89 | DECLARE_WRITE16_MEMBER(main_gnd_w); | |
| 90 | DECLARE_READ16_MEMBER(main_obj_r); | |
| 91 | DECLARE_WRITE16_MEMBER(main_obj_w); | |
| 92 | DECLARE_WRITE16_MEMBER(tst_w); | |
| 93 | DECLARE_READ16_MEMBER(main_z80_r); | |
| 94 | DECLARE_WRITE16_MEMBER(main_z80_w); | |
| 95 | DECLARE_WRITE16_MEMBER(inten_w); | |
| 96 | DECLARE_WRITE16_MEMBER(emres_w); | |
| 97 | DECLARE_READ8_MEMBER(adc_r); | |
| 98 | DECLARE_WRITE8_MEMBER(sound_vol); | |
| 87 | 99 | }; |
| 88 | 100 | |
| 89 | 101 |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | UINT8 m_sound_dummy_value; |
| 28 | 28 | UINT16 m_sound_bank; |
| 29 | 29 | UINT8 m_misc_io_data[2][0x10]; |
| 30 | read16_space_func m_custom_io_r[2]; | |
| 31 | write16_space_func m_custom_io_w[2]; | |
| 30 | read16_delegate m_custom_io_r[2]; | |
| 31 | write16_delegate m_custom_io_w[2]; | |
| 32 | 32 | UINT8 m_analog_bank; |
| 33 | 33 | UINT8 m_analog_value[4]; |
| 34 | 34 | UINT8 m_sonic_last[6]; |
| r14896 | r14897 | |
| 96 | 96 | DECLARE_WRITE16_MEMBER(system32_mixer_w); |
| 97 | 97 | DECLARE_WRITE32_MEMBER(multi32_mixer_0_w); |
| 98 | 98 | DECLARE_WRITE32_MEMBER(multi32_mixer_1_w); |
| 99 | DECLARE_READ16_MEMBER(interrupt_control_16_r); | |
| 100 | DECLARE_WRITE16_MEMBER(interrupt_control_16_w); | |
| 101 | DECLARE_READ32_MEMBER(interrupt_control_32_r); | |
| 102 | DECLARE_WRITE32_MEMBER(interrupt_control_32_w); | |
| 103 | DECLARE_READ16_MEMBER(io_chip_r); | |
| 104 | DECLARE_WRITE16_MEMBER(io_chip_w); | |
| 105 | DECLARE_READ32_MEMBER(io_chip_0_r); | |
| 106 | DECLARE_WRITE32_MEMBER(io_chip_0_w); | |
| 107 | DECLARE_READ32_MEMBER(io_chip_1_r); | |
| 108 | DECLARE_WRITE32_MEMBER(io_chip_1_w); | |
| 109 | DECLARE_READ16_MEMBER(io_expansion_r); | |
| 110 | DECLARE_WRITE16_MEMBER(io_expansion_w); | |
| 111 | DECLARE_READ32_MEMBER(io_expansion_0_r); | |
| 112 | DECLARE_WRITE32_MEMBER(io_expansion_0_w); | |
| 113 | DECLARE_READ32_MEMBER(io_expansion_1_r); | |
| 114 | DECLARE_WRITE32_MEMBER(io_expansion_1_w); | |
| 115 | DECLARE_READ16_MEMBER(analog_custom_io_r); | |
| 116 | DECLARE_WRITE16_MEMBER(analog_custom_io_w); | |
| 117 | DECLARE_READ16_MEMBER(extra_custom_io_r); | |
| 118 | DECLARE_WRITE16_MEMBER(orunners_custom_io_w); | |
| 119 | DECLARE_READ16_MEMBER(sonic_custom_io_r); | |
| 120 | DECLARE_WRITE16_MEMBER(sonic_custom_io_w); | |
| 121 | DECLARE_WRITE16_MEMBER(random_number_16_w); | |
| 122 | DECLARE_READ16_MEMBER(random_number_16_r); | |
| 123 | DECLARE_WRITE32_MEMBER(random_number_32_w); | |
| 124 | DECLARE_READ32_MEMBER(random_number_32_r); | |
| 125 | DECLARE_READ16_MEMBER(shared_ram_16_r); | |
| 126 | DECLARE_WRITE16_MEMBER(shared_ram_16_w); | |
| 127 | DECLARE_READ32_MEMBER(shared_ram_32_r); | |
| 128 | DECLARE_WRITE32_MEMBER(shared_ram_32_w); | |
| 129 | DECLARE_WRITE8_MEMBER(sound_int_control_lo_w); | |
| 130 | DECLARE_WRITE8_MEMBER(sound_int_control_hi_w); | |
| 131 | DECLARE_WRITE8_MEMBER(sound_bank_lo_w); | |
| 132 | DECLARE_WRITE8_MEMBER(sound_bank_hi_w); | |
| 133 | DECLARE_READ8_MEMBER(sound_dummy_r); | |
| 134 | DECLARE_WRITE8_MEMBER(sound_dummy_w); | |
| 135 | DECLARE_WRITE16_MEMBER(dual_pcb_comms_w); | |
| 136 | DECLARE_READ16_MEMBER(dual_pcb_comms_r); | |
| 137 | DECLARE_READ16_MEMBER(dual_pcb_masterslave); | |
| 138 | DECLARE_READ16_MEMBER(arescue_handshake_r); | |
| 139 | DECLARE_READ16_MEMBER(arescue_slavebusy_r); | |
| 140 | DECLARE_WRITE16_MEMBER(f1en_comms_echo_w); | |
| 99 | 141 | }; |
| 100 | 142 | |
| 101 | 143 |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | UINT8 * m_bank_source_data; |
| 19 | 19 | |
| 20 | 20 | UINT8 m_playfield_tile_bank; |
| 21 | DECLARE_READ16_MEMBER(sound_busy_r); | |
| 22 | DECLARE_READ16_MEMBER(pedal_0_r); | |
| 23 | DECLARE_READ16_MEMBER(pedal_1_r); | |
| 24 | DECLARE_READ8_MEMBER(audio_io_r); | |
| 25 | DECLARE_WRITE8_MEMBER(audio_io_w); | |
| 26 | DECLARE_READ16_MEMBER(badlandsb_unk_r); | |
| 21 | 27 | }; |
| 22 | 28 | |
| 23 | 29 |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | UINT16 *m_spritecache_count; |
| 20 | 20 | UINT16 *m_unknown_verify_base; |
| 21 | DECLARE_READ16_MEMBER(offtwall_atarivc_r); | |
| 22 | DECLARE_WRITE16_MEMBER(offtwall_atarivc_w); | |
| 23 | DECLARE_READ16_MEMBER(special_port3_r); | |
| 24 | DECLARE_WRITE16_MEMBER(io_latch_w); | |
| 25 | DECLARE_READ16_MEMBER(bankswitch_r); | |
| 26 | DECLARE_READ16_MEMBER(bankrom_r); | |
| 27 | DECLARE_READ16_MEMBER(spritecache_count_r); | |
| 28 | DECLARE_READ16_MEMBER(unknown_verify_r); | |
| 21 | 29 | }; |
| 22 | 30 | |
| 23 | 31 |
| r14896 | r14897 | |
|---|---|---|
| 11 | 11 | public: |
| 12 | 12 | klax_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | DECLARE_WRITE16_MEMBER(interrupt_ack_w); | |
| 14 | 15 | }; |
| 15 | 16 | |
| 16 | 17 |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | 14 | |
| 15 | 15 | UINT8 m_alpha_tile_bank; |
| 16 | DECLARE_READ16_MEMBER(special_port2_r); | |
| 17 | DECLARE_WRITE16_MEMBER(latch_w); | |
| 18 | DECLARE_READ16_MEMBER(thunderj_atarivc_r); | |
| 19 | DECLARE_WRITE16_MEMBER(thunderj_atarivc_w); | |
| 16 | 20 | }; |
| 17 | 21 | |
| 18 | 22 |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | DECLARE_WRITE8_MEMBER(ddragon_bgvideoram_w); |
| 62 | 62 | DECLARE_WRITE8_MEMBER(ddragon_fgvideoram_w); |
| 63 | 63 | DECLARE_CUSTOM_INPUT_MEMBER(sub_cpu_busy); |
| 64 | DECLARE_WRITE8_MEMBER(ddragon_bankswitch_w); | |
| 65 | DECLARE_WRITE8_MEMBER(toffy_bankswitch_w); | |
| 66 | DECLARE_READ8_MEMBER(darktowr_mcu_bank_r); | |
| 67 | DECLARE_WRITE8_MEMBER(darktowr_mcu_bank_w); | |
| 68 | DECLARE_WRITE8_MEMBER(darktowr_bankswitch_w); | |
| 69 | DECLARE_WRITE8_MEMBER(ddragon_interrupt_w); | |
| 70 | DECLARE_WRITE8_MEMBER(ddragon2_sub_irq_ack_w); | |
| 71 | DECLARE_WRITE8_MEMBER(ddragon2_sub_irq_w); | |
| 72 | DECLARE_WRITE8_MEMBER(darktowr_mcu_w); | |
| 73 | DECLARE_READ8_MEMBER(ddragon_hd63701_internal_registers_r); | |
| 74 | DECLARE_WRITE8_MEMBER(ddragon_hd63701_internal_registers_w); | |
| 75 | DECLARE_READ8_MEMBER(ddragon_spriteram_r); | |
| 76 | DECLARE_WRITE8_MEMBER(ddragon_spriteram_w); | |
| 77 | DECLARE_WRITE8_MEMBER(dd_adpcm_w); | |
| 78 | DECLARE_READ8_MEMBER(dd_adpcm_status_r); | |
| 79 | DECLARE_WRITE8_MEMBER(ddragonba_port_w); | |
| 64 | 80 | }; |
| 65 | 81 | |
| 66 | 82 |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | DECLARE_WRITE8_MEMBER(gladiatr_spritebank_w); |
| 34 | 34 | DECLARE_WRITE8_MEMBER(ppking_video_registers_w); |
| 35 | 35 | DECLARE_WRITE8_MEMBER(gladiatr_video_registers_w); |
| 36 | DECLARE_WRITE8_MEMBER(gladiatr_bankswitch_w); | |
| 37 | DECLARE_WRITE8_MEMBER(glad_cpu_sound_command_w); | |
| 38 | DECLARE_READ8_MEMBER(glad_cpu_sound_command_r); | |
| 39 | DECLARE_WRITE8_MEMBER(gladiatr_flipscreen_w); | |
| 40 | DECLARE_WRITE8_MEMBER(gladiatr_irq_patch_w); | |
| 41 | DECLARE_WRITE8_MEMBER(qx0_w); | |
| 42 | DECLARE_WRITE8_MEMBER(qx1_w); | |
| 43 | DECLARE_WRITE8_MEMBER(qx2_w); | |
| 44 | DECLARE_WRITE8_MEMBER(qx3_w); | |
| 45 | DECLARE_READ8_MEMBER(qx2_r); | |
| 46 | DECLARE_READ8_MEMBER(qx3_r); | |
| 47 | DECLARE_READ8_MEMBER(qx0_r); | |
| 48 | DECLARE_READ8_MEMBER(qx1_r); | |
| 49 | DECLARE_READ8_MEMBER(f6a3_r); | |
| 36 | 50 | }; |
| 37 | 51 | |
| 38 | 52 | /*----------- defined in video/gladiatr.c -----------*/ |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | UINT16 m_last_write_offset; |
| 28 | 28 | |
| 29 | 29 | device_t * m_rle; |
| 30 | DECLARE_READ32_MEMBER(special_port2_r); | |
| 31 | DECLARE_READ32_MEMBER(special_port3_r); | |
| 32 | DECLARE_READ32_MEMBER(a2d_data_r); | |
| 33 | DECLARE_WRITE32_MEMBER(latch_w); | |
| 34 | DECLARE_WRITE32_MEMBER(mo_command_w); | |
| 35 | DECLARE_WRITE32_MEMBER(atarigx2_protection_w); | |
| 36 | DECLARE_READ32_MEMBER(atarigx2_protection_r); | |
| 37 | DECLARE_READ32_MEMBER(rrreveng_prot_r); | |
| 30 | 38 | }; |
| 31 | 39 | |
| 32 | 40 |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | DECLARE_WRITE8_MEMBER(circus_videoram_w); |
| 27 | 27 | DECLARE_WRITE8_MEMBER(circus_clown_x_w); |
| 28 | 28 | DECLARE_WRITE8_MEMBER(circus_clown_y_w); |
| 29 | DECLARE_WRITE8_MEMBER(circus_clown_z_w); | |
| 29 | 30 | }; |
| 30 | 31 | |
| 31 | 32 | |
| 32 | 33 | |
| 33 | 34 | /*----------- defined in audio/circus.c -----------*/ |
| 34 | 35 | |
| 35 | extern WRITE8_HANDLER( circus_clown_z_w ); | |
| 36 | 36 | |
| 37 | 37 | DISCRETE_SOUND_EXTERN( circus ); |
| 38 | 38 | DISCRETE_SOUND_EXTERN( robotbwl ); |
| r14896 | r14897 | |
|---|---|---|
| 15 | 15 | UINT8 m_ym2413_volume; |
| 16 | 16 | UINT8 m_overall_volume; |
| 17 | 17 | UINT32 m_adpcm_bank_base; |
| 18 | DECLARE_READ16_MEMBER(relief_atarivc_r); | |
| 19 | DECLARE_WRITE16_MEMBER(relief_atarivc_w); | |
| 20 | DECLARE_READ16_MEMBER(special_port2_r); | |
| 21 | DECLARE_WRITE16_MEMBER(audio_control_w); | |
| 22 | DECLARE_WRITE16_MEMBER(audio_volume_w); | |
| 18 | 23 | }; |
| 19 | 24 | |
| 20 | 25 |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | DECLARE_READ8_MEMBER(twotiger_videoram_r); |
| 37 | 37 | DECLARE_WRITE8_MEMBER(twotiger_videoram_w); |
| 38 | 38 | DECLARE_WRITE8_MEMBER(mcr_91490_videoram_w); |
| 39 | DECLARE_READ8_MEMBER(solarfox_ip0_r); | |
| 40 | DECLARE_READ8_MEMBER(solarfox_ip1_r); | |
| 41 | DECLARE_READ8_MEMBER(kick_ip1_r); | |
| 42 | DECLARE_WRITE8_MEMBER(wacko_op4_w); | |
| 43 | DECLARE_READ8_MEMBER(wacko_ip1_r); | |
| 44 | DECLARE_READ8_MEMBER(wacko_ip2_r); | |
| 45 | DECLARE_READ8_MEMBER(kroozr_ip1_r); | |
| 46 | DECLARE_WRITE8_MEMBER(kroozr_op4_w); | |
| 47 | DECLARE_WRITE8_MEMBER(journey_op4_w); | |
| 48 | DECLARE_WRITE8_MEMBER(twotiger_op4_w); | |
| 49 | DECLARE_WRITE8_MEMBER(dotron_op4_w); | |
| 50 | DECLARE_READ8_MEMBER(nflfoot_ip2_r); | |
| 51 | DECLARE_WRITE8_MEMBER(nflfoot_op4_w); | |
| 52 | DECLARE_READ8_MEMBER(demoderb_ip1_r); | |
| 53 | DECLARE_READ8_MEMBER(demoderb_ip2_r); | |
| 54 | DECLARE_WRITE8_MEMBER(demoderb_op4_w); | |
| 55 | DECLARE_READ8_MEMBER(ssio_irq_clear); | |
| 56 | DECLARE_WRITE8_MEMBER(ssio_status_w); | |
| 57 | DECLARE_READ8_MEMBER(ssio_data_r); | |
| 58 | DECLARE_WRITE8_MEMBER(ssio_data_w); | |
| 59 | DECLARE_READ8_MEMBER(ssio_status_r); | |
| 60 | DECLARE_READ8_MEMBER(ssio_input_port_r); | |
| 61 | DECLARE_WRITE8_MEMBER(ssio_output_port_w); | |
| 62 | DECLARE_WRITE8_MEMBER(csdeluxe_data_w); | |
| 63 | DECLARE_READ8_MEMBER(csdeluxe_status_r); | |
| 64 | DECLARE_WRITE8_MEMBER(soundsgood_data_w); | |
| 65 | DECLARE_READ8_MEMBER(soundsgood_status_r); | |
| 66 | DECLARE_WRITE8_MEMBER(turbocs_data_w); | |
| 67 | DECLARE_READ8_MEMBER(turbocs_status_r); | |
| 68 | DECLARE_WRITE8_MEMBER(squawkntalk_dac_w); | |
| 69 | DECLARE_WRITE8_MEMBER(squawkntalk_data_w); | |
| 39 | 70 | }; |
| 40 | 71 | |
| 41 | 72 |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | UINT8 m_protdata[0x800]; |
| 47 | 47 | |
| 48 | 48 | device_t * m_rle; |
| 49 | DECLARE_READ32_MEMBER(special_port2_r); | |
| 50 | DECLARE_READ32_MEMBER(special_port3_r); | |
| 51 | DECLARE_READ32_MEMBER(analog_port0_r); | |
| 52 | DECLARE_READ32_MEMBER(analog_port1_r); | |
| 53 | DECLARE_WRITE32_MEMBER(latch_w); | |
| 54 | DECLARE_WRITE32_MEMBER(mo_command_w); | |
| 55 | DECLARE_WRITE32_MEMBER(led_w); | |
| 56 | DECLARE_READ32_MEMBER(sound_data_r); | |
| 57 | DECLARE_WRITE32_MEMBER(sound_data_w); | |
| 58 | DECLARE_READ32_MEMBER(colorram_protection_r); | |
| 59 | DECLARE_WRITE32_MEMBER(colorram_protection_w); | |
| 60 | DECLARE_WRITE32_MEMBER(tmek_pf_w); | |
| 61 | void atarigt_colorram_w(offs_t address, UINT16 data, UINT16 mem_mask); | |
| 62 | UINT16 atarigt_colorram_r(offs_t address); | |
| 49 | 63 | }; |
| 50 | 64 | |
| 51 | 65 | |
| 52 | 66 | /*----------- defined in video/atarigt.c -----------*/ |
| 53 | 67 | |
| 54 | void atarigt_colorram_w(atarigt_state *state, offs_t address, UINT16 data, UINT16 mem_mask); | |
| 55 | UINT16 atarigt_colorram_r(atarigt_state *state, offs_t address); | |
| 56 | 68 | |
| 69 | ||
| 57 | 70 | VIDEO_START( atarigt ); |
| 58 | 71 | SCREEN_VBLANK( atarigt ); |
| 59 | 72 | SCREEN_UPDATE_RGB32( atarigt ); |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | DECLARE_READ8_MEMBER(starwars_div_rel_r); |
| 52 | 52 | DECLARE_WRITE8_MEMBER(starwars_math_w); |
| 53 | 53 | DECLARE_CUSTOM_INPUT_MEMBER(matrix_flag_r); |
| 54 | DECLARE_READ8_MEMBER(starwars_sin_r); | |
| 55 | DECLARE_WRITE8_MEMBER(starwars_sout_w); | |
| 56 | DECLARE_READ8_MEMBER(starwars_main_read_r); | |
| 57 | DECLARE_READ8_MEMBER(starwars_main_ready_flag_r); | |
| 58 | DECLARE_WRITE8_MEMBER(starwars_main_wr_w); | |
| 59 | DECLARE_WRITE8_MEMBER(starwars_soundrst_w); | |
| 54 | 60 | }; |
| 55 | 61 | |
| 56 | 62 | |
| r14896 | r14897 | |
| 69 | 75 | |
| 70 | 76 | SOUND_START( starwars ); |
| 71 | 77 | |
| 72 | READ8_HANDLER( starwars_main_read_r ); | |
| 73 | READ8_HANDLER( starwars_main_ready_flag_r ); | |
| 74 | WRITE8_HANDLER( starwars_main_wr_w ); | |
| 75 | WRITE8_HANDLER( starwars_soundrst_w ); | |
| 76 | 78 | |
| 77 | READ8_HANDLER( starwars_sin_r ); | |
| 78 | WRITE8_HANDLER( starwars_sout_w ); |
| r14896 | r14897 | |
|---|---|---|
| 2207 | 2207 | $(VIDEO)/model3.o: $(MAMESRC)/video/m3raster.c |
| 2208 | 2208 | $(VIDEO)/n64.o: $(MAMESRC)/video/rdpfiltr.c |
| 2209 | 2209 | $(DRIVERS)/bfm_sc4.o: $(MAMESRC)/includes/bfm_sc45.h |
| 2210 | $(DRIVERS)/bfm_sc5.o: $(MAMESRC)/includes/bfm_sc45.h | |
| 2210 | 2211 | |
| 2211 | 2212 |
| r14896 | r14897 | |
|---|---|---|
| 107 | 107 | return; |
| 108 | 108 | |
| 109 | 109 | if (offset & 0x100) |
| 110 | paletteram_xxxxBBBBGGGGRRRR_split | |
| 110 | paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w(space, (offset & 0xff) + (m_palette_bank << 8), data); | |
| 111 | 111 | else |
| 112 | paletteram_xxxxBBBBGGGGRRRR_split | |
| 112 | paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w(space, (offset & 0xff) + (m_palette_bank << 8), data); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | READ8_MEMBER(nycaptor_state::nycaptor_palette_r) |
| r14896 | r14897 | |
|---|---|---|
| 252 | 252 | { |
| 253 | 253 | |
| 254 | 254 | if (m_paletteram_bank) |
| 255 | paletteram_xxxxRRRRGGGGBBBB_le_w(space, offset + 0x800, data); | |
| 255 | paletteram_xxxxRRRRGGGGBBBB_byte_le_w(space, offset + 0x800, data); | |
| 256 | 256 | else |
| 257 | paletteram_xxxxRRRRGGGGBBBB_le_w(space, offset, data); | |
| 257 | paletteram_xxxxRRRRGGGGBBBB_byte_le_w(space, offset, data); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | READ8_MEMBER(mitchell_state::pang_paletteram_r) |
| r14896 | r14897 | |
| 268 | 268 | |
| 269 | 269 | WRITE8_MEMBER(mitchell_state::mgakuen_paletteram_w) |
| 270 | 270 | { |
| 271 | paletteram_xxxxRRRRGGGGBBBB_le_w(space, offset, data); | |
| 271 | paletteram_xxxxRRRRGGGGBBBB_byte_le_w(space, offset, data); | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | READ8_MEMBER(mitchell_state::mgakuen_paletteram_r) |
| r14896 | r14897 | |
|---|---|---|
| 188 | 188 | UINT8 color = ((attr & 0x03) << 4) | ((attr & 0x3c) >> 2); |
| 189 | 189 | SET_TILE_INFO( |
| 190 | 190 | 0, |
| 191 | state->m_xevious_fg_videoram[tile_index] | (flip_screen | |
| 191 | state->m_xevious_fg_videoram[tile_index] | (state->flip_screen | |
| 192 | 192 | color, |
| 193 | TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen | |
| 193 | TILE_FLIPYX((attr & 0xc0) >> 6) ^ (state->flip_screen | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 297 | 297 | state->m_fg_tilemap->set_scrolly(0,scroll); |
| 298 | 298 | break; |
| 299 | 299 | case 7: |
| 300 | flip_screen_set( | |
| 300 | state->flip_screen_set( | |
| 301 | 301 | break; |
| 302 | 302 | default: |
| 303 | 303 | logerror("CRTC WRITE REG: %x Data: %03x\n",reg, scroll); |
| r14896 | r14897 | |
| 448 | 448 | sx = spriteram_2[offs + 1] - 40 + 0x100*(spriteram_3[offs + 1] & 1); |
| 449 | 449 | sy = 28*8-spriteram_2[offs]-1; |
| 450 | 450 | |
| 451 | if (flip_screen | |
| 451 | if (state->flip_screen | |
| 452 | 452 | { |
| 453 | 453 | flipx = !flipx; |
| 454 | 454 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 158 | 158 | device_set_input_line(m_audiocpu, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); |
| 159 | 159 | |
| 160 | 160 | /* bit 6 flips screen */ |
| 161 | flip_screen_set( | |
| 161 | flip_screen_set( | |
| 162 | 162 | |
| 163 | 163 | /* bit 7 enables characters? Just a guess */ |
| 164 | 164 | m_chon = ~data & 0x80; |
| r14896 | r14897 | |
| 206 | 206 | int color = attr & 0x07; |
| 207 | 207 | int flipx = attr & 0x08; |
| 208 | 208 | |
| 209 | if (flip_screen | |
| 209 | if (state->flip_screen | |
| 210 | 210 | { |
| 211 | 211 | sx = 240 - sx; |
| 212 | 212 | sy = 240 - sy; |
| r14896 | r14897 | |
| 216 | 216 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 217 | 217 | code, |
| 218 | 218 | color, |
| 219 | flipx,flip_screen | |
| 219 | flipx,state->flip_screen | |
| 220 | 220 | sx,sy,15); |
| 221 | 221 | } |
| 222 | 222 | } |
| r14896 | r14897 | |
|---|---|---|
| 128 | 128 | if (data&0x4) m_txt_enable = 0; else m_txt_enable = 1; |
| 129 | 129 | if (data&0x8) m_sprite_enable=0; else m_sprite_enable=1; |
| 130 | 130 | |
| 131 | flip_screen_set( | |
| 131 | flip_screen_set( | |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| r14896 | r14897 | |
| 157 | 157 | sprite = buffered_spriteram16[offs+1]; |
| 158 | 158 | sprite &= 0x3fff; |
| 159 | 159 | |
| 160 | if (flip_screen | |
| 160 | if (state->flip_screen | |
| 161 | 161 | x=240-x; |
| 162 | 162 | y=240-y; |
| 163 | 163 | if (fx) fx=0; else fx=1; |
| r14896 | r14897 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | WRITE8_MEMBER(tryout_state::tryout_flipscreen_w) |
| 146 | 146 | { |
| 147 | flip_screen_set( | |
| 147 | flip_screen_set( | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | static TILEMAP_MAPPER( get_fg_memory_offset ) |
| r14896 | r14897 | |
| 198 | 198 | fy = 0; |
| 199 | 199 | inc = 16; |
| 200 | 200 | |
| 201 | if (flip_screen | |
| 201 | if (state->flip_screen | |
| 202 | 202 | { |
| 203 | 203 | x = 240 - x; |
| 204 | 204 | fx = !fx; |
| r14896 | r14897 | |
| 234 | 234 | tryout_state *state = screen.machine().driver_data<tryout_state>(); |
| 235 | 235 | int scrollx = 0; |
| 236 | 236 | |
| 237 | if (!flip_screen | |
| 237 | if (!state->flip_screen | |
| 238 | 238 | state->m_fg_tilemap->set_scrollx(0, 16); /* Assumed hard-wired */ |
| 239 | 239 | else |
| 240 | 240 | state->m_fg_tilemap->set_scrollx(0, -8); /* Assumed hard-wired */ |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | SCREEN_UPDATE_IND16( madmotor ) |
| 26 | 26 | { |
| 27 | 27 | madmotor_state *state = screen.machine().driver_data<madmotor_state>(); |
| 28 | flip_screen_set( | |
| 28 | state->flip_screen_set( | |
| 29 | 29 | |
| 30 | 30 | // screen.machine().tilemap().set_flip_all(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 31 | 31 |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | switch (offset) |
| 61 | 61 | { |
| 62 | 62 | case 0: m_bg_ctrl = data; break; |
| 63 | case 1: soundlatch_w(space, 0, data); break; | |
| 63 | case 1: soundlatch_byte_w(space, 0, data); break; | |
| 64 | 64 | case 2: break; |
| 65 | 65 | case 3: break; |
| 66 | 66 | case 4: break; |
| r14896 | r14897 | |
|---|---|---|
| 73 | 73 | x = sx + xc * 8; |
| 74 | 74 | y = (sy + yc * 8) & 0xff; |
| 75 | 75 | |
| 76 | if (flip_screen | |
| 76 | if (state->flip_screen | |
| 77 | 77 | { |
| 78 | 78 | x = 248 - x; |
| 79 | 79 | y = 248 - y; |
| r14896 | r14897 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | WRITE8_MEMBER(rocnrope_state::rocnrope_flipscreen_w) |
| 98 | 98 | { |
| 99 | if (flip_screen | |
| 99 | if (flip_screen | |
| 100 | 100 | { |
| 101 | flip_screen_set( | |
| 101 | flip_screen_set( | |
| 102 | 102 | machine().tilemap().mark_all_dirty(); |
| 103 | 103 | } |
| 104 | 104 | } |
| r14896 | r14897 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | READ8_MEMBER(docastle_state::docastle_flipscreen_off_r) |
| 78 | 78 | { |
| 79 | flip_screen_set( | |
| 79 | flip_screen_set( | |
| 80 | 80 | m_do_tilemap->mark_all_dirty(); |
| 81 | 81 | return 0; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | READ8_MEMBER(docastle_state::docastle_flipscreen_on_r) |
| 85 | 85 | { |
| 86 | flip_screen_set( | |
| 86 | flip_screen_set( | |
| 87 | 87 | m_do_tilemap->mark_all_dirty(); |
| 88 | 88 | return 1; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | WRITE8_MEMBER(docastle_state::docastle_flipscreen_off_w) |
| 92 | 92 | { |
| 93 | flip_screen_set( | |
| 93 | flip_screen_set( | |
| 94 | 94 | m_do_tilemap->mark_all_dirty(); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | WRITE8_MEMBER(docastle_state::docastle_flipscreen_on_w) |
| 98 | 98 | { |
| 99 | flip_screen_set( | |
| 99 | flip_screen_set( | |
| 100 | 100 | m_do_tilemap->mark_all_dirty(); |
| 101 | 101 | } |
| 102 | 102 | |
| r14896 | r14897 | |
| 190 | 190 | flipy = state->m_spriteram[offs + 2] & 0x80; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | if (flip_screen | |
| 193 | if (state->flip_screen | |
| 194 | 194 | { |
| 195 | 195 | sx = 240 - sx; |
| 196 | 196 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 88 | 88 | int bank; |
| 89 | 89 | int total_elements = machine().gfx[0]->total_elements; |
| 90 | 90 | |
| 91 | flip_screen_set( | |
| 91 | flip_screen_set( | |
| 92 | 92 | |
| 93 | 93 | m_bg_tilemap->set_palette_offset((data & 0x07) << 4); |
| 94 | 94 | m_tx_tilemap->set_palette_offset((data & 0x07) << 4); |
| r14896 | r14897 | |
| 146 | 146 | sx = 288-16 - sx; |
| 147 | 147 | sy += 8; |
| 148 | 148 | |
| 149 | if (flip_screen | |
| 149 | if (state->flip_screen | |
| 150 | 150 | { |
| 151 | 151 | sx = 288-16 - sx; |
| 152 | 152 | sy = 224-16 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 179 | 179 | bitmap.fill(0, cliprect); |
| 180 | 180 | else |
| 181 | 181 | { |
| 182 | int flip = flip_screen | |
| 182 | int flip = state->flip_screen | |
| 183 | 183 | |
| 184 | 184 | pen = 0; |
| 185 | 185 | count = 0; |
| r14896 | r14897 | |
| 220 | 220 | sx = (8 * (offs % 8) + x) + 256-64; |
| 221 | 221 | sy = ((offs & 0x1ff) / 8) + 96; |
| 222 | 222 | |
| 223 | if (flip_screen | |
| 223 | if (state->flip_screen | |
| 224 | 224 | { |
| 225 | 225 | sx = 255 - sx; |
| 226 | 226 | sy = 255 - sy; |
| r14896 | r14897 | |
| 255 | 255 | flipx = spriteram[offs+1] & 0x40; |
| 256 | 256 | flipy = spriteram[offs+1] & 0x80; |
| 257 | 257 | |
| 258 | if (flip_screen | |
| 258 | if (state->flip_screen | |
| 259 | 259 | { |
| 260 | 260 | flipx = !flipx; |
| 261 | 261 | flipy = !flipy; |
| r14896 | r14897 | |
| 293 | 293 | palette_set_color(screen.machine(),513,MAKE_RGB(0xff,0xff,0x00)); /* yellow for player */ |
| 294 | 294 | |
| 295 | 295 | { |
| 296 | int flip = flip_screen | |
| 296 | int flip = state->flip_screen | |
| 297 | 297 | int scrollx,scrolly; |
| 298 | 298 | |
| 299 | 299 | for (i = 0;i < 32;i++) |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | WRITE8_MEMBER(yiear_state::yiear_control_w) |
| 69 | 69 | { |
| 70 | 70 | /* bit 0 flips screen */ |
| 71 | if (flip_screen | |
| 71 | if (flip_screen | |
| 72 | 72 | { |
| 73 | flip_screen_set( | |
| 73 | flip_screen_set( | |
| 74 | 74 | machine().tilemap().mark_all_dirty(); |
| 75 | 75 | } |
| 76 | 76 | |
| r14896 | r14897 | |
| 120 | 120 | int sy = 240 - spriteram[offs + 1]; |
| 121 | 121 | int sx = spriteram_2[offs]; |
| 122 | 122 | |
| 123 | if (flip_screen | |
| 123 | if (state->flip_screen | |
| 124 | 124 | { |
| 125 | 125 | sy = 240 - sy; |
| 126 | 126 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | WRITE8_MEMBER(sonson_state::sonson_flipscreen_w) |
| 118 | 118 | { |
| 119 | flip_screen_set( | |
| 119 | flip_screen_set( | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 152 | 152 | int sx = spriteram[offs + 3]; |
| 153 | 153 | int sy = spriteram[offs + 0]; |
| 154 | 154 | |
| 155 | if (flip_screen | |
| 155 | if (state->flip_screen | |
| 156 | 156 | { |
| 157 | 157 | sx = 240 - sx; |
| 158 | 158 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 41 | 41 | |
| 42 | 42 | //FIXME: flip_screen_x should not be written! |
| 43 | flip_screen_set_no_update( | |
| 43 | state->flip_screen_set_no_update( | |
| 44 | 44 | |
| 45 | 45 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more) |
| 46 | 46 | return 0; |
| r14896 | r14897 | |
|---|---|---|
| 113 | 113 | color = (spriteram16[offs+1]>>12)&0xf; |
| 114 | 114 | sprite = spriteram16[offs+1]&0xfff; |
| 115 | 115 | |
| 116 | if (flip_screen | |
| 116 | if (state->flip_screen | |
| 117 | 117 | x=240-x; |
| 118 | 118 | y=240-y; |
| 119 | 119 | if (fx) fx=0; else fx=1; |
| r14896 | r14897 | |
| 151 | 151 | state->m_pf3_layer->enable(!(state->m_scroll_ram[0x34]&1)); |
| 152 | 152 | state->m_pf1_layer->enable(!(state->m_scroll_ram[0x34]&2)); |
| 153 | 153 | state->m_pf2_layer->enable(!(state->m_scroll_ram[0x34]&4)); |
| 154 | flip_screen_set( | |
| 154 | state->flip_screen_set( | |
| 155 | 155 | |
| 156 | 156 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 157 | 157 | screen.machine().priority_bitmap.fill(0, cliprect); |
| r14896 | r14897 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | coin_lockout_global_w(machine(), ~data & 0x01); |
| 126 | 126 | |
| 127 | flip_screen_set_no_update( | |
| 127 | flip_screen_set_no_update( | |
| 128 | 128 | |
| 129 | machine().tilemap().set_flip_all(flip_screen | |
| 129 | machine().tilemap().set_flip_all(flip_screen | |
| 130 | 130 | |
| 131 | 131 | m_controller = data & 0x02; |
| 132 | 132 | |
| r14896 | r14897 | |
| 304 | 304 | latch = 0x0400; |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | state->m_bg_tilemap->set_scrollx(0, flip_screen_get(screen.machine()) ? -xld : xld); | |
| 308 | state->m_bg_tilemap->set_scrolly(0, flip_screen_get(screen.machine()) ? -yld : yld); | |
| 307 | state->m_bg_tilemap->set_scrollx(0, state->flip_screen() ? -xld : xld); | |
| 308 | state->m_bg_tilemap->set_scrolly(0, state->flip_screen() ? -yld : yld); | |
| 309 | 309 | |
| 310 | 310 | state->m_bg_tilemap->draw(state->m_tmp_bitmap1, rect, 0, 0); |
| 311 | 311 | |
| r14896 | r14897 | |
| 331 | 331 | int col = (xld + x) / 8 + 1; |
| 332 | 332 | int row = (yld + y) / 8 + 0; |
| 333 | 333 | |
| 334 | latch |= (flip_screen_get(screen.machine()) ? 31 - col : col) << 0; | |
| 335 | latch |= (flip_screen_get(screen.machine()) ? 31 - row : row) << 5; | |
| 334 | latch |= (state->flip_screen() ? 31 - col : col) << 0; | |
| 335 | latch |= (state->flip_screen() ? 31 - row : row) << 5; | |
| 336 | 336 | |
| 337 | 337 | state->m_pc3259_output[0] = (latch >> 0x0) & 0xf; |
| 338 | 338 | state->m_pc3259_output[1] = (latch >> 0x4) & 0xf; |
| r14896 | r14897 | |
|---|---|---|
| 17 | 17 | case 2: COMBINE_DATA(&m_bg_scrollx); break; // Scroll X, BG0 |
| 18 | 18 | case 3: COMBINE_DATA(&m_bg_scrolly); break; // Scroll Y, BG0 |
| 19 | 19 | case 4: break; // Unknown write |
| 20 | case 5: flip_screen_set( | |
| 20 | case 5: flip_screen_set( | |
| 21 | 21 | case 6: |
| 22 | 22 | COMBINE_DATA(&m_bg_tilebase); // BG Tile Base |
| 23 | 23 | m_bg_tilebase &= 0x1ff; |
| r14896 | r14897 | |
| 35 | 35 | case 1: return m_fg_scrolly; |
| 36 | 36 | case 2: return m_bg_scrollx; |
| 37 | 37 | case 3: return m_bg_scrolly; |
| 38 | case 5: return flip_screen | |
| 38 | case 5: return flip_screen | |
| 39 | 39 | case 6: return m_bg_tilebase; |
| 40 | 40 | } |
| 41 | 41 | |
| r14896 | r14897 | |
| 138 | 138 | if (attr & 0x02) sy = 239 + (0x100 - sy); else sy = 240 - sy; |
| 139 | 139 | if (sx > 0x17f) sx = 0 - (0x200 - sx); |
| 140 | 140 | |
| 141 | if (flip_screen | |
| 141 | if (state->flip_screen | |
| 142 | 142 | { |
| 143 | 143 | sx = 304 - sx; |
| 144 | 144 | sy = 224 - sy; |
| r14896 | r14897 | |
| 150 | 150 | { |
| 151 | 151 | drawgfx_transpen(bitmap, cliprect, |
| 152 | 152 | machine.gfx[1], code + i, color, flipx, flipy, |
| 153 | sx, sy + (flip_screen | |
| 153 | sx, sy + (state->flip_screen | |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 |
| r14896 | r14897 | |
|---|---|---|
| 250 | 250 | doesn't affect any games. |
| 251 | 251 | */ |
| 252 | 252 | |
| 253 | if (flip_screen | |
| 253 | if (machine.driver_data()->flip_screen | |
| 254 | 254 | src_y = (src_bitmap.height() - 256) - scrolly; |
| 255 | 255 | else |
| 256 | 256 | src_y = scrolly; |
| r14896 | r14897 | |
| 261 | 261 | else |
| 262 | 262 | src_x=scrollx; |
| 263 | 263 | |
| 264 | if (flip_screen | |
| 264 | if (machine.driver_data()->flip_screen | |
| 265 | 265 | src_x=(src_bitmap.width() - 256) - src_x; |
| 266 | 266 | |
| 267 | 267 | for (x=0; x<=cliprect.max_x; x++) { |
| r14896 | r14897 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | code = state->m_videoram[offs] | ((col & 0x60) << 3); |
| 73 | 73 | |
| 74 | if (flip_screen | |
| 74 | if (state->flip_screen | |
| 75 | 75 | { |
| 76 | 76 | sx = 31 - sx; |
| 77 | 77 | sy = 31 - sy; |
| r14896 | r14897 | |
| 81 | 81 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 82 | 82 | code, |
| 83 | 83 | (col & 0x0f) | ((*state->m_colorbank & 0x03) << 4), |
| 84 | flip_screen | |
| 84 | state->flip_screen | |
| 85 | 85 | 8 * sx, (8 * sy + scroll) & 0xff, transpen); |
| 86 | 86 | } |
| 87 | 87 | } |
| r14896 | r14897 | |
| 119 | 119 | /* 16x16 sprites */ |
| 120 | 120 | gfx = 1; |
| 121 | 121 | |
| 122 | if (!flip_screen | |
| 122 | if (!state->flip_screen | |
| 123 | 123 | sy = 240 - sy; |
| 124 | 124 | else |
| 125 | 125 | sx = 240 - sx; |
| r14896 | r14897 | |
| 130 | 130 | gfx = 0; |
| 131 | 131 | code <<= 2; |
| 132 | 132 | |
| 133 | if (!flip_screen | |
| 133 | if (!state->flip_screen | |
| 134 | 134 | sy = 248 - sy; |
| 135 | 135 | else |
| 136 | 136 | sx = 248 - sx; |
| r14896 | r14897 | |
| 140 | 140 | flipx = state->m_spriteram[offs + 1] & 0x40; |
| 141 | 141 | flipy = state->m_spriteram[offs + 1] & 0x80; |
| 142 | 142 | |
| 143 | if (flip_screen | |
| 143 | if (state->flip_screen | |
| 144 | 144 | { |
| 145 | 145 | flipx = !flipx; |
| 146 | 146 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | WRITE8_MEMBER(sauro_state::sauro_scroll_fg_w) |
| 81 | 81 | { |
| 82 | const int *map = (flip_screen | |
| 82 | const int *map = (flip_screen | |
| 83 | 83 | int scroll = (data & 0xf8) | map[data & 7]; |
| 84 | 84 | |
| 85 | 85 | m_fg_tilemap->set_scrollx(0, scroll); |
| r14896 | r14897 | |
| 104 | 104 | sauro_state *state = machine.driver_data<sauro_state>(); |
| 105 | 105 | UINT8 *spriteram = state->m_spriteram; |
| 106 | 106 | int offs,code,sx,sy,color,flipx; |
| 107 | int flipy = flip_screen | |
| 107 | int flipy = state->flip_screen | |
| 108 | 108 | |
| 109 | 109 | for (offs = 3; offs < state->m_spriteram_size - 1; offs += 4) |
| 110 | 110 | { |
| r14896 | r14897 | |
| 172 | 172 | sauro_state *state = machine.driver_data<sauro_state>(); |
| 173 | 173 | UINT8 *spriteram = state->m_spriteram; |
| 174 | 174 | int offs,code,sy,color,flipx,sx; |
| 175 | int flipy = flip_screen | |
| 175 | int flipy = state->flip_screen | |
| 176 | 176 | |
| 177 | 177 | /* Weird, sprites entries don't start on DWORD boundary */ |
| 178 | 178 | for (offs = 3; offs < state->m_spriteram_size - 1; offs += 4) |
| r14896 | r14897 | |
|---|---|---|
| 279 | 279 | int duplicate = spriteram_3[offs] & 0x80; |
| 280 | 280 | int x,y; |
| 281 | 281 | |
| 282 | if (flip_screen | |
| 282 | if (state->flip_screen | |
| 283 | 283 | { |
| 284 | 284 | flipx ^= 1; |
| 285 | 285 | flipy ^= 1; |
| r14896 | r14897 | |
| 308 | 308 | { |
| 309 | 309 | gaplus_state *state = screen.machine().driver_data<gaplus_state>(); |
| 310 | 310 | /* flip screen control is embedded in RAM */ |
| 311 | flip_screen_set( | |
| 311 | state->flip_screen_set( | |
| 312 | 312 | |
| 313 | 313 | bitmap.fill(0, cliprect); |
| 314 | 314 |
| r14896 | r14897 | |
|---|---|---|
| 175 | 175 | m_video_mode = data; |
| 176 | 176 | |
| 177 | 177 | /* bit 7 is flip screen */ |
| 178 | flip_screen_set( | |
| 178 | flip_screen_set( | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| r14896 | r14897 | |
| 366 | 366 | UINT32 gfxbanks = machine.region("sprites")->bytes() / 0x8000; |
| 367 | 367 | const UINT8 *gfxbase = machine.region("sprites")->base(); |
| 368 | 368 | UINT8 *spriteram = state->m_spriteram; |
| 369 | int flipscreen = flip_screen | |
| 369 | int flipscreen = state->flip_screen | |
| 370 | 370 | int spritenum; |
| 371 | 371 | |
| 372 | 372 | /* up to 32 sprites total */ |
| r14896 | r14897 | |
| 578 | 578 | yscroll = videoram[0xfbd]; |
| 579 | 579 | |
| 580 | 580 | /* adjust for flipping */ |
| 581 | if (flip_screen | |
| 581 | if (state->flip_screen | |
| 582 | 582 | { |
| 583 | 583 | xscroll = 640 - (xscroll & 0x1ff); |
| 584 | 584 | yscroll = 764 - (yscroll & 0x1ff); |
| r14896 | r14897 | |
| 614 | 614 | bitmap_ind16 &fgpixmap = state->m_tilemap_page[0]->pixmap(); |
| 615 | 615 | |
| 616 | 616 | /* get scroll offsets */ |
| 617 | if (!flip_screen | |
| 617 | if (!state->flip_screen | |
| 618 | 618 | { |
| 619 | 619 | xscroll = ((videoram[0x7c0] | (videoram[0x7c1] << 8)) & 0x1ff) - 512 + 10; |
| 620 | 620 | yscroll = videoram[0x7ba]; |
| r14896 | r14897 | |
| 657 | 657 | bitmap_ind16 &fgpixmap = state->m_tilemap_page[0]->pixmap(); |
| 658 | 658 | |
| 659 | 659 | /* get scroll offsets */ |
| 660 | if (!flip_screen | |
| 660 | if (!state->flip_screen | |
| 661 | 661 | { |
| 662 | 662 | for (y = 0; y < 32; y++) |
| 663 | 663 | rowscroll[y] = ((videoram[0x7c0 + y * 2] | (videoram[0x7c1 + y * 2] << 8)) & 0x1ff) - 512 + 10; |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | WRITE16_MEMBER(powerins_state::powerins_flipscreen_w) |
| 52 | 52 | { |
| 53 | if (ACCESSING_BITS_0_7) flip_screen_set( | |
| 53 | if (ACCESSING_BITS_0_7) flip_screen_set( | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | WRITE16_MEMBER(powerins_state::powerins_tilebank_w) |
| r14896 | r14897 | |
| 293 | 293 | |
| 294 | 294 | /* Handle flip_screen. Apply a global offset of 32 pixels along x too */ |
| 295 | 295 | |
| 296 | if (flip_screen | |
| 296 | if (state->flip_screen | |
| 297 | 297 | { |
| 298 | 298 | sx = screen_w - sx - dimx*16 - 32; flipx = !flipx; |
| 299 | 299 | sy = screen_h - sy - dimy*16; flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 133 | 133 | switch( offset*2 ) |
| 134 | 134 | { |
| 135 | 135 | case 0x1c: // FLIP SCREEN (myangel) <- this is actually zoom |
| 136 | flip_screen_set( | |
| 136 | flip_screen_set( | |
| 137 | 137 | if (data & ~1) logerror("CPU #0 PC %06X: flip screen unknown bits %04X\n",cpu_get_pc(&space.device()),data); |
| 138 | 138 | break; |
| 139 | 139 | case 0x2a: // FLIP X (pzlbowl) |
| 140 | flip_screen_x_set( | |
| 140 | flip_screen_x_set( | |
| 141 | 141 | if (data & ~1) logerror("CPU #0 PC %06X: flipx unknown bits %04X\n",cpu_get_pc(&space.device()),data); |
| 142 | 142 | break; |
| 143 | 143 | case 0x2c: // FLIP Y (pzlbowl) |
| 144 | flip_screen_y_set( | |
| 144 | flip_screen_y_set( | |
| 145 | 145 | if (data & ~1) logerror("CPU #0 PC %06X: flipy unknown bits %04X\n",cpu_get_pc(&space.device()),data); |
| 146 | 146 | break; |
| 147 | 147 |
| r14896 | r14897 | |
|---|---|---|
| 121 | 121 | int flipx = (attributes & 0x04); |
| 122 | 122 | int flipy = 0; |
| 123 | 123 | |
| 124 | if (flip_screen | |
| 124 | if (state->flip_screen | |
| 125 | 125 | flipx = !flipx; |
| 126 | 126 | flipy = !flipy; |
| 127 | 127 | } |
| r14896 | r14897 | |
| 132 | 132 | |
| 133 | 133 | vx = sx; |
| 134 | 134 | vy = sy; |
| 135 | if (flip_screen | |
| 135 | if (state->flip_screen | |
| 136 | 136 | vx = 240 - vx; |
| 137 | 137 | vy = 240 - vy; |
| 138 | 138 | } |
| r14896 | r14897 | |
| 151 | 151 | |
| 152 | 152 | vx = sx; |
| 153 | 153 | vy = sy; |
| 154 | if (flip_screen | |
| 154 | if (state->flip_screen | |
| 155 | 155 | vx = 240 - vx; |
| 156 | 156 | vy = 240 - vy; |
| 157 | 157 | } |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | WRITE8_MEMBER(paradise_state::paradise_flipscreen_w) |
| 32 | 32 | { |
| 33 | flip_screen_set( | |
| 33 | flip_screen_set( | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | WRITE8_MEMBER(paradise_state::tgtball_flipscreen_w) |
| 37 | 37 | { |
| 38 | flip_screen_set( | |
| 38 | flip_screen_set( | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /* Note: Penky updates pixel palette bank register BEFORE actually writing to the paletteram. */ |
| r14896 | r14897 | |
| 200 | 200 | int flipx = 0; // ? |
| 201 | 201 | int flipy = 0; |
| 202 | 202 | |
| 203 | if (flip_screen | |
| 203 | if (state->flip_screen | |
| 204 | 204 | { |
| 205 | 205 | x = 0xf0 - x; flipx = !flipx; |
| 206 | 206 | y = 0xf0 - y; flipy = !flipy; |
| r14896 | r14897 | |
| 263 | 263 | |
| 264 | 264 | if (layers_ctrl & 1) state->m_tilemap_0->draw(bitmap, cliprect, 0, 0); |
| 265 | 265 | if (layers_ctrl & 2) state->m_tilemap_1->draw(bitmap, cliprect, 0, 0); |
| 266 | if (layers_ctrl & 4) copybitmap_trans(bitmap, state->m_tmpbitmap, flip_screen | |
| 266 | if (layers_ctrl & 4) copybitmap_trans(bitmap, state->m_tmpbitmap, state->flip_screen | |
| 267 | 267 | |
| 268 | 268 | if (state->m_priority & 2) |
| 269 | 269 | { |
| r14896 | r14897 | |
|---|---|---|
| 221 | 221 | |
| 222 | 222 | //state->m_tilemap_reg[0] & 0x10 // ?? on coin insertion |
| 223 | 223 | |
| 224 | flip_screen_set( | |
| 224 | state->flip_screen_set( | |
| 225 | 225 | |
| 226 | 226 | if(state->m_tilemap_reg[0] & 0x02) |
| 227 | 227 | state->m_joetilemap7->draw(bitmap, cliprect, 0, 0); |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | color += 16 * (spritepalettebank[(tile>>1)&0xff] & 0x0f); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | if (flip_screen | |
| 81 | if (state->flip_screen | |
| 82 | 82 | { |
| 83 | 83 | sx=240-sx; |
| 84 | 84 | sy=240-sy; |
| r14896 | r14897 | |
| 170 | 170 | { |
| 171 | 171 | coin_counter_w( machine(), 0, data&0x01 ); |
| 172 | 172 | coin_counter_w( machine(), 1, (data&0x02)>>1 ); |
| 173 | flip_screen_set( | |
| 173 | flip_screen_set( | |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | WRITE8_MEMBER(mouser_state::mouser_flip_screen_x_w) |
| 48 | 48 | { |
| 49 | flip_screen_x_set( | |
| 49 | flip_screen_x_set( | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | WRITE8_MEMBER(mouser_state::mouser_flip_screen_y_w) |
| 53 | 53 | { |
| 54 | flip_screen_y_set( | |
| 54 | flip_screen_y_set( | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | SCREEN_UPDATE_IND16( mouser ) |
| r14896 | r14897 | |
| 71 | 71 | sx = offs % 32; |
| 72 | 72 | sy = offs / 32; |
| 73 | 73 | |
| 74 | if (flip_screen_x | |
| 74 | if (state->flip_screen_x | |
| 75 | 75 | { |
| 76 | 76 | sx = 31 - sx; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | if (flip_screen_y | |
| 79 | if (state->flip_screen_y | |
| 80 | 80 | { |
| 81 | 81 | sy = 31 - sy; |
| 82 | 82 | } |
| r14896 | r14897 | |
| 93 | 93 | drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], |
| 94 | 94 | state->m_videoram[offs] | (state->m_colorram[color_offs] >> 5) * 256 | ((state->m_colorram[color_offs] >> 4) & 1) * 512, |
| 95 | 95 | state->m_colorram[color_offs]%16, |
| 96 | flip_screen_x | |
| 96 | state->flip_screen_x | |
| 97 | 97 | 8*sx,scrolled_y_position); |
| 98 | 98 | } |
| 99 | 99 | |
| r14896 | r14897 | |
| 108 | 108 | flipx = BIT(spriteram[offs], 6); |
| 109 | 109 | flipy = BIT(spriteram[offs], 7); |
| 110 | 110 | |
| 111 | if (flip_screen_x | |
| 111 | if (state->flip_screen_x | |
| 112 | 112 | { |
| 113 | 113 | flipx = !flipx; |
| 114 | 114 | sx = 240 - sx; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | if (flip_screen_y | |
| 117 | if (state->flip_screen_y | |
| 118 | 118 | { |
| 119 | 119 | flipy = !flipy; |
| 120 | 120 | sy = 238 - sy; |
| r14896 | r14897 | |
| 137 | 137 | flipx = BIT(spriteram[offs], 6); |
| 138 | 138 | flipy = BIT(spriteram[offs], 7); |
| 139 | 139 | |
| 140 | if (flip_screen_x | |
| 140 | if (state->flip_screen_x | |
| 141 | 141 | { |
| 142 | 142 | flipx = !flipx; |
| 143 | 143 | sx = 240 - sx; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | if (flip_screen_y | |
| 146 | if (state->flip_screen_y | |
| 147 | 147 | { |
| 148 | 148 | flipy = !flipy; |
| 149 | 149 | sy = 238 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 582 | 582 | state->m_deco_tilegen1 = screen.machine().device("tilegen1"); |
| 583 | 583 | state->m_deco_tilegen2 = screen.machine().device("tilegen2"); |
| 584 | 584 | |
| 585 | screen.machine().tilemap().set_flip_all(flip_screen | |
| 585 | screen.machine().tilemap().set_flip_all(state->flip_screen | |
| 586 | 586 | |
| 587 | 587 | screen.machine().priority_bitmap.fill(0, cliprect); |
| 588 | 588 | bitmap.fill(screen.machine().pens[0x000], cliprect); // Palette index not confirmed |
| r14896 | r14897 | |
|---|---|---|
| 138 | 138 | priority_mask = 0xf0; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | if (flip_screen_x | |
| 141 | if (state->flip_screen_x | |
| 142 | 142 | { |
| 143 | 143 | sx = 239 - sx - 24; |
| 144 | 144 | flipx = !flipx; |
| 145 | 145 | } |
| 146 | if (flip_screen_y | |
| 146 | if (state->flip_screen_y | |
| 147 | 147 | { |
| 148 | 148 | sy = 254 - 16 * height - sy; |
| 149 | 149 | flipy = !flipy; |
| r14896 | r14897 | |
| 176 | 176 | lkage_state *state = screen.machine().driver_data<lkage_state>(); |
| 177 | 177 | int bank; |
| 178 | 178 | |
| 179 | flip_screen_x_set(screen.machine(), ~state->m_vreg[2] & 0x01); | |
| 180 | flip_screen_y_set(screen.machine(), ~state->m_vreg[2] & 0x02); | |
| 179 | state->flip_screen_x_set(~state->m_vreg[2] & 0x01); | |
| 180 | state->flip_screen_y_set(~state->m_vreg[2] & 0x02); | |
| 181 | 181 | |
| 182 | 182 | bank = state->m_vreg[1] & 0x08; |
| 183 | 183 |
| r14896 | r14897 | |
|---|---|---|
| 187 | 187 | { |
| 188 | 188 | |
| 189 | 189 | /* low bit controls flip; background and sprite flip are handled at render time */ |
| 190 | flip_screen_set_no_update(machine(), ~data & 1); | |
| 191 | m_fg_tilemap->set_flip(flip_screen_get(machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 190 | flip_screen_set_no_update(~data & 1); | |
| 191 | m_fg_tilemap->set_flip(flip_screen() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| r14896 | r14897 | |
| 323 | 323 | int colorbase = state->m_bg_color + (state->m_congo_color_bank << 8); |
| 324 | 324 | int xmask = pixmap.width() - 1; |
| 325 | 325 | int ymask = pixmap.height() - 1; |
| 326 | int flipmask = flip_screen_get(machine) ? 0xff : 0x00; | |
| 327 | int flipoffs = flip_screen_get(machine) ? 0x38 : 0x40; | |
| 326 | int flipmask = state->flip_screen() ? 0xff : 0x00; | |
| 327 | int flipoffs = state->flip_screen() ? 0x38 : 0x40; | |
| 328 | 328 | int x, y; |
| 329 | 329 | |
| 330 | 330 | /* the starting X value is offset by 1 pixel (normal) or 7 pixels */ |
| 331 | 331 | /* (flipped) due to a delay in the loading */ |
| 332 | if (!flip_screen | |
| 332 | if (!state->flip_screen | |
| 333 | 333 | flipoffs -= 1; |
| 334 | 334 | else |
| 335 | 335 | flipoffs += 7; |
| r14896 | r14897 | |
| 435 | 435 | zaxxon_state *state = machine.driver_data<zaxxon_state>(); |
| 436 | 436 | UINT8 *spriteram = state->m_spriteram; |
| 437 | 437 | const gfx_element *gfx = machine.gfx[2]; |
| 438 | int flip = flip_screen | |
| 438 | int flip = state->flip_screen | |
| 439 | 439 | int flipmask = flip ? 0xff : 0x00; |
| 440 | 440 | int offs; |
| 441 | 441 |
| r14896 | r14897 | |
|---|---|---|
| 170 | 170 | WRITE16_MEMBER(gaiden_state::gaiden_flip_w) |
| 171 | 171 | { |
| 172 | 172 | if (ACCESSING_BITS_0_7) |
| 173 | flip_screen_set( | |
| 173 | flip_screen_set( | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | WRITE16_MEMBER(gaiden_state::gaiden_txscrollx_w) |
| r14896 | r14897 | |
| 396 | 396 | if (ypos >= 256) |
| 397 | 397 | ypos -= 512; |
| 398 | 398 | |
| 399 | if (flip_screen | |
| 399 | if (state->flip_screen | |
| 400 | 400 | { |
| 401 | 401 | flipx = !flipx; |
| 402 | 402 | flipy = !flipy; |
| r14896 | r14897 | |
| 518 | 518 | if (ypos >= 256) |
| 519 | 519 | ypos -= 512; |
| 520 | 520 | |
| 521 | if (flip_screen | |
| 521 | if (state->flip_screen | |
| 522 | 522 | { |
| 523 | 523 | flipx = !flipx; |
| 524 | 524 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | WRITE8_MEMBER(trackfld_state::trackfld_flipscreen_w) |
| 105 | 105 | { |
| 106 | if (flip_screen | |
| 106 | if (flip_screen | |
| 107 | 107 | { |
| 108 | flip_screen_set( | |
| 108 | flip_screen_set( | |
| 109 | 109 | machine().tilemap().mark_all_dirty(); |
| 110 | 110 | } |
| 111 | 111 | } |
| r14896 | r14897 | |
| 208 | 208 | int sx = spriteram[offs] - 1; |
| 209 | 209 | int sy = 240 - spriteram_2[offs + 1]; |
| 210 | 210 | |
| 211 | if (flip_screen | |
| 211 | if (state->flip_screen | |
| 212 | 212 | { |
| 213 | 213 | sy = 240 - sy; |
| 214 | 214 | flipy = !flipy; |
| r14896 | r14897 | |
| 253 | 253 | for (row = 0; row < 32; row++) |
| 254 | 254 | { |
| 255 | 255 | scrollx = state->m_scroll[row] + 256 * (state->m_scroll2[row] & 0x01); |
| 256 | if (flip_screen | |
| 256 | if (state->flip_screen | |
| 257 | 257 | state->m_bg_tilemap->set_scrollx(row, scrollx); |
| 258 | 258 | } |
| 259 | 259 |
| r14896 | r14897 | |
|---|---|---|
| 204 | 204 | WRITE8_HANDLER( fastfred_flip_screen_x_w ) |
| 205 | 205 | { |
| 206 | 206 | fastfred_state *state = space->machine().driver_data<fastfred_state>(); |
| 207 | if (flip_screen_x | |
| 207 | if (state->flip_screen_x | |
| 208 | 208 | { |
| 209 | flip_screen_x_set( | |
| 209 | state->flip_screen_x_set( | |
| 210 | 210 | |
| 211 | state->m_bg_tilemap->set_flip((flip_screen_x | |
| 211 | state->m_bg_tilemap->set_flip((state->flip_screen_x | |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | WRITE8_HANDLER( fastfred_flip_screen_y_w ) |
| 216 | 216 | { |
| 217 | 217 | fastfred_state *state = space->machine().driver_data<fastfred_state>(); |
| 218 | if (flip_screen_y | |
| 218 | if (state->flip_screen_y | |
| 219 | 219 | { |
| 220 | flip_screen_y_set( | |
| 220 | state->flip_screen_y_set( | |
| 221 | 221 | |
| 222 | state->m_bg_tilemap->set_flip((flip_screen_x | |
| 222 | state->m_bg_tilemap->set_flip((state->flip_screen_x | |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
| r14896 | r14897 | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
| 279 | if (flip_screen_x | |
| 279 | if (state->flip_screen_x | |
| 280 | 280 | { |
| 281 | 281 | sx = 240 - sx; |
| 282 | 282 | flipx = !flipx; |
| 283 | 283 | } |
| 284 | if (flip_screen_y | |
| 284 | if (state->flip_screen_y | |
| 285 | 285 | { |
| 286 | 286 | sy = 240 - sy; |
| 287 | 287 | flipy = !flipy; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | drawgfx_transpen(bitmap,flip_screen_x | |
| 290 | drawgfx_transpen(bitmap,state->flip_screen_x | |
| 291 | 291 | code, |
| 292 | 292 | state->m_colorbank | (state->m_spriteram[offs + 2] & 0x07), |
| 293 | 293 | flipx,flipy, |
| r14896 | r14897 | |
|---|---|---|
| 199 | 199 | flipx = buffered_spriteram[offs + 1] & 0x02; |
| 200 | 200 | flipy = buffered_spriteram[offs + 1] & 0x04; |
| 201 | 201 | |
| 202 | if (flip_screen | |
| 202 | if (state->flip_screen | |
| 203 | 203 | { |
| 204 | 204 | sx = 240 - sx; |
| 205 | 205 | sy = 240 - sy; |
| r14896 | r14897 | |
| 248 | 248 | flipy = 1; |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | if (flip_screen | |
| 251 | if (state->flip_screen | |
| 252 | 252 | { |
| 253 | 253 | sx = 240 - sx; |
| 254 | 254 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | WRITE8_MEMBER(tecmo_state::tecmo_flipscreen_w) |
| 155 | 155 | { |
| 156 | flip_screen_set( | |
| 156 | flip_screen_set( | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| r14896 | r14897 | |
| 205 | 205 | flipx = bank & 1; |
| 206 | 206 | flipy = bank & 2; |
| 207 | 207 | |
| 208 | if (flip_screen | |
| 208 | if (state->flip_screen | |
| 209 | 209 | { |
| 210 | 210 | xpos = 256 - (8 * size) - xpos; |
| 211 | 211 | ypos = 256 - (8 * size) - ypos; |
| r14896 | r14897 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | if (size >= 0x10) /* 32x32 */ |
| 123 | 123 | { |
| 124 | if (flip_screen | |
| 124 | if (state->flip_screen | |
| 125 | 125 | { |
| 126 | 126 | sx = 256 - sx; |
| 127 | 127 | sy = 224 - sy; |
| r14896 | r14897 | |
| 152 | 152 | } |
| 153 | 153 | else |
| 154 | 154 | { |
| 155 | if (flip_screen | |
| 155 | if (state->flip_screen | |
| 156 | 156 | { |
| 157 | 157 | sx = ((size & 0x08) ? 280:272) - sx; |
| 158 | 158 | sy = ((size & 0x04) ? 248:240) - sy; |
| r14896 | r14897 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | WRITE8_MEMBER(cloak_state::cloak_flipscreen_w) |
| 152 | 152 | { |
| 153 | flip_screen_set( | |
| 153 | flip_screen_set( | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 212 | 212 | int sx = spriteram[offs + 192]; |
| 213 | 213 | int sy = 240 - spriteram[offs]; |
| 214 | 214 | |
| 215 | if (flip_screen | |
| 215 | if (state->flip_screen | |
| 216 | 216 | { |
| 217 | 217 | sx -= 9; |
| 218 | 218 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | * |
| 61 | 61 | *************************************/ |
| 62 | 62 | |
| 63 | void foodf_s | |
| 63 | void foodf_s | |
| 64 | 64 | { |
| 65 | if (flip != | |
| 65 | if (flip != | |
| 66 | 66 | { |
| 67 | state->m_playfield_flip = flip; | |
| 68 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 67 | m_playfield_flip = flip; | |
| 68 | m_playfield_tilemap->mark_all_dirty(); | |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| r14896 | r14897 | |
| 77 | 77 | * |
| 78 | 78 | *************************************/ |
| 79 | 79 | |
| 80 | WRITE16_ | |
| 80 | WRITE16_M | |
| 81 | 81 | { |
| 82 | foodf_state *state = space->machine().driver_data<foodf_state>(); | |
| 83 | 82 | int newword, r, g, b, bit0, bit1, bit2; |
| 84 | 83 | |
| 85 | COMBINE_DATA(&state->m_generic_paletteram_16[offset]); | |
| 86 | newword = state->m_generic_paletteram_16[offset]; | |
| 84 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 85 | newword = m_generic_paletteram_16[offset]; | |
| 87 | 86 | |
| 88 | 87 | /* only the bottom 8 bits are used */ |
| 89 | 88 | /* red component */ |
| 90 | 89 | bit0 = (newword >> 0) & 0x01; |
| 91 | 90 | bit1 = (newword >> 1) & 0x01; |
| 92 | 91 | bit2 = (newword >> 2) & 0x01; |
| 93 | r = combine_3_weights( | |
| 92 | r = combine_3_weights( | |
| 94 | 93 | |
| 95 | 94 | /* green component */ |
| 96 | 95 | bit0 = (newword >> 3) & 0x01; |
| 97 | 96 | bit1 = (newword >> 4) & 0x01; |
| 98 | 97 | bit2 = (newword >> 5) & 0x01; |
| 99 | g = combine_3_weights( | |
| 98 | g = combine_3_weights( | |
| 100 | 99 | |
| 101 | 100 | /* blue component */ |
| 102 | 101 | bit0 = (newword >> 6) & 0x01; |
| 103 | 102 | bit1 = (newword >> 7) & 0x01; |
| 104 | b = combine_2_weights( | |
| 103 | b = combine_2_weights( | |
| 105 | 104 | |
| 106 | palette_set_color( | |
| 105 | palette_set_color( | |
| 107 | 106 | } |
| 108 | 107 | |
| 109 | 108 |
| r14896 | r14897 | |
|---|---|---|
| 353 | 353 | int sx = buffered_spriteram[offs + 3]; |
| 354 | 354 | int sy = state->m_sprite_offy + 240 - (buffered_spriteram[offs + 0] & 0x1ff); |
| 355 | 355 | |
| 356 | if (flip_screen | |
| 356 | if (state->flip_screen | |
| 357 | 357 | { |
| 358 | 358 | sx = 320 - sx + 176; /* don't ask where 176 comes from, just tried it out */ |
| 359 | 359 | sy = 240 - sy + 1; /* don't ask where 1 comes from, just tried it out */ |
| r14896 | r14897 | |
|---|---|---|
| 181 | 181 | m_nmi_mask = data & 1; |
| 182 | 182 | |
| 183 | 183 | /* bit 1 flip screen */ |
| 184 | flip_screen_set( | |
| 184 | flip_screen_set( | |
| 185 | 185 | |
| 186 | 186 | /* bits 2-3 unknown */ |
| 187 | 187 | |
| r14896 | r14897 | |
| 203 | 203 | |
| 204 | 204 | static void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, const gfx_element *gfx, UINT8 *sprite ) |
| 205 | 205 | { |
| 206 | appoooh_state *state = gfx->machine().driver_data<appoooh_state>(); | |
| 206 | 207 | int offs; |
| 207 | int flipy = flip_screen | |
| 208 | int flipy = state->flip_screen | |
| 208 | 209 | |
| 209 | 210 | for (offs = 0x20 - 4; offs >= 0; offs -= 4) |
| 210 | 211 | { |
| r14896 | r14897 | |
| 234 | 235 | |
| 235 | 236 | static void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, const gfx_element *gfx, UINT8 *sprite ) |
| 236 | 237 | { |
| 238 | appoooh_state *state = gfx->machine().driver_data<appoooh_state>(); | |
| 237 | 239 | int offs; |
| 238 | int flipy = flip_screen | |
| 240 | int flipy = state->flip_screen | |
| 239 | 241 | |
| 240 | 242 | for (offs = 0x20 - 4; offs >= 0; offs -= 4) |
| 241 | 243 | { |
| r14896 | r14897 | |
|---|---|---|
| 276 | 276 | /* screen flip is handled both by software and hardware */ |
| 277 | 277 | data ^= ~input_port_read(machine(), "DSW2") & 1; |
| 278 | 278 | |
| 279 | flip_screen_set( | |
| 279 | flip_screen_set( | |
| 280 | 280 | |
| 281 | 281 | coin_counter_w(machine(), 0, data & 0x02); |
| 282 | 282 | coin_counter_w(machine(), 1, data & 0x20); |
| r14896 | r14897 | |
| 297 | 297 | const rectangle spritevisiblearea(1*8, 31*8-1, 0*8, 24*8-1); |
| 298 | 298 | const rectangle spritevisibleareaflip(1*8, 31*8-1, 8*8, 32*8-1); |
| 299 | 299 | rectangle clip = cliprect; |
| 300 | if (flip_screen | |
| 300 | if (state->flip_screen | |
| 301 | 301 | clip &= spritevisibleareaflip; |
| 302 | 302 | else |
| 303 | 303 | clip &= spritevisiblearea; |
| r14896 | r14897 | |
| 312 | 312 | int flipx = attr & 0x40; |
| 313 | 313 | int flipy = attr & 0x80; |
| 314 | 314 | |
| 315 | if (flip_screen | |
| 315 | if (state->flip_screen | |
| 316 | 316 | { |
| 317 | 317 | sx = 240 - sx; |
| 318 | 318 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 197 | 197 | |
| 198 | 198 | sy = 240 - spriteram[offs + 2]; |
| 199 | 199 | |
| 200 | if (flip_screen | |
| 200 | if (state->flip_screen | |
| 201 | 201 | { |
| 202 | 202 | sx = 240 - sx; flipx = !flipx; |
| 203 | 203 | sy = 240 - sy; flipy = !flipy; if (sizey) sy += 16; |
| r14896 | r14897 | |
| 249 | 249 | if (state->m_scrollx[0] & 0x08) // background (if enabled) |
| 250 | 250 | { |
| 251 | 251 | /* The background seems to be always flipped along x */ |
| 252 | state->m_bg_tilemap->set_flip((flip_screen | |
| 252 | state->m_bg_tilemap->set_flip((state->flip_screen | |
| 253 | 253 | state->m_bg_tilemap->set_scrollx(0, state->m_scrollx[1] + ((state->m_scrollx[0] & 0x02) << 7) ); |
| 254 | 254 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 255 | 255 | } |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | case 0x23: m_invert_controls = data ? 0x00ff : 0x0000; break; |
| 54 | 54 | case 0x28: coin_counter_w(machine(), 0, data & 1); break; |
| 55 | 55 | case 0x29: coin_counter_w(machine(), 1, data & 1); break; |
| 56 | case 0x30: flip_screen_set( | |
| 56 | case 0x30: flip_screen_set( | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| r14896 | r14897 | |
| 145 | 145 | if (sx&0x100) sx=-0x100+(sx&0xff); |
| 146 | 146 | if (sy&0x100) sy=-0x100+(sy&0xff); |
| 147 | 147 | |
| 148 | if (flip_screen | |
| 148 | if (state->flip_screen | |
| 149 | 149 | { |
| 150 | 150 | sx = 240 - sx; |
| 151 | 151 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 98 | 98 | if (bank & 1) |
| 99 | 99 | { |
| 100 | 100 | space->install_read_bank(0x0000, 0x0fff, "bank5"); |
| 101 | space->install_write_handler(0x0000, 0x0fff, write8_delegate(FUNC(simpsons_state::paletteram_xBBBBBGGGGGRRRRR_be_w), state)); | |
| 101 | space->install_write_handler(0x0000, 0x0fff, write8_delegate(FUNC(simpsons_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state)); | |
| 102 | 102 | memory_set_bankptr(machine, "bank5", state->m_generic_paletteram_8); |
| 103 | 103 | } |
| 104 | 104 | else |
| r14896 | r14897 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | number &= ~(chain - 1); |
| 160 | 160 | |
| 161 | if (flip_screen | |
| 161 | if (state->flip_screen | |
| 162 | 162 | { |
| 163 | 163 | flipy = !flipy; |
| 164 | 164 | flipx = !flipx; |
| r14896 | r14897 | |
| 168 | 168 | |
| 169 | 169 | for (count=0;count<chain;count++) |
| 170 | 170 | { |
| 171 | if (flip_screen | |
| 171 | if (state->flip_screen | |
| 172 | 172 | { |
| 173 | 173 | if (!flipy) |
| 174 | 174 | { |
| r14896 | r14897 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | static void draw_sprites_region( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank ) |
| 121 | 121 | { |
| 122 | jackal_state *state = machine.driver_data<jackal_state>(); | |
| 122 | 123 | int offs; |
| 123 | 124 | |
| 124 | 125 | for (offs = 0; offs < length; offs += 5) |
| r14896 | r14897 | |
| 137 | 138 | if (sy > 0xf0) |
| 138 | 139 | sy = sy - 256; |
| 139 | 140 | |
| 140 | if (flip_screen | |
| 141 | if (state->flip_screen | |
| 141 | 142 | { |
| 142 | 143 | sx = 240 - sx; |
| 143 | 144 | sy = 240 - sy; |
| r14896 | r14897 | |
| 150 | 151 | int spritenum = sn1 * 4 + ((sn2 & (8 + 4)) >> 2) + ((sn2 & (2 + 1)) << 10); |
| 151 | 152 | int mod = -8; |
| 152 | 153 | |
| 153 | if (flip_screen | |
| 154 | if (state->flip_screen | |
| 154 | 155 | { |
| 155 | 156 | sx += 8; |
| 156 | 157 | sy -= 8; |
| r14896 | r14897 | |
| 159 | 160 | |
| 160 | 161 | if ((attr & 0x0C) == 0x0C) |
| 161 | 162 | { |
| 162 | if (flip_screen | |
| 163 | if (state->flip_screen | |
| 163 | 164 | DRAW_SPRITE(bank + 1, spritenum, sx, sy) |
| 164 | 165 | } |
| 165 | 166 | |
| r14896 | r14897 | |
| 182 | 183 | |
| 183 | 184 | if (attr & 0x10) |
| 184 | 185 | { |
| 185 | if (flip_screen | |
| 186 | if (state->flip_screen | |
| 186 | 187 | { |
| 187 | 188 | sx -= 16; |
| 188 | 189 | sy -= 16; |
| r14896 | r14897 | |
|---|---|---|
| 312 | 312 | sx += sprite_xoffs; |
| 313 | 313 | sy -= sprite_yoffs; |
| 314 | 314 | |
| 315 | if (flip_screen | |
| 315 | if (state->flip_screen | |
| 316 | 316 | { |
| 317 | 317 | sx = -sx - sizex; |
| 318 | 318 | sy = -sy - sizey; |
| r14896 | r14897 | |
| 344 | 344 | |
| 345 | 345 | scrollx = state->m_xscroll[layer] - xdisp[layer]; |
| 346 | 346 | scrolly = state->m_yscroll[layer] + 9; |
| 347 | if (flip_screen | |
| 347 | if (state->flip_screen | |
| 348 | 348 | { |
| 349 | 349 | scrollx = -scrollx; |
| 350 | 350 | scrolly = -scrolly; |
| r14896 | r14897 | |
| 360 | 360 | int layer; |
| 361 | 361 | |
| 362 | 362 | /* flip screen is embedded in the sprite control registers */ |
| 363 | /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */ | |
| 364 | flip_screen_set_no_update(screen.machine(), state->m_spriteram[0x07f6] & 1); | |
| 365 | screen.machine().tilemap().set_flip_all(flip_screen_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 363 | /* can't use state->flip_screen_set() because the visible area is asymmetrical */ | |
| 364 | state->flip_screen_set_no_update(state->m_spriteram[0x07f6] & 1); | |
| 365 | screen.machine().tilemap().set_flip_all(state->flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 366 | 366 | set_scroll(screen.machine(), 0); |
| 367 | 367 | set_scroll(screen.machine(), 1); |
| 368 | 368 | set_scroll(screen.machine(), 2); |
| r14896 | r14897 | |
|---|---|---|
| 313 | 313 | if (flipx) tile_flipx = !tile_flipx; |
| 314 | 314 | if (flipy) tile_flipy = !tile_flipy; |
| 315 | 315 | |
| 316 | if (flip_screen | |
| 316 | if (state->flip_screen | |
| 317 | 317 | { |
| 318 | 318 | sx = max_x - sx; tile_flipx = !tile_flipx; |
| 319 | 319 | sy = max_y - sy; tile_flipy = !tile_flipy; |
| r14896 | r14897 | |
| 381 | 381 | int sx = x + tx * 8; |
| 382 | 382 | int sy = (y + real_ty * 8) & 0xff; |
| 383 | 383 | |
| 384 | if (flip_screen | |
| 384 | if (state->flip_screen | |
| 385 | 385 | { |
| 386 | 386 | sx = max_x - sx; flipx = !flipx; |
| 387 | 387 | sy = max_y - sy; flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 56 | 56 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 57 | 57 | int pri = state->m_priority[0] & 0x03; |
| 58 | 58 | |
| 59 | flip_screen_set( | |
| 59 | state->flip_screen_set( | |
| 60 | 60 | deco16ic_pf_update(state->m_deco_tilegen1, 0, 0); |
| 61 | 61 | deco16ic_pf_update(state->m_deco_tilegen2, 0, 0); |
| 62 | 62 |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | WRITE8_MEMBER(btime_state::btime_paletteram_w) |
| 141 | 141 | { |
| 142 | 142 | /* RGB output is inverted */ |
| 143 | paletteram_BBGGGRRR_w(space, offset, ~data); | |
| 143 | paletteram_BBGGGRRR_byte_w(space, offset, ~data); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | WRITE8_MEMBER(btime_state::lnc_videoram_w) |
| r14896 | r14897 | |
| 247 | 247 | // Bit 0 = Flip screen |
| 248 | 248 | // Bit 1-7 = Unknown |
| 249 | 249 | |
| 250 | flip_screen_set( | |
| 250 | flip_screen_set( | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | WRITE8_MEMBER(btime_state::bnj_video_control_w) |
| r14896 | r14897 | |
| 277 | 277 | m_btime_palette = (data & 0x30) >> 3; |
| 278 | 278 | |
| 279 | 279 | if (input_port_read(machine(), "DSW1") & 0x40) /* cocktail mode */ |
| 280 | flip_screen_set( | |
| 280 | flip_screen_set( | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | WRITE8_MEMBER(btime_state::disco_video_control_w) |
| r14896 | r14897 | |
| 285 | 285 | m_btime_palette = (data >> 2) & 0x03; |
| 286 | 286 | |
| 287 | 287 | if (!(input_port_read(machine(), "DSW1") & 0x40)) /* cocktail mode */ |
| 288 | flip_screen_set( | |
| 288 | flip_screen_set( | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| r14896 | r14897 | |
| 305 | 305 | if ((priority != -1) && (priority != ((code >> 7) & 0x01))) |
| 306 | 306 | continue; |
| 307 | 307 | |
| 308 | if (flip_screen | |
| 308 | if (state->flip_screen | |
| 309 | 309 | { |
| 310 | 310 | x = 31 + 16 - x; |
| 311 | 311 | y = 33 - y; |
| r14896 | r14897 | |
| 314 | 314 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 315 | 315 | code, |
| 316 | 316 | color, |
| 317 | flip_screen | |
| 317 | state->flip_screen | |
| 318 | 318 | 8*x,8*y, |
| 319 | 319 | transparency ? 0 : -1); |
| 320 | 320 | } |
| r14896 | r14897 | |
| 324 | 324 | UINT8 sprite_y_adjust, UINT8 sprite_y_adjust_flip_screen, |
| 325 | 325 | UINT8 *sprite_ram, offs_t interleave ) |
| 326 | 326 | { |
| 327 | btime_state *state = machine.driver_data<btime_state>(); | |
| 327 | 328 | int i; |
| 328 | 329 | offs_t offs; |
| 329 | 330 | |
| r14896 | r14897 | |
| 341 | 342 | flipx = sprite_ram[offs + 0] & 0x04; |
| 342 | 343 | flipy = sprite_ram[offs + 0] & 0x02; |
| 343 | 344 | |
| 344 | if (flip_screen | |
| 345 | if (state->flip_screen | |
| 345 | 346 | { |
| 346 | 347 | x = 240 + 128 - x; |
| 347 | 348 | y = 256 - y + sprite_y_adjust_flip_screen; |
| r14896 | r14897 | |
| 358 | 359 | flipx,flipy, |
| 359 | 360 | x, y,0); |
| 360 | 361 | |
| 361 | y = y + (flip_screen | |
| 362 | y = y + (state->flip_screen | |
| 362 | 363 | |
| 363 | 364 | // Wrap around |
| 364 | 365 | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| r14896 | r14897 | |
| 394 | 395 | int x = 240 - (16 * (offs / 16) + scroll) - 1; |
| 395 | 396 | int y = 16 * (offs % 16); |
| 396 | 397 | |
| 397 | if (flip_screen | |
| 398 | if (state->flip_screen | |
| 398 | 399 | { |
| 399 | 400 | x = 240 + 128 - x; |
| 400 | 401 | y = 256 - y; |
| r14896 | r14897 | |
| 403 | 404 | drawgfx_opaque(bitmap, cliprect,machine.gfx[2], |
| 404 | 405 | gfx[tileoffset + offs], |
| 405 | 406 | color, |
| 406 | flip_screen | |
| 407 | state->flip_screen | |
| 407 | 408 | x,y); |
| 408 | 409 | } |
| 409 | 410 | } |
| r14896 | r14897 | |
| 418 | 419 | int i, start; |
| 419 | 420 | |
| 420 | 421 | // Generate tile map |
| 421 | if (flip_screen | |
| 422 | if (state->flip_screen | |
| 422 | 423 | start = 0; |
| 423 | 424 | else |
| 424 | 425 | start = 1; |
| r14896 | r14897 | |
| 495 | 496 | sy = 16 * (((offs % 0x100) < 0x80) ? offs % 8 : (offs % 8) + 8); |
| 496 | 497 | sx = 496 - sx; |
| 497 | 498 | |
| 498 | if (flip_screen | |
| 499 | if (state->flip_screen | |
| 499 | 500 | { |
| 500 | 501 | sx = 496 - sx; |
| 501 | 502 | sy = 256 - sy; |
| r14896 | r14897 | |
| 504 | 505 | drawgfx_opaque(*state->m_background_bitmap, state->m_background_bitmap->cliprect(), screen.machine().gfx[2], |
| 505 | 506 | (state->m_bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32, |
| 506 | 507 | 0, |
| 507 | flip_screen | |
| 508 | state->flip_screen | |
| 508 | 509 | sx, sy); |
| 509 | 510 | } |
| 510 | 511 | |
| 511 | 512 | /* copy the background bitmap to the screen */ |
| 512 | 513 | scroll = (state->m_bnj_scroll1 & 0x02) * 128 + 511 - state->m_bnj_scroll2; |
| 513 | if (!flip_screen | |
| 514 | if (!state->flip_screen | |
| 514 | 515 | scroll = 767 - scroll; |
| 515 | 516 | copyscrollbitmap(bitmap, *state->m_background_bitmap, 1, &scroll, 0, 0, cliprect); |
| 516 | 517 | |
| r14896 | r14897 | |
| 542 | 543 | sx = 31 - (offs / 32); |
| 543 | 544 | sy = offs % 32; |
| 544 | 545 | |
| 545 | if (flip_screen | |
| 546 | if (state->flip_screen | |
| 546 | 547 | { |
| 547 | 548 | sx = 31 - sx; |
| 548 | 549 | sy = 33 - sy; |
| r14896 | r14897 | |
| 551 | 552 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[2], |
| 552 | 553 | state->m_bnj_backgroundram[offs], |
| 553 | 554 | 0, |
| 554 | flip_screen | |
| 555 | state->flip_screen | |
| 555 | 556 | 8*sx,8*sy); |
| 556 | 557 | } |
| 557 | 558 |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | int i; |
| 53 | 53 | |
| 54 | paletteram_BBGGRRII_w(space,offset,data); | |
| 54 | paletteram_BBGGRRII_byte_w(space,offset,data); | |
| 55 | 55 | |
| 56 | 56 | // expand the sprite palette to full length |
| 57 | 57 | if (offset < 16) |
| 58 | 58 | { |
| 59 | paletteram_BBGGRRII_w(space, 0x200 + offset * 16 + 1, data); | |
| 59 | paletteram_BBGGRRII_byte_w(space, 0x200 + offset * 16 + 1, data); | |
| 60 | 60 | |
| 61 | 61 | if (offset != 1) |
| 62 | 62 | { |
| 63 | 63 | for (i = 0; i < 16; i++) |
| 64 | 64 | { |
| 65 | paletteram_BBGGRRII_w(space, 0x200 + offset + i * 16, data); | |
| 65 | paletteram_BBGGRRII_byte_w(space, 0x200 + offset + i * 16, data); | |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | } |
| r14896 | r14897 | |
| 248 | 248 | WRITE8_MEMBER(nova2001_state::nova2001_flipscreen_w) |
| 249 | 249 | { |
| 250 | 250 | // inverted |
| 251 | flip_screen_set( | |
| 251 | flip_screen_set( | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | WRITE8_MEMBER(nova2001_state::pkunwar_flipscreen_w) |
| 255 | 255 | { |
| 256 | flip_screen_set( | |
| 256 | flip_screen_set( | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| r14896 | r14897 | |
| 286 | 286 | continue; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | if (flip_screen | |
| 289 | if (state->flip_screen | |
| 290 | 290 | { |
| 291 | 291 | sx = 240 - sx; |
| 292 | 292 | sy = 240 - sy; |
| r14896 | r14897 | |
| 324 | 324 | continue; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | if (flip_screen | |
| 327 | if (state->flip_screen | |
| 328 | 328 | { |
| 329 | 329 | sx = 240 - sx; |
| 330 | 330 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 2312 | 2312 | |
| 2313 | 2313 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 2314 | 2314 | { \ |
| 2315 | if (flip_screen | |
| 2315 | if (state->flip_screen | |
| 2316 | 2316 | pdrawgfx_transpen(bitmap,\ |
| 2317 | 2317 | cliprect,machine.gfx[2], \ |
| 2318 | 2318 | CODE, \ |
| r14896 | r14897 | |
| 2550 | 2550 | |
| 2551 | 2551 | #define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \ |
| 2552 | 2552 | { \ |
| 2553 | if (flip_screen | |
| 2553 | if (state->flip_screen | |
| 2554 | 2554 | pdrawgfx_transpen(bitmap,\ |
| 2555 | 2555 | cliprect,machine.gfx[2], \ |
| 2556 | 2556 | CODE, \ |
| r14896 | r14897 | |
| 2718 | 2718 | int sy = (offs % 256); |
| 2719 | 2719 | sx = (sx - state->m_stars2x + (col & 0x1f)) & 0x1ff; |
| 2720 | 2720 | sy = (sy - state->m_stars2y) & 0xff; |
| 2721 | if (flip_screen | |
| 2721 | if (state->flip_screen | |
| 2722 | 2722 | { |
| 2723 | 2723 | sx = 511 - sx; |
| 2724 | 2724 | sy = 255 - sy; |
| r14896 | r14897 | |
| 2743 | 2743 | int sy = (offs % 256); |
| 2744 | 2744 | sx = (sx - state->m_stars1x + (col & 0x1f)) & 0x1ff; |
| 2745 | 2745 | sy = (sy - state->m_stars1y) & 0xff; |
| 2746 | if (flip_screen | |
| 2746 | if (state->flip_screen | |
| 2747 | 2747 | { |
| 2748 | 2748 | sx = 511 - sx; |
| 2749 | 2749 | sy = 255 - sy; |
| r14896 | r14897 | |
| 2805 | 2805 | int layercontrol, l0, l1, l2, l3; |
| 2806 | 2806 | int videocontrol = state->m_cps_a_regs[CPS1_VIDEOCONTROL]; |
| 2807 | 2807 | |
| 2808 | flip_screen_set( | |
| 2808 | state->flip_screen_set( | |
| 2809 | 2809 | |
| 2810 | 2810 | layercontrol = state->m_cps_b_regs[state->m_game_config->layer_control / 2]; |
| 2811 | 2811 |
| r14896 | r14897 | |
|---|---|---|
| 172 | 172 | x += state->m_sprites_scrolldx; |
| 173 | 173 | y += state->m_sprites_scrolldy; |
| 174 | 174 | |
| 175 | if (flip_screen | |
| 175 | if (state->flip_screen | |
| 176 | 176 | { |
| 177 | 177 | flipx = !flipx; x = max_x - x - 16; |
| 178 | 178 | flipy = !flipy; y = max_y - y - 16; |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | WRITE8_MEMBER(mermaid_state::mermaid_flip_screen_x_w) |
| 85 | 85 | { |
| 86 | flip_screen_x_set( | |
| 86 | flip_screen_x_set( | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | WRITE8_MEMBER(mermaid_state::mermaid_flip_screen_y_w) |
| 90 | 90 | { |
| 91 | flip_screen_y_set( | |
| 91 | flip_screen_y_set( | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | WRITE8_MEMBER(mermaid_state::mermaid_bg_scroll_w) |
| r14896 | r14897 | |
| 205 | 205 | code |= state->m_rougien_gfxbank1 * 0x2800; |
| 206 | 206 | code |= state->m_rougien_gfxbank2 * 0x2400; |
| 207 | 207 | |
| 208 | if (flip_screen_x | |
| 208 | if (state->flip_screen_x | |
| 209 | 209 | { |
| 210 | 210 | flipx = !flipx; |
| 211 | 211 | sx = 240 - sx; |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | if (flip_screen_y | |
| 214 | if (state->flip_screen_y | |
| 215 | 215 | { |
| 216 | 216 | flipy = !flipy; |
| 217 | 217 | sy = 240 - sy; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | drawgfx_transpen(bitmap, (flip_screen_x | |
| 220 | drawgfx_transpen(bitmap, (state->flip_screen_x | |
| 221 | 221 | machine.gfx[1], code, color, flipx, flipy, sx, sy, 0); |
| 222 | 222 | } |
| 223 | 223 | } |
| r14896 | r14897 | |
| 291 | 291 | code |= state->m_rougien_gfxbank1 * 0x2800; |
| 292 | 292 | code |= state->m_rougien_gfxbank2 * 0x2400; |
| 293 | 293 | |
| 294 | if (flip_screen_x | |
| 294 | if (state->flip_screen_x | |
| 295 | 295 | { |
| 296 | 296 | flipx = !flipx; |
| 297 | 297 | sx = 240 - sx; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | if (flip_screen_y | |
| 300 | if (state->flip_screen_y | |
| 301 | 301 | { |
| 302 | 302 | flipy = !flipy; |
| 303 | 303 | sy = 240 - sy; |
| r14896 | r14897 | |
| 354 | 354 | code2 |= state->m_rougien_gfxbank1 * 0x2800; |
| 355 | 355 | code2 |= state->m_rougien_gfxbank2 * 0x2400; |
| 356 | 356 | |
| 357 | if (flip_screen_x | |
| 357 | if (state->flip_screen_x | |
| 358 | 358 | { |
| 359 | 359 | flipx2 = !flipx2; |
| 360 | 360 | sx2 = 240 - sx2; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | if (flip_screen_y | |
| 363 | if (state->flip_screen_y | |
| 364 | 364 | { |
| 365 | 365 | flipy2 = !flipy2; |
| 366 | 366 | sy2 = 240 - sy2; |
| r14896 | r14897 | |
| 394 | 394 | code |= state->m_rougien_gfxbank1 * 0x2800; |
| 395 | 395 | code |= state->m_rougien_gfxbank2 * 0x2400; |
| 396 | 396 | |
| 397 | if (flip_screen_x | |
| 397 | if (state->flip_screen_x | |
| 398 | 398 | { |
| 399 | 399 | flipx = !flipx; |
| 400 | 400 | sx = 240 - sx; |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | if (flip_screen_y | |
| 403 | if (state->flip_screen_y | |
| 404 | 404 | { |
| 405 | 405 | flipy = !flipy; |
| 406 | 406 | sy = 240 - sy; |
| r14896 | r14897 | |
| 435 | 435 | code2 |= state->m_rougien_gfxbank1 * 0x2800; |
| 436 | 436 | code2 |= state->m_rougien_gfxbank2 * 0x2400; |
| 437 | 437 | |
| 438 | if (flip_screen_x | |
| 438 | if (state->flip_screen_x | |
| 439 | 439 | { |
| 440 | 440 | flipx2 = !flipx2; |
| 441 | 441 | sx2 = 240 - sx2; |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | if (flip_screen_y | |
| 444 | if (state->flip_screen_y | |
| 445 | 445 | { |
| 446 | 446 | flipy2 = !flipy2; |
| 447 | 447 | sy2 = 240 - sy2; |
| r14896 | r14897 | |
| 475 | 475 | code |= state->m_rougien_gfxbank1 * 0x2800; |
| 476 | 476 | code |= state->m_rougien_gfxbank2 * 0x2400; |
| 477 | 477 | |
| 478 | if (flip_screen_x | |
| 478 | if (state->flip_screen_x | |
| 479 | 479 | { |
| 480 | 480 | flipx = !flipx; |
| 481 | 481 | sx = 240 - sx; |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | if (flip_screen_y | |
| 484 | if (state->flip_screen_y | |
| 485 | 485 | { |
| 486 | 486 | flipy = !flipy; |
| 487 | 487 | sy = 240 - sy; |
| r14896 | r14897 | |
| 516 | 516 | code2 |= state->m_rougien_gfxbank1 * 0x2800; |
| 517 | 517 | code2 |= state->m_rougien_gfxbank2 * 0x2400; |
| 518 | 518 | |
| 519 | if (flip_screen_x | |
| 519 | if (state->flip_screen_x | |
| 520 | 520 | { |
| 521 | 521 | flipx2 = !flipx2; |
| 522 | 522 | sx2 = 240 - sx2; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | if (flip_screen_y | |
| 525 | if (state->flip_screen_y | |
| 526 | 526 | { |
| 527 | 527 | flipy2 = !flipy2; |
| 528 | 528 | sy2 = 240 - sy2; |
| r14896 | r14897 | |
|---|---|---|
| 153 | 153 | sizex = (state->m_buf_spriteram[offs + 2] & 0x000f) + 1; |
| 154 | 154 | sizey = (state->m_buf_spriteram[offs + 3] & 0x000f) + 1; |
| 155 | 155 | |
| 156 | if (flip_screen | |
| 156 | if (state->flip_screen | |
| 157 | 157 | { |
| 158 | 158 | flipx = !flipx; |
| 159 | 159 | flipy = !flipy; |
| r14896 | r14897 | |
| 180 | 180 | othldrby_state *state = screen.machine().driver_data<othldrby_state>(); |
| 181 | 181 | int layer; |
| 182 | 182 | |
| 183 | flip_screen_set( | |
| 183 | state->flip_screen_set( | |
| 184 | 184 | |
| 185 | 185 | for (layer = 0; layer < 3; layer++) |
| 186 | 186 | { |
| 187 | if (flip_screen | |
| 187 | if (state->flip_screen | |
| 188 | 188 | { |
| 189 | 189 | state->m_bg_tilemap[layer]->set_scrollx(0, state->m_vreg[2 * layer] + 59); |
| 190 | 190 | state->m_bg_tilemap[layer]->set_scrolly(0, state->m_vreg[2 * layer + 1] + 248); |
| r14896 | r14897 | |
|---|---|---|
| 489 | 489 | |
| 490 | 490 | WRITE8_MEMBER(snk_state::marvins_flipscreen_w) |
| 491 | 491 | { |
| 492 | flip_screen_set( | |
| 492 | flip_screen_set( | |
| 493 | 493 | |
| 494 | 494 | // other bits unknown |
| 495 | 495 | } |
| r14896 | r14897 | |
| 497 | 497 | WRITE8_MEMBER(snk_state::sgladiat_flipscreen_w) |
| 498 | 498 | { |
| 499 | 499 | |
| 500 | flip_screen_set( | |
| 500 | flip_screen_set( | |
| 501 | 501 | |
| 502 | 502 | m_bg_tilemap->set_palette_offset(((data & 0xf) ^ 8) << 4); |
| 503 | 503 | |
| r14896 | r14897 | |
| 507 | 507 | WRITE8_MEMBER(snk_state::hal21_flipscreen_w) |
| 508 | 508 | { |
| 509 | 509 | |
| 510 | flip_screen_set( | |
| 510 | flip_screen_set( | |
| 511 | 511 | |
| 512 | 512 | m_bg_tilemap->set_palette_offset(((data & 0xf) ^ 8) << 4); |
| 513 | 513 | if (m_bg_tile_offset != ((data & 0x20) << 3)) |
| r14896 | r14897 | |
| 558 | 558 | */ |
| 559 | 559 | |
| 560 | 560 | |
| 561 | flip_screen_set( | |
| 561 | flip_screen_set( | |
| 562 | 562 | |
| 563 | 563 | m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x10) << 4); |
| 564 | 564 | m_sp16_scrolly = (m_sp16_scrolly & 0xff) | ((data & 0x08) << 5); |
| r14896 | r14897 | |
| 581 | 581 | */ |
| 582 | 582 | |
| 583 | 583 | |
| 584 | flip_screen_set( | |
| 584 | flip_screen_set( | |
| 585 | 585 | |
| 586 | 586 | if (m_tx_tile_offset != ((data & 0x40) << 2)) |
| 587 | 587 | { |
| r14896 | r14897 | |
| 661 | 661 | WRITE8_MEMBER(snk_state::gwar_videoattrs_w) |
| 662 | 662 | { |
| 663 | 663 | |
| 664 | flip_screen_set( | |
| 664 | flip_screen_set( | |
| 665 | 665 | |
| 666 | 666 | m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x80) << 1); |
| 667 | 667 | m_sp16_scrollx = (m_sp16_scrollx & 0xff) | ((data & 0x40) << 2); |
| r14896 | r14897 | |
| 674 | 674 | WRITE8_MEMBER(snk_state::gwara_videoattrs_w) |
| 675 | 675 | { |
| 676 | 676 | |
| 677 | flip_screen_set( | |
| 677 | flip_screen_set( | |
| 678 | 678 | |
| 679 | 679 | m_bg_scrollx = (m_bg_scrollx & 0xff) | ((data & 0x02) << 7); |
| 680 | 680 | m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x01) << 8); |
| r14896 | r14897 | |
| 733 | 733 | int flipy = (attributes&0x20); |
| 734 | 734 | int flipx = 0; |
| 735 | 735 | |
| 736 | if (flip_screen | |
| 736 | if (state->flip_screen | |
| 737 | 737 | { |
| 738 | 738 | sx = 89 - 16 - sx; |
| 739 | 739 | sy = 262 - 16 - sy; |
| r14896 | r14897 | |
| 800 | 800 | yflip = attributes & 0x20; |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | if (flip_screen | |
| 803 | if (state->flip_screen | |
| 804 | 804 | { |
| 805 | 805 | sx = 89 - size - sx; // this causes slight misalignment in tnk3 but is correct for athena and fitegolf |
| 806 | 806 | sy = 262 - size - sy; |
| r14896 | r14897 | |
| 935 | 935 | if (hw_xflip) |
| 936 | 936 | sx = 495 - size - sx; |
| 937 | 937 | |
| 938 | if (flip_screen | |
| 938 | if (state->flip_screen | |
| 939 | 939 | { |
| 940 | 940 | sx = 495 - size - sx; |
| 941 | 941 | sy = 258 - size - sy; |
| r14896 | r14897 | |
|---|---|---|
| 557 | 557 | |
| 558 | 558 | UINT32 gfxstart = (8 * 8 * 4 / 8) * (((attr & 0x000f) << 16) + code); |
| 559 | 559 | |
| 560 | if (flip_screen | |
| 560 | if (state->flip_screen | |
| 561 | 561 | { |
| 562 | 562 | flipx = !flipx; x = max_x - x - width; |
| 563 | 563 | flipy = !flipy; y = max_y - y - height; |
| r14896 | r14897 | |
| 729 | 729 | ---- ---- ---- ---0 Flip Screen */ |
| 730 | 730 | if (screenctrl & 2) |
| 731 | 731 | return 0; |
| 732 | flip_screen_set( | |
| 732 | state->flip_screen_set( | |
| 733 | 733 | |
| 734 | 734 | #if 0 |
| 735 | 735 | if (screen.machine().input().code_pressed(KEYCODE_Z)) |
| r14896 | r14897 | |
|---|---|---|
| 102 | 102 | WRITE8_MEMBER(flstory_state::flstory_palette_w) |
| 103 | 103 | { |
| 104 | 104 | if (offset & 0x100) |
| 105 | paletteram_xxxxBBBBGGGGRRRR_split | |
| 105 | paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w(space, (offset & 0xff) + (m_palette_bank << 8),data); | |
| 106 | 106 | else |
| 107 | paletteram_xxxxBBBBGGGGRRRR_split | |
| 107 | paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w(space, (offset & 0xff) + (m_palette_bank << 8),data); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | READ8_MEMBER(flstory_state::flstory_palette_r) |
| r14896 | r14897 | |
| 129 | 129 | } |
| 130 | 130 | m_palette_bank = (data & 0x20) >> 5; |
| 131 | 131 | |
| 132 | flip_screen_set(m | |
| 132 | flip_screen_set(m | |
| 133 | 133 | |
| 134 | 134 | //popmessage("%04x: gfxctrl = %02x\n", cpu_get_pc(&space.device()), data); |
| 135 | 135 | |
| r14896 | r14897 | |
| 151 | 151 | if (data & 0x04) |
| 152 | 152 | { |
| 153 | 153 | m_flipscreen = (data & 0x01); |
| 154 | flip_screen_set(m | |
| 154 | flip_screen_set(m | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | //popmessage("%04x: gfxctrl = %02x\n", cpu_get_pc(&space.device()), data); |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | m_scrl_ctrl = data >> 5; |
| 54 | 54 | |
| 55 | if (flip_screen | |
| 55 | if (flip_screen | |
| 56 | 56 | { |
| 57 | flip_screen_set( | |
| 57 | flip_screen_set( | |
| 58 | 58 | machine().tilemap().mark_all_dirty(); |
| 59 | 59 | } |
| 60 | 60 | } |
| r14896 | r14897 | |
| 89 | 89 | { |
| 90 | 90 | int code = spriteram[offs + 1]; |
| 91 | 91 | int color = spriteram[offs + 2] & 0x3f; |
| 92 | int flipx = flip_screen_x_get(machine); | |
| 93 | int flipy = flip_screen_y_get(machine); | |
| 92 | int flipx = state->flip_screen_x(); | |
| 93 | int flipy = state->flip_screen_y(); | |
| 94 | 94 | |
| 95 | 95 | int sx = spriteram[offs + 3]; |
| 96 | 96 | int sy = spriteram[offs]; |
| 97 | 97 | int px, py; |
| 98 | 98 | |
| 99 | if (flip_screen | |
| 99 | if (state->flip_screen | |
| 100 | 100 | { |
| 101 | 101 | px = 240 - sx + 0; /* +2 or +0 ? */ |
| 102 | 102 | py = sy; |
| r14896 | r14897 | |
|---|---|---|
| 268 | 268 | { |
| 269 | 269 | if (data & 0x80) |
| 270 | 270 | { |
| 271 | if (flip_screen | |
| 271 | if (state->flip_screen | |
| 272 | 272 | bitmap.pix16(255-y, 255-x) = pen; |
| 273 | 273 | else |
| 274 | 274 | bitmap.pix16(y, x) = pen; |
| r14896 | r14897 | |
| 317 | 317 | |
| 318 | 318 | static void cosmica_draw_starfield( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 319 | 319 | { |
| 320 | cosmic_state *state = screen.machine().driver_data<cosmic_state>(); | |
| 320 | 321 | UINT8 y = 0; |
| 321 | 322 | UINT8 map = 0; |
| 322 | 323 | UINT8 *PROM = screen.machine().region("user2")->base(); |
| r14896 | r14897 | |
| 333 | 334 | UINT8 x1; |
| 334 | 335 | int hc, hb_; |
| 335 | 336 | |
| 336 | if (flip_screen | |
| 337 | if (state->flip_screen | |
| 337 | 338 | x1 = x - screen.frame_number(); |
| 338 | 339 | else |
| 339 | 340 | x1 = x + screen.frame_number(); |
| r14896 | r14897 | |
| 366 | 367 | |
| 367 | 368 | static void devzone_draw_grid( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 368 | 369 | { |
| 370 | cosmic_state *state = machine.driver_data<cosmic_state>(); | |
| 369 | 371 | UINT8 y; |
| 370 | 372 | UINT8 *horz_PROM = machine.region("user2")->base(); |
| 371 | 373 | UINT8 *vert_PROM = machine.region("user3")->base(); |
| r14896 | r14897 | |
| 404 | 406 | if (!(vert_data & horz_data & 0x80)) /* NAND gate */ |
| 405 | 407 | { |
| 406 | 408 | /* blue */ |
| 407 | if (flip_screen | |
| 409 | if (state->flip_screen | |
| 408 | 410 | bitmap.pix16(255-y, 255-x) = 4; |
| 409 | 411 | else |
| 410 | 412 | bitmap.pix16(y, x) = 4; |
| r14896 | r14897 | |
| 424 | 426 | |
| 425 | 427 | static void nomnlnd_draw_background( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 426 | 428 | { |
| 429 | cosmic_state *state = screen.machine().driver_data<cosmic_state>(); | |
| 427 | 430 | UINT8 y = 0; |
| 428 | 431 | UINT8 water = screen.frame_number(); |
| 429 | 432 | UINT8 *PROM = screen.machine().region("user2")->base(); |
| r14896 | r14897 | |
| 489 | 492 | if ((!hd_) & hc_ & (!hb_)) |
| 490 | 493 | { |
| 491 | 494 | offs_t offs = ((x >> 3) & 0x03) | ((y & 0x1f) << 2) | |
| 492 | (flip_screen | |
| 495 | (state->flip_screen | |
| 493 | 496 | |
| 494 | 497 | UINT8 plane1 = PROM[offs ] << (x & 0x07); |
| 495 | 498 | UINT8 plane2 = PROM[offs | 0x0400] << (x & 0x07); |
| r14896 | r14897 | |
| 523 | 526 | |
| 524 | 527 | if (color != 0) |
| 525 | 528 | { |
| 526 | if (flip_screen | |
| 529 | if (state->flip_screen | |
| 527 | 530 | bitmap.pix16(255-y, 255-x) = color; |
| 528 | 531 | else |
| 529 | 532 | bitmap.pix16(y, x) = color; |
| r14896 | r14897 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | m_nmi_enable = data; |
| 127 | 127 | |
| 128 | if (flip_screen | |
| 128 | if (flip_screen | |
| 129 | 129 | { |
| 130 | flip_screen_set( | |
| 130 | flip_screen_set( | |
| 131 | 131 | machine().tilemap().mark_all_dirty(); |
| 132 | 132 | } |
| 133 | 133 | } |
| r14896 | r14897 | |
| 170 | 170 | int sx = 240 - spriteram[offs + 6]; |
| 171 | 171 | int sy = 248 - spriteram[offs + 4]; |
| 172 | 172 | |
| 173 | if (flip_screen | |
| 173 | if (state->flip_screen | |
| 174 | 174 | { |
| 175 | 175 | sx = 240 - sx; |
| 176 | 176 | sy = 248 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 38 | 38 | if (state->m_spriteram2 != NULL) |
| 39 | 39 | screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram2, 0x800, true); |
| 40 | 40 | |
| 41 | screen.machine().tilemap().set_flip_all(flip_screen_x | |
| 41 | screen.machine().tilemap().set_flip_all(state->flip_screen_x | |
| 42 | 42 | |
| 43 | 43 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 44 | 44 |
| r14896 | r14897 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | int offs, end, incr; |
| 215 | 215 | |
| 216 | int flipscreen = flip_screen | |
| 216 | int flipscreen = machine().driver_data()->flip_screen | |
| 217 | 217 | |
| 218 | 218 | if (invert_flip) |
| 219 | 219 | flipscreen = !flipscreen; |
| r14896 | r14897 | |
|---|---|---|
| 191 | 191 | sx = 8 * (offset % 128); |
| 192 | 192 | sy = 8 * (offset / 128); |
| 193 | 193 | |
| 194 | if (flip_screen | |
| 194 | if (flip_screen | |
| 195 | 195 | sy = 512-8 - sy; |
| 196 | 196 | |
| 197 | 197 | colour = data & 0x0f; |
| r14896 | r14897 | |
| 208 | 208 | sx = 8 * (offset % 64); |
| 209 | 209 | sy = 4 * (offset / 64); |
| 210 | 210 | |
| 211 | if (flip_screen | |
| 211 | if (flip_screen | |
| 212 | 212 | sy = 512-4 - sy; |
| 213 | 213 | |
| 214 | 214 | colour = data & 0x0f; |
| r14896 | r14897 | |
| 282 | 282 | int offs; |
| 283 | 283 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 284 | 284 | |
| 285 | if (state->m_lastflip != flip_screen | |
| 285 | if (state->m_lastflip != state->flip_screen | |
| 286 | 286 | { |
| 287 | 287 | for (offs = 0;offs < popeye_bitmapram_size;offs++) |
| 288 | 288 | state->popeye_bitmap_w(*space,offs,state->m_bitmapram[offs]); |
| 289 | 289 | |
| 290 | state->m_lastflip = flip_screen | |
| 290 | state->m_lastflip = state->flip_screen | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | set_background_palette(machine, (*state->m_palettebank & 0x08) >> 3); |
| r14896 | r14897 | |
| 303 | 303 | if (state->m_bitmap_type == TYPE_SKYSKIPR) |
| 304 | 304 | scrollx = 2*scrollx - 512; |
| 305 | 305 | |
| 306 | if (flip_screen | |
| 306 | if (state->flip_screen | |
| 307 | 307 | { |
| 308 | 308 | if (state->m_bitmap_type == TYPE_POPEYE) |
| 309 | 309 | scrollx = -scrollx; |
| r14896 | r14897 | |
| 351 | 351 | sx = 2*(spriteram[offs])-8; |
| 352 | 352 | sy = 2*(256-spriteram[offs + 1]); |
| 353 | 353 | |
| 354 | if (flip_screen | |
| 354 | if (state->flip_screen | |
| 355 | 355 | { |
| 356 | 356 | flipx = !flipx; |
| 357 | 357 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 105 | 105 | flipx = spriteram[offs + 1] & 2; |
| 106 | 106 | flipy = spriteram[offs + 1] & 1; /* flip y untested */ |
| 107 | 107 | |
| 108 | if (flip_screen | |
| 108 | if (state->flip_screen | |
| 109 | 109 | { |
| 110 | 110 | x = 240 - x; |
| 111 | 111 | y = 240 - y; |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | WRITE8_MEMBER(hyperspt_state::hyperspt_flipscreen_w) |
| 105 | 105 | { |
| 106 | if (flip_screen | |
| 106 | if (flip_screen | |
| 107 | 107 | { |
| 108 | flip_screen_set( | |
| 108 | flip_screen_set( | |
| 109 | 109 | machine().tilemap().mark_all_dirty(); |
| 110 | 110 | } |
| 111 | 111 | } |
| r14896 | r14897 | |
| 143 | 143 | int flipx = ~spriteram[offs] & 0x40; |
| 144 | 144 | int flipy = spriteram[offs] & 0x80; |
| 145 | 145 | |
| 146 | if (flip_screen | |
| 146 | if (state->flip_screen | |
| 147 | 147 | { |
| 148 | 148 | sy = 240 - sy; |
| 149 | 149 | flipy = !flipy; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | /* Note that this adjustment must be done AFTER handling flip_screen | |
| 152 | /* Note that this adjustment must be done AFTER handling state->flip_screen | |
| 153 | 153 | /* proving that this is a hardware related "feature" */ |
| 154 | 154 | |
| 155 | 155 | sy += 1; |
| r14896 | r14897 | |
| 180 | 180 | for (row = 0; row < 32; row++) |
| 181 | 181 | { |
| 182 | 182 | int scrollx = state->m_scroll[row * 2] + (state->m_scroll[(row * 2) + 1] & 0x01) * 256; |
| 183 | if (flip_screen | |
| 183 | if (state->flip_screen | |
| 184 | 184 | state->m_bg_tilemap->set_scrollx(row, scrollx); |
| 185 | 185 | } |
| 186 | 186 |
| r14896 | r14897 | |
|---|---|---|
| 508 | 508 | { |
| 509 | 509 | |
| 510 | 510 | COMBINE_DATA(&m_colorram1[offset]); |
| 511 | paletteram | |
| 511 | paletteram | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | /* sprite palette */ |
| r14896 | r14897 | |
| 522 | 522 | { |
| 523 | 523 | |
| 524 | 524 | COMBINE_DATA(&m_colorram2[offset]); |
| 525 | paletteram | |
| 525 | paletteram | |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | READ16_MEMBER(toaplan1_state::toaplan1_spriteram16_r) |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | WRITE8_MEMBER( zodiack_state::flipscreen_w ) |
| 41 | 41 | { |
| 42 | if (flip_screen | |
| 42 | if (flip_screen | |
| 43 | 43 | { |
| 44 | flip_screen_set( | |
| 44 | flip_screen_set( | |
| 45 | 45 | machine().tilemap().mark_all_dirty(); |
| 46 | 46 | } |
| 47 | 47 | } |
| r14896 | r14897 | |
| 127 | 127 | m_fg_tilemap->set_scroll_cols(32); |
| 128 | 128 | |
| 129 | 129 | /* FIXME: flip_screen_x should not be written. */ |
| 130 | flip_screen_set_no_update( | |
| 130 | flip_screen_set_no_update( | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | void zodiack_state::draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| r14896 | r14897 | |
| 139 | 139 | x = m_bulletsram[offs + 3] + 7; |
| 140 | 140 | y = 255 - m_bulletsram[offs + 1]; |
| 141 | 141 | |
| 142 | if (flip_screen | |
| 142 | if (flip_screen | |
| 143 | 143 | { |
| 144 | 144 | y = 255 - y; |
| 145 | 145 | } |
| r14896 | r14897 | |
| 166 | 166 | flipy = m_spriteram[offs + 1] & 0x80; |
| 167 | 167 | spritecode = m_spriteram[offs + 1] & 0x3f; |
| 168 | 168 | |
| 169 | if (flip_screen | |
| 169 | if (flip_screen | |
| 170 | 170 | { |
| 171 | 171 | sy = 240 - sy; |
| 172 | 172 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 190 | 190 | flipy = (spriteram[offs+1]&0x80)>>7; |
| 191 | 191 | flipx = (spriteram[offs+1]&0x40)>>6; |
| 192 | 192 | |
| 193 | if (flip_screen_x | |
| 193 | if (state->flip_screen_x | |
| 194 | 194 | { |
| 195 | 195 | sx = 256 - sx; |
| 196 | 196 | flipx = !flipx; |
| 197 | 197 | } |
| 198 | if (flip_screen_y | |
| 198 | if (state->flip_screen_y | |
| 199 | 199 | { |
| 200 | 200 | sy = 240 - sy; |
| 201 | 201 | flipy = !flipy; |
| r14896 | r14897 | |
| 245 | 245 | dx=128-state->m_h_heed+((state->m_ha&8)<<5)+3; |
| 246 | 246 | dy=128-state->m_v_heed+((state->m_ha&0x10)<<4); |
| 247 | 247 | |
| 248 | if (flip_screen_x | |
| 248 | if (state->flip_screen_x | |
| 249 | 249 | dx=128-dx+16; |
| 250 | 250 | |
| 251 | if (flip_screen_y | |
| 251 | if (state->flip_screen_y | |
| 252 | 252 | dy=128-dy; |
| 253 | 253 | |
| 254 | 254 | myclip.set(dx, dx+127, dy, dy+127); |
| r14896 | r14897 | |
| 260 | 260 | draw_sprites(screen.machine(),bitmap,myclip); |
| 261 | 261 | |
| 262 | 262 | if(state->m_ha&4) |
| 263 | copybitmap_trans(bitmap,*state->m_tmp_bitmap[state->m_ha&3],flip_screen_x | |
| 263 | copybitmap_trans(bitmap,*state->m_tmp_bitmap[state->m_ha&3],state->flip_screen_x | |
| 264 | 264 | state->m_fg->draw(bitmap, cliprect, 0,0); |
| 265 | 265 | return 0; |
| 266 | 266 | } |
| r14896 | r14897 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | ***************************************************************************/ |
| 211 | 211 | |
| 212 | void liberatr_state::video_start() | |
| 212 | void liberatr_state::video_start_liberatr() | |
| 213 | 213 | { |
| 214 | 214 | // for each planet in the planet ROMs |
| 215 | 215 | init_planet(m_planets[0], &machine().region("gfx1")->base()[0x2000]); |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_x_w) |
| 47 | 47 | { |
| 48 | flip_screen_x_set( | |
| 48 | flip_screen_x_set( | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_y_w) |
| 52 | 52 | { |
| 53 | flip_screen_y_set( | |
| 53 | flip_screen_y_set( | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | WRITE8_MEMBER(tehkanwc_state::gridiron_led0_w) |
| r14896 | r14897 | |
| 140 | 140 | int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128; |
| 141 | 141 | int sy = spriteram[offs + 3]; |
| 142 | 142 | |
| 143 | if (flip_screen_x | |
| 143 | if (state->flip_screen_x | |
| 144 | 144 | { |
| 145 | 145 | sx = 240 - sx; |
| 146 | 146 | flipx = !flipx; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | if (flip_screen_y | |
| 149 | if (state->flip_screen_y | |
| 150 | 150 | { |
| 151 | 151 | sy = 240 - sy; |
| 152 | 152 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 183 | 183 | |
| 184 | 184 | if (ACCESSING_BITS_8_15) |
| 185 | 185 | { |
| 186 | flip_screen_set( | |
| 186 | flip_screen_set( | |
| 187 | 187 | |
| 188 | 188 | m_bg_tilemap->enable(data & 0x2000); /* guess */ |
| 189 | 189 | m_fg_tilemap->enable(data & 0x1000); /* guess */ |
| r14896 | r14897 | |
| 223 | 223 | if (sy > 512 - 16) |
| 224 | 224 | sy -= 512; |
| 225 | 225 | |
| 226 | if (flip_screen | |
| 226 | if (state->flip_screen | |
| 227 | 227 | { |
| 228 | 228 | sx = 240 - sx; |
| 229 | 229 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 71 | 71 | y = (y + 16) % 0x200; |
| 72 | 72 | x = 256 - x; |
| 73 | 73 | y = 256 - y; |
| 74 | if (flip_screen | |
| 74 | if (machine.driver_data()->flip_screen | |
| 75 | 75 | { |
| 76 | 76 | y = 240 - y; |
| 77 | 77 | x = 240 - x; |
| r14896 | r14897 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | /* bit 0 flips screen */ |
| 97 | 97 | /* it is also used to multiplex player 1 and player 2 controls */ |
| 98 | flip_screen_set( | |
| 98 | flip_screen_set( | |
| 99 | 99 | |
| 100 | 100 | /* bits 1-3 are unknown */ |
| 101 | 101 | // if ((data & 0x0e) != 0) logerror("background register = %02x\n", data); |
| r14896 | r14897 | |
| 115 | 115 | sx = state->m_spriteram[offs + 3]; |
| 116 | 116 | sy = 239 - state->m_spriteram[offs]; |
| 117 | 117 | flipx = ~state->m_spriteram[offs + 2] & 0x10; |
| 118 | if (flip_screen | |
| 118 | if (state->flip_screen | |
| 119 | 119 | { |
| 120 | 120 | sx = 240 - sx; |
| 121 | 121 | sy = 238 - sy; |
| r14896 | r14897 | |
| 125 | 125 | drawgfx_transpen(bitmap, cliprect, machine.gfx[state->m_spriteram[offs + 1] & 0x80 ? 2 : 1], |
| 126 | 126 | state->m_spriteram[offs + 1] & 0x7f, |
| 127 | 127 | state->m_spriteram[offs + 2] & 0x0f, |
| 128 | flipx,flip_screen | |
| 128 | flipx,state->flip_screen | |
| 129 | 129 | sx, sy, 0); |
| 130 | 130 | } |
| 131 | 131 | } |
| r14896 | r14897 | |
|---|---|---|
| 332 | 332 | zoomx = 32 - zoomx; |
| 333 | 333 | zoomy = 32 - zoomy; |
| 334 | 334 | |
| 335 | if (flip_screen | |
| 335 | if (state->flip_screen | |
| 336 | 336 | { |
| 337 | 337 | x = width - x - (nx * zoomx) / 2; |
| 338 | 338 | y = height - y - (ny * zoomy) / 2; |
| r14896 | r14897 | |
| 453 | 453 | zoomy = 32 - zoomy; |
| 454 | 454 | |
| 455 | 455 | |
| 456 | if (flip_screen | |
| 456 | if (state->flip_screen | |
| 457 | 457 | { |
| 458 | 458 | x = width - x - (nx * zoomx) / 2; |
| 459 | 459 | y = height - y - (ny * zoomy) / 2; |
| r14896 | r14897 | |
| 533 | 533 | |
| 534 | 534 | tilemap_t *tmptilemap0, *tmptilemap1; |
| 535 | 535 | |
| 536 | flip_screen_set( | |
| 536 | state->flip_screen_set( | |
| 537 | 537 | |
| 538 | 538 | /* Layers enable (not quite right) */ |
| 539 | 539 | |
| r14896 | r14897 | |
| 707 | 707 | |
| 708 | 708 | tilemap_t *tmptilemap0, *tmptilemap1; |
| 709 | 709 | |
| 710 | flip_screen_set( | |
| 710 | state->flip_screen_set( | |
| 711 | 711 | |
| 712 | 712 | /* Layers enable (not quite right) */ |
| 713 | 713 |
| r14896 | r14897 | |
|---|---|---|
| 114 | 114 | m_tilemap0_color = data & 3; |
| 115 | 115 | m_tilemap_0->mark_all_dirty(); |
| 116 | 116 | |
| 117 | flip_screen_set( | |
| 117 | flip_screen_set( | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 |
| r14896 | r14897 | |
|---|---|---|
| 425 | 425 | state_save_register_global(machine, st0016_spr2_bank); |
| 426 | 426 | state_save_register_global(machine, st0016_pal_bank); |
| 427 | 427 | state_save_register_global(machine, st0016_char_bank); |
| 428 | state_save_register_global(machine, st0016_rom_bank); | |
| 428 | //state_save_register_global(machine, st0016_rom_bank); | |
| 429 | 429 | state_save_register_global_array(machine, st0016_vregs); |
| 430 | 430 | state_save_register_global_pointer(machine, st0016_charram, ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE); |
| 431 | 431 | state_save_register_global_pointer(machine, st0016_paletteram, ST0016_MAX_PAL_BANK*ST0016_PAL_BANK_SIZE); |
| r14896 | r14897 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | WRITE8_MEMBER(sbasketb_state::sbasketb_flipscreen_w) |
| 110 | 110 | { |
| 111 | if (flip_screen | |
| 111 | if (flip_screen | |
| 112 | 112 | { |
| 113 | flip_screen_set( | |
| 113 | flip_screen_set( | |
| 114 | 114 | machine().tilemap().mark_all_dirty(); |
| 115 | 115 | } |
| 116 | 116 | } |
| r14896 | r14897 | |
| 152 | 152 | int flipx = spriteram[offs + 1] & 0x40; |
| 153 | 153 | int flipy = spriteram[offs + 1] & 0x80; |
| 154 | 154 | |
| 155 | if (flip_screen | |
| 155 | if (state->flip_screen | |
| 156 | 156 | { |
| 157 | 157 | sx = 240 - sx; |
| 158 | 158 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | funkyjet_state *state = screen.machine().driver_data<funkyjet_state>(); |
| 17 | 17 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 18 | 18 | |
| 19 | flip_screen_set( | |
| 19 | state->flip_screen_set( | |
| 20 | 20 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 21 | 21 | |
| 22 | 22 | bitmap.fill(768, cliprect); |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | m_video_ctrl = data; |
| 23 | 23 | |
| 24 | 24 | m_flipscreen = data & 4; |
| 25 | flip_screen_set(m | |
| 25 | flip_screen_set(m | |
| 26 | 26 | m_tilemap->set_scrolly(0, (data & 0xe0) << 3); |
| 27 | 27 | if(m_flipscreen) |
| 28 | 28 | m_tilemap->set_flip((data & 2) ? TILEMAP_FLIPY : TILEMAP_FLIPX | TILEMAP_FLIPY); |
| r14896 | r14897 | |
|---|---|---|
| 41 | 41 | WRITE8_MEMBER(himesiki_state::himesiki_flip_w) |
| 42 | 42 | { |
| 43 | 43 | m_flipscreen = data & 0xc0; |
| 44 | flip_screen_set(m | |
| 44 | flip_screen_set(m | |
| 45 | 45 | |
| 46 | 46 | if (data & 0x3f) |
| 47 | 47 | logerror("p08_w %02x\n",data); |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | { |
| 38 | 38 | m_starfield_enabled = data & 0x10; |
| 39 | 39 | |
| 40 | if (flip_screen | |
| 40 | if (flip_screen | |
| 41 | 41 | { |
| 42 | flip_screen_set( | |
| 42 | flip_screen_set( | |
| 43 | 43 | machine().tilemap().mark_all_dirty(); |
| 44 | 44 | } |
| 45 | 45 | } |
| r14896 | r14897 | |
| 76 | 76 | int flipy = source[1] & 0x80; |
| 77 | 77 | int flipx = source[1] & 0x40; |
| 78 | 78 | |
| 79 | if (flip_screen | |
| 79 | if (state->flip_screen | |
| 80 | 80 | { |
| 81 | 81 | sx = 240 - sx; |
| 82 | 82 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 122 | 122 | |
| 123 | 123 | WRITE8_MEMBER(ironhors_state::ironhors_flipscreen_w) |
| 124 | 124 | { |
| 125 | if (flip_screen | |
| 125 | if (flip_screen | |
| 126 | 126 | { |
| 127 | flip_screen_set( | |
| 127 | flip_screen_set( | |
| 128 | 128 | machine().tilemap().mark_all_dirty(); |
| 129 | 129 | } |
| 130 | 130 | |
| r14896 | r14897 | |
| 170 | 170 | int flipy = sr[offs + 4] & 0x40; |
| 171 | 171 | int code = (sr[offs] << 2) + ((sr[offs + 1] & 0x03) << 10) + ((sr[offs + 1] & 0x0c) >> 2); |
| 172 | 172 | int color = ((sr[offs + 1] & 0xf0) >> 4) + 16 * state->m_palettebank; |
| 173 | // int mod = flip_screen | |
| 173 | // int mod = state->flip_screen | |
| 174 | 174 | |
| 175 | if (flip_screen | |
| 175 | if (state->flip_screen | |
| 176 | 176 | { |
| 177 | 177 | sx = 240 - sx; |
| 178 | 178 | sy = 240 - sy; |
| r14896 | r14897 | |
| 192 | 192 | |
| 193 | 193 | case 0x04: /* 16x8 */ |
| 194 | 194 | { |
| 195 | if (flip_screen | |
| 195 | if (state->flip_screen | |
| 196 | 196 | |
| 197 | 197 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 198 | 198 | code & ~1, |
| r14896 | r14897 | |
| 283 | 283 | int code = (sr[offs] << 2) + ((sr2[offs] & 0x03) << 10) + ((sr2[offs] & 0x0c) >> 2); |
| 284 | 284 | int color = ((sr2[offs] & 0xf0) >> 4) + 16 * state->m_palettebank; |
| 285 | 285 | |
| 286 | // int mod = flip_screen | |
| 286 | // int mod = flip_screen | |
| 287 | 287 | |
| 288 | // if (flip_screen | |
| 288 | // if (flip_screen | |
| 289 | 289 | { |
| 290 | 290 | // sx = 240 - sx; |
| 291 | 291 | sy = 240 - sy; |
| r14896 | r14897 | |
| 305 | 305 | |
| 306 | 306 | case 0x04: /* 16x8 */ |
| 307 | 307 | { |
| 308 | if (flip_screen | |
| 308 | if (state->flip_screen | |
| 309 | 309 | |
| 310 | 310 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 311 | 311 | code & ~1, |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | m_nmi_mask = data & 1; |
| 58 | 58 | |
| 59 | 59 | /* bit 1 = flip screen */ |
| 60 | flip_screen_set( | |
| 60 | flip_screen_set( | |
| 61 | 61 | |
| 62 | 62 | /* bit 2 =display enable */ |
| 63 | 63 | m_display_enable = data & 0x04; |
| r14896 | r14897 | |
| 106 | 106 | |
| 107 | 107 | sx += (spriteram_2[offs] & 0x20) >> 5; // not sure about this |
| 108 | 108 | |
| 109 | if (flip_screen | |
| 109 | if (state->flip_screen | |
| 110 | 110 | { |
| 111 | 111 | sx = 496 - sx; |
| 112 | 112 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 79 | 79 | int sx = spriteram[i + 2] - ((attr & 0x80) << 1); |
| 80 | 80 | int sy = spriteram[i + 3]; |
| 81 | 81 | |
| 82 | if (flip_screen | |
| 82 | if (state->flip_screen | |
| 83 | 83 | { |
| 84 | 84 | sx = 240 - sx; |
| 85 | 85 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 126 | 126 | m_nmi_mask = (data & 0x10) >> 4; |
| 127 | 127 | |
| 128 | 128 | /* bit 5 controls screen flip */ |
| 129 | flip_screen_set( | |
| 129 | flip_screen_set( | |
| 130 | 130 | |
| 131 | 131 | /* bits 6-7 unknown */ |
| 132 | 132 | } |
| r14896 | r14897 | |
| 171 | 171 | { |
| 172 | 172 | bankp_state *state = screen.machine().driver_data<bankp_state>(); |
| 173 | 173 | |
| 174 | if (flip_screen | |
| 174 | if (state->flip_screen | |
| 175 | 175 | { |
| 176 | 176 | state->m_fg_tilemap->set_scrollx(0, -state->m_scroll_x); |
| 177 | 177 | state->m_bg_tilemap->set_scrollx(0, 0); |
| r14896 | r14897 | |
|---|---|---|
| 104 | 104 | UINT8 *gfx = machine.region("gfx2")->base() + (code << 7); |
| 105 | 105 | |
| 106 | 106 | |
| 107 | if (flip_screen | |
| 107 | if (state->flip_screen | |
| 108 | 108 | sy += 32; |
| 109 | 109 | |
| 110 | 110 | /* assume no collision */ |
| r14896 | r14897 | |
|---|---|---|
| 204 | 204 | int flipy = spriteram[offs] & 2; |
| 205 | 205 | int color = spriteram_2[offs + 1] & 0x3f; |
| 206 | 206 | |
| 207 | if (flip_screen | |
| 207 | if (state->flip_screen | |
| 208 | 208 | { |
| 209 | 209 | sx += 128-2; |
| 210 | 210 | sy += 8; |
| r14896 | r14897 | |
| 230 | 230 | int x = state->m_bosco_radarx[offs] + ((~state->m_bosco_radarattr[offs] & 0x01) << 8); |
| 231 | 231 | int y = 253 - state->m_bosco_radary[offs]; |
| 232 | 232 | |
| 233 | if (flip_screen | |
| 233 | if (state->flip_screen | |
| 234 | 234 | { |
| 235 | 235 | x += 96-2; |
| 236 | 236 | y += 8; |
| r14896 | r14897 | |
| 289 | 289 | the screen, and clip it to only the position where it is supposed to be shown */ |
| 290 | 290 | rectangle fg_clip = cliprect; |
| 291 | 291 | rectangle bg_clip = cliprect; |
| 292 | if (flip_screen | |
| 292 | if (state->flip_screen | |
| 293 | 293 | { |
| 294 | 294 | bg_clip.min_x = 20*8; |
| 295 | 295 | fg_clip.max_x = 20*8-1; |
| r14896 | r14897 | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 304 | draw_stars(screen.machine(),bitmap,cliprect,flip_screen | |
| 304 | draw_stars(screen.machine(),bitmap,cliprect,state->flip_screen | |
| 305 | 305 | |
| 306 | 306 | state->m_bg_tilemap->draw(bitmap, bg_clip, 0,0); |
| 307 | 307 | state->m_fg_tilemap->draw(bitmap, fg_clip, 0,0); |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | WRITE8_MEMBER(funkybee_state::funkybee_scroll_w) |
| 64 | 64 | { |
| 65 | m_bg_tilemap->set_scrollx(0, flip_screen | |
| 65 | m_bg_tilemap->set_scrollx(0, flip_screen | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | WRITE8_MEMBER(funkybee_state::funkybee_flipscreen_w) |
| 69 | 69 | { |
| 70 | flip_screen_set( | |
| 70 | flip_screen_set( | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 107 | 107 | int sx = state->m_videoram[offs2 + 0x10]; |
| 108 | 108 | int sy = 224 - state->m_colorram[offs2]; |
| 109 | 109 | |
| 110 | if (flip_screen | |
| 110 | if (state->flip_screen | |
| 111 | 111 | { |
| 112 | 112 | sy += 32; |
| 113 | 113 | flipx = !flipx; |
| r14896 | r14897 | |
| 127 | 127 | |
| 128 | 128 | for (offs = 0x1f; offs >= 0; offs--) |
| 129 | 129 | { |
| 130 | int const flip = flip_screen | |
| 130 | int const flip = state->flip_screen | |
| 131 | 131 | int code = state->m_videoram[0x1c00 + offs]; |
| 132 | 132 | int color = state->m_colorram[0x1f10] & 0x03; |
| 133 | 133 | int sx = flip ? state->m_videoram[0x1f1f] : state->m_videoram[0x1f10]; |
| r14896 | r14897 | |
|---|---|---|
| 128 | 128 | { |
| 129 | 129 | if (ACCESSING_BITS_0_7) |
| 130 | 130 | { |
| 131 | flip_screen_set( | |
| 131 | flip_screen_set( | |
| 132 | 132 | |
| 133 | 133 | coin_lockout_w(machine(), 0, ~data & 0x10); |
| 134 | 134 | coin_lockout_w(machine(), 1, ~data & 0x20); |
| r14896 | r14897 | |
| 245 | 245 | flipy = attr & state->m_sprite_flipy_mask; /* 0x40 for lastduel, 0x80 for madgear */ |
| 246 | 246 | color = attr & 0x0f; |
| 247 | 247 | |
| 248 | if (flip_screen | |
| 248 | if (state->flip_screen | |
| 249 | 249 | { |
| 250 | 250 | sx = 496 - sx; |
| 251 | 251 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 43 | 43 | int flipy = 0; |
| 44 | 44 | int color = state->m_spriteram[offs + 1] & 0x1f; |
| 45 | 45 | |
| 46 | if (flip_screen_x | |
| 46 | if (state->flip_screen_x | |
| 47 | 47 | { |
| 48 | 48 | xpos = 240 - xpos; |
| 49 | 49 | flipx = !flipx; |
| 50 | 50 | } |
| 51 | if (flip_screen_y | |
| 51 | if (state->flip_screen_y | |
| 52 | 52 | { |
| 53 | 53 | ypos = 256 - ypos; |
| 54 | 54 | flipy = !flipy; |
| r14896 | r14897 | |
| 78 | 78 | int flipy = 0;//state->m_spriteram[offs + 0] & 0x40; |
| 79 | 79 | int color = state->m_spriteram[offs + 1] & 0x0f; |
| 80 | 80 | |
| 81 | if (flip_screen_x | |
| 81 | if (state->flip_screen_x | |
| 82 | 82 | { |
| 83 | 83 | xpos = 240 - xpos; |
| 84 | 84 | flipx = !flipx; |
| 85 | 85 | } |
| 86 | if (flip_screen_y | |
| 86 | if (state->flip_screen_y | |
| 87 | 87 | { |
| 88 | 88 | ypos = 256 - ypos; |
| 89 | 89 | flipy = !flipy; |
| r14896 | r14897 | |
| 114 | 114 | int flipy = state->m_spriteram[offs + 2] & 0x40; |
| 115 | 115 | int color = state->m_spriteram[offs + 2] & 0x1f; |
| 116 | 116 | |
| 117 | if (flip_screen_x | |
| 117 | if (state->flip_screen_x | |
| 118 | 118 | { |
| 119 | 119 | xpos = 240 - xpos; |
| 120 | 120 | flipx = !flipx; |
| 121 | 121 | } |
| 122 | if (flip_screen_y | |
| 122 | if (state->flip_screen_y | |
| 123 | 123 | { |
| 124 | 124 | ypos = 256 - ypos; |
| 125 | 125 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | case 0x2200/2 : return input_port_read(machine(), "IN5"); // DSW 3 (4 bits) |
| 413 | case 0x2300/2 : return soundlatch2_r(space,0); // From sound cpu | |
| 413 | case 0x2300/2 : return soundlatch2_byte_r(space,0); // From sound cpu | |
| 414 | 414 | |
| 415 | 415 | default: SHOW_READ_ERROR("vreg %04X read!",offset*2); |
| 416 | 416 | return m_vregs[offset]; |
| r14896 | r14897 | |
| 496 | 496 | |
| 497 | 497 | case 0x0006/2 : return input_port_read(machine(), "IN3"); // ? Read at boot only |
| 498 | 498 | |
| 499 | case 0x0008/2 : return soundlatch2_r(space,0); // From sound cpu | |
| 499 | case 0x0008/2 : return soundlatch2_byte_r(space,0); // From sound cpu | |
| 500 | 500 | |
| 501 | 501 | case 0x000c/2 : return input_port_read(machine(), "IN4"); // DSW 3 |
| 502 | 502 | |
| r14896 | r14897 | |
| 538 | 538 | |
| 539 | 539 | case 0x0004/2 : return input_port_read(machine(), "IN1"); // Buttons |
| 540 | 540 | |
| 541 | case 0x0008/2 : return soundlatch2_r(space,0); // From sound cpu | |
| 541 | case 0x0008/2 : return soundlatch2_byte_r(space,0); // From sound cpu | |
| 542 | 542 | |
| 543 | 543 | case 0x0010/2 : // X, Y |
| 544 | 544 | return input_port_read(machine(), "IN2") | (input_port_read(machine(), "IN3")<<8); |
| r14896 | r14897 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | WRITE8_HANDLER( redclash_flipscreen_w ) |
| 122 | 122 | { |
| 123 | flip_screen_set(space->machine(), data & 0x01); | |
| 123 | ladybug_state *state = space->machine().driver_data<ladybug_state>(); | |
| 124 | state->flip_screen_set(data & 0x01); | |
| 124 | 125 | } |
| 125 | 126 | |
| 126 | 127 | void redclash_set_stars_enable( running_machine &machine, UINT8 on ); //temp |
| r14896 | r14897 | |
| 278 | 279 | int sx = 8 * offs + (state->m_videoram[offs] & 0x07); /* ?? */ |
| 279 | 280 | int sy = 0xff - state->m_videoram[offs + 0x20]; |
| 280 | 281 | |
| 281 | if (flip_screen | |
| 282 | if (state->flip_screen | |
| 282 | 283 | { |
| 283 | 284 | sx = 240 - sx; |
| 284 | 285 | } |
| r14896 | r14897 | |
|---|---|---|
| 1159 | 1159 | |
| 1160 | 1160 | static void dambustr_draw_bullets(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int offs, int x, int y) |
| 1161 | 1161 | { |
| 1162 | galaxold_state *state = machine.driver_data<galaxold_state>(); | |
| 1162 | 1163 | int i, color; |
| 1163 | 1164 | |
| 1164 | if (flip_screen_x | |
| 1165 | if (state->flip_screen_x | |
| 1165 | 1166 | |
| 1166 | 1167 | x = x - 6; |
| 1167 | 1168 | |
| r14896 | r14897 | |
| 1339 | 1340 | int col1 = base + state->m_dambustr_bg_color_1; |
| 1340 | 1341 | int col2 = base + state->m_dambustr_bg_color_2; |
| 1341 | 1342 | |
| 1342 | if (flip_screen_x | |
| 1343 | if (state->flip_screen_x | |
| 1343 | 1344 | { |
| 1344 | 1345 | bitmap.plot_box( 0, 0, 256-state->m_dambustr_bg_split_line, 256, col2); |
| 1345 | 1346 | bitmap.plot_box(256-state->m_dambustr_bg_split_line, 0, state->m_dambustr_bg_split_line, 256, col1); |
| r14896 | r14897 | |
| 1356 | 1357 | { |
| 1357 | 1358 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1358 | 1359 | |
| 1359 | if (flip_screen_x | |
| 1360 | if (state->flip_screen_x | |
| 1360 | 1361 | { |
| 1361 | 1362 | rectangle clip(254 - state->m_dambustr_bg_split_line, state->m_dambustr_bg_split_line, 0, 255); |
| 1362 | 1363 | copybitmap(bitmap, *state->m_dambustr_tmpbitmap, 0, 0, 0, 0, clip); |
| r14896 | r14897 | |
|---|---|---|
| 165 | 165 | m_char_tilemap->mark_all_dirty(); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | flip_screen_set( | |
| 168 | flip_screen_set( | |
| 169 | 169 | |
| 170 | 170 | m_spritepalettebank = (data & 0x20) >> 5; |
| 171 | 171 | m_pixelpalettebank = (data & 0x08) >> 3; |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 51 | 51 | |
| 52 | flip_screen_set( | |
| 52 | state->flip_screen_set( | |
| 53 | 53 | |
| 54 | 54 | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 55 | 55 | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x08, 0x0f); |
| r14896 | r14897 | |
| 67 | 67 | SCREEN_UPDATE_IND16( baddudes ) |
| 68 | 68 | { |
| 69 | 69 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 70 | flip_screen_set( | |
| 70 | state->flip_screen_set( | |
| 71 | 71 | |
| 72 | 72 | /* WARNING: inverted wrt Midnight Resistance */ |
| 73 | 73 | if ((state->m_pri & 0x01) == 0) |
| r14896 | r14897 | |
| 108 | 108 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 109 | 109 | int trans; |
| 110 | 110 | |
| 111 | flip_screen_set( | |
| 111 | state->flip_screen_set( | |
| 112 | 112 | |
| 113 | 113 | if (state->m_pri & 0x04) |
| 114 | 114 | trans = 0x08; |
| r14896 | r14897 | |
| 153 | 153 | { |
| 154 | 154 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 155 | 155 | |
| 156 | flip_screen_set( | |
| 156 | state->flip_screen_set( | |
| 157 | 157 | |
| 158 | 158 | /* This game doesn't have the extra playfield chip on the game board, but |
| 159 | 159 | the palette does show through. */ |
| r14896 | r14897 | |
| 169 | 169 | SCREEN_UPDATE_IND16( hippodrm ) |
| 170 | 170 | { |
| 171 | 171 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 172 | flip_screen_set( | |
| 172 | state->flip_screen_set( | |
| 173 | 173 | |
| 174 | 174 | if (state->m_pri & 0x01) |
| 175 | 175 | { |
| r14896 | r14897 | |
| 192 | 192 | SCREEN_UPDATE_IND16( slyspy ) |
| 193 | 193 | { |
| 194 | 194 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 195 | flip_screen_set( | |
| 195 | state->flip_screen_set( | |
| 196 | 196 | |
| 197 | 197 | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 198 | 198 | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| r14896 | r14897 | |
| 214 | 214 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 215 | 215 | int trans; |
| 216 | 216 | |
| 217 | flip_screen_set( | |
| 217 | state->flip_screen_set( | |
| 218 | 218 | |
| 219 | 219 | if (state->m_pri & 0x04) |
| 220 | 220 | trans = 0x00; |
| r14896 | r14897 | |
|---|---|---|
| 151 | 151 | { |
| 152 | 152 | coin_counter_w(machine(), 0, data & 1); |
| 153 | 153 | coin_counter_w(machine(), 1, data & 2); |
| 154 | flip_screen_set( | |
| 154 | flip_screen_set( | |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| r14896 | r14897 | |
| 183 | 183 | sx = (state->m_spriteram[offs + 3] - 0x80) + 256 * (attr & 0x01); |
| 184 | 184 | sy = 240 - state->m_spriteram[offs]; |
| 185 | 185 | |
| 186 | if (flip_screen | |
| 186 | if (state->flip_screen | |
| 187 | 187 | { |
| 188 | 188 | sx = 240 - sx; |
| 189 | 189 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | /* dirty both current and next offsets */ |
| 76 | 76 | m_bg_tilemap->mark_tile_dirty(offset); |
| 77 | m_bg_tilemap->mark_tile_dirty((offset + (flip_screen | |
| 77 | m_bg_tilemap->mark_tile_dirty((offset + (flip_screen | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | WRITE8_DEVICE_HANDLER( hanaawas_portB_w ) |
| 81 | 81 | { |
| 82 | 82 | /* bit 7 is flip screen */ |
| 83 | if (flip_screen_get(device->machine()) != (~data & 0x80)) | |
| 83 | hanaawas_state *state = device->machine().driver_data<hanaawas_state>(); | |
| 84 | if (state->flip_screen() != (~data & 0x80)) | |
| 84 | 85 | { |
| 85 | flip_screen_set( | |
| 86 | state->flip_screen_set( | |
| 86 | 87 | device->machine().tilemap().mark_all_dirty(); |
| 87 | 88 | } |
| 88 | 89 | } |
| r14896 | r14897 | |
| 91 | 92 | { |
| 92 | 93 | hanaawas_state *state = machine.driver_data<hanaawas_state>(); |
| 93 | 94 | /* the color is determined by the current color byte, but the bank is via the previous one!!! */ |
| 94 | int offset = (tile_index + (flip_screen | |
| 95 | int offset = (tile_index + (state->flip_screen | |
| 95 | 96 | int attr = state->m_colorram[offset]; |
| 96 | 97 | int gfxbank = (attr & 0x40) >> 6; |
| 97 | 98 | int code = state->m_videoram[tile_index] + ((attr & 0x20) << 3); |
| r14896 | r14897 | |
|---|---|---|
| 752 | 752 | if (screenctrl & 2) |
| 753 | 753 | return 0; |
| 754 | 754 | |
| 755 | //flip_screen_set( | |
| 755 | //state->flip_screen_set( | |
| 756 | 756 | state->m_flip_screen = screenctrl & 1; |
| 757 | 757 | |
| 758 | 758 | /* If the game supports 16x16 tiles, make sure that the |
| r14896 | r14897 | |
|---|---|---|
| 148 | 148 | |
| 149 | 149 | WRITE8_MEMBER(circusc_state::circusc_flipscreen_w) |
| 150 | 150 | { |
| 151 | flip_screen_set( | |
| 151 | flip_screen_set( | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| r14896 | r14897 | |
| 179 | 179 | int flipx = sr[offs + 1] & 0x40; |
| 180 | 180 | int flipy = sr[offs + 1] & 0x80; |
| 181 | 181 | |
| 182 | if (flip_screen | |
| 182 | if (state->flip_screen | |
| 183 | 183 | { |
| 184 | 184 | sx = 240 - sx; |
| 185 | 185 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | WRITE8_MEMBER(mikie_state::mikie_flipscreen_w) |
| 115 | 115 | { |
| 116 | if (flip_screen | |
| 116 | if (flip_screen | |
| 117 | 117 | { |
| 118 | flip_screen_set( | |
| 118 | flip_screen_set( | |
| 119 | 119 | machine().tilemap().mark_all_dirty(); |
| 120 | 120 | } |
| 121 | 121 | } |
| r14896 | r14897 | |
| 158 | 158 | int flipx = ~spriteram[offs] & 0x10; |
| 159 | 159 | int flipy = spriteram[offs] & 0x20; |
| 160 | 160 | |
| 161 | if (flip_screen | |
| 161 | if (state->flip_screen | |
| 162 | 162 | { |
| 163 | 163 | sy = 242 - sy; |
| 164 | 164 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | WRITE8_MEMBER(zaccaria_state::zaccaria_flip_screen_x_w) |
| 175 | 175 | { |
| 176 | flip_screen_x_set( | |
| 176 | flip_screen_x_set( | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | WRITE8_MEMBER(zaccaria_state::zaccaria_flip_screen_y_w) |
| 180 | 180 | { |
| 181 | flip_screen_y_set( | |
| 181 | flip_screen_y_set( | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | |
| r14896 | r14897 | |
| 206 | 206 | */ |
| 207 | 207 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,UINT8 *spriteram,int color,int section) |
| 208 | 208 | { |
| 209 | zaccaria_state *state = machine.driver_data<zaccaria_state>(); | |
| 209 | 210 | int offs,o1 = 1,o2 = 2; |
| 210 | 211 | |
| 211 | 212 | if (section) |
| r14896 | r14897 | |
| 223 | 224 | |
| 224 | 225 | if (sx == 1) continue; |
| 225 | 226 | |
| 226 | if (flip_screen_x | |
| 227 | if (state->flip_screen_x | |
| 227 | 228 | { |
| 228 | 229 | sx = 240 - sx; |
| 229 | 230 | flipx = !flipx; |
| 230 | 231 | } |
| 231 | if (flip_screen_y | |
| 232 | if (state->flip_screen_y | |
| 232 | 233 | { |
| 233 | 234 | sy = 240 - sy; |
| 234 | 235 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | if (ACCESSING_BITS_0_7) |
| 66 | 66 | { |
| 67 | flip_screen_set( | |
| 67 | flip_screen_set( | |
| 68 | 68 | m_color_bank = ( data & 4 ) >> 2; |
| 69 | 69 | } |
| 70 | 70 | if (data & ~(1|4)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(&space.device()), data); |
| r14896 | r14897 | |
| 74 | 74 | { |
| 75 | 75 | if (ACCESSING_BITS_0_7) |
| 76 | 76 | { |
| 77 | flip_screen_set( | |
| 77 | flip_screen_set( | |
| 78 | 78 | //m_color_bank = ( data & 0x07 ); |
| 79 | 79 | } |
| 80 | 80 | if (data & ~(0x10)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(&space.device()), data); |
| r14896 | r14897 | |
| 185 | 185 | |
| 186 | 186 | if (flipx) tile_flipx = !tile_flipx; |
| 187 | 187 | |
| 188 | if (flip_screen | |
| 188 | if (state->flip_screen | |
| 189 | 189 | { |
| 190 | 190 | sx = max_x - sx; |
| 191 | 191 | sy = max_y - sy; |
| r14896 | r14897 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | flipx = flipy = 0; |
| 106 | 106 | |
| 107 | if(flip_screen | |
| 107 | if(state->flip_screen | |
| 108 | 108 | { |
| 109 | 109 | x = 246 - x; |
| 110 | 110 | y = 238 - y; |
| r14896 | r14897 | |
|---|---|---|
| 115 | 115 | WRITE8_MEMBER(tagteam_state::tagteam_flipscreen_w) |
| 116 | 116 | { |
| 117 | 117 | // d0: flip screen |
| 118 | if (flip_screen | |
| 118 | if (flip_screen | |
| 119 | 119 | { |
| 120 | flip_screen_set( | |
| 120 | flip_screen_set( | |
| 121 | 121 | machine().tilemap().mark_all_dirty(); |
| 122 | 122 | } |
| 123 | 123 | |
| r14896 | r14897 | |
| 159 | 159 | |
| 160 | 160 | if (!(state->m_videoram[offs] & 0x01)) continue; |
| 161 | 161 | |
| 162 | if (flip_screen | |
| 162 | if (state->flip_screen | |
| 163 | 163 | { |
| 164 | 164 | sx = 240 - sx; |
| 165 | 165 | sy = 240 - sy; |
| r14896 | r14897 | |
| 177 | 177 | |
| 178 | 178 | code = state->m_videoram[offs + 0x20] + 256 * spritebank; |
| 179 | 179 | color = state->m_palettebank; |
| 180 | sy += (flip_screen | |
| 180 | sy += (state->flip_screen | |
| 181 | 181 | |
| 182 | 182 | drawgfx_transpen(bitmap, cliprect, |
| 183 | 183 | machine.gfx[1], |
| r14896 | r14897 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | WRITE8_MEMBER(bagman_state::bagman_flipscreen_w) |
| 83 | 83 | { |
| 84 | if ((flip_screen | |
| 84 | if ((flip_screen | |
| 85 | 85 | { |
| 86 | flip_screen_set( | |
| 86 | flip_screen_set( | |
| 87 | 87 | m_bg_tilemap->mark_all_dirty(); |
| 88 | 88 | } |
| 89 | 89 | } |
| r14896 | r14897 | |
| 122 | 122 | sy = 255 - spriteram[offs + 2] - 16; |
| 123 | 123 | flipx = spriteram[offs] & 0x40; |
| 124 | 124 | flipy = spriteram[offs] & 0x80; |
| 125 | if (flip_screen_x | |
| 125 | if (state->flip_screen_x | |
| 126 | 126 | { |
| 127 | 127 | sx = bitmap.width() - sx - 15; |
| 128 | 128 | flipx = !flipx; |
| 129 | 129 | } |
| 130 | if (flip_screen_y | |
| 130 | if (state->flip_screen_y | |
| 131 | 131 | { |
| 132 | 132 | sy = bitmap.height() - sy - 15; |
| 133 | 133 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | device_set_input_line(m_audiocpu, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 64 | 64 | |
| 65 | 65 | // bit 7 flips screen |
| 66 | flip_screen_set( | |
| 66 | flip_screen_set( | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 116 | 116 | int sx = buffered_spriteram[offs + 3] - ((attr & 0x01) << 8); |
| 117 | 117 | int sy = buffered_spriteram[offs + 2]; |
| 118 | 118 | |
| 119 | if (flip_screen | |
| 119 | if (state->flip_screen | |
| 120 | 120 | { |
| 121 | 121 | sx = 240 - sx; |
| 122 | 122 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 376 | 376 | // Ninja Kid II doesn't use the 'big' feature so it might not be available on the board |
| 377 | 377 | int const big = (sprptr[2] & 0x04) >> 2; |
| 378 | 378 | |
| 379 | if (flip_screen | |
| 379 | if (state->flip_screen | |
| 380 | 380 | { |
| 381 | 381 | sx = 240 - 16*big - sx; |
| 382 | 382 | sy = 240 - 16*big - sy; |
| r14896 | r14897 | |
|---|---|---|
| 226 | 226 | { |
| 227 | 227 | int x,y,i,j; |
| 228 | 228 | |
| 229 | if (flip_screen | |
| 229 | if (state->flip_screen | |
| 230 | 230 | x = 376 - state->m_ball_h; |
| 231 | 231 | y = 280 - state->m_ball_v; |
| 232 | 232 | } |
| r14896 | r14897 | |
|---|---|---|
| 275 | 275 | WRITE8_MEMBER(m52_state::m52_flipscreen_w) |
| 276 | 276 | { |
| 277 | 277 | /* screen flip is handled both by software and hardware */ |
| 278 | flip_screen_set( | |
| 278 | flip_screen_set( | |
| 279 | 279 | |
| 280 | 280 | coin_counter_w(machine(), 0, data & 0x02); |
| 281 | 281 | coin_counter_w(machine(), 1, data & 0x20); |
| r14896 | r14897 | |
| 283 | 283 | |
| 284 | 284 | WRITE8_MEMBER(m52_state::alpha1v_flipscreen_w) |
| 285 | 285 | { |
| 286 | flip_screen_set( | |
| 286 | flip_screen_set( | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | |
| r14896 | r14897 | |
| 299 | 299 | rectangle rect; |
| 300 | 300 | const rectangle &visarea = machine.primary_screen->visible_area(); |
| 301 | 301 | |
| 302 | if (flip_screen_get(machine)) | |
| 302 | m52_state *state = machine.driver_data<m52_state>(); | |
| 303 | if (state->flip_screen()) | |
| 303 | 304 | { |
| 304 | 305 | xpos = 255 - xpos; |
| 305 | 306 | ypos = 255 - ypos - BGHEIGHT; |
| r14896 | r14897 | |
| 313 | 314 | drawgfx_transpen(bitmap, cliprect, |
| 314 | 315 | machine.gfx[image], |
| 315 | 316 | 0, 0, |
| 316 | flip_screen_get(machine), | |
| 317 | flip_screen_get(machine), | |
| 317 | state->flip_screen(), | |
| 318 | state->flip_screen(), | |
| 318 | 319 | xpos, |
| 319 | 320 | ypos, 0); |
| 320 | 321 | |
| 321 | 322 | drawgfx_transpen(bitmap, cliprect, |
| 322 | 323 | machine.gfx[image], |
| 323 | 324 | 0, 0, |
| 324 | flip_screen_get(machine), | |
| 325 | flip_screen_get(machine), | |
| 325 | state->flip_screen(), | |
| 326 | state->flip_screen(), | |
| 326 | 327 | xpos - 256, |
| 327 | 328 | ypos, 0); |
| 328 | 329 | |
| 329 | 330 | rect.min_x = visarea.min_x; |
| 330 | 331 | rect.max_x = visarea.max_x; |
| 331 | 332 | |
| 332 | if (flip_screen | |
| 333 | if (state->flip_screen | |
| 333 | 334 | { |
| 334 | 335 | rect.min_y = ypos - BGHEIGHT; |
| 335 | 336 | rect.max_y = ypos - 1; |
| r14896 | r14897 | |
| 370 | 371 | draw_background(screen.machine(), bitmap, cliprect, state->m_bg1xpos, state->m_bg1ypos, 4); /* cityscape */ |
| 371 | 372 | } |
| 372 | 373 | |
| 373 | state->m_bg_tilemap->set_flip(flip_screen | |
| 374 | state->m_bg_tilemap->set_flip(state->flip_screen | |
| 374 | 375 | |
| 375 | 376 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 376 | 377 | |
| r14896 | r14897 | |
| 394 | 395 | clip.min_y = 128, clip.max_y = 255; |
| 395 | 396 | |
| 396 | 397 | /* adjust for flipping */ |
| 397 | if (flip_screen | |
| 398 | if (state->flip_screen | |
| 398 | 399 | { |
| 399 | 400 | int temp = clip.min_y; |
| 400 | 401 | clip.min_y = 255 - clip.max_y; |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | cbuster_state *state = screen.machine().driver_data<cbuster_state>(); |
| 54 | 54 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 55 | 55 | |
| 56 | flip_screen_set( | |
| 56 | state->flip_screen_set( | |
| 57 | 57 | |
| 58 | 58 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram16_buffer, 0x400); |
| 59 | 59 |
| r14896 | r14897 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | WRITE8_MEMBER(gng_state::gng_flipscreen_w) |
| 95 | 95 | { |
| 96 | flip_screen_set( | |
| 96 | flip_screen_set( | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| r14896 | r14897 | |
| 120 | 120 | int flipx = attributes & 0x04; |
| 121 | 121 | int flipy = attributes & 0x08; |
| 122 | 122 | |
| 123 | if (flip_screen | |
| 123 | if (state->flip_screen | |
| 124 | 124 | { |
| 125 | 125 | sx = 240 - sx; |
| 126 | 126 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | m_sheriff_color_mode = (data >> 3) & 3; |
| 15 | 15 | m_sheriff_color_data = (data >> 0) & 7; |
| 16 | flip_screen_set_no_update( | |
| 16 | flip_screen_set_no_update( | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
| r14896 | r14897 | |
| 75 | 75 | } |
| 76 | 76 | else |
| 77 | 77 | { |
| 78 | if (flip_screen | |
| 78 | if (state->flip_screen | |
| 79 | 79 | state->m_helifire_mv %= 255; |
| 80 | 80 | else |
| 81 | 81 | state->m_helifire_mv %= 257; |
| r14896 | r14897 | |
| 94 | 94 | |
| 95 | 95 | state->m_cannon_timer = machine.scheduler().timer_alloc(FUNC(spacefev_stop_red_cannon)); |
| 96 | 96 | |
| 97 | flip_screen_set_no_update( | |
| 97 | state->flip_screen_set_no_update( | |
| 98 | 98 | |
| 99 | 99 | state->save_item(NAME(state->m_spacefev_red_screen)); |
| 100 | 100 | state->save_item(NAME(state->m_spacefev_red_cannon)); |
| r14896 | r14897 | |
| 105 | 105 | { |
| 106 | 106 | n8080_state *state = machine.driver_data<n8080_state>(); |
| 107 | 107 | |
| 108 | flip_screen_set_no_update( | |
| 108 | state->flip_screen_set_no_update( | |
| 109 | 109 | |
| 110 | 110 | state->save_item(NAME(state->m_sheriff_color_mode)); |
| 111 | 111 | state->save_item(NAME(state->m_sheriff_color_data)); |
| r14896 | r14897 | |
| 134 | 134 | state->m_helifire_LSFR[i] = data; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | flip_screen_set_no_update( | |
| 137 | state->flip_screen_set_no_update( | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | SCREEN_UPDATE_IND16( spacefev ) |
| 142 | 142 | { |
| 143 | 143 | n8080_state *state = screen.machine().driver_data<n8080_state>(); |
| 144 | UINT8 mask = flip_screen | |
| 144 | UINT8 mask = state->flip_screen | |
| 145 | 145 | |
| 146 | 146 | int x; |
| 147 | 147 | int y; |
| r14896 | r14897 | |
| 211 | 211 | SCREEN_UPDATE_IND16( sheriff ) |
| 212 | 212 | { |
| 213 | 213 | n8080_state *state = screen.machine().driver_data<n8080_state>(); |
| 214 | UINT8 mask = flip_screen | |
| 214 | UINT8 mask = state->flip_screen | |
| 215 | 215 | |
| 216 | 216 | const UINT8* pPROM = screen.machine().region("proms")->base(); |
| 217 | 217 | |
| r14896 | r14897 | |
| 323 | 323 | |
| 324 | 324 | for (n = 0; n < 8; n++) |
| 325 | 325 | { |
| 326 | if (flip_screen | |
| 326 | if (state->flip_screen | |
| 327 | 327 | { |
| 328 | 328 | if ((state->m_videoram[offset ^ 0x1fff] << n) & 0x80) |
| 329 | 329 | { |
| r14896 | r14897 | |
|---|---|---|
| 376 | 376 | |
| 377 | 377 | color = GFX[gfxaddr++]; |
| 378 | 378 | |
| 379 | // for hanamomo | |
| 380 | if ((nb1413m3_type == NB1413M3_HANAMOMO) && ((gfxaddr >= 0x20000) && (gfxaddr < 0x28000))) | |
| 381 | { | |
| 382 | color |= ((color & 0x0f) << 4); | |
| 383 | } | |
| 384 | ||
| 385 | 379 | dx1 = (2 * x + 0) & 0x1ff; |
| 386 | 380 | dx2 = (2 * x + 1) & 0x1ff; |
| 387 | 381 |
| r14896 | r14897 | |
|---|---|---|
| 99 | 99 | WRITE8_MEMBER(holeland_state::holeland_flipscreen_w) |
| 100 | 100 | { |
| 101 | 101 | if (offset) |
| 102 | flip_screen_y_set( | |
| 102 | flip_screen_y_set( | |
| 103 | 103 | else |
| 104 | flip_screen_x_set( | |
| 104 | flip_screen_x_set( | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r14896 | r14897 | |
| 125 | 125 | flipx = spriteram[offs + 3] & 0x04; |
| 126 | 126 | flipy = spriteram[offs + 3] & 0x08; |
| 127 | 127 | |
| 128 | if (flip_screen_x | |
| 128 | if (state->flip_screen_x | |
| 129 | 129 | { |
| 130 | 130 | flipx = !flipx; |
| 131 | 131 | sx = 240 - sx; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | if (flip_screen_y | |
| 134 | if (state->flip_screen_y | |
| 135 | 135 | { |
| 136 | 136 | flipy = !flipy; |
| 137 | 137 | sy = 240 - sy; |
| r14896 | r14897 | |
| 164 | 164 | flipx = spriteram[offs + 3] & 0x04; |
| 165 | 165 | flipy = spriteram[offs + 3] & 0x08; |
| 166 | 166 | |
| 167 | if (flip_screen_x | |
| 167 | if (state->flip_screen_x | |
| 168 | 168 | { |
| 169 | 169 | flipx = !flipx; |
| 170 | 170 | sx = 240 - sx; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | if (flip_screen_y | |
| 173 | if (state->flip_screen_y | |
| 174 | 174 | { |
| 175 | 175 | flipy = !flipy; |
| 176 | 176 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 110 | 110 | UINT8 *rom = machine().region("maincpu")->base(); |
| 111 | 111 | |
| 112 | 112 | /* bit 0 = flip screen */ |
| 113 | flip_screen_set( | |
| 113 | flip_screen_set( | |
| 114 | 114 | |
| 115 | 115 | /* bit 1 = ROM bank switch */ |
| 116 | 116 | memory_set_bankptr(machine(), "bank1",rom + 0x10000 + 0x4000 * ((~data & 0x02) >> 1)); |
| r14896 | r14897 | |
| 173 | 173 | int dy = -16; |
| 174 | 174 | int cy; |
| 175 | 175 | |
| 176 | if (flip_screen | |
| 176 | if (state->flip_screen | |
| 177 | 177 | { |
| 178 | 178 | sx = 240 - sx; |
| 179 | 179 | sy = 240 - sy; |
| r14896 | r14897 | |
| 192 | 192 | break; |
| 193 | 193 | |
| 194 | 194 | case 1: /* double y */ |
| 195 | if (flip_screen | |
| 195 | if (state->flip_screen | |
| 196 | 196 | cy = sy + dy; |
| 197 | 197 | which &= ~1; |
| 198 | 198 | DRAW_SPRITE(0,sx,cy); |
| r14896 | r14897 | |
|---|---|---|
| 117 | 117 | m_back_tilemap->mark_all_dirty(); |
| 118 | 118 | } |
| 119 | 119 | m_background_disable = data & 0x4; |
| 120 | flip_screen_set( | |
| 120 | flip_screen_set( | |
| 121 | 121 | break; |
| 122 | 122 | case 7: /* Background palette resistors? */ |
| 123 | 123 | /* Todo */ |
| r14896 | r14897 | |
| 126 | 126 | device_set_input_line(m_maincpu, DECO16_IRQ_LINE, CLEAR_LINE); |
| 127 | 127 | break; |
| 128 | 128 | case 9: /* Sound */ |
| 129 | soundlatch_w(space, 0, data); | |
| 129 | soundlatch_byte_w(space, 0, data); | |
| 130 | 130 | device_set_input_line(m_audiocpu, M6502_IRQ_LINE, HOLD_LINE); |
| 131 | 131 | break; |
| 132 | 132 | } |
| r14896 | r14897 | |
| 154 | 154 | device_set_input_line(m_maincpu, DECO16_IRQ_LINE, CLEAR_LINE); |
| 155 | 155 | break; |
| 156 | 156 | case 9: /* Sound */ |
| 157 | soundlatch_w(space, 0, data); | |
| 157 | soundlatch_byte_w(space, 0, data); | |
| 158 | 158 | device_set_input_line(m_audiocpu, M6502_IRQ_LINE, HOLD_LINE); |
| 159 | 159 | break; |
| 160 | 160 | } |
| r14896 | r14897 | |
| 169 | 169 | { |
| 170 | 170 | case 0: |
| 171 | 171 | //background_disable = ~data & 0x80; |
| 172 | flip_screen_set( | |
| 172 | flip_screen_set( | |
| 173 | 173 | m_back_tilemap->mark_all_dirty(); |
| 174 | 174 | break; |
| 175 | 175 | case 2: /* Sound */ |
| 176 | soundlatch_w(space, 0, data); | |
| 176 | soundlatch_byte_w(space, 0, data); | |
| 177 | 177 | device_set_input_line(m_audiocpu, M6502_IRQ_LINE, HOLD_LINE); |
| 178 | 178 | break; |
| 179 | 179 | case 4: /* Irq ack */ |
| r14896 | r14897 | |
| 319 | 319 | if (multi && fy == 0) |
| 320 | 320 | sy -= 16; |
| 321 | 321 | |
| 322 | if (flip_screen | |
| 322 | if (state->flip_screen | |
| 323 | 323 | { |
| 324 | 324 | sy = 240 - sy; |
| 325 | 325 | sx = 240 - sx; |
| r14896 | r14897 | |
| 390 | 390 | // if (multi) sy -= 16; |
| 391 | 391 | if ((fy && multi) || (fx && multi)) { code2 = code; code++; } |
| 392 | 392 | |
| 393 | if (flip_screen | |
| 393 | if (state->flip_screen | |
| 394 | 394 | { |
| 395 | 395 | sy = 240 - sy; |
| 396 | 396 | sx = 240 - sx; |
| r14896 | r14897 | |
| 451 | 451 | // if (multi) sy -= 16; |
| 452 | 452 | if (fy && multi) { code2 = code; code++; } |
| 453 | 453 | |
| 454 | if (flip_screen | |
| 454 | if (state->flip_screen | |
| 455 | 455 | { |
| 456 | 456 | sy = 240 - sy; |
| 457 | 457 | sx = 240 - sx; |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | /* bit 5 resets the sound CPU? - we ignore it */ |
| 84 | 84 | |
| 85 | 85 | /* bit 6 flips screen */ |
| 86 | flip_screen_set( | |
| 86 | flip_screen_set( | |
| 87 | 87 | |
| 88 | 88 | /* bit 7 enables characters? */ |
| 89 | 89 | m_chon = data & 0x80; |
| r14896 | r14897 | |
| 158 | 158 | |
| 159 | 159 | code += 256 * bank; |
| 160 | 160 | |
| 161 | if (flip_screen | |
| 161 | if (state->flip_screen | |
| 162 | 162 | { |
| 163 | 163 | sx = 240 - sx; |
| 164 | 164 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 331 | 331 | |
| 332 | 332 | if ((y & 1) ^ ((x >> 4) & 1)) |
| 333 | 333 | { |
| 334 | if (flip_screen_x | |
| 334 | if (state->flip_screen_x | |
| 335 | 335 | x = ~x; |
| 336 | 336 | |
| 337 | if (flip_screen_y | |
| 337 | if (state->flip_screen_y | |
| 338 | 338 | y = ~y; |
| 339 | 339 | |
| 340 | 340 | if ((y >= cliprect.min_y) && (y <= cliprect.max_y) && |
| r14896 | r14897 | |
|---|---|---|
| 133 | 133 | int flipy = 0; |
| 134 | 134 | int dy = -16; |
| 135 | 135 | |
| 136 | if (flip_screen | |
| 136 | if (state->flip_screen | |
| 137 | 137 | { |
| 138 | 138 | sx = 240 - sx; |
| 139 | 139 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); |
| 69 | 69 | |
| 70 | 70 | /* Update playfields */ |
| 71 | flip_screen_set( | |
| 71 | state->flip_screen_set( | |
| 72 | 72 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 73 | 73 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 74 | 74 | |
| r14896 | r14897 | |
| 175 | 175 | screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400, true); |
| 176 | 176 | |
| 177 | 177 | /* Update playfields */ |
| 178 | flip_screen_set( | |
| 178 | state->flip_screen_set( | |
| 179 | 179 | deco16ic_pf_update(state->m_deco_tilegen1, 0, 0); |
| 180 | 180 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 181 | 181 | |
| r14896 | r14897 | |
| 212 | 212 | screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400, false); |
| 213 | 213 | |
| 214 | 214 | /* Update playfields */ |
| 215 | flip_screen_set( | |
| 215 | state->flip_screen_set( | |
| 216 | 216 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 217 | 217 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 218 | 218 |
| r14896 | r14897 | |
|---|---|---|
| 81 | 81 | coin_counter_w(machine(), 1,data & 1); |
| 82 | 82 | |
| 83 | 83 | /* bit 7 flips screen */ |
| 84 | if (flip_screen | |
| 84 | if (flip_screen | |
| 85 | 85 | { |
| 86 | flip_screen_set( | |
| 86 | flip_screen_set( | |
| 87 | 87 | m_bg_tilemap->mark_all_dirty(); |
| 88 | 88 | } |
| 89 | 89 | } |
| r14896 | r14897 | |
| 119 | 119 | sy = spriteram[offs + 8]; |
| 120 | 120 | flipx = spriteram[offs + 4] & 0x10; |
| 121 | 121 | flipy = spriteram[offs + 4] & 0x20; |
| 122 | if (flip_screen | |
| 122 | if (state->flip_screen | |
| 123 | 123 | { |
| 124 | 124 | sx = 240 - sx; |
| 125 | 125 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 183 | 183 | |
| 184 | 184 | device_set_input_line(m_audiocpu, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 185 | 185 | |
| 186 | flip_screen_set( | |
| 186 | flip_screen_set( | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
| r14896 | r14897 | |
| 209 | 209 | sy = state->m_spriteram[offs + 2]; |
| 210 | 210 | dir = 1; |
| 211 | 211 | |
| 212 | if (flip_screen | |
| 212 | if (state->flip_screen | |
| 213 | 213 | { |
| 214 | 214 | sx = 240 - sx; |
| 215 | 215 | sy = 240 - sy; |
| r14896 | r14897 | |
| 225 | 225 | { |
| 226 | 226 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 227 | 227 | code + i,col, |
| 228 | flip_screen | |
| 228 | state->flip_screen | |
| 229 | 229 | sx,sy + 16 * i * dir,15); |
| 230 | 230 | |
| 231 | 231 | i--; |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | WRITE8_MEMBER(bombjack_state::bombjack_flipscreen_w) |
| 35 | 35 | { |
| 36 | if (flip_screen | |
| 36 | if (flip_screen | |
| 37 | 37 | { |
| 38 | flip_screen_set( | |
| 38 | flip_screen_set( | |
| 39 | 39 | machine().tilemap().mark_all_dirty(); |
| 40 | 40 | } |
| 41 | 41 | } |
| r14896 | r14897 | |
| 106 | 106 | flipx = state->m_spriteram[offs + 1] & 0x40; |
| 107 | 107 | flipy = state->m_spriteram[offs + 1] & 0x80; |
| 108 | 108 | |
| 109 | if (flip_screen | |
| 109 | if (state->flip_screen | |
| 110 | 110 | { |
| 111 | 111 | if (state->m_spriteram[offs + 1] & 0x20) |
| 112 | 112 | { |
| r14896 | r14897 | |
|---|---|---|
| 447 | 447 | if (!cliprect.contains(x, y)) |
| 448 | 448 | return; |
| 449 | 449 | |
| 450 | if (flip_screen_x_get(machine)) | |
| 450 | rallyx_state *state = machine.driver_data<rallyx_state>(); | |
| 451 | if (state->flip_screen_x()) | |
| 451 | 452 | x = 255 - x; |
| 452 | 453 | |
| 453 | if (flip_screen_y | |
| 454 | if (state->flip_screen_y | |
| 454 | 455 | y = 255 - y; |
| 455 | 456 | |
| 456 | 457 | if (colortable_entry_get_value(machine.colortable, bitmap.pix16(y, x) % 0x144) == 0) |
| r14896 | r14897 | |
| 487 | 488 | int color = spriteram_2[offs + 1] & 0x3f; |
| 488 | 489 | int flipx = spriteram[offs] & 1; |
| 489 | 490 | int flipy = spriteram[offs] & 2; |
| 490 | if (flip_screen | |
| 491 | if (state->flip_screen | |
| 491 | 492 | sx -= 2 * displacement; |
| 492 | 493 | |
| 493 | 494 | pdrawgfx_transmask(bitmap,cliprect,machine.gfx[1], |
| r14896 | r14897 | |
| 535 | 536 | |
| 536 | 537 | x = state->m_radarx[offs] + ((~state->m_radarattr[offs & 0x0f] & 0x01) << 8); |
| 537 | 538 | y = 253 - state->m_radary[offs]; |
| 538 | if (flip_screen | |
| 539 | if (state->flip_screen | |
| 539 | 540 | x -= 3; |
| 540 | 541 | |
| 541 | 542 | if (transpen) |
| r14896 | r14897 | |
| 630 | 631 | rectangle fg_clip = cliprect; |
| 631 | 632 | rectangle bg_clip = cliprect; |
| 632 | 633 | |
| 633 | if (flip_screen | |
| 634 | if (state->flip_screen | |
| 634 | 635 | { |
| 635 | 636 | bg_clip.min_x = 8 * 8; |
| 636 | 637 | fg_clip.max_x = 8 * 8 - 1; |
| r14896 | r14897 | |
| 664 | 665 | rectangle fg_clip = cliprect; |
| 665 | 666 | rectangle bg_clip = cliprect; |
| 666 | 667 | |
| 667 | if (flip_screen | |
| 668 | if (state->flip_screen | |
| 668 | 669 | { |
| 669 | 670 | bg_clip.min_x = 8 * 8; |
| 670 | 671 | fg_clip.max_x = 8 * 8 - 1; |
| r14896 | r14897 | |
| 702 | 703 | rectangle fg_clip = cliprect; |
| 703 | 704 | rectangle bg_clip = cliprect; |
| 704 | 705 | |
| 705 | if (flip_screen | |
| 706 | if (state->flip_screen | |
| 706 | 707 | { |
| 707 | 708 | /* handle reduced visible area in some games */ |
| 708 | 709 | if (screen.visible_area().max_x == 32 * 8 - 1) |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | coin_counter_w(machine(), 0, data & 0x0001); |
| 31 | 31 | coin_counter_w(machine(), 1, data & 0x0004); |
| 32 | 32 | |
| 33 | flip_screen_set( | |
| 33 | flip_screen_set( | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | if (ACCESSING_BITS_8_15) |
| r14896 | r14897 | |
| 256 | 256 | xdim = ((zoom & 0x00ff) >> 0) << (16-6+4); |
| 257 | 257 | ydim = ((zoom & 0xff00) >> 8) << (16-6+4); |
| 258 | 258 | |
| 259 | if (flip_screen_x_get(machine)) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 260 | if (flip_screen_y_get(machine)) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 259 | if (state->flip_screen_x()) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 260 | if (state->flip_screen_y()) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 261 | 261 | |
| 262 | 262 | if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; } |
| 263 | 263 | else { xstart = 0; xend = xnum; xinc = +1; } |
| r14896 | r14897 | |
| 418 | 418 | xdim = ((zoom & 0x00ff) >> 0) << (16-6+4); |
| 419 | 419 | ydim = ((zoom & 0xff00) >> 8) << (16-6+4); |
| 420 | 420 | |
| 421 | if (flip_screen_x_get(machine)) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 422 | if (flip_screen_y_get(machine)) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 421 | if (state->flip_screen_x()) { flipx = !flipx; sx = (max_x << 16) - sx - xnum * xdim; } | |
| 422 | if (state->flip_screen_y()) { flipy = !flipy; sy = (max_y << 16) - sy - ynum * ydim; } | |
| 423 | 423 | |
| 424 | 424 | if (flipx) { xstart = xnum-1; xend = -1; xinc = -1; } |
| 425 | 425 | else { xstart = 0; xend = xnum; xinc = +1; } |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | code |= ((source[2] & 0x01) << 6); |
| 79 | 79 | code |= ((source[2] & 0x08) << 4); |
| 80 | 80 | |
| 81 | if(flip_screen | |
| 81 | if(state->flip_screen | |
| 82 | 82 | { |
| 83 | 83 | flipx = !flipx; |
| 84 | 84 | flipy = !flipy; |
| r14896 | r14897 | |
| 176 | 176 | |
| 177 | 177 | draw_sprites(screen.machine(),bitmap,cliprect); |
| 178 | 178 | |
| 179 | if(flip_screen | |
| 179 | if(state->flip_screen | |
| 180 | 180 | { |
| 181 | 181 | myclip.min_x = cliprect.min_x; |
| 182 | 182 | myclip.max_x = cliprect.min_x + 15; |
| r14896 | r14897 | |
| 213 | 213 | |
| 214 | 214 | WRITE8_MEMBER(flower_state::flower_flipscreen_w) |
| 215 | 215 | { |
| 216 | flip_screen_set( | |
| 216 | flip_screen_set( | |
| 217 | 217 | } |
| r14896 | r14897 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | WRITE8_MEMBER(xain_state::xain_flipscreen_w) |
| 157 | 157 | { |
| 158 | flip_screen_set( | |
| 158 | flip_screen_set( | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| r14896 | r14897 | |
| 184 | 184 | if (sy <= -7) sy += 256; |
| 185 | 185 | flipx = attr & 0x40; |
| 186 | 186 | flipy = 0; |
| 187 | if (flip_screen | |
| 187 | if (state->flip_screen | |
| 188 | 188 | { |
| 189 | 189 | sx = 238 - sx; |
| 190 | 190 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 334 | 334 | sx += sprite_xoffs; |
| 335 | 335 | sy -= sprite_yoffs; |
| 336 | 336 | |
| 337 | if (flip_screen | |
| 337 | if (state->flip_screen | |
| 338 | 338 | { |
| 339 | 339 | sx = -sx - sizex; |
| 340 | 340 | sy = -sy - sizey; |
| r14896 | r14897 | |
| 377 | 377 | rectangle new_clip = cliprect; |
| 378 | 378 | |
| 379 | 379 | /* flip screen is embedded in the sprite control registers */ |
| 380 | /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */ | |
| 381 | flip_screen_set_no_update(screen.machine(), state->m_spriteram[0x0ff6] & 1); | |
| 382 | screen.machine().tilemap().set_flip_all(flip_screen_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 380 | /* can't use state->flip_screen_set() because the visible area is asymmetrical */ | |
| 381 | state->flip_screen_set_no_update(state->m_spriteram[0x0ff6] & 1); | |
| 382 | screen.machine().tilemap().set_flip_all(state->flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); | |
| 383 | 383 | |
| 384 | 384 | |
| 385 | 385 | /* background color */ |
| r14896 | r14897 | |
| 411 | 411 | scrollx = ( state->m_playfield_control[j+1] + (state->m_playfield_control[j+0]<<8) ) - disp_x[i]; |
| 412 | 412 | scrolly = ( state->m_playfield_control[j+3] + (state->m_playfield_control[j+2]<<8) ) + 8; |
| 413 | 413 | |
| 414 | if (flip_screen | |
| 414 | if (state->flip_screen | |
| 415 | 415 | { |
| 416 | 416 | scrollx = -scrollx; |
| 417 | 417 | scrolly = -scrolly; |
| r14896 | r14897 | |
|---|---|---|
| 194 | 194 | flipy = 0; |
| 195 | 195 | tile = (sprite_word[1] & 0xfff) + ((sprite_word[2] & 0x8000) >> 3); |
| 196 | 196 | |
| 197 | if (flip_screen | |
| 197 | if (state->flip_screen | |
| 198 | 198 | x=240-x; |
| 199 | 199 | y=240-y; |
| 200 | 200 | if (flipx) flipx=0; else flipx=1; |
| r14896 | r14897 | |
| 276 | 276 | state->m_foreground_layer->set_scrollx(0, foreground_x_scroll ); |
| 277 | 277 | state->m_foreground_layer->set_scrolly(0, foreground_y_scroll ); |
| 278 | 278 | |
| 279 | flip_screen_set( | |
| 279 | state->flip_screen_set( | |
| 280 | 280 | |
| 281 | 281 | if (state->m_scrollram16[0x28]&0x100) { |
| 282 | 282 | state->m_background_layer->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| r14896 | r14897 | |
|---|---|---|
| 160 | 160 | if (m_flipscreen != f) |
| 161 | 161 | { |
| 162 | 162 | m_flipscreen = f; |
| 163 | flip_screen_set(m | |
| 163 | flip_screen_set(m | |
| 164 | 164 | m_pix_redraw = 1; |
| 165 | 165 | |
| 166 | 166 | for (offs = 0; offs < 32; offs++) |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | WRITE8_MEMBER(renegade_state::renegade_flipscreen_w) |
| 27 | 27 | { |
| 28 | flip_screen_set( | |
| 28 | flip_screen_set( | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | WRITE8_MEMBER(renegade_state::renegade_scroll0_w) |
| r14896 | r14897 | |
| 97 | 97 | if (sx > 248) |
| 98 | 98 | sx -= 256; |
| 99 | 99 | |
| 100 | if (flip_screen | |
| 100 | if (state->flip_screen | |
| 101 | 101 | { |
| 102 | 102 | sx = 240 - sx; |
| 103 | 103 | sy = 240 - sy; |
| r14896 | r14897 | |
| 110 | 110 | drawgfx_transpen(bitmap, cliprect, machine.gfx[sprite_bank], |
| 111 | 111 | sprite_number + 1, |
| 112 | 112 | color, |
| 113 | xflip, flip_screen_get(machine), | |
| 114 | sx, sy + (flip_screen_get(machine) ? -16 : 16), 0); | |
| 113 | xflip, state->flip_screen(), | |
| 114 | sx, sy + (state->flip_screen() ? -16 : 16), 0); | |
| 115 | 115 | } |
| 116 | 116 | else |
| 117 | 117 | { |
| 118 | sy += (flip_screen | |
| 118 | sy += (state->flip_screen | |
| 119 | 119 | } |
| 120 | 120 | drawgfx_transpen(bitmap, cliprect, machine.gfx[sprite_bank], |
| 121 | 121 | sprite_number, |
| 122 | 122 | color, |
| 123 | xflip, flip_screen | |
| 123 | xflip, state->flip_screen | |
| 124 | 124 | sx, sy, 0); |
| 125 | 125 | } |
| 126 | 126 | source += 4; |
| r14896 | r14897 | |
|---|---|---|
| 416 | 416 | int color = state->m_videoram[tile_index + 0x400] & 0x3f; |
| 417 | 417 | SET_TILE_INFO( |
| 418 | 418 | 0, |
| 419 | (state->m_videoram[tile_index] & 0x7f) | (flip_screen | |
| 419 | (state->m_videoram[tile_index] & 0x7f) | (state->flip_screen | |
| 420 | 420 | color, |
| 421 | flip_screen | |
| 421 | state->flip_screen | |
| 422 | 422 | tileinfo.group = color; |
| 423 | 423 | } |
| 424 | 424 | |
| r14896 | r14897 | |
| 504 | 504 | sy -= 16 * sizey; |
| 505 | 505 | sy = (sy & 0xff) - 32; // fix wraparound |
| 506 | 506 | |
| 507 | if (flip_screen | |
| 507 | if (state->flip_screen | |
| 508 | 508 | { |
| 509 | 509 | flipx ^= 1; |
| 510 | 510 | flipy ^= 1; |
| r14896 | r14897 | |
| 537 | 537 | if ( (state->m_galaga_starcontrol[5] & 1) == 1 ) |
| 538 | 538 | { |
| 539 | 539 | int y_align = 112; /* 112 is a tweak to get alignment about perfect */ |
| 540 | int x_align = flip_screen | |
| 540 | int x_align = state->flip_screen | |
| 541 | 541 | |
| 542 | 542 | int star_cntr; |
| 543 | 543 | int set_a, set_b; |
| r14896 | r14897 | |
|---|---|---|
| 217 | 217 | WRITE8_MEMBER(lasso_state::lasso_flip_screen_w) |
| 218 | 218 | { |
| 219 | 219 | /* don't know which is which, but they are always set together */ |
| 220 | flip_screen_x_set(machine(), data & 0x01); | |
| 221 | flip_screen_y_set(machine(), data & 0x02); | |
| 220 | flip_screen_x_set(data & 0x01); | |
| 221 | flip_screen_y_set(data & 0x02); | |
| 222 | 222 | |
| 223 | machine().tilemap().set_flip_all((flip_screen_x | |
| 223 | machine().tilemap().set_flip_all((flip_screen_x | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| r14896 | r14897 | |
| 296 | 296 | flipx = source[1] & 0x40; |
| 297 | 297 | flipy = source[1] & 0x80; |
| 298 | 298 | |
| 299 | if (flip_screen_x | |
| 299 | if (state->flip_screen_x | |
| 300 | 300 | { |
| 301 | 301 | sx = 240 - sx; |
| 302 | 302 | flipx = !flipx; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | if (flip_screen_y | |
| 305 | if (state->flip_screen_y | |
| 306 | 306 | flipy = !flipy; |
| 307 | 307 | else |
| 308 | 308 | sy = 240 - sy; |
| r14896 | r14897 | |
| 334 | 334 | UINT8 x; |
| 335 | 335 | UINT8 y = offs >> 5; |
| 336 | 336 | |
| 337 | if (flip_screen_y | |
| 337 | if (state->flip_screen_y | |
| 338 | 338 | y = ~y; |
| 339 | 339 | |
| 340 | 340 | if ((y < cliprect.min_y) || (y > cliprect.max_y)) |
| r14896 | r14897 | |
| 343 | 343 | x = (offs & 0x1f) << 3; |
| 344 | 344 | data = state->m_bitmap_ram[offs]; |
| 345 | 345 | |
| 346 | if (flip_screen_x | |
| 346 | if (state->flip_screen_x | |
| 347 | 347 | x = ~x; |
| 348 | 348 | |
| 349 | 349 | for (bit = 0; bit < 8; bit++) |
| r14896 | r14897 | |
| 351 | 351 | if ((data & 0x80) && (x >= cliprect.min_x) && (x <= cliprect.max_x)) |
| 352 | 352 | bitmap.pix16(y, x) = pen; |
| 353 | 353 | |
| 354 | if (flip_screen_x | |
| 354 | if (state->flip_screen_x | |
| 355 | 355 | x = x - 1; |
| 356 | 356 | else |
| 357 | 357 | x = x + 1; |
| r14896 | r14897 | |
|---|---|---|
| 325 | 325 | if (attr & 0x01) sx -= 256; |
| 326 | 326 | if (attr & 0x04) sy -= 256; |
| 327 | 327 | |
| 328 | if (flip_screen | |
| 328 | if (state->flip_screen | |
| 329 | 329 | { |
| 330 | 330 | sx = 224 - sx; |
| 331 | 331 | sy = 224 - sy; |
| r14896 | r14897 | |
| 350 | 350 | } |
| 351 | 351 | else |
| 352 | 352 | { |
| 353 | if (flip_screen | |
| 353 | if (state->flip_screen | |
| 354 | 354 | DRAW_SPRITE(code, sx + 16, sy + 16) |
| 355 | 355 | else |
| 356 | 356 | DRAW_SPRITE(code, sx, sy) |
| r14896 | r14897 | |
| 408 | 408 | case 11: case 13: clip.max_x = state->m_sx1; break; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | if (flip_screen | |
| 411 | if (state->flip_screen | |
| 412 | 412 | clip.set(255 - clip.max_x, 255 - clip.min_x, 255 - clip.max_y, 255 - clip.min_y); |
| 413 | 413 | } |
| 414 | 414 |
| r14896 | r14897 | |
|---|---|---|
| 176 | 176 | machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 177 | 177 | break; |
| 178 | 178 | case 7: |
| 179 | soundlatch_w(space, 0, data); | |
| 179 | soundlatch_byte_w(space, 0, data); | |
| 180 | 180 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 181 | 181 | break; |
| 182 | 182 | default: |
| r14896 | r14897 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | WRITE8_MEMBER(mrjong_state::mrjong_flipscreen_w) |
| 84 | 84 | { |
| 85 | if (flip_screen | |
| 85 | if (flip_screen | |
| 86 | 86 | { |
| 87 | flip_screen_set( | |
| 87 | flip_screen_set( | |
| 88 | 88 | machine().tilemap().mark_all_dirty(); |
| 89 | 89 | } |
| 90 | 90 | } |
| r14896 | r14897 | |
| 127 | 127 | |
| 128 | 128 | sx = 224 - state->m_videoram[offs + 2]; |
| 129 | 129 | sy = state->m_videoram[offs + 0]; |
| 130 | if (flip_screen | |
| 130 | if (state->flip_screen | |
| 131 | 131 | { |
| 132 | 132 | sx = 208 - sx; |
| 133 | 133 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 145 | 145 | /* bit 5 resets the sound CPU - we ignore it */ |
| 146 | 146 | |
| 147 | 147 | /* bit 6 flips screen */ |
| 148 | flip_screen_set( | |
| 148 | flip_screen_set( | |
| 149 | 149 | |
| 150 | 150 | /* bit 7 enables characters */ |
| 151 | 151 | m_char_on = data & 0x80; |
| r14896 | r14897 | |
| 230 | 230 | int sx = state->m_spriteram[offs + 3] - ((attr & 0x10) << 4); |
| 231 | 231 | int sy = state->m_spriteram[offs + 2]; |
| 232 | 232 | |
| 233 | if (flip_screen | |
| 233 | if (state->flip_screen | |
| 234 | 234 | { |
| 235 | 235 | sx = 240 - sx; |
| 236 | 236 | sy = 240 - sy; |
| r14896 | r14897 | |
| 240 | 240 | if (priority) |
| 241 | 241 | { |
| 242 | 242 | if (color != 0x0a && color != 0x0b) |
| 243 | drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, flip_screen | |
| 243 | drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, state->flip_screen | |
| 244 | 244 | } |
| 245 | 245 | else |
| 246 | 246 | { |
| 247 | 247 | if (color == 0x0a || color == 0x0b) |
| 248 | drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, flip_screen | |
| 248 | drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, state->flip_screen | |
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | } |
| r14896 | r14897 | |
|---|---|---|
| 98 | 98 | inc = 1; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | if (flip_screen | |
| 101 | if (state->flip_screen | |
| 102 | 102 | { |
| 103 | 103 | y = 240 - y; |
| 104 | 104 | x = 240 - x; |
| r14896 | r14897 | |
| 130 | 130 | cninja_state *state = screen.machine().driver_data<cninja_state>(); |
| 131 | 131 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 132 | 132 | |
| 133 | flip_screen_set( | |
| 133 | state->flip_screen_set( | |
| 134 | 134 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 135 | 135 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 136 | 136 | |
| r14896 | r14897 | |
| 155 | 155 | deco16ic_set_enable(state->m_deco_tilegen2, 0, 1 ); |
| 156 | 156 | deco16ic_set_enable(state->m_deco_tilegen2, 1, 1 ); |
| 157 | 157 | |
| 158 | flip_screen_set( | |
| 158 | state->flip_screen_set( | |
| 159 | 159 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 160 | 160 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 161 | 161 | |
| r14896 | r14897 | |
| 176 | 176 | cninja_state *state = screen.machine().driver_data<cninja_state>(); |
| 177 | 177 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 178 | 178 | |
| 179 | flip_screen_set( | |
| 179 | state->flip_screen_set( | |
| 180 | 180 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 181 | 181 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 182 | 182 | |
| r14896 | r14897 | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /* Update playfields */ |
| 214 | flip_screen_set( | |
| 214 | state->flip_screen_set( | |
| 215 | 215 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 216 | 216 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 217 | 217 | |
| r14896 | r14897 | |
| 254 | 254 | UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); |
| 255 | 255 | |
| 256 | 256 | |
| 257 | flip_screen_set( | |
| 257 | state->flip_screen_set( | |
| 258 | 258 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 259 | 259 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 260 | 260 |
| r14896 | r14897 | |
|---|---|---|
| 303 | 303 | sprite &= ~sizex; |
| 304 | 304 | sprite &= ~(sizey << 1); |
| 305 | 305 | |
| 306 | if (flip_screen | |
| 306 | if (state->flip_screen | |
| 307 | 307 | { |
| 308 | 308 | flipx ^= 1; |
| 309 | 309 | flipy ^= 1; |
| r14896 | r14897 | |
| 374 | 374 | int row; |
| 375 | 375 | |
| 376 | 376 | for (row = 5; row < 29; row++) |
| 377 | state->m_fg_tilemap->set_scrollx(row, flip_screen_get(screen.machine()) ? state->m_scroll0-7 : state->m_scroll0); | |
| 378 | state->m_bg_tilemap->set_scrollx(0, flip_screen_get(screen.machine()) ? state->m_scroll1-4 : state->m_scroll1-3); | |
| 377 | state->m_fg_tilemap->set_scrollx(row, state->flip_screen() ? state->m_scroll0-7 : state->m_scroll0); | |
| 378 | state->m_bg_tilemap->set_scrollx(0, state->flip_screen() ? state->m_scroll1-4 : state->m_scroll1-3); | |
| 379 | 379 | |
| 380 | 380 | /* draw high priority sprite pixels, setting priority bitmap to non-zero |
| 381 | 381 | wherever there is a high-priority pixel; note that we draw to the bitmap |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | if (m_flipon != (data & 0x80)) |
| 64 | 64 | { |
| 65 | 65 | m_flipon = data & 0x80; |
| 66 | flip_screen_set(m | |
| 66 | flip_screen_set(m | |
| 67 | 67 | machine().tilemap().mark_all_dirty(); |
| 68 | 68 | } |
| 69 | 69 | } |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | { |
| 47 | 47 | |
| 48 | 48 | if (offset & 0x100) |
| 49 | paletteram_xxxxBBBBGGGGRRRR_split | |
| 49 | paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w(space, (offset & 0xff) + (m_palette_bank << 8), data); | |
| 50 | 50 | else |
| 51 | paletteram_xxxxBBBBGGGGRRRR_split | |
| 51 | paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w(space, (offset & 0xff) + (m_palette_bank << 8), data); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | READ8_MEMBER(ladyfrog_state::ladyfrog_palette_r) |
| r14896 | r14897 | |
|---|---|---|
| 24 | 24 | tumblep_state *state = screen.machine().driver_data<tumblep_state>(); |
| 25 | 25 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 26 | 26 | |
| 27 | flip_screen_set( | |
| 27 | state->flip_screen_set( | |
| 28 | 28 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 29 | 29 | |
| 30 | 30 | bitmap.fill(256, cliprect); /* not verified */ |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | WRITE8_MEMBER(jack_state::jack_paletteram_w) |
| 26 | 26 | { |
| 27 | 27 | /* RGB output is inverted */ |
| 28 | paletteram_BBGGGRRR_w(space, offset, ~data); | |
| 28 | paletteram_BBGGGRRR_byte_w(space, offset, ~data); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | READ8_MEMBER(jack_state::jack_flipscreen_r) |
| 32 | 32 | { |
| 33 | flip_screen_set( | |
| 33 | flip_screen_set( | |
| 34 | 34 | return 0; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | WRITE8_MEMBER(jack_state::jack_flipscreen_w) |
| 38 | 38 | { |
| 39 | flip_screen_set( | |
| 39 | flip_screen_set( | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 79 | 79 | flipx = (spriteram[offs + 3] & 0x80); |
| 80 | 80 | flipy = (spriteram[offs + 3] & 0x40); |
| 81 | 81 | |
| 82 | if (flip_screen | |
| 82 | if (state->flip_screen | |
| 83 | 83 | { |
| 84 | 84 | sx = 248 - sx; |
| 85 | 85 | sy = 248 - sy; |
| r14896 | r14897 | |
| 164 | 164 | flipx = (spriteram[offs + 3] & 0x80); |
| 165 | 165 | flipy = (spriteram[offs + 3] & 0x40); |
| 166 | 166 | |
| 167 | if (flip_screen | |
| 167 | if (state->flip_screen | |
| 168 | 168 | { |
| 169 | 169 | sx = 248 - sx; |
| 170 | 170 | sy = 248 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 119 | 119 | for (i = 0; i < 3; i++) |
| 120 | 120 | color |= ((m_bitmapram[offset + BITMAPRAM_SIZE / 3 * i] >> subx) & 1) << i; |
| 121 | 121 | |
| 122 | if (flip_screen | |
| 122 | if (flip_screen | |
| 123 | 123 | m_pixbitmap.pix16(y ^ 0xff, (x + subx) ^ 0xff) = PIXMAP_COLOR_BASE + 8 * m_pixcolor + color; |
| 124 | 124 | else |
| 125 | 125 | m_pixbitmap.pix16(y, x + subx) = PIXMAP_COLOR_BASE + 8 * m_pixcolor + color; |
| r14896 | r14897 | |
| 164 | 164 | coin_counter_w(machine(), 1, data & 0x20); |
| 165 | 165 | |
| 166 | 166 | /* bit 7 is screen flip */ |
| 167 | flip_screen_set( | |
| 167 | flip_screen_set( | |
| 168 | 168 | |
| 169 | 169 | /* other bits unused? */ |
| 170 | 170 | logerror("PC %04x: 1800 = %02x\n", cpu_get_pc(&space.device()), data); |
| r14896 | r14897 | |
| 192 | 192 | sy = (240 - state->m_spriteram[offs + 2]) & 0xff; |
| 193 | 193 | flipx = state->m_spriteram[offs] & 0x04; |
| 194 | 194 | flipy = state->m_spriteram[offs] & 0x02; |
| 195 | if (flip_screen | |
| 195 | if (state->flip_screen | |
| 196 | 196 | { |
| 197 | 197 | sx = 240 - sx; |
| 198 | 198 | sy = 240 - sy; |
| r14896 | r14897 | |
| 215 | 215 | dogfgt_state *state = screen.machine().driver_data<dogfgt_state>(); |
| 216 | 216 | int offs; |
| 217 | 217 | |
| 218 | if (state->m_lastflip != flip_screen | |
| 218 | if (state->m_lastflip != state->flip_screen | |
| 219 | 219 | { |
| 220 | 220 | address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 221 | 221 | |
| 222 | state->m_lastflip = flip_screen | |
| 222 | state->m_lastflip = state->flip_screen | |
| 223 | 223 | state->m_lastpixcolor = state->m_pixcolor; |
| 224 | 224 | |
| 225 | 225 | for (offs = 0; offs < BITMAPRAM_SIZE; offs++) |
| r14896 | r14897 | |
|---|---|---|
| 8 | 8 | dietgo_state *state = screen.machine().driver_data<dietgo_state>(); |
| 9 | 9 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 10 | 10 | |
| 11 | flip_screen_set( | |
| 11 | state->flip_screen_set( | |
| 12 | 12 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 13 | 13 | |
| 14 | 14 | bitmap.fill(256, cliprect); /* not verified */ |
| r14896 | r14897 | |
|---|---|---|
| 165 | 165 | m_bg_tilemap->mark_all_dirty(); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | if (flip_screen | |
| 168 | if (flip_screen | |
| 169 | 169 | { |
| 170 | flip_screen_set( | |
| 170 | flip_screen_set( | |
| 171 | 171 | machine().tilemap().mark_all_dirty(); |
| 172 | 172 | } |
| 173 | 173 | } |
| r14896 | r14897 | |
| 226 | 226 | sx = spriteram[roffs + 1]; |
| 227 | 227 | sy = spriteram[roffs]; |
| 228 | 228 | |
| 229 | if (flip_screen | |
| 229 | if (state->flip_screen | |
| 230 | 230 | { |
| 231 | 231 | sx = 240 - sx; |
| 232 | 232 | sy = 240 - sy; |
| r14896 | r14897 | |
| 288 | 288 | int sx = spriteram[offs + 2]; |
| 289 | 289 | int sy = spriteram[offs]; |
| 290 | 290 | |
| 291 | if (flip_screen | |
| 291 | if (state->flip_screen | |
| 292 | 292 | { |
| 293 | 293 | sx = 240 - sx; |
| 294 | 294 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 168 | 168 | /* So I'm using this specific check. -kal 11 jul 2002 */ |
| 169 | 169 | // if(sprite_type == 1) sy=sy+2; |
| 170 | 170 | |
| 171 | if( flip_screen | |
| 171 | if( state->flip_screen | |
| 172 | 172 | { |
| 173 | 173 | drawgfx_transpen( bitmap,cliprect,gfx, |
| 174 | 174 | sprite_number&0x7f, |
| r14896 | r14897 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | /* bit 7 flips screen */ |
| 137 | 137 | |
| 138 | if (flip_screen | |
| 138 | if (flip_screen | |
| 139 | 139 | { |
| 140 | flip_screen_set( | |
| 140 | flip_screen_set( | |
| 141 | 141 | machine().tilemap().mark_all_dirty(); |
| 142 | 142 | } |
| 143 | 143 | } |
| r14896 | r14897 | |
| 263 | 263 | { |
| 264 | 264 | /* bit 0 flips screen */ |
| 265 | 265 | |
| 266 | if (flip_screen | |
| 266 | if (flip_screen | |
| 267 | 267 | { |
| 268 | flip_screen_set( | |
| 268 | flip_screen_set( | |
| 269 | 269 | machine().tilemap().mark_all_dirty(); |
| 270 | 270 | } |
| 271 | 271 |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | x = dx; |
| 34 | 34 | y = dy; |
| 35 | 35 | |
| 36 | if (flip_screen | |
| 36 | if (state->flip_screen | |
| 37 | 37 | { |
| 38 | 38 | sx = 240 - x; |
| 39 | 39 | sy = 240 - y; |
| r14896 | r14897 | |
| 64 | 64 | x = dx; |
| 65 | 65 | y = dy; |
| 66 | 66 | |
| 67 | if (flip_screen | |
| 67 | if (state->flip_screen | |
| 68 | 68 | { |
| 69 | 69 | sx = 240 - x; |
| 70 | 70 | sy = 240 - y; |
| r14896 | r14897 | |
| 120 | 120 | x = dx; |
| 121 | 121 | y = dy; |
| 122 | 122 | |
| 123 | if (flip_screen | |
| 123 | if (state->flip_screen | |
| 124 | 124 | { |
| 125 | 125 | sx = 240 - x; |
| 126 | 126 | sy = 240 - y; |
| r14896 | r14897 | |
| 169 | 169 | |
| 170 | 170 | if (wrapr == 8) xpos -= 256; |
| 171 | 171 | |
| 172 | if (flip_screen | |
| 172 | if (state->flip_screen | |
| 173 | 173 | { |
| 174 | 174 | xpos = 240 - xpos; |
| 175 | 175 | ypos = 240 - ypos; |
| r14896 | r14897 | |
| 249 | 249 | if (x > 511) x &= 0x1ff; |
| 250 | 250 | if (y > 511) y &= 0x1ff; |
| 251 | 251 | |
| 252 | if (flip_screen | |
| 252 | if (state->flip_screen | |
| 253 | 253 | { |
| 254 | 254 | sx = 240 - x; |
| 255 | 255 | sy = 240 - y; |
| r14896 | r14897 | |
|---|---|---|
| 131 | 131 | x = (sx + (xc << 3)) & 0xff; |
| 132 | 132 | y = (sy + (yc << 3)) & 0xff; |
| 133 | 133 | |
| 134 | if (flip_screen | |
| 134 | if (state->flip_screen | |
| 135 | 135 | { |
| 136 | 136 | x = 248 - x; |
| 137 | 137 | y = 248 - y; |
| r14896 | r14897 | |
| 140 | 140 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], |
| 141 | 141 | code & 0x3fff, |
| 142 | 142 | color, |
| 143 | flip_screen | |
| 143 | state->flip_screen | |
| 144 | 144 | x, y, 15); |
| 145 | 145 | goffs += 2; |
| 146 | 146 | } |
| r14896 | r14897 | |
| 200 | 200 | x = (sx + (xc << 3)) & 0xff; |
| 201 | 201 | y = (sy + (yc << 3)) & 0xff; |
| 202 | 202 | |
| 203 | if (flip_screen | |
| 203 | if (state->flip_screen | |
| 204 | 204 | { |
| 205 | 205 | x = 248 - x; |
| 206 | 206 | y = 248 - y; |
| r14896 | r14897 | |
| 209 | 209 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], |
| 210 | 210 | code & 0x3fff, |
| 211 | 211 | color, |
| 212 | flip_screen | |
| 212 | state->flip_screen | |
| 213 | 213 | x, y, 15); |
| 214 | 214 | goffs += 2; |
| 215 | 215 | } |
| r14896 | r14897 | |
|---|---|---|
| 86 | 86 | bitmap_ind16* sprite_bitmap2 = &screen.machine().device<decospr_device>("spritegen2")->get_sprite_temp_bitmap(); |
| 87 | 87 | |
| 88 | 88 | /* Update tilemaps */ |
| 89 | flip_screen_set( | |
| 89 | state->flip_screen_set( | |
| 90 | 90 | deco16ic_pf_update(state->m_deco_tilegen1, 0, state->m_pf2_rowscroll); |
| 91 | 91 | deco16ic_pf_update(state->m_deco_tilegen2, 0, state->m_pf4_rowscroll); |
| 92 | 92 |
| r14896 | r14897 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | m_scroll_bit_8 = data & 0x01; |
| 84 | 84 | |
| 85 | if (flip_screen | |
| 85 | if (flip_screen | |
| 86 | 86 | { |
| 87 | flip_screen_set( | |
| 87 | flip_screen_set( | |
| 88 | 88 | machine().tilemap().mark_all_dirty(); |
| 89 | 89 | } |
| 90 | 90 | } |
| r14896 | r14897 | |
| 117 | 117 | gotya_state *state = machine.driver_data<gotya_state>(); |
| 118 | 118 | int row; |
| 119 | 119 | |
| 120 | if (flip_screen | |
| 120 | if (state->flip_screen | |
| 121 | 121 | { |
| 122 | 122 | sx = 35 - sx; |
| 123 | 123 | } |
| r14896 | r14897 | |
| 126 | 126 | { |
| 127 | 127 | int sy; |
| 128 | 128 | |
| 129 | if (flip_screen | |
| 129 | if (state->flip_screen | |
| 130 | 130 | sy = row; |
| 131 | 131 | else |
| 132 | 132 | sy = 31 - row; |
| r14896 | r14897 | |
| 135 | 135 | machine.gfx[0], |
| 136 | 136 | state->m_videoram2[row * 32 + col], |
| 137 | 137 | state->m_videoram2[row * 32 + col + 0x10] & 0x0f, |
| 138 | flip_screen_x | |
| 138 | state->flip_screen_x | |
| 139 | 139 | 8 * sx, 8 * sy); |
| 140 | 140 | } |
| 141 | 141 | } |
| r14896 | r14897 | |
| 153 | 153 | int sx = 256 - spriteram[offs + 0x10] + (spriteram[offs + 0x01] & 0x01) * 256; |
| 154 | 154 | int sy = spriteram[offs + 0x00]; |
| 155 | 155 | |
| 156 | if (flip_screen | |
| 156 | if (state->flip_screen | |
| 157 | 157 | sy = 240 - sy; |
| 158 | 158 | |
| 159 | 159 | drawgfx_transpen(bitmap,cliprect, |
| 160 | 160 | machine.gfx[1], |
| 161 | 161 | code, color, |
| 162 | flip_screen_x | |
| 162 | state->flip_screen_x | |
| 163 | 163 | sx, sy, 0); |
| 164 | 164 | } |
| 165 | 165 | } |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | supbtime_state *state = screen.machine().driver_data<supbtime_state>(); |
| 27 | 27 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 28 | 28 | |
| 29 | flip_screen_set( | |
| 29 | state->flip_screen_set( | |
| 30 | 30 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 31 | 31 | |
| 32 | 32 | bitmap.fill(768, cliprect); |
| r14896 | r14897 | |
|---|---|---|
| 137 | 137 | switch (offset) |
| 138 | 138 | { |
| 139 | 139 | case 0: |
| 140 | flip_screen_set( | |
| 140 | flip_screen_set( | |
| 141 | 141 | break; |
| 142 | 142 | |
| 143 | 143 | case 1: |
| r14896 | r14897 | |
| 196 | 196 | sprite &= ~sizex; |
| 197 | 197 | sprite &= ~(sizey << 1); |
| 198 | 198 | |
| 199 | if (flip_screen | |
| 199 | if (state->flip_screen | |
| 200 | 200 | { |
| 201 | 201 | flipx ^= 1; |
| 202 | 202 | flipy ^= 1; |
| r14896 | r14897 | |
|---|---|---|
| 66 | 66 | WRITE8_MEMBER(bogeyman_state::bogeyman_paletteram_w) |
| 67 | 67 | { |
| 68 | 68 | /* RGB output is inverted */ |
| 69 | paletteram_BBGGGRRR_w(space, offset, ~data); | |
| 69 | paletteram_BBGGGRRR_byte_w(space, offset, ~data); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 121 | 121 | |
| 122 | 122 | if (multi) sy -= 16; |
| 123 | 123 | |
| 124 | if (flip_screen | |
| 124 | if (state->flip_screen | |
| 125 | 125 | { |
| 126 | 126 | sx = 240 - sx; |
| 127 | 127 | sy = 240 - sy; |
| r14896 | r14897 | |
| 141 | 141 | machine.gfx[2], |
| 142 | 142 | code + 1, color, |
| 143 | 143 | flipx, flipy, |
| 144 | sx, sy + (flip_screen | |
| 144 | sx, sy + (state->flip_screen | |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | } |
| r14896 | r14897 | |
|---|---|---|
| 365 | 365 | coin_counter_w(machine(), 1,data & 0x02); |
| 366 | 366 | |
| 367 | 367 | /* bit 2 is flip screen (handled both by software and hardware) */ |
| 368 | flip_screen_set( | |
| 368 | flip_screen_set( | |
| 369 | 369 | |
| 370 | 370 | /* bit 3 is display disable */ |
| 371 | 371 | m_video_off = data & 0x08; |
| r14896 | r14897 | |
| 391 | 391 | coin_counter_w(machine(), 1,data & 0x02); |
| 392 | 392 | |
| 393 | 393 | /* bit 2 is flip screen (handled both by software and hardware) */ |
| 394 | flip_screen_set( | |
| 394 | flip_screen_set( | |
| 395 | 395 | |
| 396 | 396 | /* bit 3 is display disable */ |
| 397 | 397 | m_video_off = data & 0x08; |
| r14896 | r14897 | |
| 442 | 442 | h = 1 << ((spriteram[offs+2] & 0x3000) >> 12); |
| 443 | 443 | sy -= 16 * h; |
| 444 | 444 | |
| 445 | if (flip_screen | |
| 445 | if (state->flip_screen | |
| 446 | 446 | { |
| 447 | 447 | sx = 512 - 16*w - sx; |
| 448 | 448 | sy = 284 - 16*h - sy; |
| r14896 | r14897 | |
| 495 | 495 | h = 1 << ((spriteram16_2[offs+2] & 0x3000) >> 12); |
| 496 | 496 | sy -= 16 * h; |
| 497 | 497 | |
| 498 | if (flip_screen | |
| 498 | if (state->flip_screen | |
| 499 | 499 | { |
| 500 | 500 | sx = 512 - 16*w - sx; |
| 501 | 501 | sy = 256 - 16*h - sy; |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | WRITE8_MEMBER(pokechmp_state::pokechmp_flipscreen_w) |
| 15 | 15 | { |
| 16 | if (flip_screen | |
| 16 | if (flip_screen | |
| 17 | 17 | { |
| 18 | flip_screen_set( | |
| 18 | flip_screen_set( | |
| 19 | 19 | machine().tilemap().mark_all_dirty(); |
| 20 | 20 | } |
| 21 | 21 | } |
| r14896 | r14897 | |
| 55 | 55 | |
| 56 | 56 | flipx = spriteram[offs+1] & 0x04; |
| 57 | 57 | flipy = spriteram[offs+1] & 0x02; |
| 58 | if (flip_screen | |
| 58 | if (state->flip_screen | |
| 59 | 59 | sx=240-sx; |
| 60 | 60 | sy=240-sy; |
| 61 | 61 | if (flipx) flipx=0; else flipx=1; |
| r14896 | r14897 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | READ8_MEMBER(aeroboto_state::aeroboto_in0_r) |
| 83 | 83 | { |
| 84 | return input_port_read(machine(), flip_screen | |
| 84 | return input_port_read(machine(), flip_screen | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | WRITE8_MEMBER(aeroboto_state::aeroboto_3000_w) |
| 88 | 88 | { |
| 89 | 89 | |
| 90 | 90 | /* bit 0 selects both flip screen and player1/player2 controls */ |
| 91 | flip_screen_set( | |
| 91 | flip_screen_set( | |
| 92 | 92 | |
| 93 | 93 | /* bit 1 = char bank select */ |
| 94 | 94 | if (m_charbank != ((data & 0x02) >> 1)) |
| r14896 | r14897 | |
| 136 | 136 | int x = state->m_spriteram[offs + 3]; |
| 137 | 137 | int y = 240 - state->m_spriteram[offs]; |
| 138 | 138 | |
| 139 | if (flip_screen | |
| 139 | if (state->flip_screen | |
| 140 | 140 | { |
| 141 | 141 | x = 248 - x; |
| 142 | 142 | y = 240 - y; |
| r14896 | r14897 | |
| 145 | 145 | drawgfx_transpen(bitmap, cliprect, machine.gfx[1], |
| 146 | 146 | state->m_spriteram[offs + 1], |
| 147 | 147 | state->m_spriteram[offs + 2] & 0x07, |
| 148 | flip_screen | |
| 148 | state->flip_screen | |
| 149 | 149 | ((x + 8) & 0xff) - 8, y, 0); |
| 150 | 150 | } |
| 151 | 151 | } |
| r14896 | r14897 | |
|---|---|---|
| 211 | 211 | color = ((state->m_spriteram[offs + 1] & 0x08) >> 2) | (state->m_spriteram[offs + 1] & 0x01); |
| 212 | 212 | flipx = state->m_spriteram[offs + 1] & 0x04; |
| 213 | 213 | flipy = state->m_spriteram[offs + 1] & 0x02; |
| 214 | if (flip_screen | |
| 214 | if (state->flip_screen | |
| 215 | 215 | { |
| 216 | 216 | sx = 240 - sx; |
| 217 | 217 | sy = 240 - sy; |
| r14896 | r14897 | |
| 221 | 221 | |
| 222 | 222 | if (state->m_spriteram[offs + 1] & 0x10) /* double width */ |
| 223 | 223 | { |
| 224 | if (flip_screen | |
| 224 | if (state->flip_screen | |
| 225 | 225 | |
| 226 | 226 | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 227 | 227 | code & ~1, |
| r14896 | r14897 | |
|---|---|---|
| 171 | 171 | if (color & 1) sx -= 256; |
| 172 | 172 | if (attr & 1) sy -= 256; |
| 173 | 173 | |
| 174 | if (flip_screen | |
| 174 | if (state->flip_screen | |
| 175 | 175 | { |
| 176 | 176 | flipx = !flipx; |
| 177 | 177 | flipy = !flipy; |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | WRITE8_MEMBER(amspdwy_state::amspdwy_paletteram_w) |
| 20 | 20 | { |
| 21 | 21 | data ^= 0xff; |
| 22 | paletteram_BBGGGRRR_w(space, offset, data); | |
| 23 | // paletteram_RRRGGGBB_w(offset, data); | |
| 22 | paletteram_BBGGGRRR_byte_w(space, offset, data); | |
| 23 | // paletteram_RRRGGGBB_byte_w(offset, data); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | WRITE8_MEMBER(amspdwy_state::amspdwy_flipscreen_w) |
| 27 | 27 | { |
| 28 | 28 | m_flipscreen ^= 1; |
| 29 | flip_screen_set(m | |
| 29 | flip_screen_set(m | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /*************************************************************************** |
| r14896 | r14897 | |
| 117 | 117 | int flipx = attr & 0x80; |
| 118 | 118 | int flipy = attr & 0x40; |
| 119 | 119 | |
| 120 | if (flip_screen | |
| 120 | if (state->flip_screen | |
| 121 | 121 | { |
| 122 | 122 | x = max_x - x - 8; |
| 123 | 123 | y = max_y - y - 8; |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | WRITE8_MEMBER(srumbler_state::srumbler_4009_w) |
| 84 | 84 | { |
| 85 | 85 | /* bit 0 flips screen */ |
| 86 | flip_screen_set( | |
| 86 | flip_screen_set( | |
| 87 | 87 | |
| 88 | 88 | /* bits 4-5 used during attract mode, unknown */ |
| 89 | 89 | |
| r14896 | r14897 | |
| 142 | 142 | sx = buffered_spriteram[offs + 3] + 0x100 * ( attr & 0x01); |
| 143 | 143 | flipy = attr & 0x02; |
| 144 | 144 | |
| 145 | if (flip_screen | |
| 145 | if (state->flip_screen | |
| 146 | 146 | { |
| 147 | 147 | sx = 496 - sx; |
| 148 | 148 | sy = 240 - sy; |
| r14896 | r14897 | |
| 152 | 152 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 153 | 153 | code, |
| 154 | 154 | colour, |
| 155 | flip_screen | |
| 155 | state->flip_screen | |
| 156 | 156 | sx, sy,15); |
| 157 | 157 | } |
| 158 | 158 | } |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | WRITE8_MEMBER(pbaction_state::pbaction_scroll_w) |
| 37 | 37 | { |
| 38 | 38 | m_scroll = data - 3; |
| 39 | if (flip_screen | |
| 39 | if (flip_screen | |
| 40 | 40 | m_scroll = -m_scroll; |
| 41 | 41 | |
| 42 | 42 | m_bg_tilemap->set_scrollx(0, m_scroll); |
| r14896 | r14897 | |
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER(pbaction_state::pbaction_flipscreen_w) |
| 47 | 47 | { |
| 48 | flip_screen_set( | |
| 48 | flip_screen_set( | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 103 | 103 | flipx = spriteram[offs + 1] & 0x40; |
| 104 | 104 | flipy = spriteram[offs + 1] & 0x80; |
| 105 | 105 | |
| 106 | if (flip_screen | |
| 106 | if (state->flip_screen | |
| 107 | 107 | { |
| 108 | 108 | if (spriteram[offs] & 0x80) |
| 109 | 109 | { |
| r14896 | r14897 | |
| 123 | 123 | spriteram[offs], |
| 124 | 124 | spriteram[offs + 1] & 0x0f, |
| 125 | 125 | flipx,flipy, |
| 126 | sx + (flip_screen | |
| 126 | sx + (state->flip_screen | |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 |
| r14896 | r14897 | |
|---|---|---|
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | #include "includes/mcr.h" | |
| 8 | 9 | #include "includes/mcr68.h" |
| 9 | 10 | |
| 10 | 11 |
| r14896 | r14897 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | WRITE8_MEMBER(spcforce_state::spcforce_flip_screen_w) |
| 14 | 14 | { |
| 15 | flip_screen_set( | |
| 15 | flip_screen_set( | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| r14896 | r14897 | |
| 20 | 20 | { |
| 21 | 21 | spcforce_state *state = screen.machine().driver_data<spcforce_state>(); |
| 22 | 22 | int offs; |
| 23 | int flip = flip_screen | |
| 23 | int flip = state->flip_screen | |
| 24 | 24 | |
| 25 | 25 | /* draw the characters as sprites because they could be overlapping */ |
| 26 | 26 | bitmap.fill(0, cliprect); |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | WRITE8_MEMBER(exprraid_state::exprraid_flipscreen_w) |
| 18 | 18 | { |
| 19 | if (flip_screen | |
| 19 | if (flip_screen | |
| 20 | 20 | { |
| 21 | flip_screen_set( | |
| 21 | flip_screen_set( | |
| 22 | 22 | machine().tilemap().mark_all_dirty(); |
| 23 | 23 | } |
| 24 | 24 | } |
| r14896 | r14897 | |
| 106 | 106 | int sx = ((248 - state->m_spriteram[offs + 2]) & 0xff) - 8; |
| 107 | 107 | int sy = state->m_spriteram[offs]; |
| 108 | 108 | |
| 109 | if (flip_screen | |
| 109 | if (state->flip_screen | |
| 110 | 110 | { |
| 111 | 111 | sx = 240 - sx; |
| 112 | 112 | sy = 240 - sy; |
| r14896 | r14897 | |
| 126 | 126 | drawgfx_transpen(bitmap,cliprect, machine.gfx[1], |
| 127 | 127 | code + 1, color, |
| 128 | 128 | flipx, flipy, |
| 129 | sx, sy + (flip_screen | |
| 129 | sx, sy + (state->flip_screen | |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | } |
| r14896 | r14897 | |
|---|---|---|
| 161 | 161 | WRITE16_MEMBER(tecmo16_state::tecmo16_flipscreen_w) |
| 162 | 162 | { |
| 163 | 163 | m_flipscreen = data & 0x01; |
| 164 | flip_screen_set(m | |
| 164 | flip_screen_set(m | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /******************************************************************************/ |
| r14896 | r14897 | |
|---|---|---|
| 216 | 216 | |
| 217 | 217 | void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram_base) |
| 218 | 218 | { |
| 219 | toypop_state *state = machine.driver_data<toypop_state>(); | |
| 219 | 220 | UINT8 *spriteram = spriteram_base + 0x780; |
| 220 | 221 | UINT8 *spriteram_2 = spriteram + 0x800; |
| 221 | 222 | UINT8 *spriteram_3 = spriteram_2 + 0x800; |
| r14896 | r14897 | |
| 246 | 247 | sy -= 16 * sizey; |
| 247 | 248 | sy = (sy & 0xff) - 32; // fix wraparound |
| 248 | 249 | |
| 249 | if (flip_screen | |
| 250 | if (state->flip_screen | |
| 250 | 251 | { |
| 251 | 252 | flipx ^= 1; |
| 252 | 253 | flipy ^= 1; |
| r14896 | r14897 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | WRITE8_MEMBER(kchamp_state::kchamp_flipscreen_w) |
| 40 | 40 | { |
| 41 | flip_screen_set( | |
| 41 | flip_screen_set( | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 83 | 83 | int sx = spriteram[offs + 3] - 8; |
| 84 | 84 | int sy = 247 - spriteram[offs]; |
| 85 | 85 | |
| 86 | if (flip_screen | |
| 86 | if (state->flip_screen | |
| 87 | 87 | { |
| 88 | 88 | sx = 240 - sx; |
| 89 | 89 | sy = 240 - sy; |
| r14896 | r14897 | |
| 112 | 112 | int sx = spriteram[offs + 3]; |
| 113 | 113 | int sy = 240 - spriteram[offs]; |
| 114 | 114 | |
| 115 | if (flip_screen | |
| 115 | if (state->flip_screen | |
| 116 | 116 | { |
| 117 | 117 | sx = 240 - sx; |
| 118 | 118 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 129 | 129 | characters when screen is flipped, we have to flip them back. */ |
| 130 | 130 | SET_TILE_INFO( |
| 131 | 131 | 0, |
| 132 | (code & 0x7f) | (flip_screen | |
| 132 | (code & 0x7f) | (state->flip_screen | |
| 133 | 133 | color, |
| 134 | flip_screen | |
| 134 | state->flip_screen | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| r14896 | r14897 | |
| 227 | 227 | break; |
| 228 | 228 | |
| 229 | 229 | case 7: /* FLIP */ |
| 230 | flip_screen_set( | |
| 230 | state->flip_screen_set( | |
| 231 | 231 | break; |
| 232 | 232 | } |
| 233 | 233 | } |
| r14896 | r14897 | |
| 252 | 252 | rectangle visarea = cliprect; |
| 253 | 253 | visarea.min_x = 2*8; |
| 254 | 254 | visarea.max_x = 34*8-1; |
| 255 | if (flip_screen | |
| 255 | if (state->flip_screen | |
| 256 | 256 | { |
| 257 | 257 | visarea.min_x += 12*8; |
| 258 | 258 | visarea.max_x += 12*8; |
| r14896 | r14897 | |
| 280 | 280 | sy -= 16 * size; |
| 281 | 281 | sy = (sy & 0xff) - 32; // fix wraparound |
| 282 | 282 | |
| 283 | if (flip_screen | |
| 283 | if (state->flip_screen | |
| 284 | 284 | { |
| 285 | 285 | flipx ^= 1; |
| 286 | 286 | flipy ^= 1; |
| r14896 | r14897 | |
|---|---|---|
| 86 | 86 | sy = 240 - sy; |
| 87 | 87 | |
| 88 | 88 | |
| 89 | if (flip_screen | |
| 89 | if (machine.driver_data()->flip_screen | |
| 90 | 90 | { |
| 91 | 91 | sy = 240 - sy; |
| 92 | 92 | sx = 240 - sx; |
| r14896 | r14897 | |
|---|---|---|
| 111 | 111 | int sx = spriteram[i + 2] - ((attr & 0x80) << 1); |
| 112 | 112 | int sy = spriteram[i + 3]; |
| 113 | 113 | |
| 114 | if (flip_screen | |
| 114 | if (state->flip_screen | |
| 115 | 115 | { |
| 116 | 116 | sx = 240 - sx; |
| 117 | 117 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | WRITE8_MEMBER(markham_state::markham_flipscreen_w) |
| 49 | 49 | { |
| 50 | if (flip_screen | |
| 50 | if (flip_screen | |
| 51 | 51 | { |
| 52 | flip_screen_set( | |
| 52 | flip_screen_set( | |
| 53 | 53 | machine().tilemap().mark_all_dirty(); |
| 54 | 54 | } |
| 55 | 55 | } |
| r14896 | r14897 | |
| 83 | 83 | int chr = spriteram[offs + 1]; |
| 84 | 84 | int col = spriteram[offs + 2]; |
| 85 | 85 | |
| 86 | int fx = flip_screen_get(machine); | |
| 87 | int fy = flip_screen_get(machine); | |
| 86 | int fx = state->flip_screen(); | |
| 87 | int fy = state->flip_screen(); | |
| 88 | 88 | |
| 89 | 89 | int x = spriteram[offs + 3]; |
| 90 | 90 | int y = spriteram[offs + 0]; |
| 91 | 91 | int px, py; |
| 92 | 92 | col &= 0x3f ; |
| 93 | 93 | |
| 94 | if (flip_screen | |
| 94 | if (state->flip_screen | |
| 95 | 95 | { |
| 96 | 96 | px = x - 2; |
| 97 | 97 | py = 240 - y; |
| r14896 | r14897 | |
|---|---|---|
| 130 | 130 | memory_set_bank(machine(), "bank1", (data & 0x08) >> 3); |
| 131 | 131 | |
| 132 | 132 | m_nmi_mask = data & 0x10; |
| 133 | flip_screen_set( | |
| 133 | flip_screen_set( | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | WRITE8_MEMBER(superqix_state::superqix_0410_w) |
| r14896 | r14897 | |
| 174 | 174 | int sx = spriteram[offs + 1] + 256 * (spriteram[offs] & 0x01); |
| 175 | 175 | int sy = spriteram[offs + 2]; |
| 176 | 176 | |
| 177 | if (flip_screen | |
| 177 | if (state->flip_screen | |
| 178 | 178 | { |
| 179 | 179 | sx = 240 - sx; |
| 180 | 180 | sy = 240 - sy; |
| r14896 | r14897 | |
| 183 | 183 | drawgfx_transpen(bitmap,cliprect, machine.gfx[1], |
| 184 | 184 | code, |
| 185 | 185 | color, |
| 186 | flip_screen | |
| 186 | state->flip_screen | |
| 187 | 187 | sx, sy, 0); |
| 188 | 188 | } |
| 189 | 189 | } |
| r14896 | r14897 | |
| 204 | 204 | int sx = spriteram[offs + 1]; |
| 205 | 205 | int sy = spriteram[offs + 2]; |
| 206 | 206 | |
| 207 | if (flip_screen | |
| 207 | if (state->flip_screen | |
| 208 | 208 | { |
| 209 | 209 | sx = 240 - sx; |
| 210 | 210 | sy = 240 - sy; |
| r14896 | r14897 | |
| 233 | 233 | { |
| 234 | 234 | superqix_state *state = screen.machine().driver_data<superqix_state>(); |
| 235 | 235 | state->m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); |
| 236 | copybitmap_trans(bitmap,*state->m_fg_bitmap[state->m_show_bitmap],flip_screen | |
| 236 | copybitmap_trans(bitmap,*state->m_fg_bitmap[state->m_show_bitmap],state->flip_screen | |
| 237 | 237 | superqix_draw_sprites(screen.machine(), bitmap,cliprect); |
| 238 | 238 | state->m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0); |
| 239 | 239 | return 0; |
| r14896 | r14897 | |
|---|---|---|
| 373 | 373 | |
| 374 | 374 | WRITE8_MEMBER(mappy_state::superpac_flipscreen_w) |
| 375 | 375 | { |
| 376 | flip_screen_set( | |
| 376 | flip_screen_set( | |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | READ8_MEMBER(mappy_state::superpac_flipscreen_r) |
| 380 | 380 | { |
| 381 | flip_screen_set( | |
| 381 | flip_screen_set( | |
| 382 | 382 | return 0xff; |
| 383 | 383 | } |
| 384 | 384 | |
| r14896 | r14897 | |
| 398 | 398 | |
| 399 | 399 | static void mappy_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram_base) |
| 400 | 400 | { |
| 401 | mappy_state *state = machine.driver_data<mappy_state>(); | |
| 401 | 402 | UINT8 *spriteram = spriteram_base + 0x780; |
| 402 | 403 | UINT8 *spriteram_2 = spriteram + 0x800; |
| 403 | 404 | UINT8 *spriteram_3 = spriteram_2 + 0x800; |
| r14896 | r14897 | |
| 430 | 431 | sy -= 16 * sizey; |
| 431 | 432 | sy = (sy & 0xff) - 32; // fix wraparound |
| 432 | 433 | |
| 433 | if (flip_screen | |
| 434 | if (state->flip_screen | |
| 434 | 435 | { |
| 435 | 436 | flipx ^= 1; |
| 436 | 437 | flipy ^= 1; |
| r14896 | r14897 | |
| 478 | 479 | |
| 479 | 480 | static void phozon_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram_base) |
| 480 | 481 | { |
| 482 | mappy_state *state = machine.driver_data<mappy_state>(); | |
| 481 | 483 | UINT8 *spriteram = spriteram_base + 0x780; |
| 482 | 484 | UINT8 *spriteram_2 = spriteram + 0x800; |
| 483 | 485 | UINT8 *spriteram_3 = spriteram_2 + 0x800; |
| r14896 | r14897 | |
| 509 | 511 | sy -= 8 * sizey; |
| 510 | 512 | sy = (sy & 0xff) - 32; // fix wraparound |
| 511 | 513 | |
| 512 | if (flip_screen | |
| 514 | if (state->flip_screen | |
| 513 | 515 | { |
| 514 | 516 | flipx ^= 1; |
| 515 | 517 | flipy ^= 1; |
| r14896 | r14897 | |
| 568 | 570 | mappy_state *state = screen.machine().driver_data<mappy_state>(); |
| 569 | 571 | |
| 570 | 572 | /* flip screen control is embedded in RAM */ |
| 571 | flip_screen_set( | |
| 573 | state->flip_screen_set( | |
| 572 | 574 | |
| 573 | 575 | state->m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0); |
| 574 | 576 |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | /* bit 1 flips screen */ |
| 21 | 21 | |
| 22 | if (flip_screen | |
| 22 | if (flip_screen | |
| 23 | 23 | { |
| 24 | flip_screen_set( | |
| 24 | flip_screen_set( | |
| 25 | 25 | machine().tilemap().mark_all_dirty(); |
| 26 | 26 | } |
| 27 | 27 | |
| r14896 | r14897 | |
| 89 | 89 | if (sx > 0x100) sx -= 0x200; |
| 90 | 90 | if (sy > 0x100) sy -= 0x200; |
| 91 | 91 | |
| 92 | if (flip_screen | |
| 92 | if (state->flip_screen | |
| 93 | 93 | { |
| 94 | 94 | sx = 240 - sx; |
| 95 | 95 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | m_flipscreen = tmp; |
| 114 | 114 | |
| 115 | flip_screen_set( | |
| 115 | flip_screen_set( | |
| 116 | 116 | m_fg_tilemap->set_scrolldx(64, -64 +16); |
| 117 | 117 | } |
| 118 | 118 |
| r14896 | r14897 | |
|---|---|---|
| 162 | 162 | y = dy; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | if ( | |
| 165 | if ( | |
| 166 | 166 | { |
| 167 | 167 | sx = 240 - x; |
| 168 | 168 | sy = 240 - y; |
| r14896 | r14897 | |
|---|---|---|
| 187 | 187 | screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram2->buffer(), 0x400, true); |
| 188 | 188 | screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400, true); |
| 189 | 189 | |
| 190 | flip_screen_set( | |
| 190 | state->flip_screen_set( | |
| 191 | 191 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 192 | 192 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 193 | 193 |
| r14896 | r14897 | |
|---|---|---|
| 208 | 208 | |
| 209 | 209 | WRITE16_MEMBER(equites_state::equites_flip0_w) |
| 210 | 210 | { |
| 211 | flip_screen_set( | |
| 211 | flip_screen_set( | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | WRITE16_MEMBER(equites_state::equites_flip1_w) |
| 215 | 215 | { |
| 216 | flip_screen_set( | |
| 216 | flip_screen_set( | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | WRITE16_MEMBER(equites_state::splndrbt_flip0_w) |
| 220 | 220 | { |
| 221 | 221 | if (ACCESSING_BITS_0_7) |
| 222 | flip_screen_set( | |
| 222 | flip_screen_set( | |
| 223 | 223 | |
| 224 | 224 | if (ACCESSING_BITS_8_15) |
| 225 | 225 | m_bgcolor = data >> 8; |
| r14896 | r14897 | |
| 228 | 228 | WRITE16_MEMBER(equites_state::splndrbt_flip1_w) |
| 229 | 229 | { |
| 230 | 230 | if (ACCESSING_BITS_0_7) |
| 231 | flip_screen_set( | |
| 231 | flip_screen_set( | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | WRITE16_MEMBER(equites_state::splndrbt_bg_scrollx_w) |
| r14896 | r14897 | |
| 266 | 266 | int sy = (state->m_spriteram[offs] & 0x00ff); |
| 267 | 267 | int transmask = colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0); |
| 268 | 268 | |
| 269 | if (flip_screen | |
| 269 | if (state->flip_screen | |
| 270 | 270 | { |
| 271 | 271 | sx = 240 - sx; |
| 272 | 272 | sy = 240 - sy; |
| r14896 | r14897 | |
| 354 | 354 | |
| 355 | 355 | sy += 16; |
| 356 | 356 | |
| 357 | if (flip_screen | |
| 357 | if (state->flip_screen | |
| 358 | 358 | { |
| 359 | 359 | // sx NOT inverted |
| 360 | 360 | fx = fx ^ 1; |
| r14896 | r14897 | |
| 407 | 407 | const UINT8 * const yrom = xrom + 0x2000; |
| 408 | 408 | int scroll_x = state->m_splndrbt_bg_scrollx; |
| 409 | 409 | int scroll_y = state->m_splndrbt_bg_scrolly; |
| 410 | int const dinvert = flip_screen | |
| 410 | int const dinvert = state->flip_screen | |
| 411 | 411 | int src_y = 0; |
| 412 | 412 | int dst_y; |
| 413 | 413 | |
| 414 | if (flip_screen | |
| 414 | if (state->flip_screen | |
| 415 | 415 | { |
| 416 | 416 | scroll_x = -scroll_x - 8; |
| 417 | 417 | scroll_y = -scroll_y; |
| r14896 | r14897 | |
|---|---|---|
| 395 | 395 | int sprite_y_adjust, int sprite_y_adjust_flip_screen, |
| 396 | 396 | UINT8 *sprite_ram, int interleave) |
| 397 | 397 | { |
| 398 | decocass_state *state = machine.driver_data<decocass_state>(); | |
| 398 | 399 | int i,offs; |
| 399 | 400 | |
| 400 | 401 | /* Draw the sprites */ |
| r14896 | r14897 | |
| 411 | 412 | flipx = sprite_ram[offs + 0] & 0x04; |
| 412 | 413 | flipy = sprite_ram[offs + 0] & 0x02; |
| 413 | 414 | |
| 414 | if (flip_screen | |
| 415 | if (state->flip_screen | |
| 415 | 416 | { |
| 416 | 417 | sx = 240 - sx; |
| 417 | 418 | sy = 240 - sy + sprite_y_adjust_flip_screen; |
| r14896 | r14897 | |
| 428 | 429 | flipx,flipy, |
| 429 | 430 | sx,sy, 0); |
| 430 | 431 | |
| 431 | sy += (flip_screen | |
| 432 | sy += (state->flip_screen | |
| 432 | 433 | |
| 433 | 434 | // Wrap around |
| 434 | 435 | drawgfx_transpen(bitmap,cliprect, machine.gfx[1], |
| r14896 | r14897 | |
| 455 | 456 | |
| 456 | 457 | sy = 255 - missile_ram[offs + 0 * interleave]; |
| 457 | 458 | sx = 255 - missile_ram[offs + 2 * interleave]; |
| 458 | if (flip_screen | |
| 459 | if (state->flip_screen | |
| 459 | 460 | { |
| 460 | 461 | sx = 240 - sx; |
| 461 | 462 | sy = 240 - sy + missile_y_adjust_flip_screen; |
| r14896 | r14897 | |
| 471 | 472 | |
| 472 | 473 | sy = 255 - missile_ram[offs + 1 * interleave]; |
| 473 | 474 | sx = 255 - missile_ram[offs + 3 * interleave]; |
| 474 | if (flip_screen | |
| 475 | if (state->flip_screen | |
| 475 | 476 | { |
| 476 | 477 | sx = 240 - sx; |
| 477 | 478 | sy = 240 - sy + missile_y_adjust_flip_screen; |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | characters when screen is flipped, we have to flip them back. */ |
| 84 | 84 | SET_TILE_INFO( |
| 85 | 85 | 0, |
| 86 | code | (flip_screen | |
| 86 | code | (state->flip_screen | |
| 87 | 87 | attr & 0x3f, |
| 88 | flip_screen | |
| 88 | state->flip_screen | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| r14896 | r14897 | |
| 166 | 166 | WRITE8_MEMBER(skykid_state::skykid_flipscreen_priority_w) |
| 167 | 167 | { |
| 168 | 168 | m_priority = data; |
| 169 | flip_screen_set( | |
| 169 | flip_screen_set( | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| r14896 | r14897 | |
| 206 | 206 | sprite &= ~sizex; |
| 207 | 207 | sprite &= ~(sizey << 1); |
| 208 | 208 | |
| 209 | if (flip_screen | |
| 209 | if (state->flip_screen | |
| 210 | 210 | { |
| 211 | 211 | flipx ^= 1; |
| 212 | 212 | flipy ^= 1; |
| r14896 | r14897 | |
| 234 | 234 | SCREEN_UPDATE_IND16( skykid ) |
| 235 | 235 | { |
| 236 | 236 | skykid_state *state = screen.machine().driver_data<skykid_state>(); |
| 237 | if (flip_screen | |
| 237 | if (state->flip_screen | |
| 238 | 238 | { |
| 239 | 239 | state->m_bg_tilemap->set_scrollx(0, 189 - (state->m_scroll_x ^ 1)); |
| 240 | 240 | state->m_bg_tilemap->set_scrolly(0, 7 - state->m_scroll_y); |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | WRITE8_MEMBER(mustache_state::mustache_video_control_w) |
| 54 | 54 | { |
| 55 | if (flip_screen | |
| 55 | if (flip_screen | |
| 56 | 56 | { |
| 57 | flip_screen_set( | |
| 57 | flip_screen_set( | |
| 58 | 58 | machine().tilemap().mark_all_dirty(); |
| 59 | 59 | } |
| 60 | 60 | |
| r14896 | r14897 | |
| 121 | 121 | if ((state->m_control_byte & 0xa)) |
| 122 | 122 | clip.max_y = visarea.max_y; |
| 123 | 123 | else |
| 124 | if (flip_screen | |
| 124 | if (state->flip_screen | |
| 125 | 125 | clip.min_y = visarea.min_y + 56; |
| 126 | 126 | else |
| 127 | 127 | clip.max_y = visarea.max_y - 56; |
| 128 | 128 | |
| 129 | if (flip_screen | |
| 129 | if (state->flip_screen | |
| 130 | 130 | { |
| 131 | 131 | sx = 240 - sx; |
| 132 | 132 | sy = 240 - sy; |
| r14896 | r14897 | |
| 135 | 135 | drawgfx_transpen(bitmap,clip,gfx, |
| 136 | 136 | code, |
| 137 | 137 | color, |
| 138 | flip_screen | |
| 138 | state->flip_screen | |
| 139 | 139 | sx,sy,0); |
| 140 | 140 | } |
| 141 | 141 | } |
| r14896 | r14897 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | WRITE8_MEMBER(ladybug_state::ladybug_flipscreen_w) |
| 151 | 151 | { |
| 152 | if (flip_screen | |
| 152 | if (flip_screen | |
| 153 | 153 | { |
| 154 | flip_screen_set( | |
| 154 | flip_screen_set( | |
| 155 | 155 | machine().tilemap().mark_all_dirty(); |
| 156 | 156 | } |
| 157 | 157 | } |
| r14896 | r14897 | |
| 166 | 166 | // bit3 = enable stars |
| 167 | 167 | // bit210 = stars speed/dir |
| 168 | 168 | |
| 169 | if (flip_screen | |
| 169 | if (flip_screen | |
| 170 | 170 | { |
| 171 | flip_screen_set( | |
| 171 | flip_screen_set( | |
| 172 | 172 | machine().tilemap().mark_all_dirty(); |
| 173 | 173 | } |
| 174 | 174 | |
| r14896 | r14897 | |
| 292 | 292 | int sx = offs % 4; |
| 293 | 293 | int sy = offs / 4; |
| 294 | 294 | |
| 295 | if (flip_screen | |
| 295 | if (state->flip_screen | |
| 296 | 296 | state->m_bg_tilemap->set_scrollx(offs, -state->m_videoram[32 * sx + sy]); |
| 297 | 297 | else |
| 298 | 298 | state->m_bg_tilemap->set_scrollx(offs, state->m_videoram[32 * sx + sy]); |
| r14896 | r14897 | |
| 325 | 325 | int sx = offs % 4; |
| 326 | 326 | int sy = offs / 4; |
| 327 | 327 | |
| 328 | if (flip_screen | |
| 328 | if (state->flip_screen | |
| 329 | 329 | state->m_bg_tilemap->set_scrollx(offs, -state->m_videoram[32 * sx + sy]); |
| 330 | 330 | else |
| 331 | 331 | state->m_bg_tilemap->set_scrollx(offs, state->m_videoram[32 * sx + sy]); |
| r14896 | r14897 | |
| 335 | 335 | bitmap.fill(0, cliprect); |
| 336 | 336 | |
| 337 | 337 | // draw the stars |
| 338 | if (flip_screen | |
| 338 | if (state->flip_screen | |
| 339 | 339 | redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 1, 0x27, 0xff); |
| 340 | 340 | else |
| 341 | 341 | redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 1, 0x00, 0xd8); |
| r14896 | r14897 | |
| 344 | 344 | colortable_palette_set_color(screen.machine().colortable, 0x40, MAKE_RGB(state->m_grid_color & 0x40 ? 0xff : 0, |
| 345 | 345 | state->m_grid_color & 0x20 ? 0xff : 0, |
| 346 | 346 | state->m_grid_color & 0x10 ? 0xff : 0)); |
| 347 | state->m_grid_tilemap->draw(bitmap, cliprect, 0, flip_screen | |
| 347 | state->m_grid_tilemap->draw(bitmap, cliprect, 0, state->flip_screen | |
| 348 | 348 | |
| 349 | 349 | for (i = 0; i < 0x100; i++) |
| 350 | 350 | { |
| r14896 | r14897 | |
| 353 | 353 | UINT8 x = i; |
| 354 | 354 | int height = cliprect.max_y - cliprect.min_y + 1; |
| 355 | 355 | |
| 356 | if (flip_screen | |
| 356 | if (state->flip_screen | |
| 357 | 357 | x = ~x; |
| 358 | 358 | |
| 359 | 359 | bitmap.plot_box(x, cliprect.min_y, 1, height, 0x81); |
| r14896 | r14897 | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | // now the chars |
| 364 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, flip_screen | |
| 364 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, state->flip_screen | |
| 365 | 365 | |
| 366 | 366 | // now the sprites |
| 367 | 367 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | WRITE8_MEMBER(blueprnt_state::blueprnt_flipscreen_w) |
| 64 | 64 | { |
| 65 | 65 | |
| 66 | flip_screen_set( | |
| 66 | flip_screen_set( | |
| 67 | 67 | |
| 68 | 68 | if (m_gfx_bank != ((data & 0x04) >> 2)) |
| 69 | 69 | { |
| r14896 | r14897 | |
| 108 | 108 | int flipx = state->m_spriteram[offs + 2] & 0x40; |
| 109 | 109 | int flipy = state->m_spriteram[offs + 2 - 4] & 0x80; // -4? Awkward, isn't it? |
| 110 | 110 | |
| 111 | if (flip_screen | |
| 111 | if (state->flip_screen | |
| 112 | 112 | { |
| 113 | 113 | sx = 248 - sx; |
| 114 | 114 | sy = 240 - sy; |
| r14896 | r14897 | |
| 126 | 126 | blueprnt_state *state = screen.machine().driver_data<blueprnt_state>(); |
| 127 | 127 | int i; |
| 128 | 128 | |
| 129 | if (flip_screen | |
| 129 | if (state->flip_screen | |
| 130 | 130 | for (i = 0; i < 32; i++) |
| 131 | 131 | state->m_bg_tilemap->set_scrolly(i, state->m_scrollram[32 - i]); |
| 132 | 132 | else |
| r14896 | r14897 | |
|---|---|---|
| 56 | 56 | bit0 = VINV |
| 57 | 57 | */ |
| 58 | 58 | |
| 59 | flip_screen_y_set(machine(), data & 0x01); | |
| 60 | flip_screen_x_set(machine(), data & 0x02); | |
| 59 | flip_screen_y_set(data & 0x01); | |
| 60 | flip_screen_x_set(data & 0x02); | |
| 61 | 61 | |
| 62 | 62 | m_bg_on = data & 0x04; |
| 63 | 63 | m_sky_on = data & 0x08; |
| r14896 | r14897 | |
| 92 | 92 | |
| 93 | 93 | /* prevent wraparound */ |
| 94 | 94 | rectangle clip = cliprect; |
| 95 | if (flip_screen_x | |
| 95 | if (state->flip_screen_x | |
| 96 | 96 | else clip.max_x -= 8*8; |
| 97 | 97 | |
| 98 | 98 | for (offs = 0; offs < 0x400; offs++) |
| r14896 | r14897 | |
| 102 | 102 | int sx = offs % 32; |
| 103 | 103 | int sy = offs / 32; |
| 104 | 104 | |
| 105 | if (flip_screen_x | |
| 105 | if (state->flip_screen_x | |
| 106 | 106 | sx = 31 - sx; |
| 107 | if (flip_screen_y | |
| 107 | if (state->flip_screen_y | |
| 108 | 108 | sy = 31 - sy; |
| 109 | 109 | |
| 110 | 110 | drawgfx_opaque(state->m_tmp_bitmap1, state->m_tmp_bitmap1.cliprect(), machine.gfx[0], |
| 111 | 111 | code, |
| 112 | 112 | 2, |
| 113 | flip_screen_x | |
| 113 | state->flip_screen_x | |
| 114 | 114 | 8*sx,8*sy); |
| 115 | 115 | } |
| 116 | 116 | |
| r14896 | r14897 | |
| 137 | 137 | { |
| 138 | 138 | int sx = offs % 32; |
| 139 | 139 | int sy = offs / 32; |
| 140 | int flipx = flip_screen_x_get(machine); | |
| 141 | int flipy = flip_screen_y_get(machine); | |
| 140 | int flipx = state->flip_screen_x(); | |
| 141 | int flipy = state->flip_screen_y(); | |
| 142 | 142 | |
| 143 | 143 | int code = state->m_videoram[offs]; |
| 144 | 144 | |
| r14896 | r14897 | |
| 184 | 184 | |
| 185 | 185 | for (y = 0; y < 64; y++) |
| 186 | 186 | { |
| 187 | int dy = flip_screen_y | |
| 187 | int dy = state->flip_screen_y | |
| 188 | 188 | |
| 189 | 189 | if ((dy & ~0xff) == 0) |
| 190 | 190 | { |
| r14896 | r14897 | |
| 212 | 212 | int col = pendata[x]; |
| 213 | 213 | if (col) |
| 214 | 214 | { |
| 215 | int dx = flip_screen_x | |
| 215 | int dx = state->flip_screen_x | |
| 216 | 216 | if ((dx & ~0xff) == 0) |
| 217 | 217 | bitmap.pix16(dy, dx) = state->m_sprite_color_base + col; |
| 218 | 218 | } |
| r14896 | r14897 | |
|---|---|---|
| 150 | 150 | int flipx = attr & 0x10; |
| 151 | 151 | int flipy = attr & 0x20; |
| 152 | 152 | |
| 153 | if (flip_screen | |
| 153 | if (state->flip_screen | |
| 154 | 154 | { |
| 155 | 155 | sx = 240 - sx; |
| 156 | 156 | sy = 240 - sy; |
| r14896 | r14897 | |
| 205 | 205 | int flipx = attr & 0x10; |
| 206 | 206 | int flipy = attr & 0x20; |
| 207 | 207 | |
| 208 | if (flip_screen | |
| 208 | if (state->flip_screen | |
| 209 | 209 | { |
| 210 | 210 | sx = 240 - sx; |
| 211 | 211 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 230 | 230 | /* 0x40 = sprites */ |
| 231 | 231 | m_bg_tilemap->enable(data & 0x20); |
| 232 | 232 | m_fg_tilemap->enable(data & 0x10); |
| 233 | flip_screen_set( | |
| 233 | flip_screen_set( | |
| 234 | 234 | break; |
| 235 | 235 | } |
| 236 | 236 | } |
| r14896 | r14897 | |
| 268 | 268 | sx -= 0x100; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | if (flip_screen | |
| 271 | if (state->flip_screen | |
| 272 | 272 | { |
| 273 | 273 | sx = 240 - sx; |
| 274 | 274 | sy = 240 - sy; |
| r14896 | r14897 | |
| 280 | 280 | pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4], |
| 281 | 281 | code, |
| 282 | 282 | color, |
| 283 | flipx,flip_screen | |
| 283 | flipx,state->flip_screen | |
| 284 | 284 | sx,sy, |
| 285 | 285 | machine.priority_bitmap, |
| 286 | 286 | pri ? 0x02 : 0,0x0f); |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | m_background_priority = data & 0x01; |
| 52 | 52 | |
| 53 | 53 | /* bit 1 controls horizonal flip screen */ |
| 54 | if (flip_screen_x | |
| 54 | if (flip_screen_x | |
| 55 | 55 | { |
| 56 | flip_screen_x_set( | |
| 56 | flip_screen_x_set( | |
| 57 | 57 | machine().tilemap().mark_all_dirty(); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /* bit 2 controls horizonal flip screen */ |
| 61 | if (flip_screen_y | |
| 61 | if (flip_screen_y | |
| 62 | 62 | { |
| 63 | flip_screen_y_set( | |
| 63 | flip_screen_y_set( | |
| 64 | 64 | machine().tilemap().mark_all_dirty(); |
| 65 | 65 | } |
| 66 | 66 | |
| r14896 | r14897 | |
| 225 | 225 | int sy = (spriteram[offs]) - 13; |
| 226 | 226 | int code = (255 ^ spriteram[offs + 2]) + 256 * state->m_spritebank; |
| 227 | 227 | |
| 228 | if (flip_screen_x_get(machine)) sx = 233 - sx; | |
| 229 | if (flip_screen_y_get(machine)) sy = 244 - sy; | |
| 228 | if (state->flip_screen_x()) sx = 233 - sx; | |
| 229 | if (state->flip_screen_y()) sy = 244 - sy; | |
| 230 | 230 | |
| 231 | 231 | drawgfx_transpen(bitmap, clip, |
| 232 | 232 | machine.gfx[2], |
| 233 | 233 | code, 0, |
| 234 | flip_screen_x | |
| 234 | state->flip_screen_x | |
| 235 | 235 | sx,sy, 0); |
| 236 | 236 | } |
| 237 | 237 | } |
| r14896 | r14897 | |
|---|---|---|
| 196 | 196 | which = src[i + 3] + ((src[i + 2] & 0x0f) << 8); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | if (flip_screen | |
| 199 | if (state->flip_screen | |
| 200 | 200 | { |
| 201 | 201 | sx = 240 - sx; |
| 202 | 202 | sy = 256 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER(xxmissio_state::xxmissio_paletteram_w) |
| 47 | 47 | { |
| 48 | paletteram_BBGGRRII_w(space,offset,data); | |
| 48 | paletteram_BBGGRRII_byte_w(space,offset,data); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /****************************************************************************/ |
| r14896 | r14897 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | flipx = spriteram[offs+1] & 0x04; |
| 50 | 50 | flipy = spriteram[offs+1] & 0x02; |
| 51 | if (flip_screen | |
| 51 | if (state->flip_screen | |
| 52 | 52 | sx=240-sx; |
| 53 | 53 | sy=240-sy; |
| 54 | 54 | if (flipx) flipx=0; else flipx=1; |
| r14896 | r14897 | |
| 66 | 66 | |
| 67 | 67 | SCREEN_UPDATE_IND16( pcktgal ) |
| 68 | 68 | { |
| 69 | // flip_screen_set( | |
| 69 | // state->flip_screen_set( | |
| 70 | 70 | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 71 | 71 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 72 | 72 | return 0; |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | WRITE8_MEMBER(solomon_state::solomon_flipscreen_w) |
| 33 | 33 | { |
| 34 | if (flip_screen | |
| 34 | if (flip_screen | |
| 35 | 35 | { |
| 36 | flip_screen_set( | |
| 36 | flip_screen_set( | |
| 37 | 37 | machine().tilemap().mark_all_dirty(); |
| 38 | 38 | } |
| 39 | 39 | } |
| r14896 | r14897 | |
| 87 | 87 | int sx = spriteram[offs + 3]; |
| 88 | 88 | int sy = 241 - spriteram[offs + 2]; |
| 89 | 89 | |
| 90 | if (flip_screen | |
| 90 | if (state->flip_screen | |
| 91 | 91 | { |
| 92 | 92 | sx = 240 - sx; |
| 93 | 93 | sy = 242 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 217 | 217 | int color = src[1] & 0x1f; |
| 218 | 218 | int x,y; |
| 219 | 219 | |
| 220 | if (flip_screen | |
| 220 | if (state->flip_screen | |
| 221 | 221 | { |
| 222 | 222 | xflip = !xflip; |
| 223 | 223 | yflip = !yflip; |
| r14896 | r14897 | |
| 287 | 287 | int scroll; |
| 288 | 288 | |
| 289 | 289 | scroll = state->m_bg_scrollx + ((state->m_video_attributes & 0x04) << 6); |
| 290 | state->m_bg_tilemap->set_scrollx(0, scroll ^ (flip_screen | |
| 290 | state->m_bg_tilemap->set_scrollx(0, scroll ^ (state->flip_screen | |
| 291 | 291 | scroll = state->m_fg_scrollx + ((state->m_video_attributes & 0x08) << 5); |
| 292 | state->m_fg_tilemap->set_scrollx(0, scroll ^ (flip_screen | |
| 292 | state->m_fg_tilemap->set_scrollx(0, scroll ^ (state->flip_screen | |
| 293 | 293 | |
| 294 | 294 | // always 0 anyway |
| 295 | 295 | state->m_bg_tilemap->set_scrolly(0, state->m_bg_scrolly); |
| r14896 | r14897 | |
|---|---|---|
| 93 | 93 | sx = sprite_ram[offs]; |
| 94 | 94 | sy = 240 - sprite_ram[offs + 1]; |
| 95 | 95 | |
| 96 | if (flip_screen | |
| 96 | if (state->flip_screen | |
| 97 | 97 | { |
| 98 | 98 | sx = 248 - sx; |
| 99 | 99 | sy = 248 - sy; |
| r14896 | r14897 | |
| 109 | 109 | machine.gfx[gfxbank], |
| 110 | 110 | tile, |
| 111 | 111 | palette, |
| 112 | flip_screen | |
| 112 | state->flip_screen | |
| 113 | 113 | sx,sy, 0); |
| 114 | 114 | drawgfx_transpen(bitmap,cliprect, |
| 115 | 115 | machine.gfx[gfxbank], |
| 116 | 116 | tile+1, |
| 117 | 117 | palette, |
| 118 | flip_screen_get(machine),flip_screen_get(machine), | |
| 119 | sx,sy + (flip_screen_get(machine) ? -8 : 8), 0); | |
| 118 | state->flip_screen(),state->flip_screen(), | |
| 119 | sx,sy + (state->flip_screen() ? -8 : 8), 0); | |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | } |
| r14896 | r14897 | |
|---|---|---|
| 64 | 64 | m_background_layer->set_flip(flip); |
| 65 | 65 | m_text_layer->set_flip(flip); |
| 66 | 66 | |
| 67 | flip_screen_set( | |
| 67 | flip_screen_set( | |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| r14896 | r14897 | |
| 125 | 125 | |
| 126 | 126 | if ( sx>256 ) sx -= 512; |
| 127 | 127 | |
| 128 | if (flip_screen | |
| 128 | if (state->flip_screen | |
| 129 | 129 | { |
| 130 | 130 | sx = 240 - sx; |
| 131 | 131 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | WRITE8_MEMBER(suprloco_state::suprloco_scrollram_w) |
| 120 | 120 | { |
| 121 | int adj = flip_screen | |
| 121 | int adj = flip_screen | |
| 122 | 122 | |
| 123 | 123 | m_scrollram[offset] = data; |
| 124 | 124 | m_bg_tilemap->set_scrollx(offset, data - adj); |
| r14896 | r14897 | |
| 144 | 144 | coin_counter_w(machine(), 0, data & 0x01); |
| 145 | 145 | coin_counter_w(machine(), 1, data & 0x02); |
| 146 | 146 | |
| 147 | flip_screen_set( | |
| 147 | flip_screen_set( | |
| 148 | 148 | |
| 149 | 149 | m_control = data; |
| 150 | 150 | } |
| r14896 | r14897 | |
| 173 | 173 | static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number) |
| 174 | 174 | { |
| 175 | 175 | suprloco_state *state = machine.driver_data<suprloco_state>(); |
| 176 | int flip = flip_screen | |
| 176 | int flip = state->flip_screen | |
| 177 | 177 | int sx,sy,col,row,height,src,adjy,dy; |
| 178 | 178 | UINT8 *spr_reg; |
| 179 | 179 | UINT8 *gfx2; |
| r14896 | r14897 | |
| 191 | 191 | sx = spr_reg[SPR_X]; |
| 192 | 192 | sy = spr_reg[SPR_Y_TOP] + 1; |
| 193 | 193 | |
| 194 | if (!flip_screen | |
| 194 | if (!state->flip_screen | |
| 195 | 195 | { |
| 196 | 196 | adjy = sy; |
| 197 | 197 | dy = 1; |
| r14896 | r14897 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | WRITE16_MEMBER(m92_state::m92_paletteram_w) |
| 133 | 133 | { |
| 134 | paletteram | |
| 134 | paletteram | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /*****************************************************************************/ |
| r14896 | r14897 | |
| 349 | 349 | |
| 350 | 350 | for (row = 0; row < numrows; row++) |
| 351 | 351 | { |
| 352 | if (flip_screen | |
| 352 | if (state->flip_screen | |
| 353 | 353 | { |
| 354 | 354 | pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 355 | 355 | code + s_ptr, color, !flipx, !flipy, |
| r14896 | r14897 | |
| 424 | 424 | |
| 425 | 425 | for (row = 0; row < numrows; row++) |
| 426 | 426 | { |
| 427 | if (flip_screen | |
| 427 | if (state->flip_screen | |
| 428 | 428 | { |
| 429 | 429 | pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 430 | 430 | code + s_ptr, color, !flipx, !flipy, |
| r14896 | r14897 | |
| 544 | 544 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 545 | 545 | |
| 546 | 546 | /* Flipscreen appears hardwired to the dipswitch - strange */ |
| 547 | m92_state *state = screen.machine().driver_data<m92_state>(); | |
| 547 | 548 | if (input_port_read(screen.machine(), "DSW") & 0x100) |
| 548 | flip_screen_set( | |
| 549 | state->flip_screen_set( | |
| 549 | 550 | else |
| 550 | flip_screen_set( | |
| 551 | state->flip_screen_set( | |
| 551 | 552 | return 0; |
| 552 | 553 | } |
| 553 | 554 | |
| r14896 | r14897 | |
| 561 | 562 | ppan_draw_sprites(screen.machine(), bitmap, cliprect); |
| 562 | 563 | |
| 563 | 564 | /* Flipscreen appears hardwired to the dipswitch - strange */ |
| 565 | m92_state *state = screen.machine().driver_data<m92_state>(); | |
| 564 | 566 | if (input_port_read(screen.machine(), "DSW") & 0x100) |
| 565 | flip_screen_set( | |
| 567 | state->flip_screen_set( | |
| 566 | 568 | else |
| 567 | flip_screen_set( | |
| 569 | state->flip_screen_set( | |
| 568 | 570 | return 0; |
| 569 | 571 | } |
| r14896 | r14897 | |
|---|---|---|
| 200 | 200 | WRITE8_MEMBER(m58_state::yard_flipscreen_w) |
| 201 | 201 | { |
| 202 | 202 | /* screen flip is handled both by software and hardware */ |
| 203 | flip_screen_set( | |
| 203 | flip_screen_set( | |
| 204 | 204 | |
| 205 | 205 | coin_counter_w(machine(), 0, data & 0x02); |
| 206 | 206 | coin_counter_w(machine(), 1, data & 0x20); |
| r14896 | r14897 | |
| 245 | 245 | code2 = code1 + 0x40; |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | if (flip_screen | |
| 248 | if (state->flip_screen | |
| 249 | 249 | { |
| 250 | 250 | sx = 240 - sx; |
| 251 | 251 | sy2 = 192 - sy1; |
| r14896 | r14897 | |
| 279 | 279 | { |
| 280 | 280 | const rectangle clippanel(26*8, 32*8-1, 1*8, 31*8-1); |
| 281 | 281 | const rectangle clippanelflip(0*8, 6*8-1, 1*8, 31*8-1); |
| 282 | rectangle clip = flip_screen | |
| 282 | rectangle clip = state->flip_screen | |
| 283 | 283 | const rectangle &visarea = machine.primary_screen->visible_area(); |
| 284 | int sx = flip_screen_get(machine) ? cliprect.min_x - 8 : cliprect.max_x + 1 - SCROLL_PANEL_WIDTH; | |
| 285 | int yoffs = flip_screen_get(machine) ? -40 : -16; | |
| 284 | int sx = state->flip_screen() ? cliprect.min_x - 8 : cliprect.max_x + 1 - SCROLL_PANEL_WIDTH; | |
| 285 | int yoffs = state->flip_screen() ? -40 : -16; | |
| 286 | 286 | |
| 287 | 287 | clip.min_y += visarea.min_y + yoffs; |
| 288 | 288 | clip.max_y += visarea.max_y + yoffs; |
| 289 | 289 | clip &= cliprect; |
| 290 | 290 | |
| 291 | copybitmap(bitmap, *state->m_scroll_panel_bitmap, flip_screen | |
| 291 | copybitmap(bitmap, *state->m_scroll_panel_bitmap, state->flip_screen | |
| 292 | 292 | sx, visarea.min_y + yoffs, clip); |
| 293 | 293 | } |
| 294 | 294 | } |
| r14896 | r14897 | |
|---|---|---|
| 189 | 189 | number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8; |
| 190 | 190 | colourbank = (source[4] & 0x000f); |
| 191 | 191 | |
| 192 | if (flip_screen | |
| 192 | if (state->flip_screen | |
| 193 | 193 | if (flipy) flipy=0; else flipy=1; |
| 194 | 194 | if (flipx) flipx=0; else flipx=1; |
| 195 | 195 | ypos=240-ypos-state->m_sprite_xoff; |
| r14896 | r14897 | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | for (count=0;count<chain;count++) { |
| 200 | if (flip_screen | |
| 200 | if (state->flip_screen | |
| 201 | 201 | if (!flipy) { |
| 202 | 202 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),0); |
| 203 | 203 | } else { |
| r14896 | r14897 | |
|---|---|---|
| 10 | 10 | pktgaldx_state *state = screen.machine().driver_data<pktgaldx_state>(); |
| 11 | 11 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 12 | 12 | |
| 13 | flip_screen_set( | |
| 13 | state->flip_screen_set( | |
| 14 | 14 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 15 | 15 | |
| 16 | 16 | bitmap.fill(0, cliprect); /* not Confirmed */ |
| r14896 | r14897 | |
|---|---|---|
| 157 | 157 | |
| 158 | 158 | WRITE8_MEMBER(timeplt_state::timeplt_flipscreen_w) |
| 159 | 159 | { |
| 160 | flip_screen_set( | |
| 160 | flip_screen_set( | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 |
| r14896 | r14897 | |
|---|---|---|
| 182 | 182 | sx = (sx & 0x1ff) - (sx & 0x200); |
| 183 | 183 | sy = (sy & 0x1ff) - (sy & 0x200); |
| 184 | 184 | |
| 185 | if (flip_screen | |
| 185 | if (state->flip_screen | |
| 186 | 186 | { |
| 187 | 187 | flipx = !flipx; sx = max_x - sx - xnum * 16; |
| 188 | 188 | flipy = !flipy; sy = max_y - sy - ynum * 16; |
| r14896 | r14897 | |
| 306 | 306 | int tm_middle = pri_table[state->m_priority[0] & 0x0f][1]; |
| 307 | 307 | int tm_back = pri_table[state->m_priority[0] & 0x0f][2]; |
| 308 | 308 | |
| 309 | flip_screen_set( | |
| 309 | state->flip_screen_set( | |
| 310 | 310 | |
| 311 | 311 | /* Layers scrolling */ |
| 312 | 312 | |
| 313 | scrolly_offs = state->m_vregs[0xc / 2] - (flip_screen_get(screen.machine()) ? 0x103 : 0x1f3); | |
| 314 | scrollx_offs = state->m_vregs[0xe / 2] - (flip_screen_get(screen.machine()) ? 0x2a7 : 0x3f6); | |
| 313 | scrolly_offs = state->m_vregs[0xc / 2] - (state->flip_screen() ? 0x103 : 0x1f3); | |
| 314 | scrollx_offs = state->m_vregs[0xe / 2] - (state->flip_screen() ? 0x2a7 : 0x3f6); | |
| 315 | 315 | |
| 316 | 316 | layer0_scrolly = state->m_vregs[0x0 / 2] + scrolly_offs; |
| 317 | 317 | layer0_scrollx = state->m_vregs[0x2 / 2] + scrollx_offs; |
| r14896 | r14897 | |
|---|---|---|
| 148 | 148 | coin_counter_w(machine(), 1, data & 0x02); |
| 149 | 149 | |
| 150 | 150 | /* bit 7 flips screen */ |
| 151 | flip_screen_set( | |
| 151 | flip_screen_set( | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| r14896 | r14897 | |
| 185 | 185 | sx = spriteram[offs + 3]; |
| 186 | 186 | sy = spriteram[offs + 2]; |
| 187 | 187 | dir = 1; |
| 188 | if (flip_screen | |
| 188 | if (state->flip_screen | |
| 189 | 189 | { |
| 190 | 190 | sx = 240 - sx; |
| 191 | 191 | sy = 240 - sy; |
| r14896 | r14897 | |
| 200 | 200 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 201 | 201 | code + i, |
| 202 | 202 | col, |
| 203 | flip_screen | |
| 203 | state->flip_screen | |
| 204 | 204 | sx, sy + 16 * i * dir,15); |
| 205 | 205 | |
| 206 | 206 | /* draw again with wraparound */ |
| 207 | 207 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 208 | 208 | code + i, |
| 209 | 209 | col, |
| 210 | flip_screen | |
| 210 | state->flip_screen | |
| 211 | 211 | sx, sy + 16 * i * dir - dir * 256,15); |
| 212 | 212 | i--; |
| 213 | 213 | } while (i >= 0); |
| r14896 | r14897 | |
|---|---|---|
| 90 | 90 | if (ACCESSING_BITS_0_7) |
| 91 | 91 | { |
| 92 | 92 | /* bit 7 flips screen, the rest seems to always be set to 0x7e */ |
| 93 | flip_screen_set( | |
| 93 | flip_screen_set( | |
| 94 | 94 | |
| 95 | 95 | if ((data & 0x7f) != 0x7e) popmessage("flipscreen_w %02x",data); |
| 96 | 96 | } |
| r14896 | r14897 | |
| 131 | 131 | zoomx = shangha3_ram[offs+10]; |
| 132 | 132 | zoomy = shangha3_ram[offs+13]; |
| 133 | 133 | |
| 134 | if (flip_screen | |
| 134 | if (flip_screen | |
| 135 | 135 | { |
| 136 | 136 | sx = 383 - sx - sizex; |
| 137 | 137 | sy = 255 - sy - sizey; |
| r14896 | r14897 | |
|---|---|---|
| 154 | 154 | flipx = spriteram_3[offs] & 0x02; |
| 155 | 155 | flipy = spriteram_3[offs] & 0x01; |
| 156 | 156 | |
| 157 | if (flip_screen | |
| 157 | if (state->flip_screen | |
| 158 | 158 | { |
| 159 | 159 | flipx = !flipx; |
| 160 | 160 | flipy = !flipy; |
| r14896 | r14897 | |
| 162 | 162 | |
| 163 | 163 | if (spriteram_2[offs] & 0x08) /* double width */ |
| 164 | 164 | { |
| 165 | if (!flip_screen | |
| 165 | if (!state->flip_screen | |
| 166 | 166 | sy = 224 - sy; |
| 167 | 167 | |
| 168 | 168 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| r14896 | r14897 | |
| 179 | 179 | } |
| 180 | 180 | else |
| 181 | 181 | { |
| 182 | if (!flip_screen | |
| 182 | if (!state->flip_screen | |
| 183 | 183 | sy = 240 - sy; |
| 184 | 184 | |
| 185 | 185 | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| r14896 | r14897 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | /*************************************************************************** |
| 195 | 195 | |
| 196 | Palette (paletteram | |
| 196 | Palette (paletteram | |
| 197 | 197 | |
| 198 | 198 | The game's palette uses colors 0-4095, but we need 15 aditional palettes |
| 199 | 199 | to handle shadows and highlights properly. After a color write to the |
| r14896 | r14897 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | WRITE8_MEMBER(champbas_state::champbas_flipscreen_w) |
| 187 | 187 | { |
| 188 | flip_screen_set( | |
| 188 | flip_screen_set( | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 |
| r14896 | r14897 | |
|---|---|---|
| 260 | 260 | |
| 261 | 261 | sy -= 16 * sizey; |
| 262 | 262 | |
| 263 | if (flip_screen | |
| 263 | if (state->flip_screen | |
| 264 | 264 | { |
| 265 | 265 | sx = 496+3 - 16 * sizex - sx; |
| 266 | 266 | sy = 240 - 16 * sizey - sy; |
| r14896 | r14897 | |
| 295 | 295 | |
| 296 | 296 | scrollx = state->m_xscroll[layer] + xdisp[layer]; |
| 297 | 297 | scrolly = state->m_yscroll[layer] + 9; |
| 298 | if (flip_screen | |
| 298 | if (state->flip_screen | |
| 299 | 299 | { |
| 300 | 300 | scrollx = -scrollx + 3; |
| 301 | 301 | scrolly = -scrolly; |
| r14896 | r14897 | |
| 313 | 313 | int back; |
| 314 | 314 | |
| 315 | 315 | /* flip screen is embedded in the sprite control registers */ |
| 316 | /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */ | |
| 317 | flip_screen_set_no_update(screen.machine(), spriteram[0x07f6] & 0x01); | |
| 318 | screen.machine().tilemap().set_flip_all(flip_screen_get(screen.machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 316 | /* can't use state->flip_screen_set() because the visible area is asymmetrical */ | |
| 317 | state->flip_screen_set_no_update(spriteram[0x07f6] & 0x01); | |
| 318 | screen.machine().tilemap().set_flip_all(state->flip_screen() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 319 | 319 | set_scroll(screen.machine(), 0); |
| 320 | 320 | set_scroll(screen.machine(), 1); |
| 321 | 321 |
| r14896 | r14897 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | WRITE8_MEMBER(ssozumo_state::ssozumo_flipscreen_w) |
| 111 | 111 | { |
| 112 | flip_screen_set( | |
| 112 | flip_screen_set( | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | static TILE_GET_INFO( get_bg_tile_info ) |
| r14896 | r14897 | |
| 161 | 161 | int sx = 239 - spriteram[offs + 3]; |
| 162 | 162 | int sy = (240 - spriteram[offs + 2]) & 0xff; |
| 163 | 163 | |
| 164 | if (flip_screen | |
| 164 | if (state->flip_screen | |
| 165 | 165 | { |
| 166 | 166 | sx = 240 - sx; |
| 167 | 167 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | int bank; |
| 22 | 22 | |
| 23 | 23 | /* bits 0 and 1 flip X and Y, I don't know which is which */ |
| 24 | if (flip_screen_x | |
| 24 | if (flip_screen_x | |
| 25 | 25 | { |
| 26 | flip_screen_x_set( | |
| 26 | flip_screen_x_set( | |
| 27 | 27 | m_bg_tilemap->mark_all_dirty(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | if (flip_screen_y | |
| 30 | if (flip_screen_y | |
| 31 | 31 | { |
| 32 | flip_screen_y_set( | |
| 32 | flip_screen_y_set( | |
| 33 | 33 | m_bg_tilemap->mark_all_dirty(); |
| 34 | 34 | } |
| 35 | 35 | |
| r14896 | r14897 | |
| 76 | 76 | int bank; |
| 77 | 77 | |
| 78 | 78 | /* bits 0 and 1 flip X and Y, I don't know which is which */ |
| 79 | if (flip_screen_x | |
| 79 | if (flip_screen_x | |
| 80 | 80 | { |
| 81 | flip_screen_x_set( | |
| 81 | flip_screen_x_set( | |
| 82 | 82 | m_bg_tilemap->mark_all_dirty(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | if (flip_screen_y | |
| 85 | if (flip_screen_y | |
| 86 | 86 | { |
| 87 | flip_screen_y_set( | |
| 87 | flip_screen_y_set( | |
| 88 | 88 | m_bg_tilemap->mark_all_dirty(); |
| 89 | 89 | } |
| 90 | 90 | |
| r14896 | r14897 | |
| 121 | 121 | { |
| 122 | 122 | |
| 123 | 123 | /* bit 0 = flipx (or y?) */ |
| 124 | if (flip_screen_x | |
| 124 | if (flip_screen_x | |
| 125 | 125 | { |
| 126 | flip_screen_x_set( | |
| 126 | flip_screen_x_set( | |
| 127 | 127 | m_bg_tilemap->mark_all_dirty(); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /* bit 1 = flipy (or x?) */ |
| 131 | if (flip_screen_y | |
| 131 | if (flip_screen_y | |
| 132 | 132 | { |
| 133 | flip_screen_y_set( | |
| 133 | flip_screen_y_set( | |
| 134 | 134 | m_bg_tilemap->mark_all_dirty(); |
| 135 | 135 | } |
| 136 | 136 | |
| r14896 | r14897 | |
| 177 | 177 | |
| 178 | 178 | sx = state->m_spriteram[offs]; |
| 179 | 179 | sy = 248 - state->m_spriteram[offs + 1]; |
| 180 | if (flip_screen_x | |
| 180 | if (state->flip_screen_x | |
| 181 | 181 | sx = 248 - sx; |
| 182 | if (flip_screen_y | |
| 182 | if (state->flip_screen_y | |
| 183 | 183 | sy = 248 - sy; |
| 184 | 184 | |
| 185 | 185 | code = state->m_spriteram[offs + 3] + ((state->m_spriteram[offs + 2] & 0x03) << 8) + 1024 * state->m_gfxbank; |
| r14896 | r14897 | |
| 187 | 187 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 188 | 188 | 2 * code, |
| 189 | 189 | ((state->m_spriteram[offs + 2] & 0xf8) >> 3) + 32 * state->m_palettebank, |
| 190 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 191 | sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0); | |
| 190 | state->flip_screen_x(),state->flip_screen_y(), | |
| 191 | sx,sy + (state->flip_screen_y() ? 8 : -8),0); | |
| 192 | 192 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 193 | 193 | 2 * code + 1, |
| 194 | 194 | ((state->m_spriteram[offs + 2] & 0xf8) >> 3) + 32 * state->m_palettebank, |
| 195 | flip_screen_x | |
| 195 | state->flip_screen_x | |
| 196 | 196 | sx,sy,0); |
| 197 | 197 | } |
| 198 | 198 | } |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | case 0: |
| 68 | 68 | COMBINE_DATA( &m_video_register ); |
| 69 | 69 | |
| 70 | flip_screen_x_set(machine(), m_video_register & TWIN16_SCREEN_FLIPX); | |
| 71 | flip_screen_y_set(machine(), m_video_register & TWIN16_SCREEN_FLIPY); | |
| 70 | flip_screen_x_set(m_video_register & TWIN16_SCREEN_FLIPX); | |
| 71 | flip_screen_y_set(m_video_register & TWIN16_SCREEN_FLIPY); | |
| 72 | 72 | |
| 73 | 73 | break; |
| 74 | 74 |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | WRITE8_MEMBER(clshroad_state::clshroad_flipscreen_w) |
| 38 | 38 | { |
| 39 | flip_screen_set( | |
| 39 | flip_screen_set( | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| r14896 | r14897 | |
| 301 | 301 | int flipy = 0; |
| 302 | 302 | |
| 303 | 303 | x -= 0x4a/2; |
| 304 | if (flip_screen | |
| 304 | if (state->flip_screen | |
| 305 | 305 | { |
| 306 | 306 | y = 240 - y; |
| 307 | 307 | flipx = !flipx; |
| r14896 | r14897 | |
|---|---|---|
| 104 | 104 | if (ACCESSING_BITS_0_7) |
| 105 | 105 | { |
| 106 | 106 | m_sf_active = data & 0xff; |
| 107 | flip_screen_set( | |
| 107 | flip_screen_set( | |
| 108 | 108 | m_tx_tilemap->enable(data & 0x08); |
| 109 | 109 | m_bg_tilemap->enable(data & 0x20); |
| 110 | 110 | m_fg_tilemap->enable(data & 0x40); |
| r14896 | r14897 | |
| 144 | 144 | { |
| 145 | 145 | int c1, c2, c3, c4, t; |
| 146 | 146 | |
| 147 | if (flip_screen | |
| 147 | if (state->flip_screen | |
| 148 | 148 | { |
| 149 | 149 | sx = 480 - sx; |
| 150 | 150 | sy = 224 - sy; |
| r14896 | r14897 | |
| 195 | 195 | } |
| 196 | 196 | else |
| 197 | 197 | { |
| 198 | if (flip_screen | |
| 198 | if (state->flip_screen | |
| 199 | 199 | { |
| 200 | 200 | sx = 496 - sx; |
| 201 | 201 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | base = 64 * scrollram[offs + 1]; |
| 17 | 17 | sx = 8 * (offs / 4) + scrollx; |
| 18 | if (flip_screen | |
| 18 | if (state->flip_screen | |
| 19 | 19 | sx = 248 - sx; |
| 20 | 20 | |
| 21 | 21 | sx &= 0xff; |
| r14896 | r14897 | |
| 25 | 25 | int attr; |
| 26 | 26 | |
| 27 | 27 | sy = 8 * y + scrolly; |
| 28 | if (flip_screen | |
| 28 | if (state->flip_screen | |
| 29 | 29 | sy = 248 - sy; |
| 30 | 30 | sy &= 0xff; |
| 31 | 31 | |
| r14896 | r14897 | |
| 36 | 36 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 37 | 37 | code, |
| 38 | 38 | color, |
| 39 | flip_screen | |
| 39 | state->flip_screen | |
| 40 | 40 | sx,sy,15); |
| 41 | 41 | if (sx > 248) /* wraparound */ |
| 42 | 42 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 43 | 43 | code, |
| 44 | 44 | color, |
| 45 | flip_screen | |
| 45 | state->flip_screen | |
| 46 | 46 | sx-256,sy,15); |
| 47 | 47 | } |
| 48 | 48 | } |
| r14896 | r14897 | |
| 102 | 102 | base = 64 * state->m_scrollram[offs + 1]; |
| 103 | 103 | sx = scrollx + stepx; |
| 104 | 104 | |
| 105 | if (flip_screen | |
| 105 | if (state->flip_screen | |
| 106 | 106 | sx = 248 - sx; |
| 107 | 107 | sx &= 0xff; |
| 108 | 108 | |
| r14896 | r14897 | |
| 111 | 111 | int attr; |
| 112 | 112 | |
| 113 | 113 | sy = 8 * y + scrolly; |
| 114 | if (flip_screen | |
| 114 | if (state->flip_screen | |
| 115 | 115 | sy = 248 - sy; |
| 116 | 116 | sy &= 0xff; |
| 117 | 117 | |
| r14896 | r14897 | |
| 124 | 124 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 125 | 125 | code, |
| 126 | 126 | color, |
| 127 | flip_screen | |
| 127 | state->flip_screen | |
| 128 | 128 | sx,sy,15); |
| 129 | 129 | if (sx > 248) /* wraparound */ |
| 130 | 130 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 131 | 131 | code, |
| 132 | 132 | color, |
| 133 | flip_screen | |
| 133 | state->flip_screen | |
| 134 | 134 | sx-256,sy,15); |
| 135 | 135 | } |
| 136 | 136 | } |
| r14896 | r14897 | |
| 176 | 176 | flipx = attr & 0x40; |
| 177 | 177 | flipy = attr & 0x80; |
| 178 | 178 | |
| 179 | if (flip_screen | |
| 179 | if (state->flip_screen | |
| 180 | 180 | { |
| 181 | 181 | sx = 240 - sx; |
| 182 | 182 | sy = 240 - sy; |
| r14896 | r14897 | |
|---|---|---|
| 118 | 118 | m_sprites_disabled = data & 0x10; |
| 119 | 119 | |
| 120 | 120 | /* bit 6 is flip screen */ |
| 121 | flip_screen_set( | |
| 121 | flip_screen_set( | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | WRITE8_MEMBER(dooyong_state::pollux_ctrl_w) |
| 125 | 125 | { |
| 126 | 126 | /* bit 0 is flip screen */ |
| 127 | flip_screen_set( | |
| 127 | flip_screen_set( | |
| 128 | 128 | |
| 129 | 129 | /* bits 6 and 7 are coin counters */ |
| 130 | 130 | coin_counter_w(machine(), 0, data & 0x80); |
| r14896 | r14897 | |
| 145 | 145 | m_tx_pri = data & 0x08; |
| 146 | 146 | |
| 147 | 147 | /* bit 4 flips screen */ |
| 148 | flip_screen_set( | |
| 148 | flip_screen_set( | |
| 149 | 149 | |
| 150 | 150 | /* bit 5 used but unknown */ |
| 151 | 151 | |
| r14896 | r14897 | |
| 166 | 166 | WRITE8_MEMBER(dooyong_state::flytiger_ctrl_w) |
| 167 | 167 | { |
| 168 | 168 | /* bit 0 is flip screen */ |
| 169 | flip_screen_set( | |
| 169 | flip_screen_set( | |
| 170 | 170 | |
| 171 | 171 | /* bits 1, 2 used but unknown */ |
| 172 | 172 | |
| r14896 | r14897 | |
| 183 | 183 | if (ACCESSING_BITS_0_7) |
| 184 | 184 | { |
| 185 | 185 | /* bit 0 flips screen */ |
| 186 | flip_screen_set( | |
| 186 | flip_screen_set( | |
| 187 | 187 | |
| 188 | 188 | /* bit 4 changes tilemaps priority */ |
| 189 | 189 | m_rshark_pri = data & 0x0010; |
| r14896 | r14897 | |
| 410 | 410 | } |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | if (flip_screen | |
| 413 | if (state->flip_screen | |
| 414 | 414 | { |
| 415 | 415 | sx = 498 - sx; |
| 416 | 416 | sy = 240 - (16 * height) - sy; |
| r14896 | r14897 | |
| 475 | 475 | width = buffered_spriteram16[offs+1] & 0x000f; |
| 476 | 476 | height = (buffered_spriteram16[offs+1] & 0x00f0) >> 4; |
| 477 | 477 | |
| 478 | if (flip_screen | |
| 478 | if (state->flip_screen | |
| 479 | 479 | { |
| 480 | 480 | sx = 498 - (16 * width) - sx; |
| 481 | 481 | sy = 240 - (16 * height) - sy; |
| r14896 | r14897 | |
|---|---|---|
| 237 | 237 | fx = buffered_spriteram[offs + 1] & 0x04; |
| 238 | 238 | multi = buffered_spriteram[offs + 1] & 0x10; |
| 239 | 239 | |
| 240 | if (flip_screen | |
| 240 | if (state->flip_screen | |
| 241 | 241 | { |
| 242 | 242 | sy = 240 - sy; |
| 243 | 243 | sx = 240 - sx; |
| r14896 | r14897 | |
| 249 | 249 | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 250 | 250 | code, |
| 251 | 251 | color, |
| 252 | fx,flip_screen | |
| 252 | fx,state->flip_screen | |
| 253 | 253 | sx,sy,0); |
| 254 | 254 | if (multi) |
| 255 | 255 | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 256 | 256 | code+1, |
| 257 | 257 | color, |
| 258 | fx,flip_screen | |
| 258 | fx,state->flip_screen | |
| 259 | 259 | sx,sy2,0); |
| 260 | 260 | } |
| 261 | 261 | } |
| r14896 | r14897 | |
| 266 | 266 | { |
| 267 | 267 | dec8_state *state = screen.machine().driver_data<dec8_state>(); |
| 268 | 268 | |
| 269 | flip_screen_set( | |
| 269 | state->flip_screen_set( | |
| 270 | 270 | |
| 271 | 271 | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 272 | 272 | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x04, 0x00, 0x03); |
| r14896 | r14897 | |
| 346 | 346 | SCREEN_UPDATE_IND16( oscar ) |
| 347 | 347 | { |
| 348 | 348 | dec8_state *state = screen.machine().driver_data<dec8_state>(); |
| 349 | flip_screen_set( | |
| 349 | state->flip_screen_set( | |
| 350 | 350 | |
| 351 | 351 | // we mimic the priority scheme in dec0.c, this was originally a bit different, so this could be wrong |
| 352 | 352 | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| r14896 | r14897 | |
|---|---|---|
| 198 | 198 | sx = (sx & 0x1ff) - (sx & 0x200); |
| 199 | 199 | sy = (sy & 0x1ff) - (sy & 0x200); |
| 200 | 200 | |
| 201 | if (flip_screen | |
| 201 | if (state->flip_screen | |
| 202 | 202 | { |
| 203 | 203 | flipx = !flipx; sx = max_x - sx - xnum * 16; |
| 204 | 204 | flipy = !flipy; sy = max_y - sy - ynum * 16; |
| r14896 | r14897 | |
| 330 | 330 | int tm_middle = pri_table[(state->m_priority[0] >> 16) & 0x0f][1]; |
| 331 | 331 | int tm_back = pri_table[(state->m_priority[0] >> 16) & 0x0f][2]; |
| 332 | 332 | |
| 333 | flip_screen_set( | |
| 333 | state->flip_screen_set( | |
| 334 | 334 | |
| 335 | 335 | /* Layers scrolling */ |
| 336 | 336 | |
| 337 | scrolly_offs = ((state->m_vregs[0xc / 4] & 0xffff0000) >> 16) - (flip_screen_get(screen.machine()) ? 0x103 : 0x1f3); | |
| 338 | scrollx_offs = (state->m_vregs[0xc / 4] & 0x0000ffff) - (flip_screen_get(screen.machine()) ? 0x2c7 : 0x3f6); | |
| 337 | scrolly_offs = ((state->m_vregs[0xc / 4] & 0xffff0000) >> 16) - (state->flip_screen() ? 0x103 : 0x1f3); | |
| 338 | scrollx_offs = (state->m_vregs[0xc / 4] & 0x0000ffff) - (state->flip_screen() ? 0x2c7 : 0x3f6); | |
| 339 | 339 | |
| 340 | 340 | layer0_scrolly = ((state->m_vregs[0x0 / 4] & 0xffff0000) >> 16) + scrolly_offs; |
| 341 | 341 | layer0_scrollx = ((state->m_vregs[0x0 / 4] & 0x0000ffff)) + scrollx_offs; |
| r14896 | r14897 | |
|---|---|---|
| 175 | 175 | flipx = attr & 0x04; |
| 176 | 176 | flipy = attr & 0x02; |
| 177 | 177 | |
| 178 | if (!flip_screen | |
| 178 | if (!state->flip_screen | |
| 179 | 179 | { |
| 180 | 180 | sx = 240 - sx; |
| 181 | 181 | sy = 240 - sy; |
| r14896 | r14897 | |
| 218 | 218 | |
| 219 | 219 | if (data) |
| 220 | 220 | { |
| 221 | if (flip_screen | |
| 221 | if (state->flip_screen | |
| 222 | 222 | bitmap.pix16(255 - y, 255 - x) = data; |
| 223 | 223 | else |
| 224 | 224 | bitmap.pix16(y, x) = data; |
| r14896 | r14897 | |
|---|---|---|
| 127 | 127 | * |
| 128 | 128 | *************************************/ |
| 129 | 129 | |
| 130 | void atarigt_colorram_w( | |
| 130 | void atarigt_state::atarigt_colorram_w( | |
| 131 | 131 | { |
| 132 | 132 | UINT16 olddata; |
| 133 | 133 | |
| 134 | 134 | /* update the raw data */ |
| 135 | 135 | address = (address & 0x7ffff) / 2; |
| 136 | olddata = state->m_colorram[address]; | |
| 137 | COMBINE_DATA(&state->m_colorram[address]); | |
| 136 | olddata = m_colorram[address]; | |
| 137 | COMBINE_DATA(&m_colorram[address]); | |
| 138 | 138 | |
| 139 | 139 | /* update the TRAM checksum */ |
| 140 | 140 | if (address >= 0x10000 && address < 0x14000) |
| 141 | | |
| 141 | | |
| 142 | 142 | |
| 143 | 143 | /* update expanded MRAM */ |
| 144 | 144 | else if (address >= 0x20000 && address < 0x28000) |
| 145 | 145 | { |
| 146 | state->m_expanded_mram[0 * MRAM_ENTRIES + (address & 0x7fff)] = (state->m_colorram[address] >> 8) << RSHIFT; | |
| 147 | state->m_expanded_mram[1 * MRAM_ENTRIES + (address & 0x7fff)] = (state->m_colorram[address] & 0xff) << GSHIFT; | |
| 146 | m_expanded_mram[0 * MRAM_ENTRIES + (address & 0x7fff)] = (m_colorram[address] >> 8) << RSHIFT; | |
| 147 | m_expanded_mram[1 * MRAM_ENTRIES + (address & 0x7fff)] = (m_colorram[address] & 0xff) << GSHIFT; | |
| 148 | 148 | } |
| 149 | 149 | else if (address >= 0x30000 && address < 0x38000) |
| 150 | | |
| 150 | | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| 154 | UINT16 atarigt_colorram_r( | |
| 154 | UINT16 atarigt_state::atarigt_colorram_r( | |
| 155 | 155 | { |
| 156 | 156 | address &= 0x7ffff; |
| 157 | return | |
| 157 | return | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 |
| r14896 | r14897 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | WRITE8_MEMBER(pooyan_state::pooyan_flipscreen_w) |
| 146 | 146 | { |
| 147 | flip_screen_set( | |
| 147 | flip_screen_set( | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 |
| r14896 | r14897 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | if (high_priority != priority) continue; |
| 127 | 127 | |
| 128 | if (flip_screen | |
| 128 | if (state->flip_screen | |
| 129 | 129 | sy = sy + 248; |
| 130 | 130 | } |
| 131 | 131 | |
| r14896 | r14897 | |
| 180 | 180 | { |
| 181 | 181 | wrally_state *state = screen.machine().driver_data<wrally_state>(); |
| 182 | 182 | /* set scroll registers */ |
| 183 | if (!flip_screen | |
| 183 | if (!state->flip_screen | |
| 184 | 184 | state->m_pant[0]->set_scrolly(0, state->m_vregs[0]); |
| 185 | 185 | state->m_pant[0]->set_scrollx(0, state->m_vregs[1]+4); |
| 186 | 186 | state->m_pant[1]->set_scrolly(0, state->m_vregs[2]); |
| r14896 | r14897 | |
|---|---|---|
| 66 | 66 | // on Irem boards, screen flip is handled in both hardware and software. |
| 67 | 67 | // this game doesn't have cocktail mode so if there's software control we don't |
| 68 | 68 | // know where it is mapped. |
| 69 | flip_screen_set( | |
| 69 | state->flip_screen_set( | |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| r14896 | r14897 | |
|---|---|---|
| 366 | 366 | WRITE16_MEMBER(nmk16_state::nmk_flipscreen_w) |
| 367 | 367 | { |
| 368 | 368 | if (ACCESSING_BITS_0_7) |
| 369 | flip_screen_set( | |
| 369 | flip_screen_set( | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | WRITE16_MEMBER(nmk16_state::nmk_tilebank_w) |
| r14896 | r14897 | |
| 426 | 426 | if(pri != priority) |
| 427 | 427 | return; |
| 428 | 428 | |
| 429 | if (flip_screen | |
| 429 | if (state->flip_screen | |
| 430 | 430 | { |
| 431 | 431 | sx = 368 - sx; |
| 432 | 432 | sy = 240 - sy; |
| r14896 | r14897 | |
| 443 | 443 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| 444 | 444 | code, |
| 445 | 445 | color, |
| 446 | flip_screen | |
| 446 | state->flip_screen | |
| 447 | 447 | ((x + 16) & 0x1FF) - 16,sy & 0x1FF,15); |
| 448 | 448 | code++; |
| 449 | 449 | x += delta; |
| r14896 | r14897 | |
| 474 | 474 | if(pri != priority) |
| 475 | 475 | return; |
| 476 | 476 | |
| 477 | flipx ^= flip_screen_get(machine); | |
| 478 | flipy ^= flip_screen_get(machine); | |
| 477 | flipx ^= state->flip_screen(); | |
| 478 | flipy ^= state->flip_screen(); | |
| 479 | 479 | |
| 480 | if (flip_screen | |
| 480 | if (state->flip_screen | |
| 481 | 481 | { |
| 482 | 482 | sx = 368 - sx; |
| 483 | 483 | sy = 240 - sy; |
| r14896 | r14897 | |
| 979 | 979 | if (dsw_flipscreen) |
| 980 | 980 | { |
| 981 | 981 | |
| 982 | flip_screen_x_set(machine, ~input_port_read(machine, "DSW1") & 0x0100); | |
| 983 | flip_screen_y_set(machine, ~input_port_read(machine, "DSW1") & 0x0200); | |
| 982 | state->flip_screen_x_set(~input_port_read(machine, "DSW1") & 0x0100); | |
| 983 | state->flip_screen_y_set(~input_port_read(machine, "DSW1") & 0x0200); | |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 |
| r14896 | r14897 | |
|---|---|---|
| 1403 | 1403 | if (changed & (1 << i)) |
| 1404 | 1404 | { |
| 1405 | 1405 | MechMtr_update(i, data & (1 << i) ); |
| 1406 | generic_pulse_irq_line( | |
| 1406 | generic_pulse_irq_line( | |
| 1407 | 1407 | } |
| 1408 | 1408 | } |
| 1409 | 1409 | } |
| r14896 | r14897 | |
|---|---|---|
| 282 | 282 | |
| 283 | 283 | WRITE8_MEMBER(nycaptor_state::sound_command_w) |
| 284 | 284 | { |
| 285 | soundlatch_w(space, 0, data); | |
| 285 | soundlatch_byte_w(space, 0, data); | |
| 286 | 286 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 287 | 287 | } |
| 288 | 288 | |
| r14896 | r14897 | |
| 388 | 388 | AM_RANGE(0xca00, 0xca00) AM_WRITENOP |
| 389 | 389 | AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP |
| 390 | 390 | AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP |
| 391 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) AM_WRITE(to_main_w) | |
| 391 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w) | |
| 392 | 392 | AM_RANGE(0xd200, 0xd200) AM_READNOP AM_WRITE(nmi_enable_w) |
| 393 | 393 | AM_RANGE(0xd400, 0xd400) AM_WRITE(nmi_disable_w) |
| 394 | 394 | AM_RANGE(0xd600, 0xd600) AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 386 | 386 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 387 | 387 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("oki", oki_banking_w) |
| 388 | 388 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 389 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 389 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 390 | 390 | ADDRESS_MAP_END |
| 391 | 391 | |
| 392 | 392 | WRITE8_MEMBER(mitchell_state::mstworld_sound_w) |
| 393 | 393 | { |
| 394 | soundlatch_w(space, 0, data); | |
| 394 | soundlatch_byte_w(space, 0, data); | |
| 395 | 395 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 396 | 396 | } |
| 397 | 397 |
| r14896 | r14897 | |
|---|---|---|
| 72 | 72 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 73 | 73 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(blktiger_bgvideoram_r, blktiger_bgvideoram_w) |
| 74 | 74 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(blktiger_txvideoram_w) AM_BASE(m_txvideoram) |
| 75 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_SHARE("paletteram") | |
| 76 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_SHARE("paletteram2") | |
| 75 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_lo_w) AM_SHARE("paletteram") | |
| 76 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 77 | 77 | AM_RANGE(0xe000, 0xfdff) AM_RAM |
| 78 | 78 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE("spriteram") |
| 79 | 79 | ADDRESS_MAP_END |
| 80 | 80 | |
| 81 | 81 | static ADDRESS_MAP_START( blktiger_io_map, AS_IO, 8, blktiger_state ) |
| 82 | 82 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 83 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w) | |
| 83 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(soundlatch_byte_w) | |
| 84 | 84 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(blktiger_bankswitch_w) |
| 85 | 85 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") |
| 86 | 86 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE(blktiger_coinlockout_w) |
| r14896 | r14897 | |
| 97 | 97 | |
| 98 | 98 | static ADDRESS_MAP_START( blktigerbl_io_map, AS_IO, 8, blktiger_state ) |
| 99 | 99 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 100 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w) | |
| 100 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(soundlatch_byte_w) | |
| 101 | 101 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(blktiger_bankswitch_w) |
| 102 | 102 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") |
| 103 | 103 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW0") AM_WRITE(blktiger_coinlockout_w) |
| r14896 | r14897 | |
| 115 | 115 | static ADDRESS_MAP_START( blktiger_sound_map, AS_PROGRAM, 8, blktiger_state ) |
| 116 | 116 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 117 | 117 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 118 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) | |
| 118 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) | |
| 119 | 119 | AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 120 | 120 | AM_RANGE(0xe002, 0xe003) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 121 | 121 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 11 | 11 | { |
| 12 | 12 | public: |
| 13 | 13 | mgolf_state(const machine_config &mconfig, device_type type, const char *tag) |
| 14 | : driver_device(mconfig, type, tag) { } | |
| 14 | : driver_device(mconfig, type, tag) , | |
| 15 | m_video_ram(*this, "video_ram"){ } | |
| 15 | 16 | |
| 16 | 17 | /* memory pointers */ |
| 17 | UINT8 | |
| 18 | required_shared_ptr<UINT8> | |
| 18 | 19 | |
| 19 | 20 | /* video-related */ |
| 20 | 21 | tilemap_t* m_bg_tilemap; |
| r14896 | r14897 | |
| 38 | 39 | static TILE_GET_INFO( get_tile_info ) |
| 39 | 40 | { |
| 40 | 41 | mgolf_state *state = machine.driver_data<mgolf_state>(); |
| 41 | UINT8 code = state->m_video_ram[tile_index]; | |
| 42 | UINT8 code = state->m_video_ram.target()[tile_index]; | |
| 42 | 43 | |
| 43 | 44 | SET_TILE_INFO(0, code, code >> 7, 0); |
| 44 | 45 | } |
| r14896 | r14897 | |
| 46 | 47 | |
| 47 | 48 | WRITE8_MEMBER(mgolf_state::mgolf_vram_w) |
| 48 | 49 | { |
| 49 | m_video_ram[offset] = data; | |
| 50 | m_video_ram.target()[offset] = data; | |
| 50 | 51 | m_bg_tilemap->mark_tile_dirty(offset); |
| 51 | 52 | } |
| 52 | 53 | |
| r14896 | r14897 | |
| 70 | 71 | for (i = 0; i < 2; i++) |
| 71 | 72 | { |
| 72 | 73 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], |
| 73 | state->m_video_ram[0x399 + 4 * i], | |
| 74 | state->m_video_ram.target()[0x399 + 4 * i], | |
| 74 | 75 | i, |
| 75 | 76 | 0, 0, |
| 76 | state->m_video_ram[0x390 + 2 * i] - 7, | |
| 77 | state->m_video_ram[0x398 + 4 * i] - 16, 0); | |
| 77 | state->m_video_ram.target()[0x390 + 2 * i] - 7, | |
| 78 | state->m_video_ram.target()[0x398 + 4 * i] - 16, 0); | |
| 78 | 79 | |
| 79 | 80 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], |
| 80 | state->m_video_ram[0x39b + 4 * i], | |
| 81 | state->m_video_ram.target()[0x39b + 4 * i], | |
| 81 | 82 | i, |
| 82 | 83 | 0, 0, |
| 83 | state->m_video_ram[0x390 + 2 * i] - 15, | |
| 84 | state->m_video_ram[0x39a + 4 * i] - 16, 0); | |
| 84 | state->m_video_ram.target()[0x390 + 2 * i] - 15, | |
| 85 | state->m_video_ram.target()[0x39a + 4 * i] - 16, 0); | |
| 85 | 86 | } |
| 86 | 87 | return 0; |
| 87 | 88 | } |
| r14896 | r14897 | |
| 136 | 137 | |
| 137 | 138 | READ8_MEMBER(mgolf_state::mgolf_wram_r) |
| 138 | 139 | { |
| 139 | return m_video_ram[0x380 + offset]; | |
| 140 | return m_video_ram.target()[0x380 + offset]; | |
| 140 | 141 | } |
| 141 | 142 | |
| 142 | 143 | |
| r14896 | r14897 | |
| 178 | 179 | |
| 179 | 180 | WRITE8_MEMBER(mgolf_state::mgolf_wram_w) |
| 180 | 181 | { |
| 181 | m_video_ram[0x380 + offset] = data; | |
| 182 | m_video_ram.target()[0x380 + offset] = data; | |
| 182 | 183 | } |
| 183 | 184 | |
| 184 | 185 | |
| r14896 | r14897 | |
| 207 | 208 | AM_RANGE(0x006d, 0x006d) AM_WRITENOP |
| 208 | 209 | AM_RANGE(0x0080, 0x00ff) AM_WRITE(mgolf_wram_w) |
| 209 | 210 | AM_RANGE(0x0180, 0x01ff) AM_WRITE(mgolf_wram_w) |
| 210 | AM_RANGE(0x0800, 0x0bff) AM_WRITE(mgolf_vram_w) AM_ | |
| 211 | AM_RANGE(0x0800, 0x0bff) AM_WRITE(mgolf_vram_w) AM_ | |
| 211 | 212 | |
| 212 | 213 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 213 | 214 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 80 | 80 | { |
| 81 | 81 | public: |
| 82 | 82 | pasha2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 83 | : driver_device(mconfig, type, tag) { } | |
| 83 | : driver_device(mconfig, type, tag) , | |
| 84 | m_wram(*this, "wram"), | |
| 85 | m_paletteram(*this, "paletteram"){ } | |
| 84 | 86 | |
| 85 | 87 | /* memory pointers */ |
| 86 | UINT16 * m_paletteram; | |
| 87 | UINT16 * m_wram; | |
| 88 | required_shared_ptr<UINT16> m_wram; | |
| 89 | required_shared_ptr<UINT16> m_paletteram; | |
| 88 | 90 | |
| 89 | 91 | /* video-related */ |
| 90 | 92 | int m_vbuffer; |
| r14896 | r14897 | |
| 136 | 138 | { |
| 137 | 139 | int color; |
| 138 | 140 | |
| 139 | COMBINE_DATA(&m_paletteram[offset]); | |
| 141 | COMBINE_DATA(&m_paletteram.target()[offset]); | |
| 140 | 142 | |
| 141 | 143 | offset &= 0xff; |
| 142 | 144 | |
| 143 | color = (m_paletteram[offset] >> 8) | (m_paletteram[offset + 0x100] & 0xff00); | |
| 145 | color = (m_paletteram.target()[offset] >> 8) | (m_paletteram.target()[offset + 0x100] & 0xff00); | |
| 144 | 146 | palette_set_color_rgb(machine(), offset * 2 + 0, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10)); |
| 145 | 147 | |
| 146 | color = (m_paletteram[offset] & 0xff) | ((m_paletteram[offset + 0x100] & 0xff) << 8); | |
| 148 | color = (m_paletteram.target()[offset] & 0xff) | ((m_paletteram.target()[offset + 0x100] & 0xff) << 8); | |
| 147 | 149 | palette_set_color_rgb(machine(), offset * 2 + 1, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10)); |
| 148 | 150 | } |
| 149 | 151 | |
| r14896 | r14897 | |
| 209 | 211 | } |
| 210 | 212 | |
| 211 | 213 | static ADDRESS_MAP_START( pasha2_map, AS_PROGRAM, 16, pasha2_state ) |
| 212 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_ | |
| 214 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_ | |
| 213 | 215 | AM_RANGE(0x40000000, 0x4001ffff) AM_RAM_WRITE(bitmap_0_w) |
| 214 | 216 | AM_RANGE(0x40020000, 0x4003ffff) AM_RAM_WRITE(bitmap_1_w) |
| 215 | 217 | AM_RANGE(0x40060000, 0x40060001) AM_WRITENOP |
| r14896 | r14897 | |
| 220 | 222 | AM_RANGE(0x40074000, 0x40074001) AM_WRITE(vbuffer_set_w) |
| 221 | 223 | AM_RANGE(0x40078000, 0x40078001) AM_WRITENOP //once at startup -> to disable the eeprom? |
| 222 | 224 | AM_RANGE(0x80000000, 0x803fffff) AM_ROMBANK("bank1") |
| 223 | AM_RANGE(0xe0000000, 0xe00003ff) AM_RAM_WRITE(pasha2_palette_w) AM_ | |
| 225 | AM_RANGE(0xe0000000, 0xe00003ff) AM_RAM_WRITE(pasha2_palette_w) AM_ | |
| 224 | 226 | AM_RANGE(0xfff80000, 0xffffffff) AM_ROM AM_REGION("user1",0) |
| 225 | 227 | ADDRESS_MAP_END |
| 226 | 228 | |
| r14896 | r14897 | |
| 466 | 468 | if(cpu_get_pc(&space.device()) == 0x8302) |
| 467 | 469 | device_spin_until_interrupt(&space.device()); |
| 468 | 470 | |
| 469 | return m_wram[(0x95744 / 2) + offset]; | |
| 471 | return m_wram.target()[(0x95744 / 2) + offset]; | |
| 470 | 472 | } |
| 471 | 473 | |
| 472 | 474 | static DRIVER_INIT( pasha2 ) |
| r14896 | r14897 | |
|---|---|---|
| 290 | 290 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 291 | 291 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE(m_objectram, m_objectram_size) |
| 292 | 292 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("share1") |
| 293 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 293 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 294 | 294 | AM_RANGE(0xfa00, 0xfa00) AM_READWRITE(bublbobl_sound_status_r, bublbobl_sound_command_w) |
| 295 | 295 | AM_RANGE(0xfa03, 0xfa03) AM_WRITE(bublbobl_soundcpu_reset_w) |
| 296 | 296 | AM_RANGE(0xfa80, 0xfa80) AM_WRITE(watchdog_reset_w) |
| r14896 | r14897 | |
| 308 | 308 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| 309 | 309 | AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 310 | 310 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ym2", ym3526_r, ym3526_w) |
| 311 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_r) AM_WRITE(bublbobl_sound_status_w) | |
| 311 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) AM_WRITE(bublbobl_sound_status_w) | |
| 312 | 312 | AM_RANGE(0xb001, 0xb001) AM_WRITE(bublbobl_sh_nmi_enable_w) AM_READNOP |
| 313 | 313 | AM_RANGE(0xb002, 0xb002) AM_WRITE(bublbobl_sh_nmi_disable_w) |
| 314 | 314 | AM_RANGE(0xe000, 0xffff) AM_ROM // space for diagnostic ROM? |
| r14896 | r14897 | |
| 346 | 346 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 347 | 347 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE(m_objectram, m_objectram_size) |
| 348 | 348 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("share1") |
| 349 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 349 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 350 | 350 | AM_RANGE(0xfa00, 0xfa00) AM_READWRITE(bublbobl_sound_status_r, bublbobl_sound_command_w) |
| 351 | 351 | AM_RANGE(0xfa03, 0xfa03) AM_WRITE(bublbobl_soundcpu_reset_w) |
| 352 | 352 | AM_RANGE(0xfa80, 0xfa80) AM_WRITENOP // ??? |
| r14896 | r14897 | |
| 370 | 370 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 371 | 371 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE(m_objectram, m_objectram_size) |
| 372 | 372 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("share1") |
| 373 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 373 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 374 | 374 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(watchdog_reset_w) |
| 375 | 375 | AM_RANGE(0xfa03, 0xfa03) AM_READ_PORT("DSW0") |
| 376 | 376 | AM_RANGE(0xfa04, 0xfa04) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 392 | 392 | static ADDRESS_MAP_START( tokio_sound_map, AS_PROGRAM, 8, bublbobl_state ) |
| 393 | 393 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 394 | 394 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| 395 | AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_r) AM_WRITE(bublbobl_sound_status_w) | |
| 395 | AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_byte_r) AM_WRITE(bublbobl_sound_status_w) | |
| 396 | 396 | AM_RANGE(0x9800, 0x9800) AM_READNOP // ??? |
| 397 | 397 | AM_RANGE(0xa000, 0xa000) AM_WRITE(bublbobl_sh_nmi_disable_w) |
| 398 | 398 | AM_RANGE(0xa800, 0xa800) AM_WRITE(bublbobl_sh_nmi_enable_w) |
| r14896 | r14897 | |
|---|---|---|
| 70 | 70 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w) // YM2203 #1 |
| 71 | 71 | // AM_RANGE(0xb000, 0xb001) AM_WRITENOP // ?? |
| 72 | 72 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r,ym2203_w) // YM2203 #2 |
| 73 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_r) // From Main CPU | |
| 73 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 74 | 74 | ADDRESS_MAP_END |
| 75 | 75 | |
| 76 | 76 |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | public: |
| 35 | 35 | coinmstr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | : driver_device(mconfig, type, tag) { } | |
| 36 | : driver_device(mconfig, type, tag) , | |
| 37 | m_videoram(*this, "videoram"), | |
| 38 | m_attr_ram1(*this, "attr_ram1"), | |
| 39 | m_attr_ram2(*this, "attr_ram2"), | |
| 40 | m_attr_ram3(*this, "attr_ram3"){ } | |
| 37 | 41 | |
| 38 | UINT8 *m_videoram; | |
| 39 | UINT8 *m_attr_ram1; | |
| 40 | UINT8 *m_attr_ram2; | |
| 41 | UINT8 *m_attr_ram3; | |
| 42 | required_shared_ptr<UINT8> m_videoram; | |
| 43 | required_shared_ptr<UINT8> m_attr_ram1; | |
| 44 | required_shared_ptr<UINT8> m_attr_ram2; | |
| 45 | required_shared_ptr<UINT8> m_attr_ram3; | |
| 42 | 46 | tilemap_t *m_bg_tilemap; |
| 43 | 47 | UINT8 m_question_adr[4]; |
| 44 | 48 | DECLARE_WRITE8_MEMBER(quizmstr_bg_w); |
| r14896 | r14897 | |
| 53 | 57 | |
| 54 | 58 | WRITE8_MEMBER(coinmstr_state::quizmstr_bg_w) |
| 55 | 59 | { |
| 56 | UINT8 *videoram = m_videoram; | |
| 60 | UINT8 *videoram = m_videoram.target(); | |
| 57 | 61 | videoram[offset] = data; |
| 58 | 62 | |
| 59 | 63 | if(offset >= 0x0240) |
| r14896 | r14897 | |
| 96 | 100 | |
| 97 | 101 | WRITE8_MEMBER(coinmstr_state::quizmstr_attr1_w) |
| 98 | 102 | { |
| 99 | m_attr_ram1[offset] = data; | |
| 103 | m_attr_ram1.target()[offset] = data; | |
| 100 | 104 | |
| 101 | 105 | if(offset >= 0x0240) |
| 102 | 106 | { |
| 103 | 107 | // the later games also use attr3 for something.. |
| 104 | UINT32 paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7); | |
| 108 | UINT32 paldata = (m_attr_ram1.target()[offset] & 0x7f) | ((m_attr_ram2.target()[offset] & 0x7f) << 7); | |
| 105 | 109 | m_bg_tilemap->mark_tile_dirty(offset - 0x0240); |
| 106 | 110 | |
| 107 | 111 | coinmstr_set_pal(machine(), paldata, offset - 0x240); |
| r14896 | r14897 | |
| 111 | 115 | |
| 112 | 116 | WRITE8_MEMBER(coinmstr_state::quizmstr_attr2_w) |
| 113 | 117 | { |
| 114 | m_attr_ram2[offset] = data; | |
| 118 | m_attr_ram2.target()[offset] = data; | |
| 115 | 119 | |
| 116 | 120 | if(offset >= 0x0240) |
| 117 | 121 | { |
| 118 | 122 | // the later games also use attr3 for something.. |
| 119 | UINT32 paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7); | |
| 123 | UINT32 paldata = (m_attr_ram1.target()[offset] & 0x7f) | ((m_attr_ram2.target()[offset] & 0x7f) << 7); | |
| 120 | 124 | m_bg_tilemap->mark_tile_dirty(offset - 0x0240); |
| 121 | 125 | |
| 122 | 126 | coinmstr_set_pal(machine(), paldata, offset - 0x240); |
| r14896 | r14897 | |
| 126 | 130 | |
| 127 | 131 | WRITE8_MEMBER(coinmstr_state::quizmstr_attr3_w) |
| 128 | 132 | { |
| 129 | m_attr_ram3[offset] = data; | |
| 133 | m_attr_ram3.target()[offset] = data; | |
| 130 | 134 | |
| 131 | 135 | if(offset >= 0x0240) |
| 132 | 136 | m_bg_tilemap->mark_tile_dirty(offset - 0x0240); |
| r14896 | r14897 | |
| 202 | 206 | static ADDRESS_MAP_START( coinmstr_map, AS_PROGRAM, 8, coinmstr_state ) |
| 203 | 207 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 204 | 208 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 205 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(quizmstr_bg_w) AM_BASE(m_videoram) | |
| 206 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(quizmstr_attr1_w) AM_BASE(m_attr_ram1) | |
| 207 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(quizmstr_attr2_w) AM_BASE(m_attr_ram2) | |
| 208 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(quizmstr_attr3_w) AM_BASE(m_attr_ram3) | |
| 209 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(quizmstr_bg_w) AM_SHARE("videoram") | |
| 210 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(quizmstr_attr1_w) AM_SHARE("attr_ram1") | |
| 211 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(quizmstr_attr2_w) AM_SHARE("attr_ram2") | |
| 212 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(quizmstr_attr3_w) AM_SHARE("attr_ram3") | |
| 209 | 213 | ADDRESS_MAP_END |
| 210 | 214 | |
| 211 | 215 | // Different I/O mappping for every game |
| r14896 | r14897 | |
| 897 | 901 | static TILE_GET_INFO( get_bg_tile_info ) |
| 898 | 902 | { |
| 899 | 903 | coinmstr_state *state = machine.driver_data<coinmstr_state>(); |
| 900 | UINT8 *videoram = state->m_videoram; | |
| 904 | UINT8 *videoram = state->m_videoram.target(); | |
| 901 | 905 | int tile = videoram[tile_index + 0x0240]; |
| 902 | 906 | int color = tile_index; |
| 903 | 907 | |
| 904 | tile |= (state->m_attr_ram1[tile_index + 0x0240] & 0x80) << 1; | |
| 905 | tile |= (state->m_attr_ram2[tile_index + 0x0240] & 0x80) << 2; | |
| 908 | tile |= (state->m_attr_ram1.target()[tile_index + 0x0240] & 0x80) << 1; | |
| 909 | tile |= (state->m_attr_ram2.target()[tile_index + 0x0240] & 0x80) << 2; | |
| 906 | 910 | |
| 907 | tile |= (state->m_attr_ram3[tile_index + 0x0240] & 0x03) << (6+4); | |
| 911 | tile |= (state->m_attr_ram3.target()[tile_index + 0x0240] & 0x03) << (6+4); | |
| 908 | 912 | |
| 909 | 913 | SET_TILE_INFO(0, tile, color, 0); |
| 910 | 914 | } |
| r14896 | r14897 | |
|---|---|---|
| 116 | 116 | { |
| 117 | 117 | |
| 118 | 118 | m_sound_cpu_busy = 1; |
| 119 | soundlatch_w(space, 0, data); | |
| 119 | soundlatch_byte_w(space, 0, data); | |
| 120 | 120 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | READ8_MEMBER(mainsnk_state::sound_command_r) |
| 124 | 124 | { |
| 125 | return soundlatch_r(space, 0); | |
| 125 | return soundlatch_byte_r(space, 0); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | READ8_MEMBER(mainsnk_state::sound_ack_r) |
| r14896 | r14897 | |
|---|---|---|
| 85 | 85 | * |
| 86 | 86 | *************************************/ |
| 87 | 87 | |
| 88 | ||
| 88 | ||
| 89 | 89 | { |
| 90 | 90 | /* bit layout in this register: |
| 91 | 91 | |
| r14896 | r14897 | |
| 108 | 108 | { |
| 109 | 109 | if (data & 0x1000) |
| 110 | 110 | logerror("Color bank set to 1!\n"); |
| 111 | coin_counter_w(space->machine(), 0, (data >> 9) & 1); | |
| 112 | coin_counter_w(space->machine(), 1, (data >> 8) & 1); | |
| 111 | coin_counter_w(machine(), 0, (data >> 9) & 1); | |
| 112 | coin_counter_w(machine(), 1, (data >> 8) & 1); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /* lower byte being modified? */ |
| 116 | 116 | if (ACCESSING_BITS_0_7) |
| 117 | 117 | { |
| 118 | atarigen_set_oki6295_vol( | |
| 118 | atarigen_set_oki6295_vol( | |
| 119 | 119 | if (!(data & 0x0010)) |
| 120 | devtag_reset(space->machine(), "oki"); | |
| 121 | atarigen_set_ym2413_vol(space->machine(), ((data >> 1) & 7) * 100 / 7); | |
| 120 | devtag_reset(machine(), "oki"); | |
| 121 | atarigen_set_ym2413_vol(machine(), ((data >> 1) & 7) * 100 / 7); | |
| 122 | 122 | if (!(data & 0x0001)) |
| 123 | devtag_reset( | |
| 123 | devtag_reset( | |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
| r14896 | r14897 | |
| 148 | 148 | AM_RANGE(0x480000, 0x480003) AM_MIRROR(0x019ffc) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0xff00) |
| 149 | 149 | AM_RANGE(0x500000, 0x500fff) AM_MIRROR(0x019000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 150 | 150 | AM_RANGE(0x5a6000, 0x5a6001) AM_MIRROR(0x019ffe) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 151 | AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffe) AM_WRITE | |
| 151 | AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffe) AM_WRITE | |
| 152 | 152 | AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffc) AM_READ_PORT("IN0") |
| 153 | 153 | AM_RANGE(0x640002, 0x640003) AM_MIRROR(0x019ffc) AM_READ_PORT("IN1") |
| 154 | 154 | AM_RANGE(0x6c0000, 0x6c0001) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK0") |
| r14896 | r14897 | |
|---|---|---|
| 171 | 171 | { |
| 172 | 172 | public: |
| 173 | 173 | magicard_state(const machine_config &mconfig, device_type type, const char *tag) |
| 174 | : driver_device(mconfig, type, tag) { } | |
| 174 | : driver_device(mconfig, type, tag) , | |
| 175 | m_magicram(*this, "magicram"), | |
| 176 | m_pcab_vregs(*this, "pcab_vregs"), | |
| 177 | m_scc68070_ext_irqc_regs(*this, "scc68070_ext_irqc_regs"), | |
| 178 | m_scc68070_iic_regs(*this, "scc68070_iic_regs"), | |
| 179 | m_scc68070_uart_regs(*this, "scc68070_uart_regs"), | |
| 180 | m_scc68070_timer_regs(*this, "scc68070_timer_regs"), | |
| 181 | m_scc68070_int_irqc_regs(*this, "scc68070_int_irqc_regs"), | |
| 182 | m_scc68070_dma_ch1_regs(*this, "scc68070_dma_ch1_regs"), | |
| 183 | m_scc68070_dma_ch2_regs(*this, "scc68070_dma_ch2_regs"), | |
| 184 | m_scc68070_mmu_regs(*this, "scc68070_mmu_regs"){ } | |
| 175 | 185 | |
| 176 | UINT16 *m_magicram; | |
| 177 | UINT16 *m_pcab_vregs; | |
| 178 | UINT16 *m_scc68070_ext_irqc_regs; | |
| 179 | UINT16 *m_scc68070_iic_regs; | |
| 180 | UINT16 *m_scc68070_uart_regs; | |
| 181 | UINT16 *m_scc68070_timer_regs; | |
| 182 | UINT16 *m_scc68070_int_irqc_regs; | |
| 183 | UINT16 *m_scc68070_dma_ch1_regs; | |
| 184 | UINT16 *m_scc68070_dma_ch2_regs; | |
| 185 | UINT16 *m_scc68070_mmu_regs; | |
| 186 | required_shared_ptr<UINT16> m_magicram; | |
| 187 | required_shared_ptr<UINT16> m_pcab_vregs; | |
| 188 | required_shared_ptr<UINT16> m_scc68070_ext_irqc_regs; | |
| 189 | required_shared_ptr<UINT16> m_scc68070_iic_regs; | |
| 190 | required_shared_ptr<UINT16> m_scc68070_uart_regs; | |
| 191 | required_shared_ptr<UINT16> m_scc68070_timer_regs; | |
| 192 | required_shared_ptr<UINT16> m_scc68070_int_irqc_regs; | |
| 193 | required_shared_ptr<UINT16> m_scc68070_dma_ch1_regs; | |
| 194 | required_shared_ptr<UINT16> m_scc68070_dma_ch2_regs; | |
| 195 | required_shared_ptr<UINT16> m_scc68070_mmu_regs; | |
| 186 | 196 | struct { int r,g,b,offs,offs_internal; } m_pal; |
| 187 | 197 | DECLARE_READ16_MEMBER(test_r); |
| 188 | 198 | DECLARE_WRITE16_MEMBER(paletteram_io_w); |
| r14896 | r14897 | |
| 238 | 248 | */ |
| 239 | 249 | |
| 240 | 250 | /*63 at post test,6d all the time.*/ |
| 241 | #define SCC_CSR_VREG (state->m_pcab_vregs[0x00/2] & 0xffff) | |
| 251 | #define SCC_CSR_VREG (state->m_pcab_vregs.target()[0x00/2] & 0xffff) | |
| 242 | 252 | #define SCC_CG_VREG ((SCC_CSR_VREG & 0x10)>>4) |
| 243 | 253 | |
| 244 | 254 | /* |
| r14896 | r14897 | |
| 264 | 274 | w ........ ....aaaa VSR:H = video start address (MSB's) |
| 265 | 275 | */ |
| 266 | 276 | |
| 267 | #define SCC_DCR_VREG (state->m_pcab_vregs[0x02/2] & 0xffff) | |
| 277 | #define SCC_DCR_VREG (state->m_pcab_vregs.target()[0x02/2] & 0xffff) | |
| 268 | 278 | #define SCC_DE_VREG ((SCC_DCR_VREG & 0x8000)>>15) |
| 269 | 279 | #define SCC_FG_VREG ((SCC_DCR_VREG & 0x0080)>>7) |
| 270 | 280 | #define SCC_VSR_VREG_H ((SCC_DCR_VREG & 0xf)>>0) |
| r14896 | r14897 | |
| 274 | 284 | w aaaaaaaa aaaaaaaa VSR:L = video start address (LSB's) |
| 275 | 285 | */ |
| 276 | 286 | |
| 277 | #define SCC_VSR_VREG_L (state->m_pcab_vregs[0x04/2] & 0xffff) | |
| 287 | #define SCC_VSR_VREG_L (state->m_pcab_vregs.target()[0x04/2] & 0xffff) | |
| 278 | 288 | #define SCC_VSR_VREG ((SCC_VSR_VREG_H)<<16) | (SCC_VSR_VREG_L) |
| 279 | 289 | |
| 280 | 290 | /* |
| r14896 | r14897 | |
| 293 | 303 | w ........ xxxx.... not used |
| 294 | 304 | w ........ ....aaaa "data" (dunno the purpose...) |
| 295 | 305 | */ |
| 296 | #define SCC_DCR2_VREG (state->m_pcab_vregs[0x08/2] & 0xffff) | |
| 306 | #define SCC_DCR2_VREG (state->m_pcab_vregs.target()[0x08/2] & 0xffff) | |
| 297 | 307 | |
| 298 | 308 | /* |
| 299 | 309 | (Note: not present on the original vreg listing) |
| r14896 | r14897 | |
| 314 | 324 | 1ffff0 a = source register a |
| 315 | 325 | w nnnnnnnn nnnnnnnn source |
| 316 | 326 | */ |
| 317 | #define SCC_SRCA_VREG (state->m_pcab_vregs[0x10/2] & 0xffff) | |
| 327 | #define SCC_SRCA_VREG (state->m_pcab_vregs.target()[0x10/2] & 0xffff) | |
| 318 | 328 | |
| 319 | 329 | /* |
| 320 | 330 | 1ffff2 b = destination register b |
| 321 | 331 | rw nnnnnnnn nnnnnnnn destination |
| 322 | 332 | */ |
| 323 | 333 | |
| 324 | #define SCC_DSTB_VREG (state->m_pcab_vregs[0x12/2] & 0xffff) | |
| 334 | #define SCC_DSTB_VREG (state->m_pcab_vregs.target()[0x12/2] & 0xffff) | |
| 325 | 335 | |
| 326 | 336 | /* |
| 327 | 337 | 1ffff4 pcr = pixac command register |
| r14896 | r14897 | |
| 368 | 378 | w ........ .......0 |
| 369 | 379 | */ |
| 370 | 380 | |
| 371 | #define SCC_PCR_VREG (state->m_pcab_vregs[0x14/2] & 0xffff) | |
| 381 | #define SCC_PCR_VREG (state->m_pcab_vregs.target()[0x14/2] & 0xffff) | |
| 372 | 382 | |
| 373 | 383 | /* |
| 374 | 384 | 1ffff6 mask = mask register |
| r14896 | r14897 | |
| 420 | 430 | { |
| 421 | 431 | UINT32 color; |
| 422 | 432 | |
| 423 | color = ((state->m_magicram[count]) & 0x000f)>>0; | |
| 433 | color = ((state->m_magicram.target()[count]) & 0x000f)>>0; | |
| 424 | 434 | |
| 425 | 435 | if(cliprect.contains((x*4)+3, y)) |
| 426 | 436 | bitmap.pix32(y, (x*4)+3) = screen.machine().pens[color]; |
| 427 | 437 | |
| 428 | color = ((state->m_magicram[count]) & 0x00f0)>>4; | |
| 438 | color = ((state->m_magicram.target()[count]) & 0x00f0)>>4; | |
| 429 | 439 | |
| 430 | 440 | if(cliprect.contains((x*4)+2, y)) |
| 431 | 441 | bitmap.pix32(y, (x*4)+2) = screen.machine().pens[color]; |
| 432 | 442 | |
| 433 | color = ((state->m_magicram[count]) & 0x0f00)>>8; | |
| 443 | color = ((state->m_magicram.target()[count]) & 0x0f00)>>8; | |
| 434 | 444 | |
| 435 | 445 | if(cliprect.contains((x*4)+1, y)) |
| 436 | 446 | bitmap.pix32(y, (x*4)+1) = screen.machine().pens[color]; |
| 437 | 447 | |
| 438 | color = ((state->m_magicram[count]) & 0xf000)>>12; | |
| 448 | color = ((state->m_magicram.target()[count]) & 0xf000)>>12; | |
| 439 | 449 | |
| 440 | 450 | if(cliprect.contains((x*4)+0, y)) |
| 441 | 451 | bitmap.pix32(y, (x*4)+0) = screen.machine().pens[color]; |
| r14896 | r14897 | |
| 452 | 462 | { |
| 453 | 463 | UINT32 color; |
| 454 | 464 | |
| 455 | color = ((state->m_magicram[count]) & 0x00ff)>>0; | |
| 465 | color = ((state->m_magicram.target()[count]) & 0x00ff)>>0; | |
| 456 | 466 | |
| 457 | 467 | if(cliprect.contains((x*2)+1, y)) |
| 458 | 468 | bitmap.pix32(y, (x*2)+1) = screen.machine().pens[color]; |
| 459 | 469 | |
| 460 | color = ((state->m_magicram[count]) & 0xff00)>>8; | |
| 470 | color = ((state->m_magicram.target()[count]) & 0xff00)>>8; | |
| 461 | 471 | |
| 462 | 472 | if(cliprect.contains((x*2)+0, y)) |
| 463 | 473 | bitmap.pix32(y, (x*2)+0) = screen.machine().pens[color]; |
| r14896 | r14897 | |
| 524 | 534 | //printf("[%04x]\n",offset*2); |
| 525 | 535 | |
| 526 | 536 | |
| 527 | return m_pcab_vregs[offset]; | |
| 537 | return m_pcab_vregs.target()[offset]; | |
| 528 | 538 | } |
| 529 | 539 | |
| 530 | 540 | WRITE16_MEMBER(magicard_state::philips_66470_w) |
| 531 | 541 | { |
| 532 | COMBINE_DATA(&m_pcab_vregs[offset]); | |
| 542 | COMBINE_DATA(&m_pcab_vregs.target()[offset]); | |
| 533 | 543 | |
| 534 | 544 | // if(offset == 0x10/2) |
| 535 | 545 | // { |
| 536 | //printf("%04x %04x %04x\n",data,m_pcab_vregs[0x12/2],m_pcab_vregs[0x14/2]); | |
| 537 | //m_pcab_vregs[0x12/2] = m_pcab_vregs[0x10/2]; | |
| 546 | //printf("%04x %04x %04x\n",data,m_pcab_vregs.target()[0x12/2],m_pcab_vregs.target()[0x14/2]); | |
| 547 | //m_pcab_vregs.target()[0x12/2] = m_pcab_vregs.target()[0x10/2]; | |
| 538 | 548 | // } |
| 539 | 549 | } |
| 540 | 550 | |
| r14896 | r14897 | |
| 542 | 552 | |
| 543 | 553 | READ16_MEMBER(magicard_state::scc68070_ext_irqc_r) |
| 544 | 554 | { |
| 545 | return m_scc68070_ext_irqc_regs[offset]; | |
| 555 | return m_scc68070_ext_irqc_regs.target()[offset]; | |
| 546 | 556 | } |
| 547 | 557 | |
| 548 | 558 | WRITE16_MEMBER(magicard_state::scc68070_ext_irqc_w) |
| 549 | 559 | { |
| 550 | m_scc68070_ext_irqc_regs[offset] = data; | |
| 560 | m_scc68070_ext_irqc_regs.target()[offset] = data; | |
| 551 | 561 | } |
| 552 | 562 | |
| 553 | 563 | READ16_MEMBER(magicard_state::scc68070_iic_r) |
| r14896 | r14897 | |
| 556 | 566 | |
| 557 | 567 | switch(offset) |
| 558 | 568 | { |
| 559 | case 0x04/2: return m_scc68070_iic_regs[offset] & 0xef; //iic status register, bit 4 = pending irq | |
| 569 | case 0x04/2: return m_scc68070_iic_regs.target()[offset] & 0xef; //iic status register, bit 4 = pending irq | |
| 560 | 570 | } |
| 561 | 571 | |
| 562 | return m_scc68070_iic_regs[offset]; | |
| 572 | return m_scc68070_iic_regs.target()[offset]; | |
| 563 | 573 | } |
| 564 | 574 | |
| 565 | 575 | WRITE16_MEMBER(magicard_state::scc68070_iic_w) |
| 566 | 576 | { |
| 567 | m_scc68070_iic_regs[offset] = data; | |
| 577 | m_scc68070_iic_regs.target()[offset] = data; | |
| 568 | 578 | } |
| 569 | 579 | |
| 570 | 580 | READ16_MEMBER(magicard_state::scc68070_uart_r) |
| r14896 | r14897 | |
| 576 | 586 | case 0x02/2: return machine().rand(); //uart mode register |
| 577 | 587 | } |
| 578 | 588 | |
| 579 | return m_scc68070_uart_regs[offset]; | |
| 589 | return m_scc68070_uart_regs.target()[offset]; | |
| 580 | 590 | } |
| 581 | 591 | |
| 582 | 592 | WRITE16_MEMBER(magicard_state::scc68070_uart_w) |
| 583 | 593 | { |
| 584 | m_scc68070_uart_regs[offset] = data; | |
| 594 | m_scc68070_uart_regs.target()[offset] = data; | |
| 585 | 595 | } |
| 586 | 596 | |
| 587 | 597 | READ16_MEMBER(magicard_state::scc68070_timer_r) |
| 588 | 598 | { |
| 589 | return m_scc68070_timer_regs[offset]; | |
| 599 | return m_scc68070_timer_regs.target()[offset]; | |
| 590 | 600 | } |
| 591 | 601 | |
| 592 | 602 | WRITE16_MEMBER(magicard_state::scc68070_timer_w) |
| 593 | 603 | { |
| 594 | m_scc68070_timer_regs[offset] = data; | |
| 604 | m_scc68070_timer_regs.target()[offset] = data; | |
| 595 | 605 | } |
| 596 | 606 | |
| 597 | 607 | READ16_MEMBER(magicard_state::scc68070_int_irqc_r) |
| 598 | 608 | { |
| 599 | return m_scc68070_int_irqc_regs[offset]; | |
| 609 | return m_scc68070_int_irqc_regs.target()[offset]; | |
| 600 | 610 | } |
| 601 | 611 | |
| 602 | 612 | WRITE16_MEMBER(magicard_state::scc68070_int_irqc_w) |
| 603 | 613 | { |
| 604 | m_scc68070_int_irqc_regs[offset] = data; | |
| 614 | m_scc68070_int_irqc_regs.target()[offset] = data; | |
| 605 | 615 | } |
| 606 | 616 | |
| 607 | 617 | READ16_MEMBER(magicard_state::scc68070_dma_ch1_r) |
| 608 | 618 | { |
| 609 | return m_scc68070_dma_ch1_regs[offset]; | |
| 619 | return m_scc68070_dma_ch1_regs.target()[offset]; | |
| 610 | 620 | } |
| 611 | 621 | |
| 612 | 622 | WRITE16_MEMBER(magicard_state::scc68070_dma_ch1_w) |
| 613 | 623 | { |
| 614 | m_scc68070_dma_ch1_regs[offset] = data; | |
| 624 | m_scc68070_dma_ch1_regs.target()[offset] = data; | |
| 615 | 625 | } |
| 616 | 626 | |
| 617 | 627 | READ16_MEMBER(magicard_state::scc68070_dma_ch2_r) |
| 618 | 628 | { |
| 619 | return m_scc68070_dma_ch2_regs[offset]; | |
| 629 | return m_scc68070_dma_ch2_regs.target()[offset]; | |
| 620 | 630 | } |
| 621 | 631 | |
| 622 | 632 | WRITE16_MEMBER(magicard_state::scc68070_dma_ch2_w) |
| 623 | 633 | { |
| 624 | m_scc68070_dma_ch2_regs[offset] = data; | |
| 634 | m_scc68070_dma_ch2_regs.target()[offset] = data; | |
| 625 | 635 | } |
| 626 | 636 | |
| 627 | 637 | READ16_MEMBER(magicard_state::scc68070_mmu_r) |
| 628 | 638 | { |
| 629 | return m_scc68070_mmu_regs[offset]; | |
| 639 | return m_scc68070_mmu_regs.target()[offset]; | |
| 630 | 640 | } |
| 631 | 641 | |
| 632 | 642 | WRITE16_MEMBER(magicard_state::scc68070_mmu_w) |
| 633 | 643 | { |
| 634 | m_scc68070_mmu_regs[offset] = data; | |
| 644 | m_scc68070_mmu_regs.target()[offset] = data; | |
| 635 | 645 | |
| 636 | 646 | switch(offset) |
| 637 | 647 | { |
| r14896 | r14897 | |
| 649 | 659 | |
| 650 | 660 | static ADDRESS_MAP_START( magicard_mem, AS_PROGRAM, 16, magicard_state ) |
| 651 | 661 | // ADDRESS_MAP_GLOBAL_MASK(0x1fffff) |
| 652 | AM_RANGE(0x00000000, 0x0017ffff) AM_MIRROR(0x7fe00000) AM_RAM AM_ | |
| 662 | AM_RANGE(0x00000000, 0x0017ffff) AM_MIRROR(0x7fe00000) AM_RAM AM_ | |
| 653 | 663 | AM_RANGE(0x00180000, 0x001ffbff) AM_MIRROR(0x7fe00000) AM_RAM AM_REGION("maincpu", 0) |
| 654 | 664 | /* 001ffc00-001ffdff System I/O */ |
| 655 | 665 | AM_RANGE(0x001ffc00, 0x001ffc01) AM_MIRROR(0x7fe00000) AM_READ(test_r) |
| r14896 | r14897 | |
| 660 | 670 | AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_READ(test_r) |
| 661 | 671 | AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_WRITENOP //? |
| 662 | 672 | AM_RANGE(0x001fff80, 0x001fffbf) AM_MIRROR(0x7fe00000) AM_RAM //DRAM I/O, not accessed by this game, CD buffer? |
| 663 | AM_RANGE(0x001fffe0, 0x001fffff) AM_MIRROR(0x7fe00000) AM_READWRITE(philips_66470_r,philips_66470_w) AM_BASE(m_pcab_vregs) //video registers | |
| 664 | AM_RANGE(0x80001000, 0x8000100f) AM_READWRITE(scc68070_ext_irqc_r,scc68070_ext_irqc_w) AM_BASE(m_scc68070_ext_irqc_regs) //lir | |
| 665 | AM_RANGE(0x80002000, 0x8000200f) AM_READWRITE(scc68070_iic_r,scc68070_iic_w) AM_BASE(m_scc68070_iic_regs) //i2c | |
| 666 | AM_RANGE(0x80002010, 0x8000201f) AM_READWRITE(scc68070_uart_r,scc68070_uart_w) AM_BASE(m_scc68070_uart_regs) | |
| 667 | AM_RANGE(0x80002020, 0x8000202f) AM_READWRITE(scc68070_timer_r,scc68070_timer_w) AM_BASE(m_scc68070_timer_regs) | |
| 668 | AM_RANGE(0x80002040, 0x8000204f) AM_READWRITE(scc68070_int_irqc_r,scc68070_int_irqc_w) AM_BASE(m_scc68070_int_irqc_regs) | |
| 669 | AM_RANGE(0x80004000, 0x8000403f) AM_READWRITE(scc68070_dma_ch1_r,scc68070_dma_ch1_w) AM_BASE(m_scc68070_dma_ch1_regs) | |
| 670 | AM_RANGE(0x80004040, 0x8000407f) AM_READWRITE(scc68070_dma_ch2_r,scc68070_dma_ch2_w) AM_BASE(m_scc68070_dma_ch2_regs) | |
| 671 | AM_RANGE(0x80008000, 0x8000807f) AM_READWRITE(scc68070_mmu_r,scc68070_mmu_w) AM_BASE(m_scc68070_mmu_regs) | |
| 673 | AM_RANGE(0x001fffe0, 0x001fffff) AM_MIRROR(0x7fe00000) AM_READWRITE(philips_66470_r,philips_66470_w) AM_SHARE("pcab_vregs") //video registers | |
| 674 | AM_RANGE(0x80001000, 0x8000100f) AM_READWRITE(scc68070_ext_irqc_r,scc68070_ext_irqc_w) AM_SHARE("scc68070_ext_irqc_regs") //lir | |
| 675 | AM_RANGE(0x80002000, 0x8000200f) AM_READWRITE(scc68070_iic_r,scc68070_iic_w) AM_SHARE("scc68070_iic_regs") //i2c | |
| 676 | AM_RANGE(0x80002010, 0x8000201f) AM_READWRITE(scc68070_uart_r,scc68070_uart_w) AM_SHARE("scc68070_uart_regs") | |
| 677 | AM_RANGE(0x80002020, 0x8000202f) AM_READWRITE(scc68070_timer_r,scc68070_timer_w) AM_SHARE("scc68070_timer_regs") | |
| 678 | AM_RANGE(0x80002040, 0x8000204f) AM_READWRITE(scc68070_int_irqc_r,scc68070_int_irqc_w) AM_SHARE("scc68070_int_irqc_regs") | |
| 679 | AM_RANGE(0x80004000, 0x8000403f) AM_READWRITE(scc68070_dma_ch1_r,scc68070_dma_ch1_w) AM_SHARE("scc68070_dma_ch1_regs") | |
| 680 | AM_RANGE(0x80004040, 0x8000407f) AM_READWRITE(scc68070_dma_ch2_r,scc68070_dma_ch2_w) AM_SHARE("scc68070_dma_ch2_regs") | |
| 681 | AM_RANGE(0x80008000, 0x8000807f) AM_READWRITE(scc68070_mmu_r,scc68070_mmu_w) AM_SHARE("scc68070_mmu_regs") | |
| 672 | 682 | ADDRESS_MAP_END |
| 673 | 683 | |
| 674 | 684 | |
| r14896 | r14897 | |
| 684 | 694 | { |
| 685 | 695 | magicard_state *state = machine.driver_data<magicard_state>(); |
| 686 | 696 | UINT16 *src = (UINT16*)machine.region("maincpu" )->base(); |
| 687 | UINT16 *dst = state->m_magicram; | |
| 697 | UINT16 *dst = state->m_magicram.target(); | |
| 688 | 698 | memcpy (dst, src, 0x80000); |
| 689 | 699 | machine.device("maincpu")->reset(); |
| 690 | 700 | } |
| r14896 | r14897 | |
|---|---|---|
| 303 | 303 | if ( changed & (1 << i) ) |
| 304 | 304 | { |
| 305 | 305 | MechMtr_update(i, data & (1 << i) ); |
| 306 | generic_pulse_irq_line(machine().device("maincpu"), M6809_FIRQ_LINE, 1); | |
| 306 | generic_pulse_irq_line(machine().device("maincpu")->execute(), M6809_FIRQ_LINE, 1); | |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | } |
| r14896 | r14897 | |
| 695 | 695 | |
| 696 | 696 | AM_RANGE(0x2E00, 0x2E00) AM_READ(irqlatch_r) // irq latch |
| 697 | 697 | |
| 698 | AM_RANGE(0x3001, 0x3001) AM_READ(soundlatch_r) | |
| 698 | AM_RANGE(0x3001, 0x3001) AM_READ(soundlatch_byte_r) | |
| 699 | 699 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| 700 | 700 | AM_RANGE(0x3101, 0x3201) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 701 | 701 |
| r14896 | r14897 | |
|---|---|---|
| 114 | 114 | { |
| 115 | 115 | public: |
| 116 | 116 | murogem_state(const machine_config &mconfig, device_type type, const char *tag) |
| 117 | : driver_device(mconfig, type, tag) { } | |
| 117 | : driver_device(mconfig, type, tag) , | |
| 118 | m_videoram(*this, "videoram"){ } | |
| 118 | 119 | |
| 119 | UINT8 | |
| 120 | required_shared_ptr<UINT8> | |
| 120 | 121 | DECLARE_WRITE8_MEMBER(outport_w); |
| 121 | 122 | }; |
| 122 | 123 | |
| r14896 | r14897 | |
| 141 | 142 | AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0") |
| 142 | 143 | AM_RANGE(0x5800, 0x5800) AM_READ_PORT("IN1") |
| 143 | 144 | AM_RANGE(0x7000, 0x7000) AM_WRITE(outport_w) /* output port */ |
| 144 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_ | |
| 145 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_ | |
| 145 | 146 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 146 | 147 | ADDRESS_MAP_END |
| 147 | 148 | |
| r14896 | r14897 | |
| 212 | 213 | { |
| 213 | 214 | for(xx=0;xx<32;xx++) |
| 214 | 215 | { |
| 215 | int tileno = state->m_videoram[count]&0x3f; | |
| 216 | int attr = state->m_videoram[count+0x400]&0x0f; | |
| 216 | int tileno = state->m_videoram.target()[count]&0x3f; | |
| 217 | int attr = state->m_videoram.target()[count+0x400]&0x0f; | |
| 217 | 218 | |
| 218 | 219 | drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0); |
| 219 | 220 |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | WRITE16_MEMBER(snowbros_state::snowbros_flipscreen_w) |
| 79 | 79 | { |
| 80 | 80 | if (ACCESSING_BITS_8_15) |
| 81 | flip_screen_set( | |
| 81 | flip_screen_set( | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| r14896 | r14897 | |
| 175 | 175 | |
| 176 | 176 | READ16_MEMBER(snowbros_state::snowbros_68000_sound_r) |
| 177 | 177 | { |
| 178 | return soundlatch_r(space,offset); | |
| 178 | return soundlatch_byte_r(space,offset); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| r14896 | r14897 | |
| 183 | 183 | { |
| 184 | 184 | if (ACCESSING_BITS_0_7) |
| 185 | 185 | { |
| 186 | soundlatch_w(space, offset, data & 0xff); | |
| 186 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 187 | 187 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | WRITE16_MEMBER(snowbros_state::semicom_soundcmd_w) |
| 192 | 192 | { |
| 193 | if (ACCESSING_BITS_0_7) soundlatch_w(space,0,data & 0xff); | |
| 193 | if (ACCESSING_BITS_0_7) soundlatch_byte_w(space,0,data & 0xff); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /* Snow Bros Memory Map */ |
| r14896 | r14897 | |
| 204 | 204 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1") |
| 205 | 205 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2") |
| 206 | 206 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM") |
| 207 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 207 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 208 | 208 | AM_RANGE(0x700000, 0x701fff) AM_DEVREADWRITE_LEGACY("pandora", pandora_spriteram_LSB_r, pandora_spriteram_LSB_w) |
| 209 | 209 | AM_RANGE(0x800000, 0x800001) AM_WRITE(snowbros_irq4_ack_w) /* IRQ 4 acknowledge */ |
| 210 | 210 | AM_RANGE(0x900000, 0x900001) AM_WRITE(snowbros_irq3_ack_w) /* IRQ 3 acknowledge */ |
| r14896 | r14897 | |
| 219 | 219 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, snowbros_state ) |
| 220 | 220 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 221 | 221 | AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) |
| 222 | AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_r, soundlatch_w) /* goes back to the main CPU, checked during boot */ | |
| 222 | AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) /* goes back to the main CPU, checked during boot */ | |
| 223 | 223 | ADDRESS_MAP_END |
| 224 | 224 | |
| 225 | 225 | |
| r14896 | r14897 | |
| 286 | 286 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1") |
| 287 | 287 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2") |
| 288 | 288 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM") |
| 289 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 289 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 290 | 290 | AM_RANGE(0x700000, 0x701fff) AM_RAM AM_BASE_SIZE(m_bootleg_spriteram16, m_spriteram_size) |
| 291 | 291 | AM_RANGE(0x800000, 0x800001) AM_WRITE(snowbros_irq4_ack_w) /* IRQ 4 acknowledge */ |
| 292 | 292 | AM_RANGE(0x900000, 0x900001) AM_WRITE(snowbros_irq3_ack_w) /* IRQ 3 acknowledge */ |
| r14896 | r14897 | |
| 307 | 307 | AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1") |
| 308 | 308 | AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2") |
| 309 | 309 | AM_RANGE(0x900004, 0x900005) AM_READ_PORT("SYSTEM") |
| 310 | AM_RANGE(0xa00000, 0xa007ff) AM_RAM_WRITE(paletteram | |
| 310 | AM_RANGE(0xa00000, 0xa007ff) AM_RAM_WRITE(paletteram | |
| 311 | 311 | AM_RANGE(0xb00000, 0xb01fff) AM_RAM AM_BASE_SIZE(m_bootleg_spriteram16, m_spriteram_size) |
| 312 | 312 | ADDRESS_MAP_END |
| 313 | 313 | |
| r14896 | r14897 | |
| 320 | 320 | static ADDRESS_MAP_START( honeydol_sound_io_map, AS_IO, 8, snowbros_state ) |
| 321 | 321 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 322 | 322 | AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) // not connected? |
| 323 | AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_r, soundlatch_w) /* goes back to the main CPU, checked during boot */ | |
| 323 | AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) /* goes back to the main CPU, checked during boot */ | |
| 324 | 324 | ADDRESS_MAP_END |
| 325 | 325 | |
| 326 | 326 | /* Twin Adventure */ |
| r14896 | r14897 | |
| 329 | 329 | { |
| 330 | 330 | if (ACCESSING_BITS_0_7) |
| 331 | 331 | { |
| 332 | soundlatch_w(space, offset, data & 0xff); | |
| 332 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 333 | 333 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 334 | 334 | } |
| 335 | 335 | } |
| r14896 | r14897 | |
| 344 | 344 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1") |
| 345 | 345 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2") |
| 346 | 346 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM") |
| 347 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 347 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 348 | 348 | AM_RANGE(0x700000, 0x701fff) AM_RAM AM_BASE_SIZE(m_bootleg_spriteram16, m_spriteram_size) |
| 349 | 349 | AM_RANGE(0x800000, 0x800001) AM_WRITE(snowbros_irq4_ack_w) /* IRQ 4 acknowledge */ |
| 350 | 350 | AM_RANGE(0x900000, 0x900001) AM_WRITE(snowbros_irq3_ack_w) /* IRQ 3 acknowledge */ |
| r14896 | r14897 | |
| 362 | 362 | |
| 363 | 363 | static ADDRESS_MAP_START( twinadv_sound_io_map, AS_IO, 8, snowbros_state ) |
| 364 | 364 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 365 | AM_RANGE(0x02, 0x02) AM_READWRITE(soundlatch_r, soundlatch_w) // back to 68k? | |
| 365 | AM_RANGE(0x02, 0x02) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) // back to 68k? | |
| 366 | 366 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("oki", twinadv_oki_bank_w) // oki bank? |
| 367 | 367 | AM_RANGE(0x06, 0x06) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 368 | 368 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 384 | 384 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2") |
| 385 | 385 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM") |
| 386 | 386 | |
| 387 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 387 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 388 | 388 | AM_RANGE(0x700000, 0x701fff) AM_DEVREADWRITE_LEGACY("pandora", pandora_spriteram_LSB_r,pandora_spriteram_LSB_w) |
| 389 | 389 | AM_RANGE(0x800000, 0x800001) AM_WRITE(snowbros_irq4_ack_w) /* IRQ 4 acknowledge */ |
| 390 | 390 | AM_RANGE(0x900000, 0x900001) AM_WRITE(snowbros_irq3_ack_w) /* IRQ 3 acknowledge */ |
| r14896 | r14897 | |
| 396 | 396 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 397 | 397 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) |
| 398 | 398 | AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 399 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) | |
| 399 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_byte_r) | |
| 400 | 400 | ADDRESS_MAP_END |
| 401 | 401 | |
| 402 | 402 | /* Same volume used for all samples at the Moment, could be right, we have no |
| r14896 | r14897 | |
| 519 | 519 | AM_RANGE( 0x500000, 0x500001) AM_READ_PORT("DSW1") |
| 520 | 520 | AM_RANGE( 0x500002, 0x500003) AM_READ_PORT("DSW2") |
| 521 | 521 | AM_RANGE( 0x500004, 0x500005) AM_READ_PORT("SYSTEM") |
| 522 | AM_RANGE( 0x600000, 0x6003ff) AM_RAM_WRITE(paletteram | |
| 522 | AM_RANGE( 0x600000, 0x6003ff) AM_RAM_WRITE(paletteram | |
| 523 | 523 | AM_RANGE( 0x700000, 0x7021ff) AM_RAM AM_BASE_SIZE(m_bootleg_spriteram16, m_spriteram_size) |
| 524 | 524 | AM_RANGE(0x800000, 0x800001) AM_WRITE(snowbros_irq4_ack_w) /* IRQ 4 acknowledge */ |
| 525 | 525 | AM_RANGE(0x900000, 0x900001) AM_WRITE(snowbros_irq3_ack_w) /* IRQ 3 acknowledge */ |
| r14896 | r14897 | |
| 538 | 538 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2") |
| 539 | 539 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM") |
| 540 | 540 | |
| 541 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 541 | AM_RANGE(0x600000, 0x6001ff) AM_RAM_WRITE(paletteram | |
| 542 | 542 | AM_RANGE(0x700000, 0x701fff) AM_DEVREADWRITE_LEGACY("pandora", pandora_spriteram_LSB_r, pandora_spriteram_LSB_w) |
| 543 | 543 | AM_RANGE(0x800000, 0x800001) AM_WRITE(snowbros_irq4_ack_w) /* IRQ 4 acknowledge */ |
| 544 | 544 | AM_RANGE(0x900000, 0x900001) AM_WRITE(snowbros_irq3_ack_w) /* IRQ 3 acknowledge */ |
| r14896 | r14897 | |
|---|---|---|
| 379 | 379 | segas1x_state *state = machine.driver_data<segas1x_state>(); |
| 380 | 380 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 381 | 381 | |
| 382 | state->soundlatch_w(*space, 0, param); | |
| 382 | state->soundlatch_byte_w(*space, 0, param); | |
| 383 | 383 | device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, ASSERT_LINE); |
| 384 | 384 | } |
| 385 | 385 | |
| r14896 | r14897 | |
| 403 | 403 | segas1x_state *state = space->machine().driver_data<segas1x_state>(); |
| 404 | 404 | |
| 405 | 405 | device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 406 | return state->soundlatch_r(*space, offset); | |
| 406 | return state->soundlatch_byte_r(*space, offset); | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 |
| r14896 | r14897 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | READ8_MEMBER(nbmj9195_state::nbmj9195_sound_r) |
| 49 | 49 | { |
| 50 | return soundlatch_r(space, 0); | |
| 50 | return soundlatch_byte_r(space, 0); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | WRITE8_MEMBER(nbmj9195_state::nbmj9195_sound_w) |
| 54 | 54 | { |
| 55 | soundlatch_w(space, 0, data); | |
| 55 | soundlatch_byte_w(space, 0, data); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | WRITE8_MEMBER(nbmj9195_state::nbmj9195_soundclr_w) |
| 59 | 59 | { |
| 60 | soundlatch_clear_w(space, 0, 0); | |
| 60 | soundlatch_clear_byte_w(space, 0, 0); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static void nbmj9195_outcoin_flag_w(address_space *space, int data) |
| r14896 | r14897 | |
|---|---|---|
| 373 | 373 | |
| 374 | 374 | WRITE16_MEMBER(sslam_state::powerbls_sound_w) |
| 375 | 375 | { |
| 376 | soundlatch_w(space, 0, data & 0xff); | |
| 376 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 377 | 377 | cputag_set_input_line(machine(), "audiocpu", MCS51_INT1_LINE, HOLD_LINE); |
| 378 | 378 | } |
| 379 | 379 | |
| r14896 | r14897 | |
| 432 | 432 | UINT8 data = 0; |
| 433 | 433 | |
| 434 | 434 | if ((m_oki_control & 0x38) == 0x30) { |
| 435 | data = soundlatch_r(space,0); | |
| 435 | data = soundlatch_byte_r(space,0); | |
| 436 | 436 | } |
| 437 | 437 | else if ((m_oki_control & 0x38) == 0x28) { |
| 438 | 438 | data = (machine().device<okim6295_device>("oki")->read(space,0) & 0x0f); |
| r14896 | r14897 | |
|---|---|---|
| 89 | 89 | AM_RANGE(0x3005, 0x3005) AM_READ_PORT("DSW1") |
| 90 | 90 | AM_RANGE(0x3006, 0x3006) AM_READ_PORT("DSW2") |
| 91 | 91 | AM_RANGE(0x3008, 0x3008) AM_WRITENOP // might be Y scroll, but the game always sets it to 0 |
| 92 | AM_RANGE(0x3010, 0x3010) AM_WRITE(soundlatch_w) | |
| 92 | AM_RANGE(0x3010, 0x3010) AM_WRITE(soundlatch_byte_w) | |
| 93 | 93 | AM_RANGE(0x3018, 0x3018) AM_WRITE(sonson_flipscreen_w) |
| 94 | 94 | AM_RANGE(0x3019, 0x3019) AM_WRITE(sonson_sh_irqtrigger_w) |
| 95 | 95 | AM_RANGE(0x301e, 0x301e) AM_WRITE(sonson_coin2_counter_w) |
| r14896 | r14897 | |
| 101 | 101 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 102 | 102 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 103 | 103 | AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 104 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 104 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 105 | 105 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 106 | 106 | ADDRESS_MAP_END |
| 107 | 107 |
| r14896 | r14897 | |
|---|---|---|
| 41 | 41 | AM_RANGE(0x0200, 0x0207) AM_WRITE(hcastle_pf2_control_w) |
| 42 | 42 | AM_RANGE(0x0220, 0x023f) AM_RAM /* rowscroll? */ |
| 43 | 43 | AM_RANGE(0x0400, 0x0400) AM_WRITE(hcastle_bankswitch_w) |
| 44 | AM_RANGE(0x0404, 0x0404) AM_WRITE(soundlatch_w) | |
| 44 | AM_RANGE(0x0404, 0x0404) AM_WRITE(soundlatch_byte_w) | |
| 45 | 45 | AM_RANGE(0x0408, 0x0408) AM_WRITE(hcastle_soundirq_w) |
| 46 | 46 | AM_RANGE(0x040c, 0x040c) AM_WRITE(watchdog_reset_w) |
| 47 | 47 | AM_RANGE(0x0410, 0x0410) AM_READ_PORT("SYSTEM") AM_WRITE(hcastle_coin_w) |
| r14896 | r14897 | |
| 81 | 81 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) |
| 82 | 82 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("konami1", k007232_r, k007232_w) |
| 83 | 83 | AM_RANGE(0xc000, 0xc000) AM_DEVWRITE_LEGACY("konami1", sound_bank_w) /* 7232 bankswitch */ |
| 84 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) | |
| 84 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) | |
| 85 | 85 | ADDRESS_MAP_END |
| 86 | 86 | |
| 87 | 87 | /*****************************************************************************/ |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, copsnrob_state ) |
| 104 | 104 | ADDRESS_MAP_GLOBAL_MASK(0x1fff) |
| 105 | 105 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 106 | AM_RANGE(0x0500, 0x0507) AM_WRITE | |
| 106 | AM_RANGE(0x0500, 0x0507) AM_WRITE | |
| 107 | 107 | AM_RANGE(0x0600, 0x0600) AM_WRITEONLY AM_BASE(m_trucky) |
| 108 | 108 | AM_RANGE(0x0700, 0x07ff) AM_WRITEONLY AM_BASE(m_truckram) |
| 109 | 109 | AM_RANGE(0x0800, 0x08ff) AM_RAM AM_BASE(m_bulletsram) |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | public: |
| 35 | 35 | cntsteer_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | : driver_device(mconfig, type, tag) { } | |
| 36 | : driver_device(mconfig, type, tag) , | |
| 37 | m_spriteram(*this, "spriteram"), | |
| 38 | m_videoram(*this, "videoram"), | |
| 39 | m_colorram(*this, "colorram"), | |
| 40 | m_videoram2(*this, "videoram2"){ } | |
| 37 | 41 | |
| 38 | 42 | /* memory pointers */ |
| 39 | UINT8 * m_videoram; | |
| 40 | UINT8 * m_videoram2; | |
| 41 | UINT8 * m_colorram; | |
| 42 | UINT8 * m_spriteram; | |
| 43 | required_shared_ptr<UINT8> m_spriteram; | |
| 44 | required_shared_ptr<UINT8> m_videoram; | |
| 45 | required_shared_ptr<UINT8> m_colorram; | |
| 46 | required_shared_ptr<UINT8> m_videoram2; | |
| 43 | 47 | |
| 44 | 48 | /* video-related */ |
| 45 | 49 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 108 | 112 | static TILE_GET_INFO( get_bg_tile_info ) |
| 109 | 113 | { |
| 110 | 114 | cntsteer_state *state = machine.driver_data<cntsteer_state>(); |
| 111 | int code = state->m_videoram2[tile_index]; | |
| 115 | int code = state->m_videoram2.target()[tile_index]; | |
| 112 | 116 | |
| 113 | 117 | SET_TILE_INFO(2, code + state->m_bg_bank, state->m_bg_color_bank, 0); |
| 114 | 118 | } |
| r14896 | r14897 | |
| 116 | 120 | static TILE_GET_INFO( get_fg_tile_info ) |
| 117 | 121 | { |
| 118 | 122 | cntsteer_state *state = machine.driver_data<cntsteer_state>(); |
| 119 | int code = state->m_videoram[tile_index]; | |
| 120 | int attr = state->m_colorram[tile_index]; | |
| 123 | int code = state->m_videoram.target()[tile_index]; | |
| 124 | int attr = state->m_colorram.target()[tile_index]; | |
| 121 | 125 | |
| 122 | 126 | code |= (attr & 0x01) << 8; |
| 123 | 127 | |
| r14896 | r14897 | |
| 168 | 172 | { |
| 169 | 173 | int multi, fx, fy, sx, sy, code, color; |
| 170 | 174 | |
| 171 | if ((state->m_spriteram[offs + 1] & 1) == 1) | |
| 175 | if ((state->m_spriteram.target()[offs + 1] & 1) == 1) | |
| 172 | 176 | continue; |
| 173 | 177 | |
| 174 | code = state->m_spriteram[offs + 3] + ((state->m_spriteram[offs + 1] & 0xc0) << 2); | |
| 175 | sx = (state->m_spriteram[offs + 2]); | |
| 176 | sy = 0xf0 - state->m_spriteram[offs]; | |
| 177 | color = 0x10 + ((state->m_spriteram[offs + 1] & 0x20) >> 4) + ((state->m_spriteram[offs + 1] & 0x8)>>3); | |
| 178 | code = state->m_spriteram.target()[offs + 3] + ((state->m_spriteram.target()[offs + 1] & 0xc0) << 2); | |
| 179 | sx = (state->m_spriteram.target()[offs + 2]); | |
| 180 | sy = 0xf0 - state->m_spriteram.target()[offs]; | |
| 181 | color = 0x10 + ((state->m_spriteram.target()[offs + 1] & 0x20) >> 4) + ((state->m_spriteram.target()[offs + 1] & 0x8)>>3); | |
| 178 | 182 | |
| 179 | fx = !(state->m_spriteram[offs + 1] & 0x04); | |
| 180 | fy = (state->m_spriteram[offs + 1] & 0x02); | |
| 183 | fx = !(state->m_spriteram.target()[offs + 1] & 0x04); | |
| 184 | fy = (state->m_spriteram.target()[offs + 1] & 0x02); | |
| 181 | 185 | |
| 182 | multi = state->m_spriteram[offs + 1] & 0x10; | |
| 186 | multi = state->m_spriteram.target()[offs + 1] & 0x10; | |
| 183 | 187 | |
| 184 | 188 | if (state->m_flipscreen) |
| 185 | 189 | { |
| r14896 | r14897 | |
| 226 | 230 | { |
| 227 | 231 | int multi, fx, fy, sx, sy, code, color; |
| 228 | 232 | |
| 229 | if ((state->m_spriteram[offs + 0] & 1) == 0) | |
| 233 | if ((state->m_spriteram.target()[offs + 0] & 1) == 0) | |
| 230 | 234 | continue; |
| 231 | 235 | |
| 232 | code = state->m_spriteram[offs + 1] + ((state->m_spriteram[offs + 0x80] & 0x03) << 8); | |
| 233 | sx = 0x100 - state->m_spriteram[offs + 3]; | |
| 234 | sy = 0x100 - state->m_spriteram[offs + 2]; | |
| 235 | color = 0x10 + ((state->m_spriteram[offs + 0x80] & 0x70) >> 4); | |
| 236 | code = state->m_spriteram.target()[offs + 1] + ((state->m_spriteram.target()[offs + 0x80] & 0x03) << 8); | |
| 237 | sx = 0x100 - state->m_spriteram.target()[offs + 3]; | |
| 238 | sy = 0x100 - state->m_spriteram.target()[offs + 2]; | |
| 239 | color = 0x10 + ((state->m_spriteram.target()[offs + 0x80] & 0x70) >> 4); | |
| 236 | 240 | |
| 237 | fx = (state->m_spriteram[offs + 0] & 0x04); | |
| 238 | fy = (state->m_spriteram[offs + 0] & 0x02); | |
| 241 | fx = (state->m_spriteram.target()[offs + 0] & 0x04); | |
| 242 | fy = (state->m_spriteram.target()[offs + 0] & 0x02); | |
| 239 | 243 | |
| 240 | multi = state->m_spriteram[offs + 0] & 0x10; | |
| 244 | multi = state->m_spriteram.target()[offs + 0] & 0x10; | |
| 241 | 245 | |
| 242 | 246 | if (state->m_flipscreen) |
| 243 | 247 | { |
| r14896 | r14897 | |
| 395 | 399 | m_bg_tilemap->mark_all_dirty(); |
| 396 | 400 | break; |
| 397 | 401 | case 3: m_rotation_sign = (data & 1); |
| 398 | flip_screen_set( | |
| 402 | flip_screen_set( | |
| 399 | 403 | m_scrolly_hi = (data & 0x30) << 4; |
| 400 | 404 | m_scrollx_hi = (data & 0xc0) << 2; |
| 401 | 405 | break; |
| r14896 | r14897 | |
| 429 | 433 | |
| 430 | 434 | WRITE8_MEMBER(cntsteer_state::cntsteer_foreground_vram_w) |
| 431 | 435 | { |
| 432 | m_videoram[offset] = data; | |
| 436 | m_videoram.target()[offset] = data; | |
| 433 | 437 | m_fg_tilemap->mark_tile_dirty(offset); |
| 434 | 438 | } |
| 435 | 439 | |
| 436 | 440 | WRITE8_MEMBER(cntsteer_state::cntsteer_foreground_attr_w) |
| 437 | 441 | { |
| 438 | m_colorram[offset] = data; | |
| 442 | m_colorram.target()[offset] = data; | |
| 439 | 443 | m_fg_tilemap->mark_tile_dirty(offset); |
| 440 | 444 | } |
| 441 | 445 | |
| 442 | 446 | WRITE8_MEMBER(cntsteer_state::cntsteer_background_w) |
| 443 | 447 | { |
| 444 | m_videoram2[offset] = data; | |
| 448 | m_videoram2.target()[offset] = data; | |
| 445 | 449 | m_bg_tilemap->mark_tile_dirty(offset); |
| 446 | 450 | } |
| 447 | 451 | |
| r14896 | r14897 | |
| 458 | 462 | |
| 459 | 463 | WRITE8_MEMBER(cntsteer_state::cntsteer_sound_w) |
| 460 | 464 | { |
| 461 | soundlatch_w(space, 0, data); | |
| 465 | soundlatch_byte_w(space, 0, data); | |
| 462 | 466 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 463 | 467 | } |
| 464 | 468 | |
| r14896 | r14897 | |
| 529 | 533 | |
| 530 | 534 | static ADDRESS_MAP_START( gekitsui_cpu1_map, AS_PROGRAM, 8, cntsteer_state ) |
| 531 | 535 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 532 | AM_RANGE(0x1000, 0x11ff) AM_RAM AM_ | |
| 536 | AM_RANGE(0x1000, 0x11ff) AM_RAM AM_ | |
| 533 | 537 | AM_RANGE(0x1200, 0x1fff) AM_RAM |
| 534 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(cntsteer_foreground_vram_w) AM_BASE(m_videoram) | |
| 535 | AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(cntsteer_foreground_attr_w) AM_BASE(m_colorram) | |
| 538 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(cntsteer_foreground_vram_w) AM_SHARE("videoram") | |
| 539 | AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(cntsteer_foreground_attr_w) AM_SHARE("colorram") | |
| 536 | 540 | AM_RANGE(0x3000, 0x3003) AM_WRITE(zerotrgt_ctrl_w) |
| 537 | 541 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 538 | 542 | ADDRESS_MAP_END |
| 539 | 543 | |
| 540 | 544 | static ADDRESS_MAP_START( gekitsui_cpu2_map, AS_PROGRAM, 8, cntsteer_state ) |
| 541 | 545 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 542 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_ | |
| 546 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_ | |
| 543 | 547 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW0") |
| 544 | 548 | AM_RANGE(0x3001, 0x3001) AM_READ_PORT("P2") |
| 545 | 549 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 552 | 556 | |
| 553 | 557 | static ADDRESS_MAP_START( cntsteer_cpu1_map, AS_PROGRAM, 8, cntsteer_state ) |
| 554 | 558 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 555 | AM_RANGE(0x1000, 0x11ff) AM_RAM AM_BASE(m_spriteram) | |
| 556 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(cntsteer_foreground_vram_w) AM_BASE(m_videoram) | |
| 557 | AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(cntsteer_foreground_attr_w) AM_BASE(m_colorram) | |
| 559 | AM_RANGE(0x1000, 0x11ff) AM_RAM AM_SHARE("spriteram") | |
| 560 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(cntsteer_foreground_vram_w) AM_SHARE("videoram") | |
| 561 | AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(cntsteer_foreground_attr_w) AM_SHARE("colorram") | |
| 558 | 562 | AM_RANGE(0x3000, 0x3000) AM_WRITE(cntsteer_sub_nmi_w) |
| 559 | 563 | AM_RANGE(0x3001, 0x3001) AM_WRITE(cntsteer_sub_irq_w) |
| 560 | 564 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
| 562 | 566 | |
| 563 | 567 | static ADDRESS_MAP_START( cntsteer_cpu2_map, AS_PROGRAM, 8, cntsteer_state ) |
| 564 | 568 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 565 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_ | |
| 569 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_ | |
| 566 | 570 | AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("share3") |
| 567 | 571 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW0") |
| 568 | 572 | AM_RANGE(0x3001, 0x3001) AM_READ(cntsteer_adx_r) |
| r14896 | r14897 | |
| 597 | 601 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 598 | 602 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 599 | 603 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| 600 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 604 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 601 | 605 | AM_RANGE(0xd000, 0xd000) AM_WRITE(nmimask_w) |
| 602 | 606 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 603 | 607 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | WRITE16_MEMBER(csplayh5_state::csplayh5_sound_w) |
| 111 | 111 | { |
| 112 | soundlatch_w(space, 0, ((data >> 8) & 0xff)); | |
| 112 | soundlatch_byte_w(space, 0, ((data >> 8) & 0xff)); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| r14896 | r14897 | |
| 174 | 174 | |
| 175 | 175 | READ8_MEMBER(csplayh5_state::csplayh5_sound_r) |
| 176 | 176 | { |
| 177 | return soundlatch_r(space, 0); | |
| 177 | return soundlatch_byte_r(space, 0); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | WRITE8_MEMBER(csplayh5_state::csplayh5_soundclr_w) |
| 181 | 181 | { |
| 182 | soundlatch_clear_w(space, 0, 0); | |
| 182 | soundlatch_clear_byte_w(space, 0, 0); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | READ8_MEMBER(csplayh5_state::tmpz84c011_pio_r) |
| r14896 | r14897 | |
|---|---|---|
| 23 | 23 | { |
| 24 | 24 | public: |
| 25 | 25 | nexus3d_state(const machine_config &mconfig, device_type type, const char *tag) |
| 26 | : driver_device(mconfig, type, tag) { } | |
| 26 | : driver_device(mconfig, type, tag) , | |
| 27 | m_mainram(*this, "mainram"){ } | |
| 27 | 28 | |
| 28 | UINT32 | |
| 29 | required_shared_ptr<UINT32> m_mainram; | |
| 29 | 30 | |
| 30 | 31 | // |
| 31 | 32 | UINT8 m_last_flash_cmd; |
| r14896 | r14897 | |
| 43 | 44 | // DECLARE_READ32_MEMBER(nexus3d_unk3_r); |
| 44 | 45 | // DECLARE_WRITE32_MEMBER(nexus3d_unk2_w); |
| 45 | 46 | // DECLARE_WRITE32_MEMBER(nexus3d_unk3_w); |
| 47 | DECLARE_READ8_MEMBER(n3d_flash_r); | |
| 48 | DECLARE_WRITE8_MEMBER(n3d_flash_cmd_w); | |
| 49 | DECLARE_WRITE8_MEMBER(n3d_flash_addr_w); | |
| 46 | 50 | }; |
| 47 | 51 | |
| 48 | 52 | |
| r14896 | r14897 | |
| 63 | 67 | state->m_flash_page_addr = 0; |
| 64 | 68 | } |
| 65 | 69 | |
| 66 | READ8_ | |
| 70 | READ8_M | |
| 67 | 71 | { |
| 68 | nexus3d_state *state = space->machine().driver_data<nexus3d_state>(); | |
| 69 | 72 | |
| 70 | if ( | |
| 73 | if ( | |
| 71 | 74 | |
| 72 | if ( | |
| 75 | if ( | |
| 73 | 76 | { |
| 74 | UINT8 retdat = | |
| 77 | UINT8 retdat = | |
| 75 | 78 | |
| 76 | //logerror("n3d_flash_r %02x %04x\n", offset, | |
| 79 | //logerror("n3d_flash_r %02x %04x\n", offset, | |
| 77 | 80 | |
| 78 | | |
| 81 | | |
| 79 | 82 | return retdat; |
| 80 | 83 | } |
| 81 | 84 | |
| r14896 | r14897 | |
| 86 | 89 | } |
| 87 | 90 | |
| 88 | 91 | |
| 89 | WRITE8_ | |
| 92 | WRITE8_M | |
| 90 | 93 | { |
| 91 | nexus3d_state *state = space->machine().driver_data<nexus3d_state>(); | |
| 92 | 94 | logerror("n3d_flash_cmd_w %02x %02x\n", offset, data); |
| 93 | | |
| 95 | | |
| 94 | 96 | |
| 95 | 97 | if (data==0x00) |
| 96 | 98 | { |
| 97 | memcpy( | |
| 99 | memcpy( | |
| 98 | 100 | |
| 99 | 101 | } |
| 100 | 102 | |
| 101 | 103 | } |
| 102 | 104 | |
| 103 | WRITE8_ | |
| 105 | WRITE8_M | |
| 104 | 106 | { |
| 105 | nexus3d_state *state = space->machine().driver_data<nexus3d_state>(); | |
| 106 | 107 | // logerror("n3d_flash_addr_w %02x %02x\n", offset, data); |
| 107 | 108 | |
| 108 | | |
| 109 | | |
| 109 | 110 | |
| 110 | if (state->m_flash_addr_seq==3) | |
| 111 | state->m_flash_addr = (state->m_flash_addr & 0xffff00) | data; | |
| 111 | if (m_flash_addr_seq==3) | |
| 112 | m_flash_addr = (m_flash_addr & 0xffff00) | data; | |
| 112 | 113 | |
| 113 | if (state->m_flash_addr_seq==4) | |
| 114 | state->m_flash_addr = (state->m_flash_addr & 0xff00ff) | data << 8; | |
| 114 | if (m_flash_addr_seq==4) | |
| 115 | m_flash_addr = (m_flash_addr & 0xff00ff) | data << 8; | |
| 115 | 116 | |
| 116 | if (state->m_flash_addr_seq==5) | |
| 117 | state->m_flash_addr = (state->m_flash_addr & 0x00ffff) | data << 16; | |
| 117 | if (m_flash_addr_seq==5) | |
| 118 | m_flash_addr = (m_flash_addr & 0x00ffff) | data << 16; | |
| 118 | 119 | |
| 119 | if ( | |
| 120 | if ( | |
| 120 | 121 | { |
| 121 | state->m_flash_addr_seq = 0; | |
| 122 | state->m_flash_page_addr = 0; | |
| 123 | logerror("set flash block to %08x\n", state->m_flash_addr); | |
| 122 | m_flash_addr_seq = 0; | |
| 123 | m_flash_page_addr = 0; | |
| 124 | logerror("set flash block to %08x\n", m_flash_addr); | |
| 124 | 125 | } |
| 125 | 126 | |
| 126 | 127 | } |
| r14896 | r14897 | |
| 151 | 152 | //} |
| 152 | 153 | |
| 153 | 154 | static ADDRESS_MAP_START( nexus3d_map, AS_PROGRAM, 32, nexus3d_state ) |
| 154 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 155 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 155 | 156 | |
| 156 | 157 | AM_RANGE(0x00400000, 0x01ffffff) AM_RAM // ?? uploads various data, + pointers to data in the 0x01ffxxxx range, might be video system related |
| 157 | 158 | |
| 158 | 159 | // flash |
| 159 | AM_RANGE(0x9C000000, 0x9C000003) AM_WRITE8_LEGACY(n3d_flash_r, 0xffffffff) | |
| 160 | AM_RANGE(0x9C000010, 0x9C000013) AM_WRITE8_LEGACY(n3d_flash_cmd_w, 0xffffffff) | |
| 161 | AM_RANGE(0x9C000018, 0x9C00001b) AM_WRITE8_LEGACY(n3d_flash_addr_w, 0xffffffff) | |
| 160 | AM_RANGE(0x9C000000, 0x9C000003) AM_READ8(n3d_flash_r, 0xffffffff) | |
| 161 | AM_RANGE(0x9C000010, 0x9C000013) AM_WRITE8(n3d_flash_cmd_w, 0xffffffff) | |
| 162 | AM_RANGE(0x9C000018, 0x9C00001b) AM_WRITE8(n3d_flash_addr_w, 0xffffffff) | |
| 162 | 163 | |
| 163 | 164 | // lots of accesses in this range |
| 164 | 165 | // AM_RANGE(0xC0000F44, 0xC0000F47) AM_READWRITE(nexus3d_unk2_r, nexus3d_unk2_w ) // often |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | if (data & (1 << i)) |
| 43 | 43 | code |= 0x80 >> i; |
| 44 | 44 | |
| 45 | soundlatch_w(space, offset, code); | |
| 45 | soundlatch_byte_w(space, offset, code); | |
| 46 | 46 | if (m_sound_nmi_enable) |
| 47 | 47 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 48 | 48 | } |
| r14896 | r14897 | |
| 133 | 133 | AM_RANGE(0x4401, 0x4401) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 134 | 134 | AM_RANGE(0x4402, 0x4403) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 135 | 135 | AM_RANGE(0x4403, 0x4403) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| 136 | AM_RANGE(0x4800, 0x4800) AM_READ(soundlatch_r) | |
| 136 | AM_RANGE(0x4800, 0x4800) AM_READ(soundlatch_byte_r) | |
| 137 | 137 | AM_RANGE(0x4802, 0x4802) AM_READWRITE(bking_sndnmi_disable_r, bking_sndnmi_enable_w) |
| 138 | 138 | AM_RANGE(0xe000, 0xefff) AM_ROM /* Space for diagnostic ROM */ |
| 139 | 139 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | public: |
| 23 | 23 | skeetsht_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | : driver_device(mconfig, type, tag) { } | |
| 24 | : driver_device(mconfig, type, tag) , | |
| 25 | m_tms_vram(*this, "tms_vram"){ } | |
| 25 | 26 | |
| 26 | UINT16 | |
| 27 | required_shared_ptr<UINT16> | |
| 27 | 28 | UINT8 m_porta_latch; |
| 28 | 29 | UINT8 m_ay_sel; |
| 29 | 30 | UINT8 m_lastdataw; |
| r14896 | r14897 | |
| 69 | 70 | { |
| 70 | 71 | skeetsht_state *state = screen.machine().driver_data<skeetsht_state>(); |
| 71 | 72 | const rgb_t *const pens = tlc34076_get_pens(screen.machine().device("tlc34076")); |
| 72 | UINT16 *vram = &state->m_tms_vram[(params->rowaddr << 8) & 0x3ff00]; | |
| 73 | UINT16 *vram = &state->m_tms_vram.target()[(params->rowaddr << 8) & 0x3ff00]; | |
| 73 | 74 | UINT32 *dest = &bitmap.pix32(scanline); |
| 74 | 75 | int coladdr = params->coladdr; |
| 75 | 76 | int x; |
| r14896 | r14897 | |
| 191 | 192 | |
| 192 | 193 | static ADDRESS_MAP_START( tms_program_map, AS_PROGRAM, 16, skeetsht_state ) |
| 193 | 194 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w) |
| 194 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 195 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 195 | 196 | AM_RANGE(0x00440000, 0x004fffff) AM_READWRITE(ramdac_r, ramdac_w) |
| 196 | 197 | AM_RANGE(0xff800000, 0xffbfffff) AM_ROM AM_MIRROR(0x00400000) AM_REGION("tms", 0) |
| 197 | 198 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | { |
| 31 | 31 | public: |
| 32 | 32 | dblewing_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | : driver_device(mconfig, type, tag) { } | |
| 33 | : driver_device(mconfig, type, tag) , | |
| 34 | m_pf1_rowscroll(*this, "pf1_rowscroll"), | |
| 35 | m_pf2_rowscroll(*this, "pf2_rowscroll"), | |
| 36 | m_spriteram(*this, "spriteram"){ } | |
| 34 | 37 | |
| 35 | 38 | /* memory pointers */ |
| 36 | UINT16 * m_pf1_rowscroll; | |
| 37 | UINT16 * m_pf2_rowscroll; | |
| 38 | UINT16 * m_spriteram; | |
| 39 | size_t m_spriteram_size; | |
| 39 | required_shared_ptr<UINT16> m_pf1_rowscroll; | |
| 40 | required_shared_ptr<UINT16> m_pf2_rowscroll; | |
| 41 | required_shared_ptr<UINT16> m_spriteram; | |
| 40 | 42 | |
| 41 | 43 | /* protection */ |
| 42 | 44 | UINT16 m_008_data; |
| r14896 | r14897 | |
| 101 | 103 | dblewing_state *state = screen.machine().driver_data<dblewing_state>(); |
| 102 | 104 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 103 | 105 | |
| 104 | flip_screen_set(screen.machine(), BIT(flip, 7)); | |
| 105 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); | |
| 106 | state->flip_screen_set(BIT(flip, 7)); | |
| 107 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll.target()); | |
| 106 | 108 | |
| 107 | 109 | bitmap.fill(0, cliprect); /* not Confirmed */ |
| 108 | 110 | screen.machine().priority_bitmap.fill(0); |
| r14896 | r14897 | |
| 240 | 242 | //printf("%04x\n",m_280_data); |
| 241 | 243 | return; |
| 242 | 244 | case 0x380: // sound write |
| 243 | soundlatch_w(space, 0, data & 0xff); | |
| 245 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 244 | 246 | m_sound_irq |= 0x02; |
| 245 | 247 | device_set_input_line(m_audiocpu, 0, (m_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); |
| 246 | 248 | return; |
| r14896 | r14897 | |
| 310 | 312 | |
| 311 | 313 | AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 312 | 314 | AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 313 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_BASE(m_pf1_rowscroll) | |
| 314 | AM_RANGE(0x106000, 0x106fff) AM_RAM AM_BASE(m_pf2_rowscroll) | |
| 315 | AM_RANGE(0x104000, 0x104fff) AM_RAM AM_SHARE("pf1_rowscroll") | |
| 316 | AM_RANGE(0x106000, 0x106fff) AM_RAM AM_SHARE("pf2_rowscroll") | |
| 315 | 317 | |
| 316 | 318 | /* protection */ |
| 317 | 319 | // AM_RANGE(0x280104, 0x280105) AM_WRITENOP // ?? |
| r14896 | r14897 | |
| 328 | 330 | AM_RANGE(0x284000, 0x284001) AM_RAM |
| 329 | 331 | AM_RANGE(0x288000, 0x288001) AM_RAM |
| 330 | 332 | AM_RANGE(0x28c000, 0x28c00f) AM_RAM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w) |
| 331 | AM_RANGE(0x300000, 0x3007ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 332 | AM_RANGE(0x320000, 0x3207ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram") | |
| 333 | AM_RANGE(0x300000, 0x3007ff) AM_RAM AM_SHARE("spriteram") | |
| 334 | AM_RANGE(0x320000, 0x3207ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram") | |
| 333 | 335 | AM_RANGE(0xff0000, 0xff3fff) AM_MIRROR(0xc000) AM_RAM |
| 334 | 336 | ADDRESS_MAP_END |
| 335 | 337 | |
| r14896 | r14897 | |
| 347 | 349 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 348 | 350 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_status_port_r,ym2151_w) |
| 349 | 351 | AM_RANGE(0xb000, 0xb000) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 350 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) | |
| 352 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) | |
| 351 | 353 | AM_RANGE(0xd000, 0xd000) AM_READ(irq_latch_r) //timing? sound latch? |
| 352 | 354 | AM_RANGE(0xf000, 0xf000) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 353 | 355 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 66 | 66 | AM_RANGE(0x200000, 0x20000f) AM_READWRITE(io_r, io_w) /* TC0220IOC ? */ |
| 67 | 67 | AM_RANGE(0x300000, 0x300003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2203_r, ym2203_w, 0x00ff) |
| 68 | 68 | AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE_LEGACY("tc0080vco", tc0080vco_word_r, tc0080vco_word_w) |
| 69 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 69 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 70 | 70 | ADDRESS_MAP_END |
| 71 | 71 | |
| 72 | 72 | static INPUT_PORTS_START( parentj ) |
| r14896 | r14897 | |
|---|---|---|
| 91 | 91 | { |
| 92 | 92 | public: |
| 93 | 93 | shougi_state(const machine_config &mconfig, device_type type, const char *tag) |
| 94 | : driver_device(mconfig, type, tag) { } | |
| 94 | : driver_device(mconfig, type, tag) , | |
| 95 | m_videoram(*this, "videoram"){ } | |
| 95 | 96 | |
| 96 | UINT8 | |
| 97 | required_shared_ptr<UINT8> | |
| 97 | 98 | int m_nmi_enabled; |
| 98 | 99 | //UINT8 *m_cpu_sharedram; |
| 99 | 100 | //UINT8 m_cpu_sharedram_control_val; |
| r14896 | r14897 | |
| 185 | 186 | //if (flipscreen[0]) sx = 31 - sx; |
| 186 | 187 | //if (flipscreen[1]) sy = 31 - sy; |
| 187 | 188 | |
| 188 | data1 = state->m_videoram[offs]; /* color */ | |
| 189 | data2 = state->m_videoram[0x4000 + offs]; /* pixel data */ | |
| 189 | data1 = state->m_videoram.target()[offs]; /* color */ | |
| 190 | data2 = state->m_videoram.target()[0x4000 + offs]; /* pixel data */ | |
| 190 | 191 | |
| 191 | 192 | for (x=0; x<4; x++) /*4 pixels per byte (2 bitplanes in 2 nibbles: 1st=bits 7-4, 2nd=bits 3-0)*/ |
| 192 | 193 | { |
| r14896 | r14897 | |
| 308 | 309 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("share1") /* 2114 x 2 (0x400 x 4bit each) */ |
| 309 | 310 | AM_RANGE(0x7800, 0x7bff) AM_RAM AM_SHARE("share2") /* 2114 x 2 (0x400 x 4bit each) */ |
| 310 | 311 | |
| 311 | AM_RANGE(0x8000, 0xffff) AM_RAM AM_ | |
| 312 | AM_RANGE(0x8000, 0xffff) AM_RAM AM_ | |
| 312 | 313 | ADDRESS_MAP_END |
| 313 | 314 | |
| 314 | 315 | /* sub */ |
| r14896 | r14897 | |
|---|---|---|
| 268 | 268 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 269 | 269 | AM_RANGE(0x8000, 0x9fff) AM_RAM |
| 270 | 270 | AM_RANGE(0xa000, 0xbfff) AM_ROMBANK("bank1") |
| 271 | AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 271 | AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 272 | 272 | AM_RANGE(0xd000, 0xffff) AM_READWRITE(fromance_videoram_r, fromance_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 273 | 273 | ADDRESS_MAP_END |
| 274 | 274 |
| r14896 | r14897 | |
|---|---|---|
| 171 | 171 | m_vreg = m_io_reg[0]; |
| 172 | 172 | break; |
| 173 | 173 | |
| 174 | case 1: /* soundlatch_w */ | |
| 175 | soundlatch_w(space, 1, m_io_reg[1] & 0xff); | |
| 174 | case 1: /* soundlatch_byte_w */ | |
| 175 | soundlatch_byte_w(space, 1, m_io_reg[1] & 0xff); | |
| 176 | 176 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE ); |
| 177 | 177 | break; |
| 178 | 178 | |
| r14896 | r14897 | |
| 216 | 216 | AM_RANGE(0x100004, 0x100005) AM_READ_PORT("DSW") |
| 217 | 217 | AM_RANGE(0x100006, 0x100007) AM_READ_PORT("P3") |
| 218 | 218 | AM_RANGE(0x100000, 0x10000f) AM_WRITE(ddragon3_io_w) |
| 219 | AM_RANGE(0x140000, 0x1405ff) AM_RAM_WRITE(paletteram | |
| 219 | AM_RANGE(0x140000, 0x1405ff) AM_RAM_WRITE(paletteram | |
| 220 | 220 | AM_RANGE(0x180000, 0x180fff) AM_RAM AM_BASE(m_spriteram) |
| 221 | 221 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* working RAM */ |
| 222 | 222 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 227 | 227 | AM_RANGE(0x081000, 0x081fff) AM_RAM AM_BASE(m_spriteram) |
| 228 | 228 | AM_RANGE(0x082000, 0x0827ff) AM_RAM_WRITE(ddragon3_bg_videoram_w) AM_BASE(m_bg_videoram) /* Background (32x32 Tiles - 2 by per tile) */ |
| 229 | 229 | AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(ddragon3_scroll_w) |
| 230 | AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE(paletteram | |
| 230 | AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE(paletteram | |
| 231 | 231 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(ddragon3_io_w) |
| 232 | 232 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN0") |
| 233 | 233 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 243 | 243 | AM_RANGE(0x082000, 0x0827ff) AM_RAM_WRITE(ddragon3_bg_videoram_w) AM_BASE(m_bg_videoram) /* Background (32x32 Tiles - 2 by per tile) */ |
| 244 | 244 | AM_RANGE(0x082800, 0x082fff) AM_RAM |
| 245 | 245 | AM_RANGE(0x0c0000, 0x0c000f) AM_READWRITE(ddragon3_scroll_r, ddragon3_scroll_w) |
| 246 | AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE(paletteram | |
| 246 | AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE(paletteram | |
| 247 | 247 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(ddragon3_io_w) |
| 248 | 248 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN0") |
| 249 | 249 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 257 | 257 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 258 | 258 | AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w) |
| 259 | 259 | AM_RANGE(0xd800, 0xd800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 260 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 260 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 261 | 261 | AM_RANGE(0xe800, 0xe800) AM_DEVWRITE_LEGACY("oki", oki_bankswitch_w) |
| 262 | 262 | ADDRESS_MAP_END |
| 263 | 263 | |
| r14896 | r14897 | |
| 266 | 266 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 267 | 267 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_status_port_r, ym2151_w) |
| 268 | 268 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 269 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 269 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 270 | 270 | ADDRESS_MAP_END |
| 271 | 271 | |
| 272 | 272 | /************************************* |
| r14896 | r14897 | |
|---|---|---|
| 8 | 8 | { |
| 9 | 9 | public: |
| 10 | 10 | hotstuff_state(const machine_config &mconfig, device_type type, const char *tag) |
| 11 | : driver_device(mconfig, type, tag) { } | |
| 11 | : driver_device(mconfig, type, tag) , | |
| 12 | m_bitmapram(*this, "bitmapram"){ } | |
| 12 | 13 | |
| 13 | UINT16 | |
| 14 | required_shared_ptr<UINT16> m_bitmapram; | |
| 14 | 15 | struct |
| 15 | 16 | { |
| 16 | 17 | UINT8 index; |
| r14896 | r14897 | |
| 45 | 46 | |
| 46 | 47 | for (p=0;p<0x10;p++) |
| 47 | 48 | { |
| 48 | row_palette_data[p] = state->m_bitmapram[count+p]; | |
| 49 | row_palette_data[p] = state->m_bitmapram.target()[count+p]; | |
| 49 | 50 | |
| 50 | 51 | row_palette_data_as_rgb32_pen_data[p] = MAKE_RGB( (row_palette_data[p] & 0x0f00)>>4, (row_palette_data[p] & 0x00f0)>>0, (row_palette_data[p] & 0x000f)<<4 ); |
| 51 | 52 | |
| r14896 | r14897 | |
| 54 | 55 | for(x = 0; x < xxx; x++) |
| 55 | 56 | { |
| 56 | 57 | { |
| 57 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0xf000)>>12]; | |
| 58 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0xf000)>>12]; | |
| 58 | 59 | x++; |
| 59 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0x0f00)>>8]; | |
| 60 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0x0f00)>>8]; | |
| 60 | 61 | x++; |
| 61 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0x00f0)>>4]; | |
| 62 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0x00f0)>>4]; | |
| 62 | 63 | x++; |
| 63 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0x000f)>>0]; | |
| 64 | bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0x000f)>>0]; | |
| 64 | 65 | } |
| 65 | 66 | |
| 66 | 67 | count++; |
| r14896 | r14897 | |
| 114 | 115 | AM_RANGE(0x680000, 0x680001) AM_READWRITE8(ioboard_status_r,ioboard_data_w,0xff00) |
| 115 | 116 | AM_RANGE(0x680000, 0x680001) AM_READWRITE8(ioboard_unk_r,ioboard_reg_w,0x00ff) |
| 116 | 117 | |
| 117 | AM_RANGE(0x980000, 0x9bffff) AM_RAM AM_ | |
| 118 | AM_RANGE(0x980000, 0x9bffff) AM_RAM AM_ | |
| 118 | 119 | ADDRESS_MAP_END |
| 119 | 120 | |
| 120 | 121 | static INPUT_PORTS_START( hotstuff ) |
| r14896 | r14897 | |
|---|---|---|
| 232 | 232 | { |
| 233 | 233 | // printf("unk discoboy_port_03_w %02x\n", data); |
| 234 | 234 | // device_set_input_line(m_audiocpu, INPUT_LINE_NMI, HOLD_LINE); |
| 235 | soundlatch_w(space, 0, data); | |
| 235 | soundlatch_byte_w(space, 0, data); | |
| 236 | 236 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 237 | 237 | } |
| 238 | 238 | |
| r14896 | r14897 | |
| 349 | 349 | AM_RANGE(0xe400, 0xe400) AM_WRITE(yunsung8_adpcm_w) |
| 350 | 350 | AM_RANGE(0xec00, 0xec01) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 351 | 351 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 352 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 352 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 353 | 353 | ADDRESS_MAP_END |
| 354 | 354 | |
| 355 | 355 |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | public: |
| 94 | 94 | mediagx_state(const machine_config &mconfig, device_type type, const char *tag) |
| 95 | : driver_device(mconfig, type, tag) { } | |
| 95 | : driver_device(mconfig, type, tag) , | |
| 96 | m_main_ram(*this, "main_ram"), | |
| 97 | m_cga_ram(*this, "cga_ram"), | |
| 98 | m_bios_ram(*this, "bios_ram"), | |
| 99 | m_vram(*this, "vram"){ } | |
| 96 | 100 | |
| 97 | UINT32 *m_cga_ram; | |
| 98 | UINT32 *m_bios_ram; | |
| 99 | UINT32 *m_vram; | |
| 101 | required_shared_ptr<UINT32> m_main_ram; | |
| 102 | required_shared_ptr<UINT32> m_cga_ram; | |
| 103 | required_shared_ptr<UINT32> m_bios_ram; | |
| 104 | required_shared_ptr<UINT32> m_vram; | |
| 100 | 105 | UINT8 m_pal[768]; |
| 101 | 106 | |
| 102 | UINT32 *m_main_ram; | |
| 103 | 107 | |
| 104 | 108 | UINT32 m_disp_ctrl_reg[256/4]; |
| 105 | 109 | int m_frame_width; |
| r14896 | r14897 | |
| 149 | 153 | UINT32 m_speedup_hits[12]; |
| 150 | 154 | int m_speedup_count; |
| 151 | 155 | #endif |
| 156 | DECLARE_READ32_MEMBER(disp_ctrl_r); | |
| 157 | DECLARE_WRITE32_MEMBER(disp_ctrl_w); | |
| 158 | DECLARE_READ32_MEMBER(memory_ctrl_r); | |
| 159 | DECLARE_WRITE32_MEMBER(memory_ctrl_w); | |
| 160 | DECLARE_READ32_MEMBER(biu_ctrl_r); | |
| 161 | DECLARE_WRITE32_MEMBER(biu_ctrl_w); | |
| 162 | DECLARE_WRITE32_MEMBER(bios_ram_w); | |
| 163 | DECLARE_READ32_MEMBER(parallel_port_r); | |
| 164 | DECLARE_WRITE32_MEMBER(parallel_port_w); | |
| 165 | DECLARE_READ32_MEMBER(ad1847_r); | |
| 166 | DECLARE_WRITE32_MEMBER(ad1847_w); | |
| 167 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 168 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 169 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 170 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 152 | 171 | }; |
| 153 | 172 | |
| 154 | 173 | // Display controller registers |
| r14896 | r14897 | |
| 258 | 277 | |
| 259 | 278 | if (state->m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // 8-bit mode |
| 260 | 279 | { |
| 261 | UINT8 *framebuf = (UINT8*)&state->m_vram[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; | |
| 280 | UINT8 *framebuf = (UINT8*)&state->m_vram.target()[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; | |
| 262 | 281 | UINT8 *pal = state->m_pal; |
| 263 | 282 | |
| 264 | 283 | for (j=0; j < state->m_frame_height; j++) |
| r14896 | r14897 | |
| 278 | 297 | } |
| 279 | 298 | else // 16-bit |
| 280 | 299 | { |
| 281 | UINT16 *framebuf = (UINT16*)&state->m_vram[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; | |
| 300 | UINT16 *framebuf = (UINT16*)&state->m_vram.target()[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; | |
| 282 | 301 | |
| 283 | 302 | // RGB 5-6-5 mode |
| 284 | 303 | if ((state->m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x2) == 0) |
| r14896 | r14897 | |
| 324 | 343 | mediagx_state *state = machine.driver_data<mediagx_state>(); |
| 325 | 344 | int i, j; |
| 326 | 345 | const gfx_element *gfx = machine.gfx[0]; |
| 327 | UINT32 *cga = state->m_cga_ram; | |
| 346 | UINT32 *cga = state->m_cga_ram.target(); | |
| 328 | 347 | int index = 0; |
| 329 | 348 | |
| 330 | 349 | for (j=0; j < 25; j++) |
| r14896 | r14897 | |
| 357 | 376 | return 0; |
| 358 | 377 | } |
| 359 | 378 | |
| 360 | ||
| 379 | ||
| 361 | 380 | { |
| 362 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 363 | UINT32 r = state->m_disp_ctrl_reg[offset]; | |
| 381 | UINT32 r = m_disp_ctrl_reg[offset]; | |
| 364 | 382 | |
| 365 | 383 | switch (offset) |
| 366 | 384 | { |
| 367 | 385 | case DC_TIMING_CFG: |
| 368 | 386 | r |= 0x40000000; |
| 369 | 387 | |
| 370 | if ( | |
| 388 | if ( | |
| 371 | 389 | r &= ~0x40000000; |
| 372 | 390 | |
| 373 | 391 | #if SPEEDUP_HACKS |
| 374 | 392 | // wait for vblank speedup |
| 375 | device_spin_until_interrupt(&space | |
| 393 | device_spin_until_interrupt(&space. | |
| 376 | 394 | #endif |
| 377 | 395 | break; |
| 378 | 396 | } |
| r14896 | r14897 | |
| 380 | 398 | return r; |
| 381 | 399 | } |
| 382 | 400 | |
| 383 | ||
| 401 | ||
| 384 | 402 | { |
| 385 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 386 | 403 | |
| 387 | 404 | // printf("disp_ctrl_w %08X, %08X, %08X\n", data, offset*4, mem_mask); |
| 388 | COMBINE_DATA( | |
| 405 | COMBINE_DATA( | |
| 389 | 406 | } |
| 390 | 407 | |
| 391 | 408 | |
| r14896 | r14897 | |
| 422 | 439 | |
| 423 | 440 | |
| 424 | 441 | |
| 425 | ||
| 442 | ||
| 426 | 443 | { |
| 427 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 428 | 444 | |
| 429 | return | |
| 445 | return | |
| 430 | 446 | } |
| 431 | 447 | |
| 432 | ||
| 448 | ||
| 433 | 449 | { |
| 434 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 435 | 450 | |
| 436 | 451 | // printf("memory_ctrl_w %08X, %08X, %08X\n", data, offset*4, mem_mask); |
| 437 | 452 | if (offset == 0x20/4) |
| 438 | 453 | { |
| 439 | ramdac_device *ramdac = | |
| 454 | ramdac_device *ramdac = | |
| 440 | 455 | |
| 441 | if(( | |
| 456 | if(( | |
| 442 | 457 | { |
| 443 | 458 | // guess: crtc params? |
| 444 | 459 | // ... |
| 445 | 460 | } |
| 446 | else if(( | |
| 461 | else if(( | |
| 447 | 462 | { |
| 448 | state->m_pal_index = data; | |
| 449 | ramdac->index_w( *space, 0, data ); | |
| 463 | m_pal_index = data; | |
| 464 | ramdac->index_w( *&space, 0, data ); | |
| 450 | 465 | } |
| 451 | else if(( | |
| 466 | else if(( | |
| 452 | 467 | { |
| 453 | state->m_pal[state->m_pal_index] = data & 0xff; | |
| 454 | state->m_pal_index++; | |
| 455 | if (state->m_pal_index >= 768) | |
| 468 | m_pal[m_pal_index] = data & 0xff; | |
| 469 | m_pal_index++; | |
| 470 | if (m_pal_index >= 768) | |
| 456 | 471 | { |
| 457 | | |
| 472 | | |
| 458 | 473 | } |
| 459 | ramdac->pal_w( *space, 0, data ); | |
| 474 | ramdac->pal_w( *&space, 0, data ); | |
| 460 | 475 | } |
| 461 | 476 | } |
| 462 | 477 | else |
| 463 | 478 | { |
| 464 | COMBINE_DATA( | |
| 479 | COMBINE_DATA( | |
| 465 | 480 | } |
| 466 | 481 | } |
| 467 | 482 | |
| 468 | 483 | |
| 469 | 484 | |
| 470 | ||
| 485 | ||
| 471 | 486 | { |
| 472 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 473 | 487 | |
| 474 | 488 | if (offset == 0) |
| 475 | 489 | { |
| 476 | 490 | return 0xffffff; |
| 477 | 491 | } |
| 478 | return | |
| 492 | return | |
| 479 | 493 | } |
| 480 | 494 | |
| 481 | ||
| 495 | ||
| 482 | 496 | { |
| 483 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 484 | 497 | |
| 485 | 498 | //mame_printf_debug("biu_ctrl_w %08X, %08X, %08X\n", data, offset, mem_mask); |
| 486 | COMBINE_DATA( | |
| 499 | COMBINE_DATA( | |
| 487 | 500 | |
| 488 | 501 | if (offset == 3) // BC_XMAP_3 register |
| 489 | 502 | { |
| r14896 | r14897 | |
| 492 | 505 | } |
| 493 | 506 | |
| 494 | 507 | #ifdef UNUSED_FUNCTION |
| 495 | ||
| 508 | ||
| 496 | 509 | { |
| 497 | 510 | |
| 498 | 511 | } |
| r14896 | r14897 | |
| 552 | 565 | } |
| 553 | 566 | } |
| 554 | 567 | |
| 555 | ||
| 568 | ||
| 556 | 569 | { |
| 557 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 558 | 570 | UINT32 r = 0; |
| 559 | 571 | //static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" }; // but parallel_pointer takes values 0 -> 23 |
| 560 | 572 | |
| 561 | 573 | if (ACCESSING_BITS_8_15) |
| 562 | 574 | { |
| 563 | UINT8 nibble = | |
| 575 | UINT8 nibble = | |
| 564 | 576 | r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11); |
| 565 | logerror("%08X:parallel_port_r()\n", cpu_get_pc(&space | |
| 577 | logerror("%08X:parallel_port_r()\n", cpu_get_pc(&space. | |
| 566 | 578 | #if 0 |
| 567 | if ( | |
| 579 | if ( | |
| 568 | 580 | { |
| 569 | r |= input_port_read( | |
| 581 | r |= input_port_read( | |
| 570 | 582 | } |
| 571 | else if ( | |
| 583 | else if ( | |
| 572 | 584 | { |
| 573 | r |= input_port_read( | |
| 585 | r |= input_port_read( | |
| 574 | 586 | } |
| 575 | else if ( | |
| 587 | else if ( | |
| 576 | 588 | { |
| 577 | r |= input_port_read( | |
| 589 | r |= input_port_read( | |
| 578 | 590 | } |
| 579 | 591 | |
| 580 | //r |= | |
| 592 | //r |= | |
| 581 | 593 | #endif |
| 582 | 594 | } |
| 583 | 595 | if (ACCESSING_BITS_16_23) |
| 584 | 596 | { |
| 585 | r |= | |
| 597 | r |= | |
| 586 | 598 | } |
| 587 | 599 | |
| 588 | 600 | return r; |
| 589 | 601 | } |
| 590 | 602 | |
| 591 | ||
| 603 | ||
| 592 | 604 | { |
| 593 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 594 | 605 | static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" }; // but parallel_pointer takes values 0 -> 23 |
| 595 | 606 | |
| 596 | COMBINE_DATA( & | |
| 607 | COMBINE_DATA( & | |
| 597 | 608 | |
| 598 | 609 | if (ACCESSING_BITS_0_7) |
| 599 | 610 | { |
| r14896 | r14897 | |
| 612 | 623 | 7x..ff = advance pointer |
| 613 | 624 | */ |
| 614 | 625 | |
| 615 | logerror("%08X:", cpu_get_pc(&space | |
| 626 | logerror("%08X:", cpu_get_pc(&space. | |
| 616 | 627 | |
| 617 | | |
| 628 | | |
| 618 | 629 | //parallel_pointer++; |
| 619 | 630 | //logerror("[%02X] Advance pointer to %d\n", data, parallel_pointer); |
| 620 | 631 | switch (data & 0xfc) |
| 621 | 632 | { |
| 622 | 633 | case 0x18: |
| 623 | state->m_parallel_pointer = data & 3; | |
| 624 | logerror("[%02X] Reset pointer to %d\n", data, state->m_parallel_pointer); | |
| 634 | m_parallel_pointer = data & 3; | |
| 635 | logerror("[%02X] Reset pointer to %d\n", data, m_parallel_pointer); | |
| 625 | 636 | break; |
| 626 | 637 | |
| 627 | 638 | case 0x20: |
| r14896 | r14897 | |
| 662 | 673 | default: |
| 663 | 674 | if (data >= 0x70) |
| 664 | 675 | { |
| 665 | state->m_parallel_pointer++; | |
| 666 | logerror("[%02X] Advance pointer to %d\n", data, state->m_parallel_pointer); | |
| 676 | m_parallel_pointer++; | |
| 677 | logerror("[%02X] Advance pointer to %d\n", data, m_parallel_pointer); | |
| 667 | 678 | } |
| 668 | 679 | else |
| 669 | 680 | logerror("[%02X] Unknown write\n", data); |
| r14896 | r14897 | |
| 748 | 759 | } |
| 749 | 760 | } |
| 750 | 761 | |
| 751 | ||
| 762 | ||
| 752 | 763 | { |
| 753 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 754 | 764 | |
| 755 | 765 | switch (offset) |
| 756 | 766 | { |
| 757 | 767 | case 0x14/4: |
| 758 | return (( | |
| 768 | return (( | |
| 759 | 769 | } |
| 760 | 770 | return 0; |
| 761 | 771 | } |
| 762 | 772 | |
| 763 | ||
| 773 | ||
| 764 | 774 | { |
| 765 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 766 | 775 | |
| 767 | 776 | if (offset == 0) |
| 768 | 777 | { |
| 769 | 778 | if (ACCESSING_BITS_16_31) |
| 770 | 779 | { |
| 771 | 780 | UINT16 ldata = (data >> 16) & 0xffff; |
| 772 | | |
| 781 | | |
| 773 | 782 | } |
| 774 | 783 | if (ACCESSING_BITS_0_15) |
| 775 | 784 | { |
| 776 | 785 | UINT16 rdata = data & 0xffff; |
| 777 | | |
| 786 | | |
| 778 | 787 | } |
| 779 | 788 | |
| 780 | | |
| 789 | | |
| 781 | 790 | } |
| 782 | 791 | else if (offset == 3) |
| 783 | 792 | { |
| 784 | 793 | int reg = (data >> 8) & 0xf; |
| 785 | ad1847_reg_write( | |
| 794 | ad1847_reg_write( | |
| 786 | 795 | } |
| 787 | 796 | } |
| 788 | 797 | |
| r14896 | r14897 | |
| 794 | 803 | *************************************************************************/ |
| 795 | 804 | |
| 796 | 805 | |
| 797 | ||
| 806 | ||
| 798 | 807 | { |
| 799 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 800 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 808 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 801 | 809 | |
| 802 | 810 | switch(offset % 8) |
| 803 | 811 | { |
| 804 | 812 | case 1: |
| 805 | data = | |
| 813 | data = | |
| 806 | 814 | break; |
| 807 | 815 | case 2: |
| 808 | data = | |
| 816 | data = | |
| 809 | 817 | break; |
| 810 | 818 | case 3: |
| 811 | data = | |
| 819 | data = | |
| 812 | 820 | break; |
| 813 | 821 | case 7: |
| 814 | data = | |
| 822 | data = | |
| 815 | 823 | break; |
| 816 | 824 | } |
| 817 | 825 | return data; |
| 818 | 826 | } |
| 819 | 827 | |
| 820 | 828 | |
| 821 | ||
| 829 | ||
| 822 | 830 | { |
| 823 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 824 | 831 | |
| 825 | | |
| 832 | | |
| 826 | 833 | |
| 827 | 834 | switch(offset % 8) |
| 828 | 835 | { |
| 829 | 836 | case 1: |
| 830 | | |
| 837 | | |
| 831 | 838 | break; |
| 832 | 839 | case 2: |
| 833 | | |
| 840 | | |
| 834 | 841 | break; |
| 835 | 842 | case 3: |
| 836 | | |
| 843 | | |
| 837 | 844 | break; |
| 838 | 845 | case 7: |
| 839 | | |
| 846 | | |
| 840 | 847 | break; |
| 841 | 848 | } |
| 842 | 849 | } |
| r14896 | r14897 | |
| 851 | 858 | } |
| 852 | 859 | |
| 853 | 860 | |
| 854 | ||
| 861 | ||
| 855 | 862 | { |
| 856 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 857 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 863 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 858 | 864 | & 0xFF0000; |
| 859 | 865 | |
| 860 | return space | |
| 866 | return space. | |
| 861 | 867 | } |
| 862 | 868 | |
| 863 | 869 | |
| 864 | ||
| 870 | ||
| 865 | 871 | { |
| 866 | mediagx_state *state = space->machine().driver_data<mediagx_state>(); | |
| 867 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 872 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 868 | 873 | & 0xFF0000; |
| 869 | 874 | |
| 870 | space | |
| 875 | space. | |
| 871 | 876 | } |
| 872 | 877 | |
| 873 | 878 | static void set_dma_channel(device_t *device, int channel, int _state) |
| r14896 | r14897 | |
| 886 | 891 | { |
| 887 | 892 | DEVCB_LINE(pc_dma_hrq_changed), |
| 888 | 893 | DEVCB_NULL, |
| 889 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 890 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 894 | DEVCB_DRIVER_MEMBER(mediagx_state, pc_dma_read_byte), | |
| 895 | DEVCB_DRIVER_MEMBER(mediagx_state, pc_dma_write_byte), | |
| 891 | 896 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 892 | 897 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 893 | 898 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 908 | 913 | /*****************************************************************************/ |
| 909 | 914 | |
| 910 | 915 | static ADDRESS_MAP_START( mediagx_map, AS_PROGRAM, 32, mediagx_state ) |
| 911 | AM_RANGE(0x00000000, 0x0009ffff) AM_RAM AM_ | |
| 916 | AM_RANGE(0x00000000, 0x0009ffff) AM_RAM AM_ | |
| 912 | 917 | AM_RANGE(0x000a0000, 0x000affff) AM_RAM |
| 913 | AM_RANGE(0x000b0000, 0x000b7fff) AM_RAM AM_BASE(m_cga_ram) | |
| 914 | AM_RANGE(0x000c0000, 0x000fffff) AM_RAM AM_BASE(m_bios_ram) | |
| 918 | AM_RANGE(0x000b0000, 0x000b7fff) AM_RAM AM_SHARE("cga_ram") | |
| 919 | AM_RANGE(0x000c0000, 0x000fffff) AM_RAM AM_SHARE("bios_ram") | |
| 915 | 920 | AM_RANGE(0x00100000, 0x00ffffff) AM_RAM |
| 916 | AM_RANGE(0x40008000, 0x400080ff) AM_READWRITE_LEGACY(biu_ctrl_r, biu_ctrl_w) | |
| 917 | AM_RANGE(0x40008300, 0x400083ff) AM_READWRITE_LEGACY(disp_ctrl_r, disp_ctrl_w) | |
| 918 | AM_RANGE(0x40008400, 0x400084ff) AM_READWRITE_LEGACY(memory_ctrl_r, memory_ctrl_w) | |
| 919 | AM_RANGE(0x40800000, 0x40bfffff) AM_RAM AM_BASE(m_vram) | |
| 921 | AM_RANGE(0x40008000, 0x400080ff) AM_READWRITE(biu_ctrl_r, biu_ctrl_w) | |
| 922 | AM_RANGE(0x40008300, 0x400083ff) AM_READWRITE(disp_ctrl_r, disp_ctrl_w) | |
| 923 | AM_RANGE(0x40008400, 0x400084ff) AM_READWRITE(memory_ctrl_r, memory_ctrl_w) | |
| 924 | AM_RANGE(0x40800000, 0x40bfffff) AM_RAM AM_SHARE("vram") | |
| 920 | 925 | AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("bios", 0) /* System BIOS */ |
| 921 | 926 | ADDRESS_MAP_END |
| 922 | 927 | |
| r14896 | r14897 | |
| 926 | 931 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 927 | 932 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 928 | 933 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) |
| 929 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 934 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 930 | 935 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff) |
| 931 | 936 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8_LEGACY("dma8237_2", at_dma8237_2_r, at_dma8237_2_w, 0xffffffff) |
| 932 | 937 | AM_RANGE(0x00e8, 0x00eb) AM_NOP // I/O delay port |
| 933 | 938 | AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE_LEGACY("ide", ide_r, ide_w) |
| 934 | AM_RANGE(0x0378, 0x037b) AM_READWRITE | |
| 939 | AM_RANGE(0x0378, 0x037b) AM_READWRITE | |
| 935 | 940 | AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE_LEGACY("ide", fdc_r, fdc_w) |
| 936 | AM_RANGE(0x0400, 0x04ff) AM_READWRITE | |
| 941 | AM_RANGE(0x0400, 0x04ff) AM_READWRITE | |
| 937 | 942 | AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE_LEGACY("pcibus", pci_32le_r, pci_32le_w) |
| 938 | 943 | ADDRESS_MAP_END |
| 939 | 944 | |
| r14896 | r14897 | |
| 1238 | 1243 | state->m_speedup_hits[idx]++; |
| 1239 | 1244 | device_spin_until_interrupt(&space->device()); |
| 1240 | 1245 | } |
| 1241 | return state->m_main_ram[state->m_speedup_table[idx].offset/4]; | |
| 1246 | return state->m_main_ram.target()[state->m_speedup_table[idx].offset/4]; | |
| 1242 | 1247 | } |
| 1243 | 1248 | |
| 1244 | 1249 | static READ32_HANDLER( speedup0_r ) { return generic_speedup(space, 0); } |
| r14896 | r14897 | |
|---|---|---|
| 23 | 23 | { |
| 24 | 24 | public: |
| 25 | 25 | summit_state(const machine_config &mconfig, device_type type, const char *tag) |
| 26 | : driver_device(mconfig, type, tag) { } | |
| 26 | : driver_device(mconfig, type, tag) , | |
| 27 | m_attr(*this, "attr"), | |
| 28 | m_vram(*this, "vram"){ } | |
| 27 | 29 | |
| 28 | UINT8 *m_vram; | |
| 29 | UINT8 *m_attr; | |
| 30 | required_shared_ptr<UINT8> m_attr; | |
| 31 | required_shared_ptr<UINT8> m_vram; | |
| 30 | 32 | DECLARE_WRITE8_MEMBER(out_w); |
| 31 | 33 | }; |
| 32 | 34 | |
| r14896 | r14897 | |
| 48 | 50 | { |
| 49 | 51 | for (x=0;x<32;x++) |
| 50 | 52 | { |
| 51 | int tile = (state->m_vram[count] | ((state->m_attr[count]&1)<<8) ); | |
| 53 | int tile = (state->m_vram.target()[count] | ((state->m_attr.target()[count]&1)<<8) ); | |
| 52 | 54 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8); |
| 53 | 55 | |
| 54 | 56 | count++; |
| r14896 | r14897 | |
| 65 | 67 | static ADDRESS_MAP_START( mainmap, AS_PROGRAM, 8, summit_state ) |
| 66 | 68 | AM_RANGE(0x0000, 0x17ff) AM_ROM |
| 67 | 69 | |
| 68 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_BASE(m_attr) | |
| 69 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_BASE(m_vram) | |
| 70 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_SHARE("attr") | |
| 71 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_SHARE("vram") | |
| 70 | 72 | |
| 71 | 73 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("IN0") |
| 72 | 74 | // AM_RANGE(0x3880, 0x3880) AM_WRITE(out_w) |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | WRITE8_MEMBER(ambush_state::flip_screen_w) |
| 55 | 55 | { |
| 56 | flip_screen_set( | |
| 56 | flip_screen_set( | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 |
| r14896 | r14897 | |
|---|---|---|
| 44 | 44 | { |
| 45 | 45 | public: |
| 46 | 46 | skimaxx_state(const machine_config &mconfig, device_type type, const char *tag) |
| 47 | : driver_device(mconfig, type, tag) { } | |
| 47 | : driver_device(mconfig, type, tag) , | |
| 48 | m_blitter_regs(*this, "blitter_regs"), | |
| 49 | m_fpga_ctrl(*this, "fpga_ctrl"), | |
| 50 | m_fg_buffer(*this, "fg_buffer"){ } | |
| 48 | 51 | |
| 52 | required_shared_ptr<UINT32> m_blitter_regs; | |
| 53 | required_shared_ptr<UINT32> m_fpga_ctrl; | |
| 54 | required_shared_ptr<UINT16> m_fg_buffer; | |
| 49 | 55 | UINT32 *m_bg_buffer; |
| 50 | UINT16 *m_fg_buffer; | |
| 51 | 56 | UINT32 *m_bg_buffer_front; |
| 52 | 57 | UINT32 *m_bg_buffer_back; |
| 53 | UINT32 *m_blitter_regs; | |
| 54 | 58 | UINT16 *m_blitter_gfx; |
| 55 | 59 | UINT32 m_blitter_gfx_len; |
| 56 | 60 | UINT32 m_blitter_src_x; |
| 57 | 61 | UINT32 m_blitter_src_dx; |
| 58 | 62 | UINT32 m_blitter_src_y; |
| 59 | 63 | UINT32 m_blitter_src_dy; |
| 60 | UINT32 *m_fpga_ctrl; | |
| 61 | 64 | DECLARE_WRITE32_MEMBER(skimaxx_blitter_w); |
| 62 | 65 | DECLARE_READ32_MEMBER(skimaxx_blitter_r); |
| 63 | 66 | DECLARE_WRITE32_MEMBER(m68k_tms_w); |
| r14896 | r14897 | |
| 80 | 83 | // Set up blit parameters |
| 81 | 84 | WRITE32_MEMBER(skimaxx_state::skimaxx_blitter_w) |
| 82 | 85 | { |
| 83 | UINT32 newdata = COMBINE_DATA( &m_blitter_regs[offset] ); | |
| 86 | UINT32 newdata = COMBINE_DATA( &m_blitter_regs.target()[offset] ); | |
| 84 | 87 | |
| 85 | 88 | switch (offset) |
| 86 | 89 | { |
| r14896 | r14897 | |
| 164 | 167 | static void skimaxx_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg) |
| 165 | 168 | { |
| 166 | 169 | skimaxx_state *state = space->machine().driver_data<skimaxx_state>(); |
| 167 | memcpy(shiftreg, &state->m_fg_buffer[TOWORD(address)], 512 * sizeof(UINT16)); | |
| 170 | memcpy(shiftreg, &state->m_fg_buffer.target()[TOWORD(address)], 512 * sizeof(UINT16)); | |
| 168 | 171 | } |
| 169 | 172 | |
| 170 | 173 | static void skimaxx_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg) |
| 171 | 174 | { |
| 172 | 175 | skimaxx_state *state = space->machine().driver_data<skimaxx_state>(); |
| 173 | memcpy(&state->m_fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16)); | |
| 176 | memcpy(&state->m_fg_buffer.target()[TOWORD(address)], shiftreg, 512 * sizeof(UINT16)); | |
| 174 | 177 | } |
| 175 | 178 | |
| 176 | 179 | |
| r14896 | r14897 | |
| 188 | 191 | if (params->rowaddr >= 0x220) |
| 189 | 192 | { |
| 190 | 193 | UINT32 rowaddr = (params->rowaddr - 0x220); |
| 191 | UINT16 *fg = &state->m_fg_buffer[rowaddr << 8]; | |
| 194 | UINT16 *fg = &state->m_fg_buffer.target()[rowaddr << 8]; | |
| 192 | 195 | UINT32 *bg = &state->m_bg_buffer_front[rowaddr/2 * 1024/2]; |
| 193 | 196 | UINT16 *dest = &bitmap.pix16(scanline); |
| 194 | 197 | //int coladdr = params->coladdr; |
| r14896 | r14897 | |
| 375 | 378 | AM_RANGE(0x00000000, 0x000100ff) AM_RAM |
| 376 | 379 | AM_RANGE(0x00008000, 0x0003ffff) AM_RAM |
| 377 | 380 | AM_RANGE(0x00050000, 0x0005ffff) AM_RAM |
| 378 | AM_RANGE(0x00220000, 0x003fffff) AM_RAM AM_ | |
| 381 | AM_RANGE(0x00220000, 0x003fffff) AM_RAM AM_ | |
| 379 | 382 | AM_RANGE(0x02000000, 0x0200000f) AM_RAM |
| 380 | 383 | AM_RANGE(0x02100000, 0x0210000f) AM_RAM |
| 381 | 384 | AM_RANGE(0x04000000, 0x047fffff) AM_ROM AM_REGION("tmsgfx", 0) |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | { |
| 51 | 51 | public: |
| 52 | 52 | mwarr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | : driver_device(mconfig, type, tag) { } | |
| 53 | : driver_device(mconfig, type, tag) , | |
| 54 | m_bg_videoram(*this, "bg_videoram"), | |
| 55 | m_mlow_videoram(*this, "mlow_videoram"), | |
| 56 | m_mhigh_videoram(*this, "mhigh_videoram"), | |
| 57 | m_tx_videoram(*this, "tx_videoram"), | |
| 58 | m_bg_scrollram(*this, "bg_scrollram"), | |
| 59 | m_mlow_scrollram(*this, "mlow_scrollram"), | |
| 60 | m_mhigh_scrollram(*this, "mhigh_scrollram"), | |
| 61 | m_vidattrram(*this, "vidattrram"), | |
| 62 | m_spriteram(*this, "spriteram"), | |
| 63 | m_mwarr_ram(*this, "mwarr_ram"){ } | |
| 54 | 64 | |
| 55 | 65 | /* memory pointers */ |
| 56 | UINT16 *m_bg_videoram; | |
| 57 | UINT16 *m_mlow_videoram; | |
| 58 | UINT16 *m_mhigh_videoram; | |
| 59 | UINT16 *m_tx_videoram; | |
| 60 | UINT16 *m_bg_scrollram; | |
| 61 | UINT16 *m_mlow_scrollram; | |
| 62 | UINT16 *m_mhigh_scrollram; | |
| 63 | UINT16 *m_vidattrram; | |
| 64 | UINT16 *m_spriteram; | |
| 66 | required_shared_ptr<UINT16> m_bg_videoram; | |
| 67 | required_shared_ptr<UINT16> m_mlow_videoram; | |
| 68 | required_shared_ptr<UINT16> m_mhigh_videoram; | |
| 69 | required_shared_ptr<UINT16> m_tx_videoram; | |
| 70 | required_shared_ptr<UINT16> m_bg_scrollram; | |
| 71 | required_shared_ptr<UINT16> m_mlow_scrollram; | |
| 72 | required_shared_ptr<UINT16> m_mhigh_scrollram; | |
| 73 | required_shared_ptr<UINT16> m_vidattrram; | |
| 74 | required_shared_ptr<UINT16> m_spriteram; | |
| 65 | 75 | // UINT16 *m_paletteram; // currently this uses generic palette handling |
| 66 | UINT16 | |
| 76 | required_shared_ptr<UINT16> | |
| 67 | 77 | |
| 68 | 78 | /* video-related */ |
| 69 | 79 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 93 | 103 | WRITE16_MEMBER(mwarr_state::bg_videoram_w) |
| 94 | 104 | { |
| 95 | 105 | |
| 96 | COMBINE_DATA(&m_bg_videoram[offset]); | |
| 106 | COMBINE_DATA(&m_bg_videoram.target()[offset]); | |
| 97 | 107 | m_bg_tilemap->mark_tile_dirty(offset); |
| 98 | 108 | } |
| 99 | 109 | |
| 100 | 110 | WRITE16_MEMBER(mwarr_state::mlow_videoram_w) |
| 101 | 111 | { |
| 102 | 112 | |
| 103 | COMBINE_DATA(&m_mlow_videoram[offset]); | |
| 113 | COMBINE_DATA(&m_mlow_videoram.target()[offset]); | |
| 104 | 114 | m_mlow_tilemap->mark_tile_dirty(offset); |
| 105 | 115 | } |
| 106 | 116 | |
| 107 | 117 | WRITE16_MEMBER(mwarr_state::mhigh_videoram_w) |
| 108 | 118 | { |
| 109 | 119 | |
| 110 | COMBINE_DATA(&m_mhigh_videoram[offset]); | |
| 120 | COMBINE_DATA(&m_mhigh_videoram.target()[offset]); | |
| 111 | 121 | m_mhigh_tilemap->mark_tile_dirty(offset); |
| 112 | 122 | } |
| 113 | 123 | |
| 114 | 124 | WRITE16_MEMBER(mwarr_state::tx_videoram_w) |
| 115 | 125 | { |
| 116 | 126 | |
| 117 | COMBINE_DATA(&m_tx_videoram[offset]); | |
| 127 | COMBINE_DATA(&m_tx_videoram.target()[offset]); | |
| 118 | 128 | m_tx_tilemap->mark_tile_dirty(offset); |
| 119 | 129 | } |
| 120 | 130 | |
| r14896 | r14897 | |
| 147 | 157 | /* refresh sprites on screen */ |
| 148 | 158 | for (i = 0; i < 0x800; i++) |
| 149 | 159 | { |
| 150 | m_sprites_buffer[i] = m_spriteram[i]; | |
| 160 | m_sprites_buffer[i] = m_spriteram.target()[i]; | |
| 151 | 161 | } |
| 152 | 162 | break; |
| 153 | 163 | |
| r14896 | r14897 | |
| 165 | 175 | int i; |
| 166 | 176 | double brightness; |
| 167 | 177 | |
| 168 | COMBINE_DATA(&m_mwarr_ram[0x14 / 2]); | |
| 178 | COMBINE_DATA(&m_mwarr_ram.target()[0x14 / 2]); | |
| 169 | 179 | |
| 170 | 180 | brightness = (double)(data & 0xff); |
| 171 | 181 | for (i = 0; i < 0x800; i++) |
| r14896 | r14897 | |
| 183 | 193 | |
| 184 | 194 | static ADDRESS_MAP_START( mwarr_map, AS_PROGRAM, 16, mwarr_state ) |
| 185 | 195 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 186 | AM_RANGE(0x100000, 0x1007ff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(m_bg_videoram) | |
| 187 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(mlow_videoram_w) AM_BASE(m_mlow_videoram) | |
| 188 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(mhigh_videoram_w) AM_BASE(m_mhigh_videoram) | |
| 189 | AM_RANGE(0x101800, 0x1027ff) AM_RAM_WRITE(tx_videoram_w) AM_BASE(m_tx_videoram) | |
| 190 | AM_RANGE(0x103000, 0x1033ff) AM_RAM AM_BASE(m_bg_scrollram) | |
| 191 | AM_RANGE(0x103400, 0x1037ff) AM_RAM AM_BASE(m_mlow_scrollram) | |
| 192 | AM_RANGE(0x103800, 0x103bff) AM_RAM AM_BASE(m_mhigh_scrollram) | |
| 193 | AM_RANGE(0x103c00, 0x103fff) AM_RAM AM_BASE(m_vidattrram) | |
| 194 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 195 | AM_RANGE(0x108000, 0x108fff) AM_RAM AM_BASE(m_spriteram) | |
| 196 | AM_RANGE(0x100000, 0x1007ff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram") | |
| 197 | AM_RANGE(0x100800, 0x100fff) AM_RAM_WRITE(mlow_videoram_w) AM_SHARE("mlow_videoram") | |
| 198 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(mhigh_videoram_w) AM_SHARE("mhigh_videoram") | |
| 199 | AM_RANGE(0x101800, 0x1027ff) AM_RAM_WRITE(tx_videoram_w) AM_SHARE("tx_videoram") | |
| 200 | AM_RANGE(0x103000, 0x1033ff) AM_RAM AM_SHARE("bg_scrollram") | |
| 201 | AM_RANGE(0x103400, 0x1037ff) AM_RAM AM_SHARE("mlow_scrollram") | |
| 202 | AM_RANGE(0x103800, 0x103bff) AM_RAM AM_SHARE("mhigh_scrollram") | |
| 203 | AM_RANGE(0x103c00, 0x103fff) AM_RAM AM_SHARE("vidattrram") | |
| 204 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 205 | AM_RANGE(0x108000, 0x108fff) AM_RAM AM_SHARE("spriteram") | |
| 196 | 206 | AM_RANGE(0x110000, 0x110001) AM_READ_PORT("P1_P2") |
| 197 | 207 | AM_RANGE(0x110002, 0x110003) AM_READ_PORT("SYSTEM") |
| 198 | 208 | AM_RANGE(0x110004, 0x110005) AM_READ_PORT("DSW") |
| 199 | 209 | AM_RANGE(0x110010, 0x110011) AM_DEVWRITE_LEGACY("oki2", oki1_bank_w) |
| 200 | 210 | AM_RANGE(0x110014, 0x110015) AM_WRITE(mwarr_brightness_w) |
| 201 | 211 | AM_RANGE(0x110016, 0x110017) AM_WRITE(sprites_commands_w) |
| 202 | AM_RANGE(0x110000, 0x11ffff) AM_RAM AM_ | |
| 212 | AM_RANGE(0x110000, 0x11ffff) AM_RAM AM_ | |
| 203 | 213 | AM_RANGE(0x180000, 0x180001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) |
| 204 | 214 | AM_RANGE(0x190000, 0x190001) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) |
| 205 | 215 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 342 | 352 | static TILE_GET_INFO( get_bg_tile_info ) |
| 343 | 353 | { |
| 344 | 354 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 345 | int tileno = state->m_bg_videoram[tile_index] & 0x1fff; | |
| 346 | int colour = (state->m_bg_videoram[tile_index] & 0xe000) >> 13; | |
| 355 | int tileno = state->m_bg_videoram.target()[tile_index] & 0x1fff; | |
| 356 | int colour = (state->m_bg_videoram.target()[tile_index] & 0xe000) >> 13; | |
| 347 | 357 | |
| 348 | 358 | SET_TILE_INFO(4, tileno, colour, 0); |
| 349 | 359 | } |
| r14896 | r14897 | |
| 351 | 361 | static TILE_GET_INFO( get_mlow_tile_info ) |
| 352 | 362 | { |
| 353 | 363 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 354 | int tileno = state->m_mlow_videoram[tile_index] & 0x1fff; | |
| 355 | int colour = (state->m_mlow_videoram[tile_index] & 0xe000) >> 13; | |
| 364 | int tileno = state->m_mlow_videoram.target()[tile_index] & 0x1fff; | |
| 365 | int colour = (state->m_mlow_videoram.target()[tile_index] & 0xe000) >> 13; | |
| 356 | 366 | |
| 357 | 367 | SET_TILE_INFO(3, tileno, colour, 0); |
| 358 | 368 | } |
| r14896 | r14897 | |
| 360 | 370 | static TILE_GET_INFO( get_mhigh_tile_info ) |
| 361 | 371 | { |
| 362 | 372 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 363 | int tileno = state->m_mhigh_videoram[tile_index] & 0x1fff; | |
| 364 | int colour = (state->m_mhigh_videoram[tile_index] & 0xe000) >> 13; | |
| 373 | int tileno = state->m_mhigh_videoram.target()[tile_index] & 0x1fff; | |
| 374 | int colour = (state->m_mhigh_videoram.target()[tile_index] & 0xe000) >> 13; | |
| 365 | 375 | |
| 366 | 376 | SET_TILE_INFO(2, tileno, colour, 0); |
| 367 | 377 | } |
| r14896 | r14897 | |
| 369 | 379 | static TILE_GET_INFO( get_tx_tile_info ) |
| 370 | 380 | { |
| 371 | 381 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 372 | int tileno = state->m_tx_videoram[tile_index] & 0x1fff; | |
| 373 | int colour = (state->m_tx_videoram[tile_index] & 0xe000) >> 13; | |
| 382 | int tileno = state->m_tx_videoram.target()[tile_index] & 0x1fff; | |
| 383 | int colour = (state->m_tx_videoram.target()[tile_index] & 0xe000) >> 13; | |
| 374 | 384 | |
| 375 | 385 | SET_TILE_INFO(1, tileno, colour, 0); |
| 376 | 386 | } |
| r14896 | r14897 | |
| 473 | 483 | |
| 474 | 484 | screen.machine().priority_bitmap.fill(0, cliprect); |
| 475 | 485 | |
| 476 | if (BIT(state->m_vidattrram[6], 0)) | |
| 486 | if (BIT(state->m_vidattrram.target()[6], 0)) | |
| 477 | 487 | { |
| 478 | 488 | for (i = 0; i < 256; i++) |
| 479 | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram[i] + 20); | |
| 489 | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram.target()[i] + 20); | |
| 480 | 490 | } |
| 481 | 491 | else |
| 482 | 492 | { |
| 483 | 493 | for (i = 0; i < 256; i++) |
| 484 | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram[0] + 19); | |
| 494 | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram.target()[0] + 19); | |
| 485 | 495 | } |
| 486 | 496 | |
| 487 | if (BIT(state->m_vidattrram[6], 2)) | |
| 497 | if (BIT(state->m_vidattrram.target()[6], 2)) | |
| 488 | 498 | { |
| 489 | 499 | for (i = 0; i < 256; i++) |
| 490 | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram[i] + 19); | |
| 500 | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram.target()[i] + 19); | |
| 491 | 501 | } |
| 492 | 502 | else |
| 493 | 503 | { |
| 494 | 504 | for (i = 0; i < 256; i++) |
| 495 | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram[0] + 19); | |
| 505 | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram.target()[0] + 19); | |
| 496 | 506 | } |
| 497 | 507 | |
| 498 | if (BIT(state->m_vidattrram[6], 4)) | |
| 508 | if (BIT(state->m_vidattrram.target()[6], 4)) | |
| 499 | 509 | { |
| 500 | 510 | for (i = 0; i < 256; i++) |
| 501 | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram[i] + 19); | |
| 511 | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram.target()[i] + 19); | |
| 502 | 512 | } |
| 503 | 513 | else |
| 504 | 514 | { |
| 505 | 515 | for (i = 0; i < 256; i++) |
| 506 | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram[0] + 19); | |
| 516 | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram.target()[0] + 19); | |
| 507 | 517 | } |
| 508 | 518 | |
| 509 | state->m_bg_tilemap->set_scrolly(0, state->m_vidattrram[1] + 1); | |
| 510 | state->m_mlow_tilemap->set_scrolly(0, state->m_vidattrram[2] + 1); | |
| 511 | state->m_mhigh_tilemap->set_scrolly(0, state->m_vidattrram[3] + 1); | |
| 519 | state->m_bg_tilemap->set_scrolly(0, state->m_vidattrram.target()[1] + 1); | |
| 520 | state->m_mlow_tilemap->set_scrolly(0, state->m_vidattrram.target()[2] + 1); | |
| 521 | state->m_mhigh_tilemap->set_scrolly(0, state->m_vidattrram.target()[3] + 1); | |
| 512 | 522 | |
| 513 | state->m_tx_tilemap->set_scrollx(0, state->m_vidattrram[0] + 16); | |
| 514 | state->m_tx_tilemap->set_scrolly(0, state->m_vidattrram[4] + 1); | |
| 523 | state->m_tx_tilemap->set_scrollx(0, state->m_vidattrram.target()[0] + 16); | |
| 524 | state->m_tx_tilemap->set_scrolly(0, state->m_vidattrram.target()[4] + 1); | |
| 515 | 525 | |
| 516 | 526 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0x01); |
| 517 | 527 | state->m_mlow_tilemap->draw(bitmap, cliprect, 0, 0x02); |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | { |
| 46 | 46 | public: |
| 47 | 47 | vroulet_state(const machine_config &mconfig, device_type type, const char *tag) |
| 48 | : driver_device(mconfig, type, tag) { } | |
| 48 | : driver_device(mconfig, type, tag) , | |
| 49 | m_videoram(*this, "videoram"), | |
| 50 | m_colorram(*this, "colorram"), | |
| 51 | m_ball(*this, "ball"){ } | |
| 49 | 52 | |
| 50 | UINT8 *m_ball; | |
| 51 | UINT8 *m_videoram; | |
| 52 | UINT8 *m_colorram; | |
| 53 | required_shared_ptr<UINT8> m_videoram; | |
| 54 | required_shared_ptr<UINT8> m_colorram; | |
| 55 | required_shared_ptr<UINT8> m_ball; | |
| 53 | 56 | tilemap_t *m_bg_tilemap; |
| 54 | 57 | DECLARE_WRITE8_MEMBER(vroulet_paletteram_w); |
| 55 | 58 | DECLARE_WRITE8_MEMBER(vroulet_videoram_w); |
| r14896 | r14897 | |
| 63 | 66 | WRITE8_MEMBER(vroulet_state::vroulet_paletteram_w) |
| 64 | 67 | { |
| 65 | 68 | /* |
| 66 | paletteram_xxxxBBBBGGGGRRRR_be_w | |
| 69 | paletteram_xxxxBBBBGGGGRRRR_byte_be_w | |
| 67 | 70 | but... each palette has 8 colors only, not 16 as expected... |
| 68 | 71 | */ |
| 69 | 72 | |
| r14896 | r14897 | |
| 82 | 85 | |
| 83 | 86 | WRITE8_MEMBER(vroulet_state::vroulet_videoram_w) |
| 84 | 87 | { |
| 85 | m_videoram[offset] = data; | |
| 88 | m_videoram.target()[offset] = data; | |
| 86 | 89 | m_bg_tilemap->mark_tile_dirty(offset); |
| 87 | 90 | } |
| 88 | 91 | |
| 89 | 92 | WRITE8_MEMBER(vroulet_state::vroulet_colorram_w) |
| 90 | 93 | { |
| 91 | m_colorram[offset] = data; | |
| 94 | m_colorram.target()[offset] = data; | |
| 92 | 95 | m_bg_tilemap->mark_tile_dirty(offset); |
| 93 | 96 | } |
| 94 | 97 | |
| 95 | 98 | static TILE_GET_INFO( get_bg_tile_info ) |
| 96 | 99 | { |
| 97 | 100 | vroulet_state *state = machine.driver_data<vroulet_state>(); |
| 98 | int attr = state->m_colorram[tile_index]; | |
| 99 | int code = state->m_videoram[tile_index] + ((attr & 0xc0) << 2); | |
| 101 | int attr = state->m_colorram.target()[tile_index]; | |
| 102 | int code = state->m_videoram.target()[tile_index] + ((attr & 0xc0) << 2); | |
| 100 | 103 | int color = attr & 0x1f; |
| 101 | 104 | |
| 102 | 105 | SET_TILE_INFO(0, code, color, 0); |
| r14896 | r14897 | |
| 114 | 117 | vroulet_state *state = screen.machine().driver_data<vroulet_state>(); |
| 115 | 118 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 116 | 119 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], 0x320, 1, 0, 0, |
| 117 | state->m_ball[1], state->m_ball[0] - 12, 0); | |
| 120 | state->m_ball.target()[1], state->m_ball.target()[0] - 12, 0); | |
| 118 | 121 | return 0; |
| 119 | 122 | } |
| 120 | 123 | |
| r14896 | r14897 | |
| 124 | 127 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 125 | 128 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_SHARE("nvram") |
| 126 | 129 | AM_RANGE(0x8000, 0x8000) AM_NOP |
| 127 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(vroulet_videoram_w) AM_BASE(m_videoram) | |
| 128 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(vroulet_colorram_w) AM_BASE(m_colorram) | |
| 129 | AM_RANGE(0xa000, 0xa001) AM_RAM AM_BASE(m_ball) | |
| 130 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(vroulet_videoram_w) AM_SHARE("videoram") | |
| 131 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(vroulet_colorram_w) AM_SHARE("colorram") | |
| 132 | AM_RANGE(0xa000, 0xa001) AM_RAM AM_SHARE("ball") | |
| 130 | 133 | AM_RANGE(0xb000, 0xb0ff) AM_WRITE(vroulet_paletteram_w) AM_SHARE("paletteram") |
| 131 | 134 | AM_RANGE(0xc000, 0xc000) AM_NOP |
| 132 | 135 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 223 | 223 | { |
| 224 | 224 | public: |
| 225 | 225 | coinmvga_state(const machine_config &mconfig, device_type type, const char *tag) |
| 226 | : driver_device(mconfig, type, tag) { } | |
| 226 | : driver_device(mconfig, type, tag) , | |
| 227 | m_vram(*this, "vram"){ } | |
| 227 | 228 | |
| 228 | UINT16 | |
| 229 | required_shared_ptr<UINT16> | |
| 229 | 230 | struct { int r,g,b,offs,offs_internal; } m_bgpal, m_fgpal; |
| 230 | 231 | DECLARE_WRITE8_MEMBER(debug_w); |
| 231 | 232 | DECLARE_WRITE16_MEMBER(ramdac_bg_w); |
| r14896 | r14897 | |
| 257 | 258 | { |
| 258 | 259 | for (x=0;x<128;x++) |
| 259 | 260 | { |
| 260 | int tile = state->m_vram[count]; | |
| 261 | int tile = state->m_vram.target()[count]; | |
| 261 | 262 | //int colour = tile>>12; |
| 262 | 263 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8); |
| 263 | 264 | |
| r14896 | r14897 | |
| 360 | 361 | |
| 361 | 362 | // AM_RANGE(0x0a0000, 0x0fffff) AM_RAM |
| 362 | 363 | // AM_RANGE(0x100000, 0x1fffff) AM_RAM //colorama |
| 363 | AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_ | |
| 364 | AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_ | |
| 364 | 365 | // AM_RANGE(0x40746e, 0x40746f) AM_READ(test_r) AM_WRITENOP //touch screen related, colorama |
| 365 | 366 | // AM_RANGE(0x403afa, 0x403afb) AM_READ(test_r) AM_WRITENOP //touch screen related, cmrltv75 |
| 366 | 367 | AM_RANGE(0x400000, 0x40ffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | public: |
| 59 | 59 | twins_state(const machine_config &mconfig, device_type type, const char *tag) |
| 60 | : driver_device(mconfig, type, tag) { } | |
| 60 | : driver_device(mconfig, type, tag) , | |
| 61 | m_videoram(*this, "videoram"){ } | |
| 61 | 62 | |
| 62 | UINT16 | |
| 63 | required_shared_ptr<UINT16> | |
| 63 | 64 | UINT16 *m_pal; |
| 64 | 65 | UINT16 m_paloff; |
| 65 | 66 | DECLARE_READ16_MEMBER(twins_port4_r); |
| r14896 | r14897 | |
| 96 | 97 | |
| 97 | 98 | static ADDRESS_MAP_START( twins_map, AS_PROGRAM, 16, twins_state ) |
| 98 | 99 | AM_RANGE(0x00000, 0x0ffff) AM_RAM |
| 99 | AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_ | |
| 100 | AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_ | |
| 100 | 101 | AM_RANGE(0x20000, 0xfffff) AM_ROM |
| 101 | 102 | ADDRESS_MAP_END |
| 102 | 103 | |
| r14896 | r14897 | |
| 145 | 146 | { |
| 146 | 147 | for(x=0;x<xxx;x++) |
| 147 | 148 | { |
| 148 | bitmap.pix16(y, x) = ((UINT8 *)state->m_videoram)[BYTE_XOR_LE(count)]; | |
| 149 | bitmap.pix16(y, x) = ((UINT8 *)state->m_videoram.target())[BYTE_XOR_LE(count)]; | |
| 149 | 150 | count++; |
| 150 | 151 | } |
| 151 | 152 | } |
| r14896 | r14897 | |
| 244 | 245 | { |
| 245 | 246 | for(x=0;x<xxx;x++) |
| 246 | 247 | { |
| 247 | bitmap.pix16(y, x) = ((UINT8 *)state->m_videoram)[BYTE_XOR_LE(count)]; | |
| 248 | bitmap.pix16(y, x) = ((UINT8 *)state->m_videoram.target())[BYTE_XOR_LE(count)]; | |
| 248 | 249 | count++; |
| 249 | 250 | } |
| 250 | 251 | } |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | WRITE16_MEMBER(powerins_state::powerins_soundlatch_w) |
| 63 | 63 | { |
| 64 | 64 | if (ACCESSING_BITS_0_7) |
| 65 | soundlatch_w(space, 0, data & 0xff); | |
| 65 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | READ8_MEMBER(powerins_state::powerinb_fake_ym2203_r) |
| r14896 | r14897 | |
| 114 | 114 | static ADDRESS_MAP_START( powerins_sound_map, AS_PROGRAM, 8, powerins_state ) |
| 115 | 115 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 116 | 116 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 117 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 117 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 118 | 118 | // AM_RANGE(0xe000, 0xe000) AM_WRITENOP // ? written only once ? |
| 119 | 119 | // AM_RANGE(0xe001, 0xe001) AM_WRITENOP // ? |
| 120 | 120 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | public: |
| 20 | 20 | cultures_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | : driver_device(mconfig, type, tag) { } | |
| 21 | : driver_device(mconfig, type, tag) , | |
| 22 | m_bg0_videoram(*this, "bg0_videoram"), | |
| 23 | m_bg0_regs_x(*this, "bg0_regs_x"), | |
| 24 | m_bg0_regs_y(*this, "bg0_regs_y"), | |
| 25 | m_bg1_regs_x(*this, "bg1_regs_x"), | |
| 26 | m_bg1_regs_y(*this, "bg1_regs_y"), | |
| 27 | m_bg2_regs_x(*this, "bg2_regs_x"), | |
| 28 | m_bg2_regs_y(*this, "bg2_regs_y"){ } | |
| 22 | 29 | |
| 30 | UINT8 m_paletteram[0x4000]; | |
| 23 | 31 | /* memory pointers */ |
| 24 | UINT8 * m_bg0_videoram; | |
| 25 | UINT8 m_paletteram[0x4000]; | |
| 26 | UINT8 * m_bg0_regs_x; | |
| 27 | UINT8 * m_bg1_regs_x; | |
| 28 | UINT8 * m_bg2_regs_x; | |
| 29 | UINT8 * m_bg0_regs_y; | |
| 30 | UINT8 * m_bg1_regs_y; | |
| 31 | UINT8 * m_bg2_regs_y; | |
| 32 | required_shared_ptr<UINT8> m_bg0_videoram; | |
| 33 | required_shared_ptr<UINT8> m_bg0_regs_x; | |
| 34 | required_shared_ptr<UINT8> m_bg0_regs_y; | |
| 35 | required_shared_ptr<UINT8> m_bg1_regs_x; | |
| 36 | required_shared_ptr<UINT8> m_bg1_regs_y; | |
| 37 | required_shared_ptr<UINT8> m_bg2_regs_x; | |
| 38 | required_shared_ptr<UINT8> m_bg2_regs_y; | |
| 32 | 39 | |
| 33 | 40 | /* video-related */ |
| 34 | 41 | tilemap_t *m_bg0_tilemap; |
| r14896 | r14897 | |
| 66 | 73 | static TILE_GET_INFO( get_bg0_tile_info ) |
| 67 | 74 | { |
| 68 | 75 | cultures_state *state = machine.driver_data<cultures_state>(); |
| 69 | int code = state->m_bg0_videoram[tile_index * 2] + (state->m_bg0_videoram[tile_index * 2 + 1] << 8); | |
| 76 | int code = state->m_bg0_videoram.target()[tile_index * 2] + (state->m_bg0_videoram.target()[tile_index * 2 + 1] << 8); | |
| 70 | 77 | SET_TILE_INFO(0, code, code >> 12, 0); |
| 71 | 78 | } |
| 72 | 79 | |
| r14896 | r14897 | |
| 95 | 102 | int attr; |
| 96 | 103 | |
| 97 | 104 | // tilemaps attributes |
| 98 | attr = (state->m_bg0_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg0_regs_y[3] & 1 ? TILEMAP_FLIPY : 0); | |
| 105 | attr = (state->m_bg0_regs_x.target()[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg0_regs_y.target()[3] & 1 ? TILEMAP_FLIPY : 0); | |
| 99 | 106 | state->m_bg0_tilemap->set_flip(attr); |
| 100 | 107 | |
| 101 | attr = (state->m_bg1_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg1_regs_y[3] & 1 ? TILEMAP_FLIPY : 0); | |
| 108 | attr = (state->m_bg1_regs_x.target()[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg1_regs_y.target()[3] & 1 ? TILEMAP_FLIPY : 0); | |
| 102 | 109 | state->m_bg1_tilemap->set_flip(attr); |
| 103 | 110 | |
| 104 | attr = (state->m_bg2_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg2_regs_y[3] & 1 ? TILEMAP_FLIPY : 0); | |
| 111 | attr = (state->m_bg2_regs_x.target()[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg2_regs_y.target()[3] & 1 ? TILEMAP_FLIPY : 0); | |
| 105 | 112 | state->m_bg2_tilemap->set_flip(attr); |
| 106 | 113 | |
| 107 | 114 | // tilemaps scrolls |
| 108 | state->m_bg0_tilemap->set_scrollx(0, (state->m_bg0_regs_x[2] << 8) + state->m_bg0_regs_x[0]); | |
| 109 | state->m_bg1_tilemap->set_scrollx(0, (state->m_bg1_regs_x[2] << 8) + state->m_bg1_regs_x[0]); | |
| 110 | state->m_bg2_tilemap->set_scrollx(0, (state->m_bg2_regs_x[2] << 8) + state->m_bg2_regs_x[0]); | |
| 111 | state->m_bg0_tilemap->set_scrolly(0, (state->m_bg0_regs_y[2] << 8) + state->m_bg0_regs_y[0]); | |
| 112 | state->m_bg1_tilemap->set_scrolly(0, (state->m_bg1_regs_y[2] << 8) + state->m_bg1_regs_y[0]); | |
| 113 | state->m_bg2_tilemap->set_scrolly(0, (state->m_bg2_regs_y[2] << 8) + state->m_bg2_regs_y[0]); | |
| 115 | state->m_bg0_tilemap->set_scrollx(0, (state->m_bg0_regs_x.target()[2] << 8) + state->m_bg0_regs_x.target()[0]); | |
| 116 | state->m_bg1_tilemap->set_scrollx(0, (state->m_bg1_regs_x.target()[2] << 8) + state->m_bg1_regs_x.target()[0]); | |
| 117 | state->m_bg2_tilemap->set_scrollx(0, (state->m_bg2_regs_x.target()[2] << 8) + state->m_bg2_regs_x.target()[0]); | |
| 118 | state->m_bg0_tilemap->set_scrolly(0, (state->m_bg0_regs_y.target()[2] << 8) + state->m_bg0_regs_y.target()[0]); | |
| 119 | state->m_bg1_tilemap->set_scrolly(0, (state->m_bg1_regs_y.target()[2] << 8) + state->m_bg1_regs_y.target()[0]); | |
| 120 | state->m_bg2_tilemap->set_scrolly(0, (state->m_bg2_regs_y.target()[2] << 8) + state->m_bg2_regs_y.target()[0]); | |
| 114 | 121 | |
| 115 | 122 | state->m_bg2_tilemap->draw(bitmap, cliprect, 0, 0); |
| 116 | 123 | state->m_bg0_tilemap->draw(bitmap, cliprect, 0, 0); |
| r14896 | r14897 | |
| 142 | 149 | } |
| 143 | 150 | else |
| 144 | 151 | { |
| 145 | m_bg0_videoram[offset] = data; | |
| 152 | m_bg0_videoram.target()[offset] = data; | |
| 146 | 153 | m_bg0_tilemap->mark_tile_dirty(offset >> 1); |
| 147 | 154 | } |
| 148 | 155 | } |
| r14896 | r14897 | |
| 183 | 190 | static ADDRESS_MAP_START( cultures_map, AS_PROGRAM, 8, cultures_state ) |
| 184 | 191 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 185 | 192 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 186 | AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(bg0_videoram_w) AM_ | |
| 193 | AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(bg0_videoram_w) AM_ | |
| 187 | 194 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 188 | 195 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 189 | 196 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 192 | 199 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 193 | 200 | AM_RANGE(0x00, 0x03) AM_RAM |
| 194 | 201 | AM_RANGE(0x10, 0x13) AM_RAM |
| 195 | AM_RANGE(0x20, 0x23) AM_RAM AM_BASE(m_bg0_regs_x) | |
| 196 | AM_RANGE(0x30, 0x33) AM_RAM AM_BASE(m_bg0_regs_y) | |
| 197 | AM_RANGE(0x40, 0x43) AM_RAM AM_BASE(m_bg1_regs_x) | |
| 198 | AM_RANGE(0x50, 0x53) AM_RAM AM_BASE(m_bg1_regs_y) | |
| 199 | AM_RANGE(0x60, 0x63) AM_RAM AM_BASE(m_bg2_regs_x) | |
| 200 | AM_RANGE(0x70, 0x73) AM_RAM AM_BASE(m_bg2_regs_y) | |
| 202 | AM_RANGE(0x20, 0x23) AM_RAM AM_SHARE("bg0_regs_x") | |
| 203 | AM_RANGE(0x30, 0x33) AM_RAM AM_SHARE("bg0_regs_y") | |
| 204 | AM_RANGE(0x40, 0x43) AM_RAM AM_SHARE("bg1_regs_x") | |
| 205 | AM_RANGE(0x50, 0x53) AM_RAM AM_SHARE("bg1_regs_y") | |
| 206 | AM_RANGE(0x60, 0x63) AM_RAM AM_SHARE("bg2_regs_x") | |
| 207 | AM_RANGE(0x70, 0x73) AM_RAM AM_SHARE("bg2_regs_y") | |
| 201 | 208 | AM_RANGE(0x80, 0x80) AM_WRITE(cpu_bankswitch_w) |
| 202 | 209 | AM_RANGE(0x90, 0x90) AM_WRITE(misc_w) |
| 203 | 210 | AM_RANGE(0xa0, 0xa0) AM_WRITE(bg_bank_w) |
| r14896 | r14897 | |
|---|---|---|
| 455 | 455 | { |
| 456 | 456 | public: |
| 457 | 457 | _5clown_state(const machine_config &mconfig, device_type type, const char *tag) |
| 458 | : driver_device(mconfig, type, tag) { } | |
| 458 | : driver_device(mconfig, type, tag) , | |
| 459 | m_videoram(*this, "videoram"), | |
| 460 | m_colorram(*this, "colorram"){ } | |
| 459 | 461 | |
| 460 | 462 | UINT8 m_main_latch_d800; |
| 461 | 463 | UINT8 m_snd_latch_0800; |
| 462 | 464 | UINT8 m_snd_latch_0a02; |
| 463 | 465 | UINT8 m_ay8910_addr; |
| 464 | 466 | device_t *m_ay8910; |
| 465 | UINT8 *m_videoram; | |
| 466 | UINT8 *m_colorram; | |
| 467 | required_shared_ptr<UINT8> m_videoram; | |
| 468 | required_shared_ptr<UINT8> m_colorram; | |
| 467 | 469 | tilemap_t *m_bg_tilemap; |
| 468 | 470 | int m_mux_data; |
| 469 | 471 | DECLARE_WRITE8_MEMBER(fclown_videoram_w); |
| r14896 | r14897 | |
| 486 | 488 | |
| 487 | 489 | WRITE8_MEMBER(_5clown_state::fclown_videoram_w) |
| 488 | 490 | { |
| 489 | m_videoram[offset] = data; | |
| 491 | m_videoram.target()[offset] = data; | |
| 490 | 492 | m_bg_tilemap->mark_tile_dirty(offset); |
| 491 | 493 | } |
| 492 | 494 | |
| 493 | 495 | WRITE8_MEMBER(_5clown_state::fclown_colorram_w) |
| 494 | 496 | { |
| 495 | m_colorram[offset] = data; | |
| 497 | m_colorram.target()[offset] = data; | |
| 496 | 498 | m_bg_tilemap->mark_tile_dirty(offset); |
| 497 | 499 | } |
| 498 | 500 | |
| r14896 | r14897 | |
| 510 | 512 | x--- ---- Extra color for 7's. |
| 511 | 513 | */ |
| 512 | 514 | |
| 513 | int attr = state->m_colorram[tile_index]; | |
| 514 | int code = ((attr & 0x01) << 8) | ((attr & 0x40) << 2) | state->m_videoram[tile_index]; /* bit 8 for extended char set */ | |
| 515 | int attr = state->m_colorram.target()[tile_index]; | |
| 516 | int code = ((attr & 0x01) << 8) | ((attr & 0x40) << 2) | state->m_videoram.target()[tile_index]; /* bit 8 for extended char set */ | |
| 515 | 517 | int bank = (attr & 0x02) >> 1; /* bit 1 switch the gfx banks */ |
| 516 | 518 | int color = (attr & 0x3c) >> 2 | ((attr & 0x80) >> 3); /* bits 2-3-4-5-7 for color */ |
| 517 | 519 | |
| r14896 | r14897 | |
| 723 | 725 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 724 | 726 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 725 | 727 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 726 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(fclown_videoram_w) AM_BASE(m_videoram) /* Init'ed at $2042 */ | |
| 727 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(fclown_colorram_w) AM_BASE(m_colorram) /* Init'ed at $2054 */ | |
| 728 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(fclown_videoram_w) AM_SHARE("videoram") /* Init'ed at $2042 */ | |
| 729 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(fclown_colorram_w) AM_SHARE("colorram") /* Init'ed at $2054 */ | |
| 728 | 730 | AM_RANGE(0x2000, 0x7fff) AM_ROM /* ROM space */ |
| 729 | 731 | |
| 730 | 732 | AM_RANGE(0xc048, 0xc048) AM_WRITE(cpu_c048_w ) |
| r14896 | r14897 | |
|---|---|---|
| 17 | 17 | { |
| 18 | 18 | public: |
| 19 | 19 | tgtpanic_state(const machine_config &mconfig, device_type type, const char *tag) |
| 20 | : driver_device(mconfig, type, tag) { } | |
| 20 | : driver_device(mconfig, type, tag) , | |
| 21 | m_ram(*this, "ram"){ } | |
| 21 | 22 | |
| 22 | UINT8 | |
| 23 | required_shared_ptr<UINT8> | |
| 23 | 24 | UINT8 m_color; |
| 24 | 25 | DECLARE_WRITE8_MEMBER(color_w); |
| 25 | 26 | }; |
| r14896 | r14897 | |
| 45 | 46 | |
| 46 | 47 | for (offs = 0; offs < 0x2000; ++offs) |
| 47 | 48 | { |
| 48 | UINT8 val = state->m_ram[offs]; | |
| 49 | UINT8 val = state->m_ram.target()[offs]; | |
| 49 | 50 | |
| 50 | 51 | y = (offs & 0x7f) << 1; |
| 51 | 52 | x = (offs >> 7) << 2; |
| r14896 | r14897 | |
| 82 | 83 | |
| 83 | 84 | static ADDRESS_MAP_START( prg_map, AS_PROGRAM, 8, tgtpanic_state ) |
| 84 | 85 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 85 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_ | |
| 86 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_ | |
| 86 | 87 | ADDRESS_MAP_END |
| 87 | 88 | |
| 88 | 89 | static ADDRESS_MAP_START( io_map, AS_IO, 8, tgtpanic_state ) |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") |
| 36 | 36 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW0") |
| 37 | 37 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW1") |
| 38 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) | |
| 38 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) | |
| 39 | 39 | AM_RANGE(0xc804, 0xc804) AM_WRITE(exedexes_c804_w) /* coin counters + text layer enable */ |
| 40 | 40 | AM_RANGE(0xc806, 0xc806) AM_WRITENOP /* Watchdog ?? */ |
| 41 | 41 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(exedexes_videoram_w) AM_BASE(m_videoram) /* Video RAM */ |
| r14896 | r14897 | |
| 53 | 53 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, exedexes_state ) |
| 54 | 54 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 55 | 55 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 56 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 56 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 57 | 57 | AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 58 | 58 | AM_RANGE(0x8002, 0x8002) AM_DEVWRITE_LEGACY("sn1", sn76496_w) |
| 59 | 59 | AM_RANGE(0x8003, 0x8003) AM_DEVWRITE_LEGACY("sn2", sn76496_w) |
| r14896 | r14897 | |
|---|---|---|
| 270 | 270 | AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x03fe) AM_READ_PORT("0c00") AM_WRITENOP |
| 271 | 271 | AM_RANGE(0x0c01, 0x0c01) AM_MIRROR(0x03fe) AM_READ_PORT("0c01") AM_WRITENOP |
| 272 | 272 | AM_RANGE(0x1000, 0x13ff) AM_NOP |
| 273 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ | |
| 273 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ | |
| 274 | 274 | AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x03ff) AM_READ(a2d_data_r) AM_WRITENOP |
| 275 | 275 | AM_RANGE(0x1c00, 0x1c01) AM_MIRROR(0x007f) AM_READNOP AM_WRITE(nvram_enable_w) |
| 276 | 276 | AM_RANGE(0x1c80, 0x1c82) AM_MIRROR(0x0078) AM_READNOP AM_WRITE(a2d_select_w) |
| r14896 | r14897 | |
| 282 | 282 | AM_RANGE(0x1e82, 0x1e83) AM_MIRROR(0x0078) AM_NOP /* write: LED control - not used */ |
| 283 | 283 | AM_RANGE(0x1e84, 0x1e84) AM_MIRROR(0x0078) AM_READNOP AM_WRITEONLY AM_BASE(m_foreground_bank) |
| 284 | 284 | AM_RANGE(0x1e85, 0x1e85) AM_MIRROR(0x0078) AM_NOP |
| 285 | AM_RANGE(0x1e86, 0x1e86) AM_MIRROR(0x0078) AM_READNOP AM_WRITE | |
| 285 | AM_RANGE(0x1e86, 0x1e86) AM_MIRROR(0x0078) AM_READNOP AM_WRITE | |
| 286 | 286 | AM_RANGE(0x1e87, 0x1e87) AM_MIRROR(0x0078) AM_READNOP AM_WRITEONLY AM_BASE(m_video_off) |
| 287 | AM_RANGE(0x1f00, 0x1f00) AM_MIRROR(0x007f) AM_READNOP AM_WRITE | |
| 287 | AM_RANGE(0x1f00, 0x1f00) AM_MIRROR(0x007f) AM_READNOP AM_WRITE | |
| 288 | 288 | AM_RANGE(0x1f80, 0x1f80) AM_MIRROR(0x007f) AM_READNOP AM_WRITE(rom_banksel_w) |
| 289 | 289 | AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(m_backgroundram) |
| 290 | 290 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE(m_paletteram) |
| r14896 | r14897 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | ***************************************************************************/ |
| 120 | 120 | |
| 121 | ||
| 121 | ||
| 122 | 122 | { |
| 123 | 123 | if (ACCESSING_BITS_0_7) |
| 124 | 124 | { |
| 125 | UINT8 *ROM = space->machine().region( "x1snd" )->base(); | |
| 126 | int banks = (space->machine().region( "x1snd" )->bytes() - 0x100000) / 0x20000; | |
| 125 | UINT8 *ROM = machine().region( "x1snd" )->base(); | |
| 126 | int banks = (machine().region( "x1snd" )->bytes() - 0x100000) / 0x20000; | |
| 127 | 127 | if (data >= banks) |
| 128 | 128 | { |
| 129 | logerror("CPU #0 PC %06X: invalid sound bank %04X\n",cpu_get_pc(&space | |
| 129 | logerror("CPU #0 PC %06X: invalid sound bank %04X\n",cpu_get_pc(&space. | |
| 130 | 130 | data %= banks; |
| 131 | 131 | } |
| 132 | 132 | memcpy(ROM + offset * 0x20000, ROM + 0x100000 + data * 0x20000, 0x20000); |
| r14896 | r14897 | |
| 138 | 138 | Guardians |
| 139 | 139 | ***************************************************************************/ |
| 140 | 140 | |
| 141 | ||
| 141 | ||
| 142 | 142 | { |
| 143 | 143 | if (ACCESSING_BITS_0_7) |
| 144 | 144 | { |
| 145 | 145 | // initially 0, then either $25 (coin 1) or $2a (coin 2) |
| 146 | coin_counter_w(space->machine(), 0,data & 0x01); // or 0x04 | |
| 147 | coin_counter_w(space->machine(), 1,data & 0x02); // or 0x08 | |
| 146 | coin_counter_w(machine(), 0,data & 0x01); // or 0x04 | |
| 147 | coin_counter_w(machine(), 1,data & 0x02); // or 0x08 | |
| 148 | 148 | } |
| 149 | 149 | // popmessage("%04X", data & 0xffff); |
| 150 | 150 | } |
| r14896 | r14897 | |
| 159 | 159 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P2") // P2 |
| 160 | 160 | AM_RANGE(0x700004, 0x700005) AM_READ_PORT("SYSTEM") // Coins |
| 161 | 161 | AM_RANGE(0x70000c, 0x70000d) AM_READ(watchdog_reset16_r) // Watchdog |
| 162 | AM_RANGE(0x800000, 0x800001) AM_WRITE | |
| 162 | AM_RANGE(0x800000, 0x800001) AM_WRITE | |
| 163 | 163 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 164 | 164 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 165 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 165 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 166 | 166 | AM_RANGE(0xc50000, 0xc5ffff) AM_RAM // cleared |
| 167 | 167 | AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 168 | AM_RANGE(0xe00010, 0xe0001f) AM_WRITE | |
| 168 | AM_RANGE(0xe00010, 0xe0001f) AM_WRITE | |
| 169 | 169 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| 170 | 170 | ADDRESS_MAP_END |
| 171 | 171 | |
| r14896 | r14897 | |
| 199 | 199 | AM_RANGE(0x700008, 0x700009) AM_READ_PORT("IN0") // P1 |
| 200 | 200 | AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN1") // P2 |
| 201 | 201 | AM_RANGE(0x70000c, 0x70000d) AM_WRITE(watchdog_reset16_w) |
| 202 | AM_RANGE(0x800000, 0x800001) AM_WRITE | |
| 202 | AM_RANGE(0x800000, 0x800001) AM_WRITE | |
| 203 | 203 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 204 | 204 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 205 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 205 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 206 | 206 | AM_RANGE(0xc50000, 0xc5ffff) AM_RAM // cleared |
| 207 | 207 | AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 208 | AM_RANGE(0xe00010, 0xe0001f) AM_WRITE | |
| 208 | AM_RANGE(0xe00010, 0xe0001f) AM_WRITE | |
| 209 | 209 | AM_RANGE(0xfffd0a, 0xfffd0b) AM_DEVREADWRITE_LEGACY("eeprom", gundamex_eeprom_r,gundamex_eeprom_w) // parallel data register |
| 210 | 210 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| 211 | 211 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 215 | 215 | Wakakusamonogatari Mahjong Yonshimai |
| 216 | 216 | ***************************************************************************/ |
| 217 | 217 | |
| 218 | ||
| 218 | ||
| 219 | 219 | { |
| 220 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 221 | 220 | |
| 222 | switch ( | |
| 221 | switch ( | |
| 223 | 222 | { |
| 224 | case 0x01: return input_port_read(space->machine(), "P1_KEY0"); | |
| 225 | case 0x02: return input_port_read(space->machine(), "P1_KEY1"); | |
| 226 | case 0x04: return input_port_read(space->machine(), "P1_KEY2"); | |
| 227 | case 0x08: return input_port_read(space->machine(), "P1_KEY3"); | |
| 228 | case 0x10: return input_port_read(space->machine(), "P1_KEY4"); | |
| 229 | default: logerror("p1_r with keyboard_row = %02x\n", state->m_keyboard_row); return 0xffff; | |
| 223 | case 0x01: return input_port_read(machine(), "P1_KEY0"); | |
| 224 | case 0x02: return input_port_read(machine(), "P1_KEY1"); | |
| 225 | case 0x04: return input_port_read(machine(), "P1_KEY2"); | |
| 226 | case 0x08: return input_port_read(machine(), "P1_KEY3"); | |
| 227 | case 0x10: return input_port_read(machine(), "P1_KEY4"); | |
| 228 | default: logerror("p1_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff; | |
| 230 | 229 | } |
| 231 | 230 | } |
| 232 | 231 | |
| 233 | ||
| 232 | ||
| 234 | 233 | { |
| 235 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 236 | 234 | |
| 237 | switch ( | |
| 235 | switch ( | |
| 238 | 236 | { |
| 239 | case 0x01: return input_port_read(space->machine(), "P2_KEY0"); | |
| 240 | case 0x02: return input_port_read(space->machine(), "P2_KEY1"); | |
| 241 | case 0x04: return input_port_read(space->machine(), "P2_KEY2"); | |
| 242 | case 0x08: return input_port_read(space->machine(), "P2_KEY3"); | |
| 243 | case 0x10: return input_port_read(space->machine(), "P2_KEY4"); | |
| 244 | default: logerror("p2_r with keyboard_row = %02x\n", state->m_keyboard_row); return 0xffff; | |
| 237 | case 0x01: return input_port_read(machine(), "P2_KEY0"); | |
| 238 | case 0x02: return input_port_read(machine(), "P2_KEY1"); | |
| 239 | case 0x04: return input_port_read(machine(), "P2_KEY2"); | |
| 240 | case 0x08: return input_port_read(machine(), "P2_KEY3"); | |
| 241 | case 0x10: return input_port_read(machine(), "P2_KEY4"); | |
| 242 | default: logerror("p2_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff; | |
| 245 | 243 | } |
| 246 | 244 | } |
| 247 | 245 | |
| 248 | ||
| 246 | ||
| 249 | 247 | { |
| 250 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 251 | 248 | |
| 252 | 249 | if (ACCESSING_BITS_0_7) |
| 253 | | |
| 250 | | |
| 254 | 251 | } |
| 255 | 252 | |
| 256 | 253 | static ADDRESS_MAP_START( mj4simai_map, AS_PROGRAM, 16, seta2_state ) |
| 257 | 254 | AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM |
| 258 | 255 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM |
| 259 | AM_RANGE(0x600000, 0x600001) AM_READ_LEGACY(mj4simai_p1_r) // P1 | |
| 260 | AM_RANGE(0x600002, 0x600003) AM_READ_LEGACY(mj4simai_p2_r) // P2 | |
| 261 | AM_RANGE(0x600004, 0x600005) AM_WRITE_LEGACY(mj4simai_keyboard_w) // select keyboard row to read | |
| 256 | AM_RANGE(0x600000, 0x600001) AM_READ(mj4simai_p1_r) // P1 | |
| 257 | AM_RANGE(0x600002, 0x600003) AM_READ(mj4simai_p2_r) // P2 | |
| 258 | AM_RANGE(0x600004, 0x600005) AM_WRITE(mj4simai_keyboard_w) // select keyboard row to read | |
| 262 | 259 | AM_RANGE(0x600006, 0x600007) AM_READ(watchdog_reset16_r) // Watchdog |
| 263 | 260 | AM_RANGE(0x600100, 0x600101) AM_READ_PORT("SYSTEM") // |
| 264 | 261 | AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins? |
| 265 | 262 | AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1 |
| 266 | 263 | AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2") // DSW 2 |
| 267 | AM_RANGE(0x600300, 0x60030f) AM_WRITE | |
| 264 | AM_RANGE(0x600300, 0x60030f) AM_WRITE | |
| 268 | 265 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 269 | 266 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 270 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 267 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 271 | 268 | AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 272 | 269 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| 273 | 270 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 287 | 284 | AM_RANGE(0x700200, 0x700201) AM_WRITENOP // Leds? Coins? |
| 288 | 285 | AM_RANGE(0x700300, 0x700301) AM_READ_PORT("DSW1") // DSW 1 |
| 289 | 286 | AM_RANGE(0x700302, 0x700303) AM_READ_PORT("DSW2") // DSW 2 |
| 290 | AM_RANGE(0x700310, 0x70031f) AM_WRITE | |
| 287 | AM_RANGE(0x700310, 0x70031f) AM_WRITE | |
| 291 | 288 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 292 | 289 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 293 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 290 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 294 | 291 | AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 295 | 292 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| 296 | 293 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 310 | 307 | AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins? |
| 311 | 308 | AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1 |
| 312 | 309 | AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2") // DSW 2 |
| 313 | AM_RANGE(0x600300, 0x60030f) AM_WRITE | |
| 310 | AM_RANGE(0x600300, 0x60030f) AM_WRITE | |
| 314 | 311 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 315 | 312 | AM_RANGE(0xd00000, 0xd3ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 316 | AM_RANGE(0xd40000, 0xd4ffff) AM_RAM_WRITE(paletteram | |
| 313 | AM_RANGE(0xd40000, 0xd4ffff) AM_RAM_WRITE(paletteram | |
| 317 | 314 | AM_RANGE(0xd60000, 0xd6003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 318 | 315 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| 319 | 316 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 325 | 322 | |
| 326 | 323 | /* The game checks for a specific value read from the ROM region. |
| 327 | 324 | The offset to use is stored in RAM at address 0x20BA16 */ |
| 328 | ||
| 325 | ||
| 329 | 326 | { |
| 330 | UINT32 address = (space->read_word(0x20ba16) << 16) | space->read_word(0x20ba18); | |
| 331 | return space->machine().region("maincpu")->base()[address - 2]; | |
| 327 | UINT32 address = (space.read_word(0x20ba16) << 16) | space.read_word(0x20ba18); | |
| 328 | return machine().region("maincpu")->base()[address - 2]; | |
| 332 | 329 | } |
| 333 | 330 | |
| 334 | ||
| 331 | ||
| 335 | 332 | { |
| 336 | return input_port_read( | |
| 333 | return input_port_read( | |
| 337 | 334 | } |
| 338 | 335 | |
| 339 | ||
| 336 | ||
| 340 | 337 | { |
| 341 | 338 | if (ACCESSING_BITS_0_7) |
| 342 | 339 | { |
| 343 | coin_counter_w(space->machine(), 0,data & 0x10); | |
| 344 | coin_counter_w(space->machine(), 1,data & 0x20); | |
| 340 | coin_counter_w(machine(), 0,data & 0x10); | |
| 341 | coin_counter_w(machine(), 1,data & 0x20); | |
| 345 | 342 | } |
| 346 | 343 | } |
| 347 | 344 | |
| r14896 | r14897 | |
| 350 | 347 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM |
| 351 | 348 | AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1 |
| 352 | 349 | AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2 |
| 353 | AM_RANGE(0x400300, 0x40030f) AM_WRITE | |
| 350 | AM_RANGE(0x400300, 0x40030f) AM_WRITE | |
| 354 | 351 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 355 | 352 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| 356 | AM_RANGE(0x500004, 0x500005) AM_READWRITE | |
| 353 | AM_RANGE(0x500004, 0x500005) AM_READWRITE | |
| 357 | 354 | AM_RANGE(0x500006, 0x500007) AM_READ(watchdog_reset16_r) // Watchdog |
| 358 | AM_RANGE(0x700000, 0x700001) AM_READ | |
| 355 | AM_RANGE(0x700000, 0x700001) AM_READ | |
| 359 | 356 | AM_RANGE(0x800000, 0x83ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 360 | AM_RANGE(0x840000, 0x84ffff) AM_RAM_WRITE(paletteram | |
| 357 | AM_RANGE(0x840000, 0x84ffff) AM_RAM_WRITE(paletteram | |
| 361 | 358 | AM_RANGE(0x860000, 0x86003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 362 | 359 | AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 363 | 360 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| r14896 | r14897 | |
| 375 | 372 | AM_RANGE(0x300000, 0x30ffff) AM_RAM // RAM |
| 376 | 373 | AM_RANGE(0x500300, 0x500301) AM_READ_PORT("DSW1") // DSW 1 |
| 377 | 374 | AM_RANGE(0x500302, 0x500303) AM_READ_PORT("DSW2") // DSW 2 |
| 378 | AM_RANGE(0x500300, 0x50030f) AM_WRITE | |
| 375 | AM_RANGE(0x500300, 0x50030f) AM_WRITE | |
| 379 | 376 | AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") // P1 |
| 380 | 377 | AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2") // P2 |
| 381 | 378 | AM_RANGE(0x600004, 0x600005) AM_READ_PORT("SYSTEM") // Coins |
| 382 | AM_RANGE(0x600004, 0x600005) AM_WRITE | |
| 379 | AM_RANGE(0x600004, 0x600005) AM_WRITE | |
| 383 | 380 | AM_RANGE(0x600006, 0x600007) AM_READ(watchdog_reset16_r) // Watchdog |
| 384 | //AM_RANGE(0x700000, 0x700001) AM_READ | |
| 381 | //AM_RANGE(0x700000, 0x700001) AM_READ | |
| 385 | 382 | AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 386 | AM_RANGE(0xb40000, 0xb4ffff) AM_RAM_WRITE(paletteram | |
| 383 | AM_RANGE(0xb40000, 0xb4ffff) AM_RAM_WRITE(paletteram | |
| 387 | 384 | AM_RANGE(0xb60000, 0xb6003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) |
| 388 | 385 | AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 389 | 386 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| r14896 | r14897 | |
| 394 | 391 | Reel'N Quake |
| 395 | 392 | ***************************************************************************/ |
| 396 | 393 | |
| 397 | ||
| 394 | ||
| 398 | 395 | { |
| 399 | 396 | if (ACCESSING_BITS_0_7) |
| 400 | 397 | { |
| 401 | set_led_status( space->machine(), 0, data & 0x0001 ); // start | |
| 402 | set_led_status( space->machine(), 1, data & 0x0002 ); // small | |
| 403 | set_led_status( space->machine(), 2, data & 0x0004 ); // bet | |
| 404 | set_led_status( space->machine(), 3, data & 0x0008 ); // big | |
| 405 | set_led_status( space->machine(), 4, data & 0x0010 ); // double up | |
| 406 | set_led_status( space->machine(), 5, data & 0x0020 ); // collect | |
| 407 | set_led_status( space->machine(), 6, data & 0x0040 ); // bet cancel | |
| 398 | set_led_status( machine(), 0, data & 0x0001 ); // start | |
| 399 | set_led_status( machine(), 1, data & 0x0002 ); // small | |
| 400 | set_led_status( machine(), 2, data & 0x0004 ); // bet | |
| 401 | set_led_status( machine(), 3, data & 0x0008 ); // big | |
| 402 | set_led_status( machine(), 4, data & 0x0010 ); // double up | |
| 403 | set_led_status( machine(), 5, data & 0x0020 ); // collect | |
| 404 | set_led_status( machine(), 6, data & 0x0040 ); // bet cancel | |
| 408 | 405 | } |
| 409 | 406 | if (ACCESSING_BITS_8_15) |
| 410 | 407 | { |
| 411 | ticket_dispenser_ | |
| 408 | machine().device<ticket_dispenser_ | |
| 412 | 409 | } |
| 413 | 410 | |
| 414 | 411 | // popmessage("LED %04X", data); |
| 415 | 412 | } |
| 416 | 413 | |
| 417 | ||
| 414 | ||
| 418 | 415 | { |
| 419 | 416 | if (ACCESSING_BITS_0_7) |
| 420 | 417 | { |
| 421 | coin_counter_w(space->machine(), 0, data & 0x01); // coin in | |
| 422 | coin_counter_w(space->machine(), 1, data & 0x02); // coin in | |
| 423 | coin_counter_w(space->machine(), 2, data & 0x04); // pay out | |
| 424 | coin_counter_w(space->machine(), 3, data & 0x08); // key in | |
| 418 | coin_counter_w(machine(), 0, data & 0x01); // coin in | |
| 419 | coin_counter_w(machine(), 1, data & 0x02); // coin in | |
| 420 | coin_counter_w(machine(), 2, data & 0x04); // pay out | |
| 421 | coin_counter_w(machine(), 3, data & 0x08); // key in | |
| 425 | 422 | // data & 0x10); // Sound IRQ Ack.? 1->0 |
| 426 | 423 | // data & 0x20); // Vblank IRQ.? 1 |
| 427 | 424 | } |
| r14896 | r14897 | |
| 436 | 433 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("TICKET") // Tickets |
| 437 | 434 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("SYSTEM") // Coins |
| 438 | 435 | AM_RANGE(0x400006, 0x400007) AM_READ(watchdog_reset16_r) // Watchdog |
| 439 | AM_RANGE(0x400200, 0x400201) AM_WRITE | |
| 436 | AM_RANGE(0x400200, 0x400201) AM_WRITE | |
| 440 | 437 | AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1 |
| 441 | 438 | AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2 |
| 442 | AM_RANGE(0x400300, 0x40030f) AM_WRITE | |
| 439 | AM_RANGE(0x400300, 0x40030f) AM_WRITE | |
| 443 | 440 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 444 | 441 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 445 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 442 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram | |
| 446 | 443 | AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 447 | AM_RANGE(0xfffd0a, 0xfffd0b) AM_WRITE | |
| 444 | AM_RANGE(0xfffd0a, 0xfffd0b) AM_WRITE | |
| 448 | 445 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers |
| 449 | 446 | ADDRESS_MAP_END |
| 450 | 447 | |
| r14896 | r14897 | |
| 467 | 464 | Sammy Outdoor Shooting |
| 468 | 465 | ***************************************************************************/ |
| 469 | 466 | |
| 470 | ||
| 467 | ||
| 471 | 468 | { |
| 472 | 469 | if (ACCESSING_BITS_0_7) |
| 473 | 470 | { |
| 474 | coin_counter_w(space->machine(), 0, data & 0x10); | |
| 475 | coin_counter_w(space->machine(), 1, data & 0x20); | |
| 471 | coin_counter_w(machine(), 0, data & 0x10); | |
| 472 | coin_counter_w(machine(), 1, data & 0x20); | |
| 476 | 473 | // Are these connected? They are set in I/O test |
| 477 | coin_lockout_w(space->machine(), 0,~data & 0x40); | |
| 478 | coin_lockout_w(space->machine(), 1,~data & 0x80); | |
| 474 | coin_lockout_w(machine(), 0,~data & 0x40); | |
| 475 | coin_lockout_w(machine(), 1,~data & 0x80); | |
| 479 | 476 | } |
| 480 | 477 | // popmessage("%04x",data); |
| 481 | 478 | } |
| r14896 | r14897 | |
| 488 | 485 | AM_RANGE( 0x400000, 0x400001 ) AM_READ_PORT("DSW1") // DSW 1 |
| 489 | 486 | AM_RANGE( 0x400002, 0x400003 ) AM_READ_PORT("BUTTONS") // Buttons |
| 490 | 487 | |
| 491 | AM_RANGE( 0x400300, 0x40030f ) AM_WRITE | |
| 488 | AM_RANGE( 0x400300, 0x40030f ) AM_WRITE | |
| 492 | 489 | |
| 493 | 490 | AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("GUN1") // P1 |
| 494 | 491 | AM_RANGE( 0x580000, 0x580001 ) AM_READ_PORT("GUN2") // P2 |
| 495 | 492 | |
| 496 | 493 | AM_RANGE( 0x700000, 0x700001 ) AM_READ_PORT("TRIGGER") // Trigger |
| 497 | 494 | AM_RANGE( 0x700002, 0x700003 ) AM_READ_PORT("PUMP") // Pump |
| 498 | AM_RANGE( 0x700004, 0x700005 ) AM_READ_PORT("COIN") AM_WRITE | |
| 495 | AM_RANGE( 0x700004, 0x700005 ) AM_READ_PORT("COIN") AM_WRITE | |
| 499 | 496 | AM_RANGE( 0x700006, 0x700007 ) AM_READ(watchdog_reset16_r ) // Watchdog? |
| 500 | 497 | |
| 501 | 498 | AM_RANGE( 0x800000, 0x83ffff ) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 502 | AM_RANGE( 0x840000, 0x84ffff ) AM_RAM_WRITE(paletteram | |
| 499 | AM_RANGE( 0x840000, 0x84ffff ) AM_RAM_WRITE(paletteram | |
| 503 | 500 | AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(seta2_vregs_w) AM_BASE(m_vregs) // Video Registers |
| 504 | 501 | |
| 505 | 502 | AM_RANGE( 0x900000, 0x903fff ) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r, seta_sound_word_w ) // Sound |
| r14896 | r14897 | |
| 516 | 513 | // Bus conversion functions: |
| 517 | 514 | |
| 518 | 515 | // RAM shared with the sub CPU |
| 519 | ||
| 516 | ||
| 520 | 517 | { |
| 521 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 522 | UINT16 val = state->m_nvram[offset]; | |
| 518 | UINT16 val = m_nvram[offset]; | |
| 523 | 519 | return ((val & 0xff00) << 8) | (val & 0x00ff); |
| 524 | 520 | } |
| 525 | 521 | |
| 526 | ||
| 522 | ||
| 527 | 523 | { |
| 528 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 529 | 524 | if (ACCESSING_BITS_0_7) |
| 530 | 525 | { |
| 531 | | |
| 526 | | |
| 532 | 527 | } |
| 533 | 528 | if (ACCESSING_BITS_16_23) |
| 534 | 529 | { |
| 535 | | |
| 530 | | |
| 536 | 531 | } |
| 537 | 532 | } |
| 538 | 533 | |
| 539 | ||
| 534 | ||
| 540 | 535 | { |
| 541 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 542 | 536 | |
| 543 | COMBINE_DATA( & | |
| 537 | COMBINE_DATA( & | |
| 544 | 538 | } |
| 545 | 539 | |
| 546 | ||
| 540 | ||
| 547 | 541 | { |
| 548 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 549 | 542 | |
| 550 | return | |
| 543 | return | |
| 551 | 544 | } |
| 552 | 545 | |
| 553 | static WRITE32_HANDLER( paletteram32_dword_w ) | |
| 554 | { | |
| 555 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 556 | COMBINE_DATA( &state->m_generic_paletteram_32[offset] ); | |
| 557 | if (ACCESSING_BITS_16_31) | |
| 558 | state->set_color_555(offset * 2 + 0, 10+16, 5+16, 0+16, state->m_generic_paletteram_32[offset]); | |
| 559 | if (ACCESSING_BITS_0_15) | |
| 560 | state->set_color_555(offset * 2 + 1, 10, 5, 0, state->m_generic_paletteram_32[offset]); | |
| 561 | } | |
| 562 | ||
| 563 | 546 | // Main CPU |
| 564 | 547 | |
| 565 | 548 | // ColdFire peripherals |
| r14896 | r14897 | |
| 569 | 552 | CF_MBSR = 0x1ec/4 |
| 570 | 553 | }; |
| 571 | 554 | |
| 572 | ||
| 555 | ||
| 573 | 556 | { |
| 574 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 575 | 557 | |
| 576 | COMBINE_DATA( & | |
| 558 | COMBINE_DATA( & | |
| 577 | 559 | } |
| 578 | 560 | |
| 579 | ||
| 561 | ||
| 580 | 562 | { |
| 581 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 582 | 563 | |
| 583 | 564 | switch( offset ) |
| 584 | 565 | { |
| 585 | 566 | case CF_MBSR: |
| 586 | return | |
| 567 | return | |
| 587 | 568 | |
| 588 | 569 | case CF_PPDAT: |
| 589 | return input_port_read( | |
| 570 | return input_port_read( | |
| 590 | 571 | } |
| 591 | 572 | |
| 592 | return | |
| 573 | return | |
| 593 | 574 | } |
| 594 | 575 | |
| 595 | ||
| 576 | ||
| 596 | 577 | { |
| 597 | UINT32 ret = input_port_read( | |
| 578 | UINT32 ret = input_port_read( | |
| 598 | 579 | |
| 599 | 580 | // This bits let you move the crosshair in the inputs / touch panel test with a joystick |
| 600 | if (!( | |
| 581 | if (!( | |
| 601 | 582 | ret |= 0x3f; |
| 602 | 583 | |
| 603 | 584 | return ret; |
| r14896 | r14897 | |
| 626 | 607 | AM_RANGE( 0x00000000, 0x0007ffff ) AM_ROM |
| 627 | 608 | AM_RANGE( 0x00200000, 0x0020ffff ) AM_RAM |
| 628 | 609 | |
| 629 | AM_RANGE( 0x00500000, 0x00500003 ) AM_READ | |
| 610 | AM_RANGE( 0x00500000, 0x00500003 ) AM_READ | |
| 630 | 611 | AM_RANGE( 0x00500004, 0x00500007 ) AM_READ(watchdog_reset32_r ) AM_WRITENOP |
| 631 | 612 | |
| 632 | 613 | AM_RANGE( 0x00600000, 0x00600003 ) AM_DEVREADWRITE_LEGACY("oki", oki_read, oki_write) |
| 633 | 614 | |
| 634 | AM_RANGE( 0x00800000, 0x0083ffff ) AM_READWRITE16_LEGACY(spriteram16_word_r, spriteram16_word_w, 0xffffffff ) AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 635 | AM_RANGE( 0x00840000, 0x0084ffff ) AM_RAM_WRITE_LEGACY(paletteram32_dword_w) AM_SHARE("paletteram") | |
| 615 | AM_RANGE( 0x00800000, 0x0083ffff ) AM_READWRITE16(spriteram16_word_r, spriteram16_word_w, 0xffffffff ) AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 616 | AM_RANGE( 0x00840000, 0x0084ffff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_dword_be_w) AM_SHARE("paletteram") | |
| 636 | 617 | AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(seta2_vregs_w, 0xffffffff ) AM_BASE(m_vregs) |
| 637 | 618 | |
| 638 | AM_RANGE( 0x00c00000, 0x00c002ff ) AM_READWRITE | |
| 619 | AM_RANGE( 0x00c00000, 0x00c002ff ) AM_READWRITE | |
| 639 | 620 | |
| 640 | AM_RANGE(0xf0000000, 0xf00001ff ) AM_READWRITE | |
| 621 | AM_RANGE(0xf0000000, 0xf00001ff ) AM_READWRITE | |
| 641 | 622 | AM_RANGE(0xffffe000, 0xffffffff ) AM_RAM // SRAM |
| 642 | 623 | ADDRESS_MAP_END |
| 643 | 624 | |
| r14896 | r14897 | |
| 655 | 636 | |
| 656 | 637 | #define FUNCUBE_SUB_CPU_CLOCK (XTAL_14_7456MHz) |
| 657 | 638 | |
| 658 | ||
| 639 | ||
| 659 | 640 | { |
| 660 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 661 | UINT8 ret = input_port_read(space->machine(),"SWITCH"); | |
| 641 | UINT8 ret = input_port_read(machine(),"SWITCH"); | |
| 662 | 642 | UINT8 coin_bit0 = 1; // active low |
| 663 | 643 | UINT8 coin_bit1 = 1; |
| 664 | 644 | |
| 665 | UINT8 hopper_bit = ( | |
| 645 | UINT8 hopper_bit = ( | |
| 666 | 646 | |
| 667 | 647 | const UINT64 coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK / (1000/20); |
| 668 | 648 | |
| 669 | if ( | |
| 649 | if ( | |
| 670 | 650 | { |
| 671 | UINT64 elapsed = downcast<cpu_device *>(&space | |
| 651 | UINT64 elapsed = downcast<cpu_device *>(&space. | |
| 672 | 652 | |
| 673 | 653 | if ( elapsed < coin_total_cycles/2 ) |
| 674 | 654 | coin_bit0 = 0; |
| 675 | 655 | else if ( elapsed < coin_total_cycles ) |
| 676 | 656 | coin_bit1 = 0; |
| 677 | 657 | else |
| 678 | | |
| 658 | | |
| 679 | 659 | } |
| 680 | 660 | else |
| 681 | 661 | { |
| 682 | 662 | if (!(ret & 1)) |
| 683 | | |
| 663 | | |
| 684 | 664 | } |
| 685 | 665 | |
| 686 | 666 | return (ret & ~7) | (hopper_bit << 2) | (coin_bit1 << 1) | coin_bit0; |
| 687 | 667 | } |
| 688 | 668 | |
| 689 | ||
| 669 | ||
| 690 | 670 | { |
| 691 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 692 | 671 | UINT8 ret = 0xff; |
| 693 | 672 | |
| 694 | switch( | |
| 673 | switch( | |
| 695 | 674 | { |
| 696 | case 4: ret = state->m_funcube_serial_fifo[0]; break; | |
| 697 | case 3: ret = state->m_funcube_serial_fifo[1]; break; | |
| 698 | case 2: ret = state->m_funcube_serial_fifo[2]; break; | |
| 699 | case 1: ret = state->m_funcube_serial_fifo[3]; break; | |
| 675 | case 4: ret = m_funcube_serial_fifo[0]; break; | |
| 676 | case 3: ret = m_funcube_serial_fifo[1]; break; | |
| 677 | case 2: ret = m_funcube_serial_fifo[2]; break; | |
| 678 | case 1: ret = m_funcube_serial_fifo[3]; break; | |
| 700 | 679 | } |
| 701 | 680 | |
| 702 | if (state->m_funcube_serial_count) | |
| 703 | state->m_funcube_serial_count--; | |
| 681 | if (m_funcube_serial_count) | |
| 682 | m_funcube_serial_count--; | |
| 704 | 683 | |
| 705 | 684 | return ret; |
| 706 | 685 | } |
| r14896 | r14897 | |
| 712 | 691 | #endif |
| 713 | 692 | } |
| 714 | 693 | |
| 715 | ||
| 694 | ||
| 716 | 695 | { |
| 717 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 718 | 696 | |
| 719 | * | |
| 697 | * | |
| 720 | 698 | |
| 721 | set_led_status( space->machine(), 0, (~data) & 0x01 ); // win lamp (red) | |
| 722 | set_led_status( space->machine(), 1, (~data) & 0x02 ); // win lamp (green) | |
| 699 | set_led_status( machine(), 0, (~data) & 0x01 ); // win lamp (red) | |
| 700 | set_led_status( machine(), 1, (~data) & 0x02 ); // win lamp (green) | |
| 723 | 701 | |
| 724 | 702 | // Set in a moving pattern: 0111 -> 1011 -> 1101 -> 1110 |
| 725 | set_led_status( space->machine(), 2, (~data) & 0x10 ); | |
| 726 | set_led_status( space->machine(), 3, (~data) & 0x20 ); | |
| 727 | set_led_status( space->machine(), 4, (~data) & 0x40 ); | |
| 728 | set_led_status( space->machine(), 5, (~data) & 0x80 ); | |
| 703 | set_led_status( machine(), 2, (~data) & 0x10 ); | |
| 704 | set_led_status( machine(), 3, (~data) & 0x20 ); | |
| 705 | set_led_status( machine(), 4, (~data) & 0x40 ); | |
| 706 | set_led_status( machine(), 5, (~data) & 0x80 ); | |
| 729 | 707 | |
| 730 | 708 | funcube_debug_outputs(); |
| 731 | 709 | } |
| 732 | 710 | |
| 733 | ||
| 711 | ||
| 734 | 712 | { |
| 735 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 736 | 713 | |
| 737 | 714 | // Bits 1,2,3 read |
| 738 | return * | |
| 715 | return * | |
| 739 | 716 | } |
| 740 | 717 | |
| 741 | ||
| 718 | ||
| 742 | 719 | { |
| 743 | seta2_state *state = space->machine().driver_data<seta2_state>(); | |
| 744 | 720 | |
| 745 | * | |
| 721 | * | |
| 746 | 722 | |
| 747 | 723 | // Bits 0,1,3 written |
| 748 | 724 | |
| 749 | 725 | // Bit 0: hopper motor |
| 750 | | |
| 726 | | |
| 751 | 727 | |
| 752 | 728 | // Bit 1: high on pay out |
| 753 | 729 | |
| 754 | 730 | // Bit 3: low after coining up, blinks on pay out |
| 755 | set_led_status( | |
| 731 | set_led_status( | |
| 756 | 732 | |
| 757 | 733 | funcube_debug_outputs(); |
| 758 | 734 | } |
| 759 | 735 | |
| 760 | 736 | |
| 761 | 737 | static ADDRESS_MAP_START( funcube_sub_io, AS_IO, 8, seta2_state ) |
| 762 | AM_RANGE( H8_PORT_7, H8_PORT_7 ) AM_READ | |
| 738 | AM_RANGE( H8_PORT_7, H8_PORT_7 ) AM_READ | |
| 763 | 739 | AM_RANGE( H8_PORT_4, H8_PORT_4 ) AM_NOP // unused |
| 764 | AM_RANGE( H8_PORT_A, H8_PORT_A ) AM_READWRITE_LEGACY(funcube_outputs_r, funcube_outputs_w ) AM_BASE(m_funcube_outputs ) | |
| 765 | AM_RANGE( H8_PORT_B, H8_PORT_B ) AM_WRITE_LEGACY(funcube_leds_w ) AM_BASE(m_funcube_leds ) | |
| 740 | AM_RANGE( H8_PORT_A, H8_PORT_A ) AM_READWRITE(funcube_outputs_r, funcube_outputs_w ) AM_BASE(m_funcube_outputs ) | |
| 741 | AM_RANGE( H8_PORT_B, H8_PORT_B ) AM_WRITE(funcube_leds_w ) AM_BASE(m_funcube_leds ) | |
| 766 | 742 | // AM_RANGE( H8_SERIAL_0, H8_SERIAL_0 ) // cabinets linking (jpunit) |
| 767 | AM_RANGE( H8_SERIAL_1, H8_SERIAL_1 ) AM_READ | |
| 743 | AM_RANGE( H8_SERIAL_1, H8_SERIAL_1 ) AM_READ | |
| 768 | 744 | ADDRESS_MAP_END |
| 769 | 745 | |
| 770 | 746 | |
| r14896 | r14897 | |
| 1558 | 1534 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1559 | 1535 | |
| 1560 | 1536 | PORT_START("TICKET") // $400003.b |
| 1561 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) // ticket sensor | |
| 1537 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) // ticket sensor | |
| 1562 | 1538 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1563 | 1539 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1564 | 1540 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // knock down |
| r14896 | r14897 | |
| 2127 | 2103 | MCFG_CPU_PROGRAM_MAP(reelquak_map) |
| 2128 | 2104 | |
| 2129 | 2105 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 2130 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 2106 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 2131 | 2107 | |
| 2132 | 2108 | // video hardware |
| 2133 | 2109 | MCFG_SCREEN_MODIFY("screen") |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | flkatck_bankswitch_w(space, 0, data); |
| 70 | 70 | break; |
| 71 | 71 | case 0x05: /* sound code number */ |
| 72 | soundlatch_w(space, 0, data); | |
| 72 | soundlatch_byte_w(space, 0, data); | |
| 73 | 73 | break; |
| 74 | 74 | case 0x06: /* Cause interrupt on audio CPU */ |
| 75 | 75 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| r14896 | r14897 | |
| 96 | 96 | AM_RANGE(0x0000, 0x0007) AM_RAM_WRITE(flkatck_k007121_regs_w) /* 007121 registers */ |
| 97 | 97 | AM_RANGE(0x0008, 0x03ff) AM_RAM /* RAM */ |
| 98 | 98 | AM_RANGE(0x0400, 0x041f) AM_READWRITE(flkatck_ls138_r, flkatck_ls138_w) /* inputs, DIPS, bankswitch, counters, sound command */ |
| 99 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_SHARE("paletteram") /* palette */ | |
| 99 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_le_w) AM_SHARE("paletteram") /* palette */ | |
| 100 | 100 | AM_RANGE(0x1000, 0x1fff) AM_RAM /* RAM */ |
| 101 | 101 | AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(flkatck_k007121_w) AM_BASE(m_k007121_ram) /* Video RAM (007121) */ |
| 102 | 102 | AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("bank1") /* banked ROM */ |
| r14896 | r14897 | |
| 110 | 110 | // AM_RANGE(0x9001, 0x9001) AM_RAM /* ??? */ |
| 111 | 111 | AM_RANGE(0x9004, 0x9004) AM_READNOP /* ??? */ |
| 112 | 112 | AM_RANGE(0x9006, 0x9006) AM_WRITENOP /* ??? */ |
| 113 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 113 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 114 | 114 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("konami", k007232_r, k007232_w) /* 007232 registers */ |
| 115 | 115 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */ |
| 116 | 116 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | WRITE8_MEMBER(contra_state::cpu_sound_command_w) |
| 55 | 55 | { |
| 56 | soundlatch_w(space, offset, data); | |
| 56 | soundlatch_byte_w(space, offset, data); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| r14896 | r14897 | |
| 96 | 96 | ADDRESS_MAP_END |
| 97 | 97 | |
| 98 | 98 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, contra_state ) |
| 99 | AM_RANGE(0x0000, 0x0000) AM_READ(soundlatch_r) | |
| 99 | AM_RANGE(0x0000, 0x0000) AM_READ(soundlatch_byte_r) | |
| 100 | 100 | AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 101 | 101 | AM_RANGE(0x4000, 0x4000) AM_WRITENOP /* read triggers irq reset and latch read (in the hardware only). */ |
| 102 | 102 | AM_RANGE(0x6000, 0x67ff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 56 | 56 | int m_cbaj_to_r3k; |
| 57 | 57 | int m_latch_to_z80; |
| 58 | 58 | DECLARE_CUSTOM_INPUT_MEMBER(jdredd_gun_mux_read); |
| 59 | DECLARE_READ32_MEMBER(znsecsel_r); | |
| 60 | DECLARE_WRITE32_MEMBER(znsecsel_w); | |
| 61 | DECLARE_READ32_MEMBER(boardconfig_r); | |
| 62 | DECLARE_READ32_MEMBER(unknown_r); | |
| 63 | DECLARE_WRITE32_MEMBER(coin_w); | |
| 64 | DECLARE_READ32_MEMBER(capcom_kickharness_r); | |
| 65 | DECLARE_WRITE32_MEMBER(bank_coh1000c_w); | |
| 66 | DECLARE_WRITE8_MEMBER(qsound_bankswitch_w); | |
| 67 | DECLARE_WRITE32_MEMBER(zn_qsound_w); | |
| 68 | DECLARE_WRITE32_MEMBER(bank_coh3002c_w); | |
| 69 | DECLARE_WRITE32_MEMBER(bank_coh1000t_w); | |
| 70 | DECLARE_WRITE8_MEMBER(fx1a_sound_bankswitch_w); | |
| 71 | DECLARE_READ32_MEMBER(taitofx1a_ymsound_r); | |
| 72 | DECLARE_WRITE32_MEMBER(taitofx1a_ymsound_w); | |
| 73 | DECLARE_WRITE32_MEMBER(taitofx1b_volume_w); | |
| 74 | DECLARE_WRITE32_MEMBER(taitofx1b_sound_w); | |
| 75 | DECLARE_READ32_MEMBER(taitofx1b_sound_r); | |
| 76 | DECLARE_WRITE32_MEMBER(coh1002e_bank_w); | |
| 77 | DECLARE_WRITE32_MEMBER(coh1002e_latch_w); | |
| 78 | DECLARE_WRITE32_MEMBER(bam2_sec_w); | |
| 79 | DECLARE_WRITE32_MEMBER(bam2_mcu_w); | |
| 80 | DECLARE_READ32_MEMBER(bam2_mcu_r); | |
| 81 | DECLARE_READ32_MEMBER(bam2_unk_r); | |
| 82 | DECLARE_WRITE32_MEMBER(acpsx_00_w); | |
| 83 | DECLARE_WRITE32_MEMBER(acpsx_10_w); | |
| 84 | DECLARE_WRITE32_MEMBER(nbajamex_80_w); | |
| 85 | DECLARE_READ32_MEMBER(nbajamex_08_r); | |
| 86 | DECLARE_READ32_MEMBER(nbajamex_80_r); | |
| 87 | DECLARE_WRITE32_MEMBER(coh1001l_bnk_w); | |
| 88 | DECLARE_WRITE32_MEMBER(coh1002v_bnk_w); | |
| 89 | DECLARE_WRITE32_MEMBER(coh1002m_bank_w); | |
| 90 | DECLARE_READ32_MEMBER(cbaj_z80_r); | |
| 91 | DECLARE_WRITE32_MEMBER(cbaj_z80_w); | |
| 92 | DECLARE_READ8_MEMBER(cbaj_z80_latch_r); | |
| 93 | DECLARE_WRITE8_MEMBER(cbaj_z80_latch_w); | |
| 94 | DECLARE_READ8_MEMBER(cbaj_z80_ready_r); | |
| 59 | 95 | }; |
| 60 | 96 | |
| 61 | 97 | INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) |
| r14896 | r14897 | |
| 238 | 274 | { NULL, NULL, NULL } |
| 239 | 275 | }; |
| 240 | 276 | |
| 241 | ||
| 277 | ||
| 242 | 278 | { |
| 243 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 244 | 279 | |
| 245 | verboselog( space->machine(), 2, "znsecsel_r( %08x, %08x )\n", offset, mem_mask ); | |
| 246 | return state->m_n_znsecsel; | |
| 280 | verboselog( machine(), 2, "znsecsel_r( %08x, %08x )\n", offset, mem_mask ); | |
| 281 | return m_n_znsecsel; | |
| 247 | 282 | } |
| 248 | 283 | |
| 249 | 284 | static void sio_znsec0_handler( running_machine &machine, int n_data ) |
| r14896 | r14897 | |
| 321 | 356 | } |
| 322 | 357 | } |
| 323 | 358 | |
| 324 | ||
| 359 | ||
| 325 | 360 | { |
| 326 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 327 | 361 | |
| 328 | COMBINE_DATA( & | |
| 362 | COMBINE_DATA( & | |
| 329 | 363 | |
| 330 | if( ( | |
| 364 | if( ( | |
| 331 | 365 | { |
| 332 | psx_sio_install_handler( space->machine(), 0, sio_pad_handler ); | |
| 333 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 366 | psx_sio_install_handler( machine(), 0, sio_pad_handler ); | |
| 367 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 334 | 368 | } |
| 335 | else if( ( | |
| 369 | else if( ( | |
| 336 | 370 | { |
| 337 | 371 | znsec_start( 1 ); |
| 338 | psx_sio_install_handler( space->machine(), 0, sio_znsec1_handler ); | |
| 339 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 372 | psx_sio_install_handler( machine(), 0, sio_znsec1_handler ); | |
| 373 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 340 | 374 | } |
| 341 | else if( ( | |
| 375 | else if( ( | |
| 342 | 376 | { |
| 343 | 377 | znsec_start( 0 ); |
| 344 | psx_sio_install_handler( space->machine(), 0, sio_znsec0_handler ); | |
| 345 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 378 | psx_sio_install_handler( machine(), 0, sio_znsec0_handler ); | |
| 379 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 346 | 380 | } |
| 347 | 381 | else |
| 348 | 382 | { |
| 349 | state->m_n_dip_bit = 0; | |
| 350 | state->m_b_lastclock = 1; | |
| 383 | m_n_dip_bit = 0; | |
| 384 | m_b_lastclock = 1; | |
| 351 | 385 | |
| 352 | psx_sio_install_handler( space->machine(), 0, sio_dip_handler ); | |
| 353 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 386 | psx_sio_install_handler( machine(), 0, sio_dip_handler ); | |
| 387 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 354 | 388 | |
| 355 | | |
| 389 | | |
| 356 | 390 | } |
| 357 | 391 | |
| 358 | verboselog( | |
| 392 | verboselog( | |
| 359 | 393 | } |
| 360 | 394 | |
| 361 | 395 | static TIMER_CALLBACK( dip_timer_fired ) |
| r14896 | r14897 | |
| 369 | 403 | } |
| 370 | 404 | } |
| 371 | 405 | |
| 372 | ||
| 406 | ||
| 373 | 407 | { |
| 374 | 408 | /* |
| 375 | 409 | ------00 mem=4M |
| r14896 | r14897 | |
| 390 | 424 | 111----- rev=5 |
| 391 | 425 | */ |
| 392 | 426 | |
| 393 | if( | |
| 427 | if( | |
| 394 | 428 | { |
| 395 | 429 | return 64|32|8; |
| 396 | 430 | } |
| r14896 | r14897 | |
| 400 | 434 | } |
| 401 | 435 | } |
| 402 | 436 | |
| 403 | ||
| 437 | ||
| 404 | 438 | { |
| 405 | verboselog( | |
| 439 | verboselog( | |
| 406 | 440 | return 0xffffffff; |
| 407 | 441 | } |
| 408 | 442 | |
| 409 | ||
| 443 | ||
| 410 | 444 | { |
| 411 | 445 | /* 0x01=counter |
| 412 | 446 | 0x02=coin lock 1 |
| r14896 | r14897 | |
| 416 | 450 | */ |
| 417 | 451 | if( ( data & ~0x23 ) != 0 ) |
| 418 | 452 | { |
| 419 | verboselog( | |
| 453 | verboselog( | |
| 420 | 454 | } |
| 421 | 455 | } |
| 422 | 456 | |
| r14896 | r14897 | |
| 429 | 463 | AM_RANGE(0x1fa00300, 0x1fa00303) AM_READ_PORT("SYSTEM") |
| 430 | 464 | AM_RANGE(0x1fa10000, 0x1fa10003) AM_READ_PORT("P3") |
| 431 | 465 | AM_RANGE(0x1fa10100, 0x1fa10103) AM_READ_PORT("P4") |
| 432 | AM_RANGE(0x1fa10200, 0x1fa10203) AM_READ_LEGACY(boardconfig_r) | |
| 433 | AM_RANGE(0x1fa10300, 0x1fa10303) AM_READWRITE_LEGACY(znsecsel_r, znsecsel_w) | |
| 434 | AM_RANGE(0x1fa20000, 0x1fa20003) AM_WRITE_LEGACY(coin_w) | |
| 466 | AM_RANGE(0x1fa10200, 0x1fa10203) AM_READ(boardconfig_r) | |
| 467 | AM_RANGE(0x1fa10300, 0x1fa10303) AM_READWRITE(znsecsel_r, znsecsel_w) | |
| 468 | AM_RANGE(0x1fa20000, 0x1fa20003) AM_WRITE(coin_w) | |
| 435 | 469 | AM_RANGE(0x1fa30000, 0x1fa30003) AM_NOP /* ?? */ |
| 436 | 470 | AM_RANGE(0x1fa40000, 0x1fa40003) AM_READNOP /* ?? */ |
| 437 | 471 | AM_RANGE(0x1fa60000, 0x1fa60003) AM_READNOP /* ?? */ |
| 438 | 472 | AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0xffffffff) /* eeprom */ |
| 439 | AM_RANGE(0x1fb20000, 0x1fb20007) AM_READ | |
| 473 | AM_RANGE(0x1fb20000, 0x1fb20007) AM_READ | |
| 440 | 474 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_SHARE("share2") AM_REGION("user1", 0) /* bios */ |
| 441 | 475 | AM_RANGE(0x80000000, 0x803fffff) AM_RAM AM_SHARE("share1") /* ram mirror */ |
| 442 | 476 | AM_RANGE(0x80400000, 0x807fffff) AM_RAM AM_SHARE("share1") /* ram mirror */ |
| r14896 | r14897 | |
| 641 | 675 | Unpopulated sockets - 1.3B, 2.2E, 3.3E, 8.2K, 9.3K, 10.4K, 11.5K, 12.6K & 13.7K |
| 642 | 676 | */ |
| 643 | 677 | |
| 644 | ||
| 678 | ||
| 645 | 679 | { |
| 646 | 680 | /* required for buttons 4,5&6 */ |
| 647 | verboselog( | |
| 681 | verboselog( | |
| 648 | 682 | return 0xffffffff; |
| 649 | 683 | } |
| 650 | 684 | |
| 651 | ||
| 685 | ||
| 652 | 686 | { |
| 653 | memory_set_bankptr( | |
| 687 | memory_set_bankptr( | |
| 654 | 688 | } |
| 655 | 689 | |
| 656 | ||
| 690 | ||
| 657 | 691 | { |
| 658 | memory_set_bankptr( | |
| 692 | memory_set_bankptr( | |
| 659 | 693 | } |
| 660 | 694 | |
| 661 | 695 | static INTERRUPT_GEN( qsound_interrupt ) |
| r14896 | r14897 | |
| 663 | 697 | device_set_input_line(device, 0, HOLD_LINE); |
| 664 | 698 | } |
| 665 | 699 | |
| 666 | ||
| 700 | ||
| 667 | 701 | { |
| 668 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 669 | state->soundlatch_w(*space, 0, data); | |
| 670 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 702 | soundlatch_byte_w(*&space, 0, data); | |
| 703 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 671 | 704 | } |
| 672 | 705 | |
| 673 | 706 | static DRIVER_INIT( coh1000c ) |
| 674 | 707 | { |
| 708 | zn_state *state = machine.driver_data<zn_state>(); | |
| 675 | 709 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */ |
| 676 | 710 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */ |
| 677 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(bank_coh1000c_w) ); /* bankswitch */ | |
| 678 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40010, 0x1fb40013, FUNC(capcom_kickharness_r) ); | |
| 679 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40020, 0x1fb40023, FUNC(capcom_kickharness_r) ); | |
| 711 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::bank_coh1000c_w),state)); /* bankswitch */ | |
| 712 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40010, 0x1fb40013, read32_delegate(FUNC(zn_state::capcom_kickharness_r),state)); | |
| 713 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40020, 0x1fb40023, read32_delegate(FUNC(zn_state::capcom_kickharness_r),state)); | |
| 680 | 714 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */ |
| 681 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 715 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 682 | 716 | |
| 683 | 717 | zn_driver_init(machine); |
| 684 | 718 | |
| r14896 | r14897 | |
| 704 | 738 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 705 | 739 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank10") /* banked (contains music data) */ |
| 706 | 740 | AM_RANGE(0xd000, 0xd002) AM_DEVWRITE_LEGACY("qsound", qsound_w) |
| 707 | AM_RANGE(0xd003, 0xd003) AM_WRITE | |
| 741 | AM_RANGE(0xd003, 0xd003) AM_WRITE | |
| 708 | 742 | AM_RANGE(0xd007, 0xd007) AM_DEVREAD_LEGACY("qsound", qsound_r) |
| 709 | 743 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 710 | 744 | ADDRESS_MAP_END |
| 711 | 745 | |
| 712 | 746 | static ADDRESS_MAP_START( qsound_portmap, AS_IO, 8, zn_state ) |
| 713 | 747 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 714 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 748 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 715 | 749 | ADDRESS_MAP_END |
| 716 | 750 | |
| 717 | 751 | static MACHINE_CONFIG_DERIVED( coh1000c, zn1_1mb_vram ) |
| r14896 | r14897 | |
| 882 | 916 | Unpopulated sockets on Rival Schools - None |
| 883 | 917 | */ |
| 884 | 918 | |
| 885 | ||
| 919 | ||
| 886 | 920 | { |
| 887 | memory_set_bankptr( | |
| 921 | memory_set_bankptr( | |
| 888 | 922 | } |
| 889 | 923 | |
| 890 | 924 | static DRIVER_INIT( coh3002c ) |
| 891 | 925 | { |
| 926 | zn_state *state = machine.driver_data<zn_state>(); | |
| 892 | 927 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */ |
| 893 | 928 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */ |
| 894 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40010, 0x1fb40013, FUNC(capcom_kickharness_r) ); | |
| 895 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40020, 0x1fb40023, FUNC(capcom_kickharness_r) ); | |
| 896 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(bank_coh3002c_w) ); /* bankswitch */ | |
| 929 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40010, 0x1fb40013, read32_delegate(FUNC(zn_state::capcom_kickharness_r),state)); | |
| 930 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb40020, 0x1fb40023, read32_delegate(FUNC(zn_state::capcom_kickharness_r),state)); | |
| 931 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00003, write32_delegate(FUNC(zn_state::bank_coh3002c_w),state)); /* bankswitch */ | |
| 897 | 932 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */ |
| 898 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 933 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 899 | 934 | |
| 900 | 935 | zn_driver_init(machine); |
| 901 | 936 | } |
| r14896 | r14897 | |
| 1140 | 1175 | FM1208S - RAMTRON 4096bit Nonvolatile Ferroelectric RAM (512w x 8b) |
| 1141 | 1176 | */ |
| 1142 | 1177 | |
| 1143 | ||
| 1178 | ||
| 1144 | 1179 | { |
| 1145 | device_t *mb3773 = | |
| 1180 | device_t *mb3773 = | |
| 1146 | 1181 | mb3773_set_ck(mb3773, (data & 0x20) >> 5); |
| 1147 | verboselog( space->machine(), 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 1148 | memory_set_bankptr( space->machine(), "bank1", space->machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) ); | |
| 1182 | verboselog( machine(), 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 1183 | memory_set_bankptr( machine(), "bank1", machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) ); | |
| 1149 | 1184 | } |
| 1150 | 1185 | |
| 1151 | ||
| 1186 | ||
| 1152 | 1187 | { |
| 1153 | memory_set_bankptr( | |
| 1188 | memory_set_bankptr( | |
| 1154 | 1189 | } |
| 1155 | 1190 | |
| 1156 | ||
| 1191 | ||
| 1157 | 1192 | { |
| 1158 | device_t *tc0140syt = | |
| 1193 | device_t *tc0140syt = | |
| 1159 | 1194 | return tc0140syt_comm_r(tc0140syt, 0) << 16; |
| 1160 | 1195 | } |
| 1161 | 1196 | |
| 1162 | ||
| 1197 | ||
| 1163 | 1198 | { |
| 1164 | device_t *tc0140syt = | |
| 1199 | device_t *tc0140syt = | |
| 1165 | 1200 | |
| 1166 | 1201 | if (mem_mask == 0x0000ffff) |
| 1167 | 1202 | { |
| r14896 | r14897 | |
| 1180 | 1215 | machine.device<nvram_device>("eeprom1")->set_base(state->m_taitofx1_eeprom1, state->m_taitofx1_eeprom_size1); |
| 1181 | 1216 | |
| 1182 | 1217 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */ |
| 1183 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb40000, 0x1fb40003, FUNC(bank_coh1000t_w) ); /* bankswitch */ | |
| 1184 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fb80000, 0x1fb80003, FUNC(taitofx1a_ymsound_r), FUNC(taitofx1a_ymsound_w) ); | |
| 1218 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb40000, 0x1fb40003, write32_delegate(FUNC(zn_state::bank_coh1000t_w),state)); /* bankswitch */ | |
| 1219 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1fb80000, 0x1fb80003, read32_delegate(FUNC(zn_state::taitofx1a_ymsound_r),state), write32_delegate(FUNC(zn_state::taitofx1a_ymsound_w),state)); | |
| 1185 | 1220 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( state->m_taitofx1_eeprom_size1 - 1 ), "bank2" ); |
| 1186 | 1221 | |
| 1187 | 1222 | zn_driver_init(machine); |
| r14896 | r14897 | |
| 1205 | 1240 | AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */ |
| 1206 | 1241 | AM_RANGE(0xee00, 0xee00) AM_NOP /* ? */ |
| 1207 | 1242 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */ |
| 1208 | AM_RANGE(0xf200, 0xf200) AM_WRITE | |
| 1243 | AM_RANGE(0xf200, 0xf200) AM_WRITE | |
| 1209 | 1244 | ADDRESS_MAP_END |
| 1210 | 1245 | |
| 1211 | 1246 | /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ |
| r14896 | r14897 | |
| 1243 | 1278 | MCFG_TC0140SYT_ADD("tc0140syt", coh1000ta_tc0140syt_intf) |
| 1244 | 1279 | MACHINE_CONFIG_END |
| 1245 | 1280 | |
| 1246 | ||
| 1281 | ||
| 1247 | 1282 | { |
| 1248 | verboselog( | |
| 1283 | verboselog( | |
| 1249 | 1284 | } |
| 1250 | 1285 | |
| 1251 | ||
| 1286 | ||
| 1252 | 1287 | { |
| 1253 | verboselog( | |
| 1288 | verboselog( | |
| 1254 | 1289 | } |
| 1255 | 1290 | |
| 1256 | ||
| 1291 | ||
| 1257 | 1292 | { |
| 1258 | 1293 | UINT32 data = 0; // bit 0 = busy? |
| 1259 | verboselog( | |
| 1294 | verboselog( | |
| 1260 | 1295 | return data; |
| 1261 | 1296 | } |
| 1262 | 1297 | |
| r14896 | r14897 | |
| 1272 | 1307 | |
| 1273 | 1308 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */ |
| 1274 | 1309 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fb00000, 0x1fb00000 + ( state->m_taitofx1_eeprom_size1 - 1 ), "bank2" ); |
| 1275 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb40000, 0x1fb40003, FUNC(bank_coh1000t_w) ); /* bankswitch */ | |
| 1276 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb80000, 0x1fb8ffff, FUNC(taitofx1b_volume_w) ); | |
| 1277 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fba0000, 0x1fbaffff, FUNC(taitofx1b_sound_w) ); | |
| 1278 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fbc0000, 0x1fbc0003, FUNC(taitofx1b_sound_r) ); | |
| 1310 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb40000, 0x1fb40003, write32_delegate(FUNC(zn_state::bank_coh1000t_w),state)); /* bankswitch */ | |
| 1311 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb80000, 0x1fb8ffff, write32_delegate(FUNC(zn_state::taitofx1b_volume_w),state)); | |
| 1312 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fba0000, 0x1fbaffff, write32_delegate(FUNC(zn_state::taitofx1b_sound_w),state)); | |
| 1313 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fbc0000, 0x1fbc0003, read32_delegate(FUNC(zn_state::taitofx1b_sound_r),state)); | |
| 1279 | 1314 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( state->m_taitofx1_eeprom_size2 - 1 ), "bank3" ); |
| 1280 | 1315 | |
| 1281 | 1316 | zn_driver_init(machine); |
| r14896 | r14897 | |
| 1631 | 1666 | |
| 1632 | 1667 | */ |
| 1633 | 1668 | |
| 1634 | ||
| 1669 | ||
| 1635 | 1670 | { |
| 1636 | 1671 | znsecsel_w( space, offset, data, mem_mask ); |
| 1637 | 1672 | |
| 1638 | memory_set_bankptr( | |
| 1673 | memory_set_bankptr( | |
| 1639 | 1674 | } |
| 1640 | 1675 | |
| 1641 | ||
| 1676 | ||
| 1642 | 1677 | { |
| 1643 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 1644 | 1678 | if (offset) |
| 1645 | cputag_set_input_line( | |
| 1679 | cputag_set_input_line( | |
| 1646 | 1680 | else |
| 1647 | s | |
| 1681 | s | |
| 1648 | 1682 | } |
| 1649 | 1683 | |
| 1650 | 1684 | static DRIVER_INIT( coh1002e ) |
| 1651 | 1685 | { |
| 1686 | zn_state *state = machine.driver_data<zn_state>(); | |
| 1652 | 1687 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); |
| 1653 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fa10300, 0x1fa10303, FUNC(coh1002e_bank_w) ); | |
| 1654 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00007, FUNC(coh1002e_latch_w) ); | |
| 1688 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fa10300, 0x1fa10303, write32_delegate(FUNC(zn_state::coh1002e_bank_w),state)); | |
| 1689 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00007, write32_delegate(FUNC(zn_state::coh1002e_latch_w),state)); | |
| 1655 | 1690 | |
| 1656 | 1691 | zn_driver_init(machine); |
| 1657 | 1692 | } |
| r14896 | r14897 | |
| 1666 | 1701 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1667 | 1702 | AM_RANGE(0x080000, 0x0fffff) AM_RAM |
| 1668 | 1703 | AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE8_LEGACY("ymf", ymf271_r, ymf271_w, 0x00ff ) |
| 1669 | AM_RANGE(0x180008, 0x180009) AM_READ8(soundlatch_r, 0x00ff ) | |
| 1704 | AM_RANGE(0x180008, 0x180009) AM_READ8(soundlatch_byte_r, 0x00ff ) | |
| 1670 | 1705 | AM_RANGE(0x000000, 0x07ffff) AM_WRITENOP |
| 1671 | 1706 | AM_RANGE(0x100020, 0xffffff) AM_WRITENOP |
| 1672 | 1707 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1721 | 1756 | |
| 1722 | 1757 | */ |
| 1723 | 1758 | |
| 1724 | ||
| 1759 | ||
| 1725 | 1760 | { |
| 1726 | 1761 | znsecsel_w( space, offset, data, mem_mask ); |
| 1727 | 1762 | } |
| r14896 | r14897 | |
| 1742 | 1777 | */ |
| 1743 | 1778 | |
| 1744 | 1779 | |
| 1745 | ||
| 1780 | ||
| 1746 | 1781 | { |
| 1747 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 1748 | 1782 | |
| 1749 | 1783 | if (offset == 0) |
| 1750 | 1784 | { |
| 1751 | 1785 | if (ACCESSING_BITS_0_15) |
| 1752 | 1786 | { |
| 1753 | memory_set_bankptr( | |
| 1787 | memory_set_bankptr( | |
| 1754 | 1788 | } |
| 1755 | 1789 | else if (ACCESSING_BITS_16_31) |
| 1756 | 1790 | { |
| 1757 | state->m_bam2_mcu_command = data>>16; | |
| 1758 | logerror("MCU command: %04x (PC %08x)\n", state->m_bam2_mcu_command, cpu_get_pc(&space->device())); | |
| 1791 | m_bam2_mcu_command = data>>16; | |
| 1792 | logerror("MCU command: %04x (PC %08x)\n", m_bam2_mcu_command, cpu_get_pc(&space.device())); | |
| 1759 | 1793 | } |
| 1760 | 1794 | } |
| 1761 | 1795 | } |
| 1762 | 1796 | |
| 1763 | ||
| 1797 | ||
| 1764 | 1798 | { |
| 1765 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 1766 | 1799 | |
| 1767 | 1800 | switch (offset) |
| 1768 | 1801 | { |
| 1769 | 1802 | case 0: |
| 1770 | logerror("MCU port 0 read @ PC %08x mask %08x\n", cpu_get_pc(&space | |
| 1803 | logerror("MCU port 0 read @ PC %08x mask %08x\n", cpu_get_pc(&space. | |
| 1771 | 1804 | break; |
| 1772 | 1805 | |
| 1773 | 1806 | case 1: |
| 1774 | logerror("MCU status read @ PC %08x mask %08x\n", cpu_get_pc(&space | |
| 1807 | logerror("MCU status read @ PC %08x mask %08x\n", cpu_get_pc(&space. | |
| 1775 | 1808 | |
| 1776 | switch ( | |
| 1809 | switch ( | |
| 1777 | 1810 | { |
| 1778 | 1811 | case 0x7f: // first drive check |
| 1779 | 1812 | case 0x1c: // second drive check (causes HDD detected) |
| r14896 | r14897 | |
| 1786 | 1819 | return 0; |
| 1787 | 1820 | } |
| 1788 | 1821 | |
| 1789 | ||
| 1822 | ||
| 1790 | 1823 | { |
| 1791 | 1824 | return 0; |
| 1792 | 1825 | } |
| 1793 | 1826 | |
| 1794 | 1827 | static DRIVER_INIT( bam2 ) |
| 1795 | 1828 | { |
| 1829 | zn_state *state = machine.driver_data<zn_state>(); | |
| 1796 | 1830 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); |
| 1797 | 1831 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); |
| 1798 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb00000, 0x1fb00007, FUNC(bam2_mcu_r) ); | |
| 1799 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fa20000, 0x1fa20003, FUNC(bam2_unk_r) ); | |
| 1800 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fa10300, 0x1fa10303, FUNC(bam2_sec_w) ); | |
| 1801 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00007, FUNC(bam2_mcu_w) ); | |
| 1832 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fb00000, 0x1fb00007, read32_delegate(FUNC(zn_state::bam2_mcu_r),state)); | |
| 1833 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fa20000, 0x1fa20003, read32_delegate(FUNC(zn_state::bam2_unk_r),state)); | |
| 1834 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fa10300, 0x1fa10303, write32_delegate(FUNC(zn_state::bam2_sec_w),state)); | |
| 1835 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fb00000, 0x1fb00007, write32_delegate(FUNC(zn_state::bam2_mcu_w),state)); | |
| 1802 | 1836 | |
| 1803 | 1837 | zn_driver_init(machine); |
| 1804 | 1838 | } |
| r14896 | r14897 | |
| 2077 | 2111 | } |
| 2078 | 2112 | } |
| 2079 | 2113 | |
| 2080 | ||
| 2114 | ||
| 2081 | 2115 | { |
| 2082 | verboselog( | |
| 2116 | verboselog( | |
| 2083 | 2117 | } |
| 2084 | 2118 | |
| 2085 | ||
| 2119 | ||
| 2086 | 2120 | { |
| 2087 | verboselog( | |
| 2121 | verboselog( | |
| 2088 | 2122 | } |
| 2089 | 2123 | |
| 2090 | ||
| 2124 | ||
| 2091 | 2125 | { |
| 2092 | verboselog( space->machine(), 0, "nbajamex_80_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 2093 | psx_irq_set(space->machine(), 0x400); | |
| 2126 | verboselog( machine(), 0, "nbajamex_80_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 2127 | psx_irq_set(machine(), 0x400); | |
| 2094 | 2128 | } |
| 2095 | 2129 | |
| 2096 | ||
| 2130 | ||
| 2097 | 2131 | { |
| 2098 | 2132 | UINT32 data = 0xffffffff; |
| 2099 | verboselog( | |
| 2133 | verboselog( | |
| 2100 | 2134 | return data; |
| 2101 | 2135 | } |
| 2102 | 2136 | |
| 2103 | ||
| 2137 | ||
| 2104 | 2138 | { |
| 2105 | 2139 | UINT32 data = 0xffffffff; |
| 2106 | verboselog( | |
| 2140 | verboselog( | |
| 2107 | 2141 | return data; |
| 2108 | 2142 | } |
| 2109 | 2143 | |
| r14896 | r14897 | |
| 2112 | 2146 | zn_state *state = machine.driver_data<zn_state>(); |
| 2113 | 2147 | |
| 2114 | 2148 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" ); |
| 2115 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fbfff00, 0x1fbfff03, FUNC(acpsx_00_w) ); | |
| 2116 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fbfff10, 0x1fbfff13, FUNC(acpsx_10_w) ); | |
| 2149 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fbfff00, 0x1fbfff03, write32_delegate(FUNC(zn_state::acpsx_00_w),state)); | |
| 2150 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1fbfff10, 0x1fbfff13, write32_delegate(FUNC(zn_state::acpsx_10_w),state)); | |
| 2117 | 2151 | |
| 2118 | 2152 | if( strcmp( machine.system().name, "nbajamex" ) == 0 ) |
| 2119 | 2153 | { |
| r14896 | r14897 | |
| 2121 | 2155 | state->m_nbajamex_eeprom = auto_alloc_array( machine, UINT8, state->m_nbajamex_eeprom_size ); |
| 2122 | 2156 | |
| 2123 | 2157 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1f200000, 0x1f200000 + ( state->m_nbajamex_eeprom_size - 1 ), "bank2" ); |
| 2124 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fbfff08, 0x1fbfff0b, FUNC(nbajamex_08_r) ); | |
| 2125 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fbfff80, 0x1fbfff83, FUNC(nbajamex_80_r), FUNC(nbajamex_80_w) ); | |
| 2158 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1fbfff08, 0x1fbfff0b, read32_delegate(FUNC(zn_state::nbajamex_08_r),state)); | |
| 2159 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1fbfff80, 0x1fbfff83, read32_delegate(FUNC(zn_state::nbajamex_80_r),state), write32_delegate(FUNC(zn_state::nbajamex_80_w),state)); | |
| 2126 | 2160 | |
| 2127 | 2161 | memory_set_bankptr( machine, "bank2", state->m_nbajamex_eeprom ); /* ram/eeprom/?? */ |
| 2128 | 2162 | } |
| r14896 | r14897 | |
| 2282 | 2316 | VSync - 60Hz |
| 2283 | 2317 | */ |
| 2284 | 2318 | |
| 2285 | ||
| 2319 | ||
| 2286 | 2320 | { |
| 2287 | memory_set_bankptr( | |
| 2321 | memory_set_bankptr( | |
| 2288 | 2322 | } |
| 2289 | 2323 | |
| 2290 | 2324 | static DRIVER_INIT( coh1001l ) |
| 2291 | 2325 | { |
| 2326 | zn_state *state = machine.driver_data<zn_state>(); | |
| 2292 | 2327 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked rom */ |
| 2293 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2328 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2294 | 2329 | |
| 2295 | 2330 | zn_driver_init(machine); |
| 2296 | 2331 | } |
| r14896 | r14897 | |
| 2324 | 2359 | |
| 2325 | 2360 | */ |
| 2326 | 2361 | |
| 2327 | ||
| 2362 | ||
| 2328 | 2363 | { |
| 2329 | memory_set_bankptr( | |
| 2364 | memory_set_bankptr( | |
| 2330 | 2365 | } |
| 2331 | 2366 | |
| 2332 | 2367 | static DRIVER_INIT( coh1002v ) |
| 2333 | 2368 | { |
| 2369 | zn_state *state = machine.driver_data<zn_state>(); | |
| 2334 | 2370 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f27ffff, "bank1" ); |
| 2335 | 2371 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb00000, 0x1fbfffff, "bank2" ); |
| 2336 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2372 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2337 | 2373 | |
| 2338 | 2374 | zn_driver_init(machine); |
| 2339 | 2375 | } |
| r14896 | r14897 | |
| 2507 | 2543 | for 11 more 32MBit smt SOP44 MASKROMs. |
| 2508 | 2544 | */ |
| 2509 | 2545 | |
| 2510 | ||
| 2546 | ||
| 2511 | 2547 | { |
| 2512 | verboselog( space->machine(), 1, "coh1002m_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 2513 | memory_set_bankptr( space->machine(), "bank1", space->machine().region( "user2" )->base() + ((data>>16) * 0x800000) ); | |
| 2548 | verboselog( machine(), 1, "coh1002m_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 2549 | memory_set_bankptr( machine(), "bank1", machine().region( "user2" )->base() + ((data>>16) * 0x800000) ); | |
| 2514 | 2550 | } |
| 2515 | 2551 | |
| 2516 | ||
| 2552 | ||
| 2517 | 2553 | { |
| 2518 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 2519 | 2554 | int ready; |
| 2520 | 2555 | |
| 2521 | | |
| 2556 | | |
| 2522 | 2557 | |
| 2523 | ready = state->m_cbaj_to_r3k; | |
| 2524 | state->m_cbaj_to_r3k &= ~2; | |
| 2525 | return state->soundlatch2_r(*space,0) | ready<<24; | |
| 2558 | ready = m_cbaj_to_r3k; | |
| 2559 | m_cbaj_to_r3k &= ~2; | |
| 2560 | return soundlatch2_byte_r(*&space,0) | ready<<24; | |
| 2526 | 2561 | } |
| 2527 | 2562 | |
| 2528 | ||
| 2563 | ||
| 2529 | 2564 | { |
| 2530 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 2531 | space->machine().scheduler().synchronize(); | |
| 2565 | machine().scheduler().synchronize(); | |
| 2532 | 2566 | |
| 2533 | state->m_cbaj_to_z80 |= 2; | |
| 2534 | state->m_latch_to_z80 = data; | |
| 2567 | m_cbaj_to_z80 |= 2; | |
| 2568 | m_latch_to_z80 = data; | |
| 2535 | 2569 | } |
| 2536 | 2570 | |
| 2537 | 2571 | static DRIVER_INIT( coh1002m ) |
| 2538 | 2572 | { |
| 2573 | zn_state *state = machine.driver_data<zn_state>(); | |
| 2539 | 2574 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); |
| 2540 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fb00000, 0x1fb00003, FUNC(cbaj_z80_r), FUNC(cbaj_z80_w) ); | |
| 2541 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb00004, 0x1fb00007, FUNC(coh1002m_bank_w) ); | |
| 2575 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1fb00000, 0x1fb00003, read32_delegate(FUNC(zn_state::cbaj_z80_r),state), write32_delegate(FUNC(zn_state::cbaj_z80_w),state)); | |
| 2576 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1fb00004, 0x1fb00007, write32_delegate(FUNC(zn_state::coh1002m_bank_w),state)); | |
| 2542 | 2577 | |
| 2543 | 2578 | zn_driver_init(machine); |
| 2544 | 2579 | } |
| r14896 | r14897 | |
| 2549 | 2584 | zn_machine_init(machine); |
| 2550 | 2585 | } |
| 2551 | 2586 | |
| 2552 | ||
| 2587 | ||
| 2553 | 2588 | { |
| 2554 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 2555 | 2589 | |
| 2556 | state->m_cbaj_to_z80 &= ~2; | |
| 2557 | return state->m_latch_to_z80; | |
| 2590 | m_cbaj_to_z80 &= ~2; | |
| 2591 | return m_latch_to_z80; | |
| 2558 | 2592 | } |
| 2559 | 2593 | |
| 2560 | ||
| 2594 | ||
| 2561 | 2595 | { |
| 2562 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 2563 | 2596 | |
| 2564 | state->m_cbaj_to_r3k |= 2; | |
| 2565 | state->soundlatch2_w(*space, 0, data); | |
| 2597 | m_cbaj_to_r3k |= 2; | |
| 2598 | soundlatch2_byte_w(*&space, 0, data); | |
| 2566 | 2599 | } |
| 2567 | 2600 | |
| 2568 | ||
| 2601 | ||
| 2569 | 2602 | { |
| 2570 | zn_state *state = space->machine().driver_data<zn_state>(); | |
| 2571 | 2603 | |
| 2572 | int ret = | |
| 2604 | int ret = | |
| 2573 | 2605 | |
| 2574 | | |
| 2606 | | |
| 2575 | 2607 | |
| 2576 | 2608 | return ret; |
| 2577 | 2609 | } |
| r14896 | r14897 | |
| 2584 | 2616 | static ADDRESS_MAP_START( cbaj_z80_port_map, AS_IO, 8, zn_state ) |
| 2585 | 2617 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2586 | 2618 | AM_RANGE( 0x84, 0x85 ) AM_DEVREADWRITE_LEGACY("ymz", ymz280b_r, ymz280b_w ) |
| 2587 | AM_RANGE( 0x90, 0x90 ) AM_READWRITE_LEGACY(cbaj_z80_latch_r, cbaj_z80_latch_w ) | |
| 2588 | AM_RANGE( 0x91, 0x91 ) AM_READ_LEGACY(cbaj_z80_ready_r ) | |
| 2619 | AM_RANGE( 0x90, 0x90 ) AM_READWRITE(cbaj_z80_latch_r, cbaj_z80_latch_w ) | |
| 2620 | AM_RANGE( 0x91, 0x91 ) AM_READ(cbaj_z80_ready_r ) | |
| 2589 | 2621 | ADDRESS_MAP_END |
| 2590 | 2622 | |
| 2591 | 2623 |
| r14896 | r14897 | |
|---|---|---|
| 900 | 900 | AM_RANGE(0x000000, 0x17ffff) AM_ROM |
| 901 | 901 | |
| 902 | 902 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // area [B] - Work RAM |
| 903 | AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(paletteram | |
| 903 | AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(paletteram | |
| 904 | 904 | |
| 905 | 905 | AM_RANGE(0x300000, 0x303fff) AM_RAM_WRITE(galpani3_suprnova_sprite32_w) AM_SHARE("spriteram") |
| 906 | 906 | AM_RANGE(0x380000, 0x38003f) AM_RAM_WRITE(galpani3_suprnova_sprite32regs_w) AM_BASE(m_sprregs) |
| r14896 | r14897 | |
|---|---|---|
| 164 | 164 | AM_RANGE(0xb14000, 0xb17fff) AM_WRITENOP //used by histryma @0x0000b25a,b270 |
| 165 | 165 | AM_RANGE(0xb18000, 0xb1bfff) AM_WRITENOP //used by histryma @0x0000b25a,b270,b286 |
| 166 | 166 | |
| 167 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(paletteram | |
| 167 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(paletteram | |
| 168 | 168 | |
| 169 | 169 | AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE(m_spriteram) |
| 170 | 170 | |
| r14896 | r14897 | |
| 195 | 195 | AM_RANGE(0xb0c000, 0xb0ffff) AM_RAM_WRITE(fof_txt_tileram_w) AM_BASE(m_fof_txt_tileram) |
| 196 | 196 | |
| 197 | 197 | AM_RANGE(0xc00000, 0xc00fff) AM_READONLY |
| 198 | AM_RANGE(0xc00000, 0xc03fff) AM_WRITE(paletteram | |
| 198 | AM_RANGE(0xc00000, 0xc03fff) AM_WRITE(paletteram | |
| 199 | 199 | |
| 200 | 200 | AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE(m_spriteram) |
| 201 | 201 |
| r14896 | r14897 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | WRITE16_MEMBER(terracre_state::amazon_sound_w) |
| 148 | 148 | { |
| 149 | soundlatch_w(space,0,((data & 0x7f) << 1) | 1); | |
| 149 | soundlatch_byte_w(space,0,((data & 0x7f) << 1) | 1); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | READ8_MEMBER(terracre_state::soundlatch_clear_r) |
| 153 | 153 | { |
| 154 | soundlatch_clear_w(space,0,0); | |
| 154 | soundlatch_clear_byte_w(space,0,0); | |
| 155 | 155 | return 0; |
| 156 | 156 | } |
| 157 | 157 | |
| r14896 | r14897 | |
| 239 | 239 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("dac1", dac_signed_w) |
| 240 | 240 | AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("dac2", dac_signed_w) |
| 241 | 241 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r) |
| 242 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r) | |
| 242 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r) | |
| 243 | 243 | ADDRESS_MAP_END |
| 244 | 244 | |
| 245 | 245 | static ADDRESS_MAP_START( sound_2203_io_map, AS_IO, 8, terracre_state ) |
| r14896 | r14897 | |
| 248 | 248 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("dac1", dac_signed_w) |
| 249 | 249 | AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("dac2", dac_signed_w) |
| 250 | 250 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r) |
| 251 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r) | |
| 251 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r) | |
| 252 | 252 | ADDRESS_MAP_END |
| 253 | 253 | |
| 254 | 254 | static INPUT_PORTS_START( terracre ) |
| r14896 | r14897 | |
|---|---|---|
| 343 | 343 | |
| 344 | 344 | WRITE32_MEMBER(deco32_state::deco32_sound_w) |
| 345 | 345 | { |
| 346 | soundlatch_w(space,0,data & 0xff); | |
| 346 | soundlatch_byte_w(space,0,data & 0xff); | |
| 347 | 347 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 348 | 348 | } |
| 349 | 349 | |
| r14896 | r14897 | |
| 669 | 669 | if (offset==0x700/4) { |
| 670 | 670 | |
| 671 | 671 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 672 | soundlatch_w(space,0,(data>>16)&0xff); | |
| 672 | soundlatch_byte_w(space,0,(data>>16)&0xff); | |
| 673 | 673 | m_nslasher_sound_irq |= 0x02; |
| 674 | 674 | cputag_set_input_line(machine(), "audiocpu", 0, (m_nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); |
| 675 | 675 | } |
| r14896 | r14897 | |
| 1004 | 1004 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1005 | 1005 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 1006 | 1006 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 1007 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 1007 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 1008 | 1008 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 1009 | 1009 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 1010 | 1010 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
| 1015 | 1015 | /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ |
| 1016 | 1016 | m_nslasher_sound_irq &= ~0x02; |
| 1017 | 1017 | cputag_set_input_line(machine(), "audiocpu", 0, (m_nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); |
| 1018 | return soundlatch_r(space,0); | |
| 1018 | return soundlatch_byte_r(space,0); | |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | static ADDRESS_MAP_START( nslasher_sound, AS_PROGRAM, 8, deco32_state ) |
| r14896 | r14897 | |
| 3352 | 3352 | |
| 3353 | 3353 | deco156_decrypt(machine); |
| 3354 | 3354 | |
| 3355 | soundlatch_setclearedvalue(machine, 0xff); | |
| 3355 | deco32_state *state = machine.driver_data<deco32_state>(); | |
| 3356 | state->soundlatch_setclearedvalue(0xff); | |
| 3356 | 3357 | |
| 3357 | 3358 | /* The board for Night Slashers is very close to the Fighter's History and |
| 3358 | 3359 | Tattoo Assassins boards, but has an encrypted ARM cpu. */ |
| r14896 | r14897 | |
|---|---|---|
| 198 | 198 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") |
| 199 | 199 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") |
| 200 | 200 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") |
| 201 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) | |
| 201 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w) | |
| 202 | 202 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 203 | 203 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| 204 | 204 | AM_RANGE(0xc300, 0xc301) AM_RAM AM_BASE(m_bg0_scrollx) |
| r14896 | r14897 | |
| 222 | 222 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") |
| 223 | 223 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") |
| 224 | 224 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") |
| 225 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) | |
| 225 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w) | |
| 226 | 226 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 227 | 227 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| 228 | 228 | AM_RANGE(0xc300, 0xc300) AM_WRITE(valtric_unknown_w) |
| r14896 | r14897 | |
| 247 | 247 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") |
| 248 | 248 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") |
| 249 | 249 | AM_RANGE(0xc100, 0xc100) AM_WRITE(butasan_unknown_w) |
| 250 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) | |
| 250 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w) | |
| 251 | 251 | AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w) |
| 252 | 252 | AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w) |
| 253 | 253 | AM_RANGE(0xc203, 0xc203) AM_WRITE(butasan_pageselect_w) |
| r14896 | r14897 | |
| 268 | 268 | static ADDRESS_MAP_START( sound_map_a, AS_PROGRAM, 8, argus_state ) |
| 269 | 269 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 270 | 270 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 271 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) | |
| 271 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) | |
| 272 | 272 | ADDRESS_MAP_END |
| 273 | 273 | |
| 274 | 274 | static ADDRESS_MAP_START( sound_map_b, AS_PROGRAM, 8, argus_state ) |
| 275 | 275 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 276 | 276 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 277 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 277 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 278 | 278 | ADDRESS_MAP_END |
| 279 | 279 | |
| 280 | 280 | #if 0 |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | public: |
| 33 | 33 | superdq_state(const machine_config &mconfig, device_type type, const char *tag) |
| 34 | 34 | : driver_device(mconfig, type, tag), |
| 35 | m_laserdisc(*this, "laserdisc") { } | |
| 35 | m_laserdisc(*this, "laserdisc") , | |
| 36 | m_videoram(*this, "videoram"){ } | |
| 36 | 37 | |
| 37 | 38 | required_device<pioneer_ldv1000_device> m_laserdisc; |
| 38 | 39 | UINT8 m_ld_in_latch; |
| 39 | 40 | UINT8 m_ld_out_latch; |
| 40 | 41 | |
| 41 | UINT8 | |
| 42 | required_shared_ptr<UINT8> | |
| 42 | 43 | tilemap_t *m_tilemap; |
| 43 | 44 | int m_color_bank; |
| 44 | 45 | DECLARE_WRITE8_MEMBER(superdq_videoram_w); |
| r14896 | r14897 | |
| 50 | 51 | static TILE_GET_INFO( get_tile_info ) |
| 51 | 52 | { |
| 52 | 53 | superdq_state *state = machine.driver_data<superdq_state>(); |
| 53 | int tile = state->m_videoram[tile_index]; | |
| 54 | int tile = state->m_videoram.target()[tile_index]; | |
| 54 | 55 | |
| 55 | 56 | SET_TILE_INFO(0, tile, state->m_color_bank, 0); |
| 56 | 57 | } |
| r14896 | r14897 | |
| 146 | 147 | WRITE8_MEMBER(superdq_state::superdq_videoram_w) |
| 147 | 148 | { |
| 148 | 149 | |
| 149 | m_videoram[offset] = data; | |
| 150 | m_videoram.target()[offset] = data; | |
| 150 | 151 | m_tilemap->mark_tile_dirty(offset); |
| 151 | 152 | } |
| 152 | 153 | |
| r14896 | r14897 | |
| 202 | 203 | static ADDRESS_MAP_START( superdq_map, AS_PROGRAM, 8, superdq_state ) |
| 203 | 204 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 204 | 205 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 205 | AM_RANGE(0x5c00, 0x5fff) AM_RAM_WRITE(superdq_videoram_w) AM_ | |
| 206 | AM_RANGE(0x5c00, 0x5fff) AM_RAM_WRITE(superdq_videoram_w) AM_ | |
| 206 | 207 | ADDRESS_MAP_END |
| 207 | 208 | |
| 208 | 209 | static ADDRESS_MAP_START( superdq_io, AS_IO, 8, superdq_state ) |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | { |
| 28 | 28 | public: |
| 29 | 29 | bestleag_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | : driver_device(mconfig, type, tag) { } | |
| 30 | : driver_device(mconfig, type, tag) , | |
| 31 | m_bgram(*this, "bgram"), | |
| 32 | m_fgram(*this, "fgram"), | |
| 33 | m_txram(*this, "txram"), | |
| 34 | m_vregs(*this, "vregs"), | |
| 35 | m_spriteram(*this, "spriteram"){ } | |
| 31 | 36 | |
| 32 | UINT16 *m_txram; | |
| 33 | UINT16 *m_bgram; | |
| 34 | UINT16 *m_fgram; | |
| 35 | UINT16 *m_vregs; | |
| 37 | required_shared_ptr<UINT16> m_bgram; | |
| 38 | required_shared_ptr<UINT16> m_fgram; | |
| 39 | required_shared_ptr<UINT16> m_txram; | |
| 40 | required_shared_ptr<UINT16> m_vregs; | |
| 41 | required_shared_ptr<UINT16> m_spriteram; | |
| 36 | 42 | tilemap_t *m_tx_tilemap; |
| 37 | 43 | tilemap_t *m_bg_tilemap; |
| 38 | 44 | tilemap_t *m_fg_tilemap; |
| 39 | UINT16 *m_spriteram; | |
| 40 | size_t m_spriteram_size; | |
| 41 | 45 | DECLARE_WRITE16_MEMBER(bestleag_txram_w); |
| 42 | 46 | DECLARE_WRITE16_MEMBER(bestleag_bgram_w); |
| 43 | 47 | DECLARE_WRITE16_MEMBER(bestleag_fgram_w); |
| r14896 | r14897 | |
| 50 | 54 | static TILE_GET_INFO( get_tx_tile_info ) |
| 51 | 55 | { |
| 52 | 56 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 53 | int code = state->m_txram[tile_index]; | |
| 57 | int code = state->m_txram.target()[tile_index]; | |
| 54 | 58 | |
| 55 | 59 | SET_TILE_INFO( |
| 56 | 60 | 0, |
| r14896 | r14897 | |
| 62 | 66 | static TILE_GET_INFO( get_bg_tile_info ) |
| 63 | 67 | { |
| 64 | 68 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 65 | int code = state->m_bgram[tile_index]; | |
| 69 | int code = state->m_bgram.target()[tile_index]; | |
| 66 | 70 | |
| 67 | 71 | SET_TILE_INFO( |
| 68 | 72 | 1, |
| r14896 | r14897 | |
| 74 | 78 | static TILE_GET_INFO( get_fg_tile_info ) |
| 75 | 79 | { |
| 76 | 80 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 77 | int code = state->m_fgram[tile_index]; | |
| 81 | int code = state->m_fgram.target()[tile_index]; | |
| 78 | 82 | |
| 79 | 83 | SET_TILE_INFO( |
| 80 | 84 | 1, |
| r14896 | r14897 | |
| 113 | 117 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 114 | 118 | { |
| 115 | 119 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 116 | UINT16 *spriteram16 = state->m_spriteram; | |
| 120 | UINT16 *spriteram16 = state->m_spriteram.target(); | |
| 117 | 121 | |
| 118 | 122 | /* |
| 119 | 123 | |
| r14896 | r14897 | |
| 123 | 127 | |
| 124 | 128 | int offs; |
| 125 | 129 | |
| 126 | for (offs = 0x16/2;offs < state->m_spriteram | |
| 130 | for (offs = 0x16/2;offs < state->m_spriteram.bytes()/2;offs += 4) | |
| 127 | 131 | { |
| 128 | 132 | int code = spriteram16[offs+3] & 0xfff; |
| 129 | 133 | int color = (spriteram16[offs+2] & 0xf000) >> 12; |
| r14896 | r14897 | |
| 136 | 140 | return; |
| 137 | 141 | |
| 138 | 142 | /* it can change sprites color mask like the original set */ |
| 139 | if(state->m_vregs[0x00/2] & 0x1000) | |
| 143 | if(state->m_vregs.target()[0x00/2] & 0x1000) | |
| 140 | 144 | color &= 7; |
| 141 | 145 | |
| 142 | 146 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| r14896 | r14897 | |
| 169 | 173 | static SCREEN_UPDATE_IND16(bestleag) |
| 170 | 174 | { |
| 171 | 175 | bestleag_state *state = screen.machine().driver_data<bestleag_state>(); |
| 172 | state->m_bg_tilemap->set_scrollx(0,(state->m_vregs[0x00/2] & 0xfff) + (state->m_vregs[0x08/2] & 0x7) - 3); | |
| 173 | state->m_bg_tilemap->set_scrolly(0,state->m_vregs[0x02/2]); | |
| 174 | state->m_tx_tilemap->set_scrollx(0,state->m_vregs[0x04/2]); | |
| 175 | state->m_tx_tilemap->set_scrolly(0,state->m_vregs[0x06/2]); | |
| 176 | state->m_fg_tilemap->set_scrollx(0,state->m_vregs[0x08/2] & 0xfff8); | |
| 177 | state->m_fg_tilemap->set_scrolly(0,state->m_vregs[0x0a/2]); | |
| 176 | state->m_bg_tilemap->set_scrollx(0,(state->m_vregs.target()[0x00/2] & 0xfff) + (state->m_vregs.target()[0x08/2] & 0x7) - 3); | |
| 177 | state->m_bg_tilemap->set_scrolly(0,state->m_vregs.target()[0x02/2]); | |
| 178 | state->m_tx_tilemap->set_scrollx(0,state->m_vregs.target()[0x04/2]); | |
| 179 | state->m_tx_tilemap->set_scrolly(0,state->m_vregs.target()[0x06/2]); | |
| 180 | state->m_fg_tilemap->set_scrollx(0,state->m_vregs.target()[0x08/2] & 0xfff8); | |
| 181 | state->m_fg_tilemap->set_scrolly(0,state->m_vregs.target()[0x0a/2]); | |
| 178 | 182 | |
| 179 | 183 | state->m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 180 | 184 | state->m_fg_tilemap->draw(bitmap, cliprect, 0,0); |
| r14896 | r14897 | |
| 186 | 190 | static SCREEN_UPDATE_IND16(bestleaw) |
| 187 | 191 | { |
| 188 | 192 | bestleag_state *state = screen.machine().driver_data<bestleag_state>(); |
| 189 | state->m_bg_tilemap->set_scrollx(0,state->m_vregs[0x08/2]); | |
| 190 | state->m_bg_tilemap->set_scrolly(0,state->m_vregs[0x0a/2]); | |
| 191 | state->m_tx_tilemap->set_scrollx(0,state->m_vregs[0x00/2]); | |
| 192 | state->m_tx_tilemap->set_scrolly(0,state->m_vregs[0x02/2]); | |
| 193 | state->m_fg_tilemap->set_scrollx(0,state->m_vregs[0x04/2]); | |
| 194 | state->m_fg_tilemap->set_scrolly(0,state->m_vregs[0x06/2]); | |
| 193 | state->m_bg_tilemap->set_scrollx(0,state->m_vregs.target()[0x08/2]); | |
| 194 | state->m_bg_tilemap->set_scrolly(0,state->m_vregs.target()[0x0a/2]); | |
| 195 | state->m_tx_tilemap->set_scrollx(0,state->m_vregs.target()[0x00/2]); | |
| 196 | state->m_tx_tilemap->set_scrolly(0,state->m_vregs.target()[0x02/2]); | |
| 197 | state->m_fg_tilemap->set_scrollx(0,state->m_vregs.target()[0x04/2]); | |
| 198 | state->m_fg_tilemap->set_scrolly(0,state->m_vregs.target()[0x06/2]); | |
| 195 | 199 | |
| 196 | 200 | state->m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 197 | 201 | state->m_fg_tilemap->draw(bitmap, cliprect, 0,0); |
| r14896 | r14897 | |
| 202 | 206 | |
| 203 | 207 | WRITE16_MEMBER(bestleag_state::bestleag_txram_w) |
| 204 | 208 | { |
| 205 | m_txram[offset] = data; | |
| 209 | m_txram.target()[offset] = data; | |
| 206 | 210 | m_tx_tilemap->mark_tile_dirty(offset); |
| 207 | 211 | } |
| 208 | 212 | |
| 209 | 213 | WRITE16_MEMBER(bestleag_state::bestleag_bgram_w) |
| 210 | 214 | { |
| 211 | m_bgram[offset] = data; | |
| 215 | m_bgram.target()[offset] = data; | |
| 212 | 216 | m_bg_tilemap->mark_tile_dirty(offset); |
| 213 | 217 | } |
| 214 | 218 | |
| 215 | 219 | WRITE16_MEMBER(bestleag_state::bestleag_fgram_w) |
| 216 | 220 | { |
| 217 | m_fgram[offset] = data; | |
| 221 | m_fgram.target()[offset] = data; | |
| 218 | 222 | m_fg_tilemap->mark_tile_dirty(offset); |
| 219 | 223 | } |
| 220 | 224 | |
| r14896 | r14897 | |
| 230 | 234 | static ADDRESS_MAP_START( bestleag_map, AS_PROGRAM, 16, bestleag_state ) |
| 231 | 235 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 232 | 236 | AM_RANGE(0x0d2000, 0x0d3fff) AM_NOP // left over from the original game (only read / written in memory test) |
| 233 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM_WRITE(bestleag_bgram_w) AM_BASE(m_bgram) | |
| 234 | AM_RANGE(0x0e8000, 0x0ebfff) AM_RAM_WRITE(bestleag_fgram_w) AM_BASE(m_fgram) | |
| 235 | AM_RANGE(0x0f0000, 0x0f3fff) AM_RAM_WRITE(bestleag_txram_w) AM_BASE(m_txram) | |
| 236 | AM_RANGE(0x0f8000, 0x0f800b) AM_RAM AM_BASE(m_vregs) | |
| 237 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") | |
| 238 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 237 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM_WRITE(bestleag_bgram_w) AM_SHARE("bgram") | |
| 238 | AM_RANGE(0x0e8000, 0x0ebfff) AM_RAM_WRITE(bestleag_fgram_w) AM_SHARE("fgram") | |
| 239 | AM_RANGE(0x0f0000, 0x0f3fff) AM_RAM_WRITE(bestleag_txram_w) AM_SHARE("txram") | |
| 240 | AM_RANGE(0x0f8000, 0x0f800b) AM_RAM AM_SHARE("vregs") | |
| 241 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") | |
| 242 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_SHARE("spriteram") | |
| 239 | 243 | AM_RANGE(0x300010, 0x300011) AM_READ_PORT("SYSTEM") |
| 240 | 244 | AM_RANGE(0x300012, 0x300013) AM_READ_PORT("P1") |
| 241 | 245 | AM_RANGE(0x300014, 0x300015) AM_READ_PORT("P2") |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | { |
| 41 | 41 | public: |
| 42 | 42 | tomcat_state(const machine_config &mconfig, device_type type, const char *tag) |
| 43 | : driver_device(mconfig, type, tag) { } | |
| 43 | : driver_device(mconfig, type, tag) , | |
| 44 | m_shared_ram(*this, "shared_ram"){ } | |
| 44 | 45 | |
| 45 | 46 | int m_control_num; |
| 46 | UINT16 | |
| 47 | required_shared_ptr<UINT16> | |
| 47 | 48 | UINT8 m_nvram[0x800]; |
| 48 | 49 | int m_dsp_BIO; |
| 49 | 50 | int m_dsp_idle; |
| r14896 | r14897 | |
| 254 | 255 | |
| 255 | 256 | READ16_MEMBER(tomcat_state::tomcat_shared_ram_r) |
| 256 | 257 | { |
| 257 | return m_shared_ram[offset]; | |
| 258 | return m_shared_ram.target()[offset]; | |
| 258 | 259 | } |
| 259 | 260 | |
| 260 | 261 | WRITE16_MEMBER(tomcat_state::tomcat_shared_ram_w) |
| 261 | 262 | { |
| 262 | COMBINE_DATA(&m_shared_ram[offset]); | |
| 263 | COMBINE_DATA(&m_shared_ram.target()[offset]); | |
| 263 | 264 | } |
| 264 | 265 | |
| 265 | 266 | READ8_MEMBER(tomcat_state::tomcat_nvram_r) |
| r14896 | r14897 | |
| 303 | 304 | ADDRESS_MAP_END |
| 304 | 305 | |
| 305 | 306 | static ADDRESS_MAP_START( dsp_map, AS_PROGRAM, 16, tomcat_state ) |
| 306 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_ | |
| 307 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_ | |
| 307 | 308 | ADDRESS_MAP_END |
| 308 | 309 | |
| 309 | 310 | static ADDRESS_MAP_START( dsp_io_map, AS_IO, 16, tomcat_state ) |
| r14896 | r14897 | |
| 357 | 358 | static MACHINE_START(tomcat) |
| 358 | 359 | { |
| 359 | 360 | tomcat_state *state = machine.driver_data<tomcat_state>(); |
| 360 | ((UINT16*)state->m_shared_ram)[0x0000] = 0xf600; | |
| 361 | ((UINT16*)state->m_shared_ram)[0x0001] = 0x0000; | |
| 362 | ((UINT16*)state->m_shared_ram)[0x0002] = 0xf600; | |
| 363 | ((UINT16*)state->m_shared_ram)[0x0003] = 0x0000; | |
| 361 | ((UINT16*)state->m_shared_ram.target())[0x0000] = 0xf600; | |
| 362 | ((UINT16*)state->m_shared_ram.target())[0x0001] = 0x0000; | |
| 363 | ((UINT16*)state->m_shared_ram.target())[0x0002] = 0xf600; | |
| 364 | ((UINT16*)state->m_shared_ram.target())[0x0003] = 0x0000; | |
| 364 | 365 | |
| 365 | 366 | machine.device<nvram_device>("nvram")->set_base(state->m_nvram, 0x800); |
| 366 | 367 |
| r14896 | r14897 | |
|---|---|---|
| 469 | 469 | AM_RANGE(0xc027, 0xc027) AM_MIRROR(0x1fc0) AM_WRITE(congo_color_bank_w) |
| 470 | 470 | AM_RANGE(0xc028, 0xc029) AM_MIRROR(0x1fc4) AM_WRITE(zaxxon_bg_position_w) |
| 471 | 471 | AM_RANGE(0xc030, 0xc033) AM_MIRROR(0x1fc4) AM_WRITE(congo_sprite_custom_w) |
| 472 | AM_RANGE(0xc038, 0xc03f) AM_MIRROR(0x1fc0) AM_WRITE(soundlatch_w) | |
| 472 | AM_RANGE(0xc038, 0xc03f) AM_MIRROR(0x1fc0) AM_WRITE(soundlatch_byte_w) | |
| 473 | 473 | ADDRESS_MAP_END |
| 474 | 474 | |
| 475 | 475 | |
| r14896 | r14897 | |
| 875 | 875 | |
| 876 | 876 | static const ppi8255_interface congo_ppi_intf = |
| 877 | 877 | { |
| 878 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 878 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 879 | 879 | DEVCB_NULL, |
| 880 | 880 | DEVCB_NULL, |
| 881 | 881 | DEVCB_NULL, |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | // These values were derived based on disassembly of the code. Usually, it |
| 20 | 20 | // was pretty obvious what the values should be. Of course, this will have |
| 21 | 21 | // to change if a different ROM set ever surfaces. |
| 22 | ||
| 22 | ||
| 23 | 23 | { |
| 24 | switch (cpu_get_pc(&space | |
| 24 | switch (cpu_get_pc(&space. | |
| 25 | 25 | { |
| 26 | 26 | case 0x03c0: return 0x9d; |
| 27 | 27 | case 0x03e6: return 0x9f; |
| r14896 | r14897 | |
| 47 | 47 | case 0x7b58: return 0x20; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | logerror("Uncaught custom I/O read %04X at %04X\n", 0xc800+offset, cpu_get_pc(&space | |
| 50 | logerror("Uncaught custom I/O read %04X at %04X\n", 0xc800+offset, cpu_get_pc(&space. | |
| 51 | 51 | return 0x00; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | ||
| 54 | ||
| 55 | 55 | { |
| 56 | 56 | |
| 57 | switch (cpu_get_pc(&space | |
| 57 | switch (cpu_get_pc(&space. | |
| 58 | 58 | { |
| 59 | 59 | case 0x049d: return 0xad; /* compare */ |
| 60 | 60 | case 0x04b9: /* compare with 0x9e ??? When ??? */ |
| r14896 | r14897 | |
| 75 | 75 | return 0x00; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | logerror("Uncaught custom I/O read %04X at %04X\n", 0xc085+offset, cpu_get_pc(&space | |
| 78 | logerror("Uncaught custom I/O read %04X at %04X\n", 0xc085+offset, cpu_get_pc(&space. | |
| 79 | 79 | return 0x00; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | ||
| 82 | ||
| 83 | 83 | { |
| 84 | 84 | |
| 85 | switch (cpu_get_pc(&space | |
| 85 | switch (cpu_get_pc(&space. | |
| 86 | 86 | { |
| 87 | 87 | case 0x0395: return 0xf7; /* $C900 compare */ |
| 88 | 88 | case 0x03f5: /* $c8fd */ |
| r14896 | r14897 | |
| 100 | 100 | return 0x00; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | logerror("Uncaught custom I/O read %04X at %04X\n", 0xc8fb+offset, cpu_get_pc(&space | |
| 103 | logerror("Uncaught custom I/O read %04X at %04X\n", 0xc8fb+offset, cpu_get_pc(&space. | |
| 104 | 104 | return 0x00; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | ||
| 108 | ||
| 109 | 109 | { |
| 110 | 110 | if (offset == 0x100) return 0x63; |
| 111 | 111 | |
| 112 | 112 | return 0x00; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | ||
| 115 | ||
| 116 | 116 | { |
| 117 | 117 | if (offset == 0x100) return 0x6a; |
| 118 | 118 | |
| r14896 | r14897 | |
| 130 | 130 | gfx_element_set_source(machine.gfx[1], state->m_imago_sprites); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | ||
| 133 | ||
| 134 | 134 | { |
| 135 | cputag_set_input_line( | |
| 135 | cputag_set_input_line( | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | ||
| 138 | ||
| 139 | 139 | { |
| 140 | fastfred_state *state = space->machine().driver_data<fastfred_state>(); | |
| 141 | state->m_imago_sprites_bank = (data & 2) >> 1; | |
| 140 | m_imago_sprites_bank = (data & 2) >> 1; | |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | ||
| 143 | ||
| 145 | 144 | { |
| 146 | fastfred_state *state = space->machine().driver_data<fastfred_state>(); | |
| 147 | UINT8 *rom = (UINT8 *)space->machine().region("gfx2")->base(); | |
| 145 | UINT8 *rom = (UINT8 *)machine().region("gfx2")->base(); | |
| 148 | 146 | UINT8 sprites_data; |
| 149 | 147 | |
| 150 | sprites_data = rom[state->m_imago_sprites_address + 0x2000*0 + state->m_imago_sprites_bank * 0x1000]; | |
| 151 | state->m_imago_sprites[offset + 0x800*0] = sprites_data; | |
| 148 | sprites_data = rom[m_imago_sprites_address + 0x2000*0 + m_imago_sprites_bank * 0x1000]; | |
| 149 | m_imago_sprites[offset + 0x800*0] = sprites_data; | |
| 152 | 150 | |
| 153 | sprites_data = rom[state->m_imago_sprites_address + 0x2000*1 + state->m_imago_sprites_bank * 0x1000]; | |
| 154 | state->m_imago_sprites[offset + 0x800*1] = sprites_data; | |
| 151 | sprites_data = rom[m_imago_sprites_address + 0x2000*1 + m_imago_sprites_bank * 0x1000]; | |
| 152 | m_imago_sprites[offset + 0x800*1] = sprites_data; | |
| 155 | 153 | |
| 156 | sprites_data = rom[state->m_imago_sprites_address + 0x2000*2 + state->m_imago_sprites_bank * 0x1000]; | |
| 157 | state->m_imago_sprites[offset + 0x800*2] = sprites_data; | |
| 154 | sprites_data = rom[m_imago_sprites_address + 0x2000*2 + m_imago_sprites_bank * 0x1000]; | |
| 155 | m_imago_sprites[offset + 0x800*2] = sprites_data; | |
| 158 | 156 | |
| 159 | gfx_element_mark_dirty( | |
| 157 | gfx_element_mark_dirty( | |
| 160 | 158 | } |
| 161 | 159 | |
| 162 | ||
| 160 | ||
| 163 | 161 | { |
| 164 | fastfred_state *state = space->machine().driver_data<fastfred_state>(); | |
| 165 | state->m_imago_sprites_address = offset; | |
| 162 | m_imago_sprites_address = offset; | |
| 166 | 163 | return 0xff; //not really used |
| 167 | 164 | } |
| 168 | 165 | |
| 169 | ||
| 166 | ||
| 170 | 167 | { |
| 171 | fastfred_state *state = space->machine().driver_data<fastfred_state>(); | |
| 172 | 168 | |
| 173 | | |
| 169 | | |
| 174 | 170 | } |
| 175 | 171 | |
| 176 | ||
| 172 | ||
| 177 | 173 | { |
| 178 | fastfred_state *state = space->machine().driver_data<fastfred_state>(); | |
| 179 | 174 | |
| 180 | | |
| 175 | | |
| 181 | 176 | } |
| 182 | 177 | |
| 183 | 178 | static ADDRESS_MAP_START( fastfred_map, AS_PROGRAM, 8, fastfred_state ) |
| r14896 | r14897 | |
| 185 | 180 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 186 | 181 | AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x400) AM_RAM_WRITE_LEGACY(fastfred_videoram_w) AM_BASE(m_videoram) |
| 187 | 182 | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE_LEGACY(fastfred_attributes_w) AM_BASE(m_attributesram) |
| 188 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE(m_spriteram | |
| 183 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 189 | 184 | AM_RANGE(0xd860, 0xdbff) AM_RAM // Unused, but initialized |
| 190 | 185 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("BUTTONS") AM_WRITEONLY AM_BASE(m_background_color) |
| 191 | 186 | AM_RANGE(0xe800, 0xe800) AM_READ_PORT("JOYS") |
| 192 | 187 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSW") AM_WRITENOP |
| 193 | AM_RANGE(0xf001, 0xf001) AM_WRITE | |
| 188 | AM_RANGE(0xf001, 0xf001) AM_WRITE | |
| 194 | 189 | AM_RANGE(0xf002, 0xf002) AM_WRITE_LEGACY(fastfred_colorbank1_w) |
| 195 | 190 | AM_RANGE(0xf003, 0xf003) AM_WRITE_LEGACY(fastfred_colorbank2_w) |
| 196 | 191 | AM_RANGE(0xf004, 0xf004) AM_WRITE_LEGACY(fastfred_charbank1_w) |
| r14896 | r14897 | |
| 199 | 194 | AM_RANGE(0xf007, 0xf007) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 200 | 195 | AM_RANGE(0xf116, 0xf116) AM_WRITE_LEGACY(fastfred_flip_screen_x_w) |
| 201 | 196 | AM_RANGE(0xf117, 0xf117) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 202 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(watchdog_reset_r, soundlatch_w) | |
| 197 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) | |
| 203 | 198 | ADDRESS_MAP_END |
| 204 | 199 | |
| 205 | 200 | |
| r14896 | r14897 | |
| 207 | 202 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 208 | 203 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 209 | 204 | AM_RANGE(0xd000, 0xd03f) AM_RAM_WRITE_LEGACY(fastfred_attributes_w) AM_BASE(m_attributesram) |
| 210 | AM_RANGE(0xd040, 0xd05f) AM_RAM AM_BASE(m_spriteram | |
| 205 | AM_RANGE(0xd040, 0xd05f) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 211 | 206 | AM_RANGE(0xd060, 0xd3ff) AM_RAM |
| 212 | 207 | AM_RANGE(0xd800, 0xdbff) AM_MIRROR(0x400) AM_RAM_WRITE_LEGACY(fastfred_videoram_w) AM_BASE(m_videoram) |
| 213 | 208 | AM_RANGE(0xe000, 0xe000) AM_WRITEONLY AM_BASE(m_background_color) |
| r14896 | r14897 | |
| 216 | 211 | AM_RANGE(0xe802, 0xe802) AM_READ_PORT("BUTTONS") |
| 217 | 212 | AM_RANGE(0xe803, 0xe803) AM_READ_PORT("JOYS") |
| 218 | 213 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP // Unused, but initialized |
| 219 | AM_RANGE(0xf001, 0xf001) AM_WRITE | |
| 214 | AM_RANGE(0xf001, 0xf001) AM_WRITE | |
| 220 | 215 | AM_RANGE(0xf002, 0xf002) AM_WRITE_LEGACY(fastfred_colorbank1_w) |
| 221 | 216 | AM_RANGE(0xf003, 0xf003) AM_WRITE_LEGACY(fastfred_colorbank2_w) |
| 222 | 217 | AM_RANGE(0xf004, 0xf004) AM_WRITE_LEGACY(fastfred_charbank1_w) |
| r14896 | r14897 | |
| 232 | 227 | |
| 233 | 228 | static ADDRESS_MAP_START( imago_map, AS_PROGRAM, 8, fastfred_state ) |
| 234 | 229 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 235 | AM_RANGE(0x1000, 0x1fff) AM_READ | |
| 230 | AM_RANGE(0x1000, 0x1fff) AM_READ | |
| 236 | 231 | AM_RANGE(0x2000, 0x6fff) AM_ROM |
| 237 | 232 | AM_RANGE(0xb000, 0xb3ff) AM_RAM // same fg videoram (which one of the 2 is really used?) |
| 238 | AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE | |
| 233 | AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE | |
| 239 | 234 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 240 | 235 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE_LEGACY(imago_fg_videoram_w) AM_BASE(m_imago_fg_videoram) |
| 241 | 236 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE_LEGACY(fastfred_videoram_w) AM_BASE(m_videoram) |
| 242 | 237 | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE_LEGACY(fastfred_attributes_w) AM_BASE(m_attributesram) |
| 243 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE(m_spriteram | |
| 238 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 244 | 239 | AM_RANGE(0xd860, 0xd8ff) AM_RAM // Unused, but initialized |
| 245 | 240 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("BUTTONS") |
| 246 | 241 | AM_RANGE(0xe800, 0xe800) AM_READ_PORT("JOYS") |
| 247 | 242 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSW") AM_WRITENOP // writes 1 when level starts, 0 when game over |
| 248 | AM_RANGE(0xf001, 0xf001) AM_WRITE | |
| 243 | AM_RANGE(0xf001, 0xf001) AM_WRITE | |
| 249 | 244 | AM_RANGE(0xf002, 0xf002) AM_WRITE_LEGACY(fastfred_colorbank1_w) |
| 250 | 245 | AM_RANGE(0xf003, 0xf003) AM_WRITE_LEGACY(fastfred_colorbank2_w) |
| 251 | AM_RANGE(0xf004, 0xf004) AM_WRITE | |
| 246 | AM_RANGE(0xf004, 0xf004) AM_WRITE | |
| 252 | 247 | AM_RANGE(0xf005, 0xf005) AM_WRITE_LEGACY(imago_charbank_w) |
| 253 | 248 | AM_RANGE(0xf006, 0xf006) AM_WRITE_LEGACY(fastfred_flip_screen_x_w) |
| 254 | 249 | AM_RANGE(0xf007, 0xf007) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 255 | 250 | AM_RANGE(0xf400, 0xf400) AM_WRITENOP // writes 0 or 2 |
| 256 | AM_RANGE(0xf401, 0xf401) AM_WRITE_LEGACY(imago_sprites_bank_w) | |
| 257 | AM_RANGE(0xf800, 0xf800) AM_READNOP AM_WRITE(soundlatch_w) | |
| 251 | AM_RANGE(0xf401, 0xf401) AM_WRITE(imago_sprites_bank_w) | |
| 252 | AM_RANGE(0xf800, 0xf800) AM_READNOP AM_WRITE(soundlatch_byte_w) | |
| 258 | 253 | ADDRESS_MAP_END |
| 259 | 254 | |
| 260 | 255 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, fastfred_state ) |
| 261 | 256 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 262 | 257 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 263 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) AM_WRITE | |
| 258 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE | |
| 264 | 259 | AM_RANGE(0x4000, 0x4000) AM_WRITEONLY // Reset PSG's |
| 265 | 260 | AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("ay8910.1", ay8910_address_data_w) |
| 266 | 261 | AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay8910.2", ay8910_address_data_w) |
| r14896 | r14897 | |
| 1009 | 1004 | static DRIVER_INIT( flyboy ) |
| 1010 | 1005 | { |
| 1011 | 1006 | fastfred_state *state = machine.driver_data<fastfred_state>(); |
| 1012 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc085, 0xc099, FUNC(flyboy_custom1_io_r)); | |
| 1013 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc8fb, 0xc900, FUNC(flyboy_custom2_io_r)); | |
| 1007 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc085, 0xc099, read8_delegate(FUNC(fastfred_state::flyboy_custom1_io_r),state)); | |
| 1008 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc8fb, 0xc900, read8_delegate(FUNC(fastfred_state::flyboy_custom2_io_r),state)); | |
| 1014 | 1009 | state->m_hardware_type = 1; |
| 1015 | 1010 | } |
| 1016 | 1011 | |
| r14896 | r14897 | |
| 1023 | 1018 | static DRIVER_INIT( fastfred ) |
| 1024 | 1019 | { |
| 1025 | 1020 | fastfred_state *state = machine.driver_data<fastfred_state>(); |
| 1026 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1021 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1027 | 1022 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); |
| 1028 | 1023 | state->m_hardware_type = 1; |
| 1029 | 1024 | } |
| r14896 | r14897 | |
| 1031 | 1026 | static DRIVER_INIT( jumpcoas ) |
| 1032 | 1027 | { |
| 1033 | 1028 | fastfred_state *state = machine.driver_data<fastfred_state>(); |
| 1034 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1029 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1035 | 1030 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); |
| 1036 | 1031 | state->m_hardware_type = 0; |
| 1037 | 1032 | } |
| r14896 | r14897 | |
| 1039 | 1034 | static DRIVER_INIT( boggy84b ) |
| 1040 | 1035 | { |
| 1041 | 1036 | fastfred_state *state = machine.driver_data<fastfred_state>(); |
| 1042 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1037 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1043 | 1038 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); |
| 1044 | 1039 | state->m_hardware_type = 2; |
| 1045 | 1040 | } |
| r14896 | r14897 | |
| 1047 | 1042 | static DRIVER_INIT( boggy84 ) |
| 1048 | 1043 | { |
| 1049 | 1044 | fastfred_state *state = machine.driver_data<fastfred_state>(); |
| 1050 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1045 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1051 | 1046 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff); |
| 1052 | 1047 | state->m_hardware_type = 2; |
| 1053 | 1048 | } |
| r14896 | r14897 | |
|---|---|---|
| 361 | 361 | return; |
| 362 | 362 | |
| 363 | 363 | case 2: /* SONREQ (Sound CPU byte) */ |
| 364 | soundlatch_w(space, 0, data & 0xff); | |
| 364 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 365 | 365 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 366 | 366 | break; |
| 367 | 367 | |
| r14896 | r14897 | |
| 440 | 440 | |
| 441 | 441 | static ADDRESS_MAP_START( karnov_sound_map, AS_PROGRAM, 8, karnov_state ) |
| 442 | 442 | AM_RANGE(0x0000, 0x05ff) AM_RAM |
| 443 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_r) | |
| 443 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_byte_r) | |
| 444 | 444 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 445 | 445 | AM_RANGE(0x1800, 0x1801) AM_DEVWRITE_LEGACY("ym2", ym3526_w) |
| 446 | 446 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 74 | 74 | { |
| 75 | 75 | |
| 76 | 76 | /* bit 0 is flip screen */ |
| 77 | flip_screen_set( | |
| 77 | flip_screen_set( | |
| 78 | 78 | |
| 79 | 79 | /* bits 1 and 2 select ROM bank */ |
| 80 | 80 | memory_set_bank(machine(), "bank1", (data & 0x06) >> 1); |
| r14896 | r14897 | |
| 127 | 127 | else if (pc == 0x0445) |
| 128 | 128 | { |
| 129 | 129 | m_soundstate = 0x80; |
| 130 | soundlatch_w(space, 0, data); | |
| 130 | soundlatch_byte_w(space, 0, data); | |
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| r14896 | r14897 | |
| 288 | 288 | AM_RANGE(0xdf80, 0xdfff) AM_RAM |
| 289 | 289 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(lwings_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 290 | 290 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(lwings_bg1videoram_w) AM_BASE(m_bg1videoram) |
| 291 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split2_w) AM_SHARE("paletteram2") | |
| 292 | AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split1_w) AM_SHARE("paletteram") | |
| 291 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 292 | AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_lo_w) AM_SHARE("paletteram") | |
| 293 | 293 | AM_RANGE(0xf800, 0xf801) AM_WRITE(lwings_bg1_scrollx_w) |
| 294 | 294 | AM_RANGE(0xf802, 0xf803) AM_WRITE(lwings_bg1_scrolly_w) |
| 295 | 295 | AM_RANGE(0xf804, 0xf804) AM_WRITE(trojan_bg2_scrollx_w) |
| r14896 | r14897 | |
| 311 | 311 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("spriteram") |
| 312 | 312 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(lwings_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 313 | 313 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(lwings_bg1videoram_w) AM_BASE(m_bg1videoram) |
| 314 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split2_w) AM_SHARE("paletteram2") | |
| 315 | AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split1_w) AM_SHARE("paletteram") | |
| 314 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 315 | AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_lo_w) AM_SHARE("paletteram") | |
| 316 | 316 | |
| 317 | 317 | AM_RANGE(0xf808, 0xf808) AM_READ_PORT("SERVICE") |
| 318 | 318 | AM_RANGE(0xf809, 0xf809) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 320 | 320 | AM_RANGE(0xf80a, 0xf80a) AM_READ_PORT("P2") |
| 321 | 321 | AM_RANGE(0xf80b, 0xf80b) AM_READ_PORT("DSWA") |
| 322 | 322 | AM_RANGE(0xf80a, 0xf80b) AM_WRITE(lwings_bg1_scrolly_w) |
| 323 | AM_RANGE(0xf80c, 0xf80c) AM_READ_PORT("DSWB") AM_WRITE(soundlatch_w) | |
| 323 | AM_RANGE(0xf80c, 0xf80c) AM_READ_PORT("DSWB") AM_WRITE(soundlatch_byte_w) | |
| 324 | 324 | AM_RANGE(0xf80d, 0xf80d) AM_WRITE(watchdog_reset_w) |
| 325 | 325 | AM_RANGE(0xf80e, 0xf80e) AM_WRITE(lwings_bankswitch_w) |
| 326 | 326 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 333 | 333 | AM_RANGE(0xdf80, 0xdfff) AM_RAM |
| 334 | 334 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(lwings_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 335 | 335 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(lwings_bg1videoram_w) AM_BASE(m_bg1videoram) |
| 336 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split2_w) AM_SHARE("paletteram2") | |
| 337 | AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split1_w) AM_SHARE("paletteram") | |
| 336 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 337 | AM_RANGE(0xf400, 0xf7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_lo_w) AM_SHARE("paletteram") | |
| 338 | 338 | |
| 339 | 339 | AM_RANGE(0xf800, 0xf801) AM_WRITE(lwings_bg1_scrollx_w) |
| 340 | 340 | AM_RANGE(0xf802, 0xf803) AM_WRITE(lwings_bg1_scrolly_w) |
| r14896 | r14897 | |
| 344 | 344 | AM_RANGE(0xf809, 0xf809) AM_READ_PORT("P1") |
| 345 | 345 | AM_RANGE(0xf80a, 0xf80a) AM_READ_PORT("P2") |
| 346 | 346 | AM_RANGE(0xf80b, 0xf80b) AM_READ_PORT("DSWA") |
| 347 | AM_RANGE(0xf80c, 0xf80c) AM_READ_PORT("DSWB") AM_WRITE(soundlatch_w) | |
| 348 | AM_RANGE(0xf80d, 0xf80d) AM_WRITE(soundlatch2_w) | |
| 347 | AM_RANGE(0xf80c, 0xf80c) AM_READ_PORT("DSWB") AM_WRITE(soundlatch_byte_w) | |
| 348 | AM_RANGE(0xf80d, 0xf80d) AM_WRITE(soundlatch2_byte_w) | |
| 349 | 349 | AM_RANGE(0xf80e, 0xf80e) AM_WRITE(lwings_bankswitch_w) |
| 350 | 350 | ADDRESS_MAP_END |
| 351 | 351 | |
| 352 | 352 | static ADDRESS_MAP_START( lwings_sound_map, AS_PROGRAM, 8, lwings_state ) |
| 353 | 353 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 354 | 354 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 355 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) | |
| 355 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) | |
| 356 | 356 | AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("2203a", ym2203_w) |
| 357 | 357 | AM_RANGE(0xe002, 0xe003) AM_DEVWRITE_LEGACY("2203b", ym2203_w) |
| 358 | 358 | AM_RANGE(0xe006, 0xe006) AM_READ(avengers_soundlatch2_r) //AT: (avengers061gre) |
| r14896 | r14897 | |
| 372 | 372 | |
| 373 | 373 | static ADDRESS_MAP_START( trojan_adpcm_io_map, AS_IO, 8, lwings_state ) |
| 374 | 374 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 375 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r) | |
| 375 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) | |
| 376 | 376 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("5205", msm5205_w) |
| 377 | 377 | ADDRESS_MAP_END |
| 378 | 378 |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | public: |
| 20 | 20 | xtheball_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | : driver_device(mconfig, type, tag) { } | |
| 21 | : driver_device(mconfig, type, tag) , | |
| 22 | m_vram_bg(*this, "vrabg"), | |
| 23 | m_vram_fg(*this, "vrafg"){ } | |
| 22 | 24 | |
| 23 | UINT16 *m_vram_bg; | |
| 24 | UINT16 *m_vram_fg; | |
| 25 | required_shared_ptr<UINT16> m_vram_bg; | |
| 26 | required_shared_ptr<UINT16> m_vram_fg; | |
| 25 | 27 | UINT8 m_bitvals[32]; |
| 26 | 28 | DECLARE_WRITE16_MEMBER(bit_controls_w); |
| 27 | 29 | DECLARE_READ16_MEMBER(analogx_r); |
| r14896 | r14897 | |
| 40 | 42 | static void xtheball_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params) |
| 41 | 43 | { |
| 42 | 44 | xtheball_state *state = screen.machine().driver_data<xtheball_state>(); |
| 43 | UINT16 *srcbg = &state->m_vram_bg[(params->rowaddr << 8) & 0xff00]; | |
| 45 | UINT16 *srcbg = &state->m_vram_bg.target()[(params->rowaddr << 8) & 0xff00]; | |
| 44 | 46 | UINT32 *dest = &bitmap.pix32(scanline); |
| 45 | 47 | const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); |
| 46 | 48 | int coladdr = params->coladdr; |
| r14896 | r14897 | |
| 50 | 52 | if (!state->m_bitvals[0x13]) |
| 51 | 53 | { |
| 52 | 54 | /* mode 0: foreground is the same as background */ |
| 53 | UINT16 *srcfg = &state->m_vram_fg[(params->rowaddr << 8) & 0xff00]; | |
| 55 | UINT16 *srcfg = &state->m_vram_fg.target()[(params->rowaddr << 8) & 0xff00]; | |
| 54 | 56 | |
| 55 | 57 | for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++) |
| 56 | 58 | { |
| r14896 | r14897 | |
| 65 | 67 | { |
| 66 | 68 | /* mode 1: foreground is half background resolution in */ |
| 67 | 69 | /* X and supports two pages */ |
| 68 | UINT16 *srcfg = &state->m_vram_fg[(params->rowaddr << 7) & 0xff00]; | |
| 70 | UINT16 *srcfg = &state->m_vram_fg.target()[(params->rowaddr << 7) & 0xff00]; | |
| 69 | 71 | |
| 70 | 72 | for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++) |
| 71 | 73 | { |
| r14896 | r14897 | |
| 91 | 93 | { |
| 92 | 94 | xtheball_state *state = space->machine().driver_data<xtheball_state>(); |
| 93 | 95 | if (address >= 0x01000000 && address <= 0x010fffff) |
| 94 | memcpy(shiftreg, &state->m_vram_bg[TOWORD(address & 0xff000)], TOBYTE(0x1000)); | |
| 96 | memcpy(shiftreg, &state->m_vram_bg.target()[TOWORD(address & 0xff000)], TOBYTE(0x1000)); | |
| 95 | 97 | else if (address >= 0x02000000 && address <= 0x020fffff) |
| 96 | memcpy(shiftreg, &state->m_vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000)); | |
| 98 | memcpy(shiftreg, &state->m_vram_fg.target()[TOWORD(address & 0xff000)], TOBYTE(0x1000)); | |
| 97 | 99 | else |
| 98 | 100 | logerror("%s:xtheball_to_shiftreg(%08X)\n", space->machine().describe_context(), address); |
| 99 | 101 | } |
| r14896 | r14897 | |
| 103 | 105 | { |
| 104 | 106 | xtheball_state *state = space->machine().driver_data<xtheball_state>(); |
| 105 | 107 | if (address >= 0x01000000 && address <= 0x010fffff) |
| 106 | memcpy(&state->m_vram_bg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000)); | |
| 108 | memcpy(&state->m_vram_bg.target()[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000)); | |
| 107 | 109 | else if (address >= 0x02000000 && address <= 0x020fffff) |
| 108 | memcpy(&state->m_vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000)); | |
| 110 | memcpy(&state->m_vram_fg.target()[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000)); | |
| 109 | 111 | else |
| 110 | 112 | logerror("%s:xtheball_from_shiftreg(%08X)\n", space->machine().describe_context(), address); |
| 111 | 113 | } |
| r14896 | r14897 | |
| 130 | 132 | switch (offset) |
| 131 | 133 | { |
| 132 | 134 | case 7: |
| 133 | ticket_dispenser_ | |
| 135 | machine().device<ticket_dispenser_ | |
| 134 | 136 | break; |
| 135 | 137 | |
| 136 | 138 | case 8: |
| r14896 | r14897 | |
| 210 | 212 | |
| 211 | 213 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xtheball_state ) |
| 212 | 214 | AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_SHARE("nvram") |
| 213 | AM_RANGE(0x01000000, 0x010fffff) AM_RAM AM_BASE(m_vram_bg) | |
| 214 | AM_RANGE(0x02000000, 0x020fffff) AM_RAM AM_BASE(m_vram_fg) | |
| 215 | AM_RANGE(0x01000000, 0x010fffff) AM_RAM AM_SHARE("vrabg") | |
| 216 | AM_RANGE(0x02000000, 0x020fffff) AM_RAM AM_SHARE("vrafg") | |
| 215 | 217 | AM_RANGE(0x03000000, 0x030000ff) AM_DEVREADWRITE8_LEGACY("tlc34076", tlc34076_r, tlc34076_w, 0x00ff) |
| 216 | 218 | AM_RANGE(0x03040000, 0x030401ff) AM_WRITE(bit_controls_w) |
| 217 | 219 | AM_RANGE(0x03040080, 0x0304008f) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 240 | 242 | static INPUT_PORTS_START( xtheball ) |
| 241 | 243 | PORT_START("DSW") |
| 242 | 244 | PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 243 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 245 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 244 | 246 | PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 245 | 247 | PORT_DIPNAME( 0x0700, 0x0000, "Target Tickets") |
| 246 | 248 | PORT_DIPSETTING( 0x0000, "3" ) |
| r14896 | r14897 | |
| 340 | 342 | |
| 341 | 343 | MCFG_NVRAM_ADD_1FILL("nvram") |
| 342 | 344 | |
| 343 | MCFG_TICKET_DISPENSER_ADD("ticket", 100, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 345 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 344 | 346 | |
| 345 | 347 | /* video hardware */ |
| 346 | 348 | MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) |
| r14896 | r14897 | |
|---|---|---|
| 350 | 350 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 351 | 351 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 352 | 352 | AM_RANGE(0x00, 0x01) AM_WRITENOP /* the 2A03 #1 is not present */ |
| 353 | AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW2") AM_WRITE(soundlatch_w) | |
| 354 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_WRITE(soundlatch2_w) | |
| 353 | AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW2") AM_WRITE(soundlatch_byte_w) | |
| 354 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_WRITE(soundlatch2_byte_w) | |
| 355 | 355 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) /* VLM5030 */ |
| 356 | 356 | // AM_RANGE(0x05, 0x05) AM_WRITENOP /* unused */ |
| 357 | 357 | // AM_RANGE(0x06, 0x06) AM_WRITENOP |
| r14896 | r14897 | |
| 370 | 370 | |
| 371 | 371 | static ADDRESS_MAP_START( punchout_sound_map, AS_PROGRAM, 8, punchout_state ) |
| 372 | 372 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 373 | AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch_r) | |
| 374 | AM_RANGE(0x4017, 0x4017) AM_READ(soundlatch2_r) | |
| 373 | AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch_byte_r) | |
| 374 | AM_RANGE(0x4017, 0x4017) AM_READ(soundlatch2_byte_r) | |
| 375 | 375 | AM_RANGE(0x4000, 0x4017) AM_DEVREADWRITE_LEGACY("nes", nes_psg_r,nes_psg_w) |
| 376 | 376 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 377 | 377 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 23 | 23 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* 4000-7fff is written to during startup, probably leftover code */ |
| 24 | 24 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(news_fgram_w) AM_BASE(m_fgram) |
| 25 | 25 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(news_bgram_w) AM_BASE(m_bgram) |
| 26 | AM_RANGE(0x9000, 0x91ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_be_w) AM_SHARE("paletteram") | |
| 26 | AM_RANGE(0x9000, 0x91ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_be_w) AM_SHARE("paletteram") | |
| 27 | 27 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("DSW") |
| 28 | 28 | AM_RANGE(0xc001, 0xc001) AM_READ_PORT("INPUTS") |
| 29 | 29 | AM_RANGE(0xc002, 0xc002) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| r14896 | r14897 | |
|---|---|---|
| 238 | 238 | segas1x_state *state = machine.driver_data<segas1x_state>(); |
| 239 | 239 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 240 | 240 | |
| 241 | state->soundlatch_w(*space, 0, param); | |
| 241 | state->soundlatch_byte_w(*space, 0, param); | |
| 242 | 242 | device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, ASSERT_LINE); |
| 243 | 243 | } |
| 244 | 244 | |
| r14896 | r14897 | |
| 254 | 254 | { |
| 255 | 255 | segas1x_state *state = space->machine().driver_data<segas1x_state>(); |
| 256 | 256 | device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 257 | return state->soundlatch_r(*space, offset); | |
| 257 | return state->soundlatch_byte_r(*space, offset); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 |
| r14896 | r14897 | |
|---|---|---|
| 216 | 216 | |
| 217 | 217 | WRITE8_MEMBER(cclimber_state::swimmer_sh_soundlatch_w) |
| 218 | 218 | { |
| 219 | soundlatch_w(space,offset,data); | |
| 219 | soundlatch_byte_w(space,offset,data); | |
| 220 | 220 | cputag_set_input_line_and_vector(machine(), "audiocpu", 0, HOLD_LINE, 0xff); |
| 221 | 221 | } |
| 222 | 222 | |
| r14896 | r14897 | |
| 399 | 399 | static ADDRESS_MAP_START( swimmer_audio_map, AS_PROGRAM, 8, cclimber_state ) |
| 400 | 400 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 401 | 401 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 402 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 402 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 403 | 403 | AM_RANGE(0x4000, 0x4001) AM_RAM /* ??? */ |
| 404 | 404 | ADDRESS_MAP_END |
| 405 | 405 |
| r14896 | r14897 | |
|---|---|---|
| 89 | 89 | * |
| 90 | 90 | *************************************/ |
| 91 | 91 | |
| 92 | ||
| 92 | ||
| 93 | 93 | { |
| 94 | foodf_state *state = space->machine().driver_data<foodf_state>(); | |
| 95 | state->m_nvram->recall(0); | |
| 96 | state->m_nvram->recall(1); | |
| 97 | state->m_nvram->recall(0); | |
| 94 | m_nvram->recall(0); | |
| 95 | m_nvram->recall(1); | |
| 96 | m_nvram->recall(0); | |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | 99 | |
| r14896 | r14897 | |
| 160 | 159 | * |
| 161 | 160 | *************************************/ |
| 162 | 161 | |
| 163 | ||
| 162 | ||
| 164 | 163 | { |
| 165 | foodf_state *state = space->machine().driver_data<foodf_state>(); | |
| 166 | foodf_set_flip(state, data & 0x01); | |
| 164 | foodf_set_flip(data & 0x01); | |
| 167 | 165 | |
| 168 | | |
| 166 | | |
| 169 | 167 | |
| 170 | 168 | if (!(data & 0x04)) |
| 171 | atarigen_scanline_int_ack_w(space,0,0,0xffff); | |
| 169 | atarigen_scanline_int_ack_w(&space,0,0,0xffff); | |
| 172 | 170 | if (!(data & 0x08)) |
| 173 | atarigen_video_int_ack_w(space,0,0,0xffff); | |
| 171 | atarigen_video_int_ack_w(&space,0,0,0xffff); | |
| 174 | 172 | |
| 175 | 173 | output_set_led_value(0, (data >> 4) & 1); |
| 176 | 174 | output_set_led_value(1, (data >> 5) & 1); |
| 177 | 175 | |
| 178 | coin_counter_w(space->machine(), 0, (data >> 6) & 1); | |
| 179 | coin_counter_w(space->machine(), 1, (data >> 7) & 1); | |
| 176 | coin_counter_w(machine(), 0, (data >> 6) & 1); | |
| 177 | coin_counter_w(machine(), 1, (data >> 7) & 1); | |
| 180 | 178 | } |
| 181 | 179 | |
| 182 | 180 | |
| r14896 | r14897 | |
| 187 | 185 | * |
| 188 | 186 | *************************************/ |
| 189 | 187 | |
| 190 | ||
| 188 | ||
| 191 | 189 | { |
| 192 | 190 | static const char *const portnames[] = { "STICK0_X", "STICK1_X", "STICK0_Y", "STICK1_Y" }; |
| 193 | foodf_state *state = space->machine().driver_data<foodf_state>(); | |
| 194 | 191 | |
| 195 | return input_port_read( | |
| 192 | return input_port_read( | |
| 196 | 193 | } |
| 197 | 194 | |
| 198 | 195 | |
| 199 | ||
| 196 | ||
| 200 | 197 | { |
| 201 | foodf_state *state = space->machine().driver_data<foodf_state>(); | |
| 202 | state->m_whichport = offset ^ 3; | |
| 198 | m_whichport = offset ^ 3; | |
| 203 | 199 | } |
| 204 | 200 | |
| 205 | 201 | |
| r14896 | r14897 | |
| 219 | 215 | AM_RANGE(0x01c000, 0x01c0ff) AM_MIRROR(0x3e3f00) AM_RAM AM_BASE(m_spriteram) |
| 220 | 216 | AM_RANGE(0x800000, 0x8007ff) AM_MIRROR(0x03f800) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 221 | 217 | AM_RANGE(0x900000, 0x9001ff) AM_MIRROR(0x03fe00) AM_DEVREADWRITE8("nvram", x2212_device, read, write, 0x00ff) |
| 222 | AM_RANGE(0x940000, 0x940007) AM_MIRROR(0x023ff8) AM_READ_LEGACY(analog_r) | |
| 223 | AM_RANGE(0x944000, 0x944007) AM_MIRROR(0x023ff8) AM_WRITE_LEGACY(analog_w) | |
| 224 | AM_RANGE(0x948000, 0x948001) AM_MIRROR(0x023ffe) AM_READ_PORT("SYSTEM") AM_WRITE8_LEGACY(digital_w, 0x00ff) | |
| 225 | AM_RANGE(0x950000, 0x9501ff) AM_MIRROR(0x023e00) AM_WRITE_LEGACY(foodf_paletteram_w) AM_SHARE("paletteram") | |
| 226 | AM_RANGE(0x954000, 0x954001) AM_MIRROR(0x023ffe) AM_WRITE_LEGACY(nvram_recall_w) | |
| 218 | AM_RANGE(0x940000, 0x940007) AM_MIRROR(0x023ff8) AM_READ(analog_r) | |
| 219 | AM_RANGE(0x944000, 0x944007) AM_MIRROR(0x023ff8) AM_WRITE(analog_w) | |
| 220 | AM_RANGE(0x948000, 0x948001) AM_MIRROR(0x023ffe) AM_READ_PORT("SYSTEM") AM_WRITE8(digital_w, 0x00ff) | |
| 221 | AM_RANGE(0x950000, 0x9501ff) AM_MIRROR(0x023e00) AM_WRITE(foodf_paletteram_w) AM_SHARE("paletteram") | |
| 222 | AM_RANGE(0x954000, 0x954001) AM_MIRROR(0x023ffe) AM_WRITE(nvram_recall_w) | |
| 227 | 223 | AM_RANGE(0x958000, 0x958001) AM_MIRROR(0x023ffe) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) |
| 228 | 224 | AM_RANGE(0xa40000, 0xa4001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8_LEGACY("pokey2", pokey_r, pokey_w, 0x00ff) |
| 229 | 225 | AM_RANGE(0xa80000, 0xa8001f) AM_MIRROR(0x03ffe0) AM_DEVREADWRITE8_LEGACY("pokey1", pokey_r, pokey_w, 0x00ff) |
| r14896 | r14897 | |
| 479 | 475 | * |
| 480 | 476 | *************************************/ |
| 481 | 477 | |
| 482 | GAME( 1982, foodf, 0, foodf, foodf, 0, ROT0, "Atari", "Food Fight (rev 3)", GAME_SUPPORTS_SAVE ) | |
| 483 | GAME( 1982, foodf2, foodf, foodf, foodf, 0, ROT0, "Atari", "Food Fight (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 484 | GAME( 1982, foodfc, foodf, foodf, foodf, 0, ROT0, "Atari", "Food Fight (cocktail)", GAME_SUPPORTS_SAVE ) | |
| 478 | GAME( 1982, foodf, 0, foodf, foodf, 0, ROT0, "General Computer Corporation (Atari license)", "Food Fight (rev 3)", GAME_SUPPORTS_SAVE ) | |
| 479 | GAME( 1982, foodf2, foodf, foodf, foodf, 0, ROT0, "General Computer Corporation (Atari license)", "Food Fight (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 480 | GAME( 1982, foodfc, foodf, foodf, foodf, 0, ROT0, "General Computer Corporation (Atari license)", "Food Fight (cocktail)", GAME_SUPPORTS_SAVE ) |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | cesclassic_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | 33 | : driver_device(mconfig, type, tag), |
| 34 | 34 | m_maincpu(*this, "maincpu"), |
| 35 | m_oki(*this, "oki") | |
| 36 | { } | |
| 35 | m_oki(*this, "oki"), | |
| 36 | m_vram(*this, "vram"){ } | |
| 37 | 37 | |
| 38 | 38 | DECLARE_WRITE16_MEMBER(irq2_ack_w); |
| 39 | 39 | DECLARE_WRITE16_MEMBER(irq3_ack_w); |
| 40 | 40 | DECLARE_WRITE16_MEMBER(lamps_w); |
| 41 | 41 | DECLARE_WRITE16_MEMBER(outputs_w); |
| 42 | 42 | |
| 43 | UINT16 *m_vram; | |
| 44 | 43 | |
| 45 | 44 | UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 46 | 45 | |
| r14896 | r14897 | |
| 50 | 49 | required_device<cpu_device> m_maincpu; |
| 51 | 50 | required_device<okim6295_device> m_oki; |
| 52 | 51 | |
| 52 | required_shared_ptr<UINT16> m_vram; | |
| 53 | 53 | // driver_device overrides |
| 54 | 54 | virtual void video_start(); |
| 55 | 55 | |
| r14896 | r14897 | |
| 75 | 75 | { |
| 76 | 76 | UINT8 color; |
| 77 | 77 | |
| 78 | color = (((m_vram[x+y*16+0x400])>>(15-xi)) & 1); | |
| 79 | color |= (((m_vram[x+y*16])>>(15-xi)) & 1)<<1; | |
| 78 | color = (((m_vram.target()[x+y*16+0x400])>>(15-xi)) & 1); | |
| 79 | color |= (((m_vram.target()[x+y*16])>>(15-xi)) & 1)<<1; | |
| 80 | 80 | |
| 81 | 81 | if((x*16+xi)<256 && ((y)+0)<256) |
| 82 | 82 | bitmap.pix32(y, x*16+xi) = machine().pens[color]; |
| r14896 | r14897 | |
| 119 | 119 | static ADDRESS_MAP_START( cesclassic_map, AS_PROGRAM, 16, cesclassic_state ) |
| 120 | 120 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 121 | 121 | AM_RANGE(0x400000, 0x40cfff) AM_RAM |
| 122 | AM_RANGE(0x40d000, 0x40ffff) AM_RAM AM_ | |
| 122 | AM_RANGE(0x40d000, 0x40ffff) AM_RAM AM_ | |
| 123 | 123 | AM_RANGE(0x410000, 0x410001) AM_READ_PORT("VBLANK") //probably m68681 lies there instead |
| 124 | 124 | AM_RANGE(0x410004, 0x410005) AM_WRITE(irq3_ack_w) |
| 125 | 125 | AM_RANGE(0x410006, 0x410007) AM_WRITE(irq2_ack_w) |
| r14896 | r14897 | |
|---|---|---|
| 38 | 38 | WRITE8_MEMBER(aliens_state::bankedram_w) |
| 39 | 39 | { |
| 40 | 40 | if (m_palette_selected) |
| 41 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 41 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 42 | 42 | else |
| 43 | 43 | m_ram[offset] = data; |
| 44 | 44 | } |
| r14896 | r14897 | |
| 69 | 69 | WRITE8_MEMBER(aliens_state::aliens_sh_irqtrigger_w) |
| 70 | 70 | { |
| 71 | 71 | |
| 72 | soundlatch_w(space, offset, data); | |
| 72 | soundlatch_byte_w(space, offset, data); | |
| 73 | 73 | device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); |
| 74 | 74 | } |
| 75 | 75 | |
| r14896 | r14897 | |
| 133 | 133 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM g04_b03.bin */ |
| 134 | 134 | AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ |
| 135 | 135 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 136 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 136 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 137 | 137 | AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) |
| 138 | 138 | ADDRESS_MAP_END |
| 139 | 139 |
| r14896 | r14897 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, _88games_state ) |
| 130 | 130 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(m_banked_rom) /* banked ROM + palette RAM */ |
| 131 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(m_paletteram_1000) /* banked ROM + palette RAM */ | |
| 131 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_be_w) AM_BASE(m_paletteram_1000) /* banked ROM + palette RAM */ | |
| 132 | 132 | AM_RANGE(0x2000, 0x2fff) AM_RAM |
| 133 | 133 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("nvram") |
| 134 | 134 | AM_RANGE(0x3800, 0x3fff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(m_ram) |
| 135 | 135 | AM_RANGE(0x5f84, 0x5f84) AM_WRITE(k88games_5f84_w) |
| 136 | 136 | AM_RANGE(0x5f88, 0x5f88) AM_WRITE(watchdog_reset_w) |
| 137 | AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(soundlatch_w) | |
| 137 | AM_RANGE(0x5f8c, 0x5f8c) AM_WRITE(soundlatch_byte_w) | |
| 138 | 138 | AM_RANGE(0x5f90, 0x5f90) AM_WRITE(k88games_sh_irqtrigger_w) |
| 139 | 139 | AM_RANGE(0x5f94, 0x5f94) AM_READ_PORT("IN0") |
| 140 | 140 | AM_RANGE(0x5f95, 0x5f95) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 150 | 150 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 151 | 151 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 152 | 152 | AM_RANGE(0x9000, 0x9000) AM_WRITE(speech_msg_w) |
| 153 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 153 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 154 | 154 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 155 | 155 | AM_RANGE(0xe000, 0xe000) AM_WRITE(speech_control_w) |
| 156 | 156 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 2090 | 2090 | WRITE8_MEMBER(dynax_state::mmpanic_soundlatch_w) |
| 2091 | 2091 | { |
| 2092 | 2092 | |
| 2093 | soundlatch_w(*&space, 0, data); | |
| 2093 | soundlatch_byte_w(*&space, 0, data); | |
| 2094 | 2094 | device_set_input_line(m_soundcpu, INPUT_LINE_NMI, PULSE_LINE); |
| 2095 | 2095 | } |
| 2096 | 2096 | |
| r14896 | r14897 | |
| 2200 | 2200 | |
| 2201 | 2201 | static ADDRESS_MAP_START( mmpanic_sound_portmap, AS_IO, 8, dynax_state ) |
| 2202 | 2202 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2203 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 2203 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 2204 | 2204 | AM_RANGE(0x02, 0x02) AM_READNOP // read just before port 00 |
| 2205 | 2205 | AM_RANGE(0x04, 0x04) AM_NOP // read only once at the start |
| 2206 | 2206 | AM_RANGE(0x06, 0x06) AM_WRITENOP // almost always 1, sometimes 0 |
| r14896 | r14897 | |
| 2338 | 2338 | |
| 2339 | 2339 | static ADDRESS_MAP_START( funkyfig_sound_portmap, AS_IO, 8, dynax_state ) |
| 2340 | 2340 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2341 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r) | |
| 2341 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) | |
| 2342 | 2342 | AM_RANGE(0x04, 0x04) AM_READNOP // read only once at the start |
| 2343 | 2343 | ADDRESS_MAP_END |
| 2344 | 2344 |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | switch (offset) |
| 141 | 141 | { |
| 142 | 142 | case 0: /* 3e00 - SND irq */ |
| 143 | state->soundlatch_w(*space, 0, data); | |
| 143 | state->soundlatch_byte_w(*space, 0, data); | |
| 144 | 144 | device_set_input_line(state->m_snd_cpu, state->m_sound_irq, (state->m_sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE ); |
| 145 | 145 | break; |
| 146 | 146 | |
| r14896 | r14897 | |
| 175 | 175 | state->m_scrolly_hi = ((data & 0x02) >> 1); |
| 176 | 176 | state->m_scrollx_hi = data & 0x01; |
| 177 | 177 | |
| 178 | flip_screen_set( | |
| 178 | state->flip_screen_set( | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | static WRITE8_HANDLER( chinagat_bankswitch_w ) |
| r14896 | r14897 | |
| 309 | 309 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("share1") |
| 310 | 310 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(ddragon_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 311 | 311 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(ddragon_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 312 | AM_RANGE(0x3000, 0x317f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 313 | AM_RANGE(0x3400, 0x357f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 312 | AM_RANGE(0x3000, 0x317f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 313 | AM_RANGE(0x3400, 0x357f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 314 | 314 | AM_RANGE(0x3800, 0x397f) AM_WRITE_BANK("bank3") AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 315 | 315 | AM_RANGE(0x3e00, 0x3e04) AM_WRITE_LEGACY(chinagat_interrupt_w) |
| 316 | 316 | AM_RANGE(0x3e06, 0x3e06) AM_WRITEONLY AM_BASE(m_scrolly_lo) |
| r14896 | r14897 | |
| 341 | 341 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 342 | 342 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 343 | 343 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 344 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r) | |
| 344 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r) | |
| 345 | 345 | ADDRESS_MAP_END |
| 346 | 346 | |
| 347 | 347 | static ADDRESS_MAP_START( ym2203c_sound_map, AS_PROGRAM, 8, ddragon_state ) |
| r14896 | r14897 | |
| 359 | 359 | |
| 360 | 360 | // AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 361 | 361 | // AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 362 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r) | |
| 362 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r) | |
| 363 | 363 | ADDRESS_MAP_END |
| 364 | 364 | |
| 365 | 365 | static ADDRESS_MAP_START( saiyugoub1_sound_map, AS_PROGRAM, 8, ddragon_state ) |
| r14896 | r14897 | |
| 367 | 367 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 368 | 368 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 369 | 369 | AM_RANGE(0x9800, 0x9800) AM_WRITE_LEGACY(saiyugoub1_mcu_command_w) |
| 370 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r) | |
| 370 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r) | |
| 371 | 371 | ADDRESS_MAP_END |
| 372 | 372 | |
| 373 | 373 | static ADDRESS_MAP_START( i8748_map, AS_PROGRAM, 8, ddragon_state ) |
| r14896 | r14897 | |
|---|---|---|
| 307 | 307 | { |
| 308 | 308 | if (ACCESSING_BITS_8_15) |
| 309 | 309 | { |
| 310 | soundlatch_w(space, 0, (data & 0xff00) >> 8 ); | |
| 310 | soundlatch_byte_w(space, 0, (data & 0xff00) >> 8 ); | |
| 311 | 311 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 312 | 312 | } |
| 313 | 313 | } |
| r14896 | r14897 | |
| 372 | 372 | AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM |
| 373 | 373 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // Work RAM |
| 374 | 374 | AM_RANGE(0x30e000, 0x30ffff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 375 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 375 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 376 | 376 | // AM_RANGE(0x480000, 0x480001) AM_RAM // ? |
| 377 | 377 | AM_RANGE(0x500000, 0x500001) AM_READWRITE(kaneko16_bg15_reg_r, kaneko16_bg15_reg_w) AM_BASE(m_bg15_reg) // High Color Background |
| 378 | 378 | AM_RANGE(0x580000, 0x580001) AM_READWRITE(kaneko16_bg15_select_r, kaneko16_bg15_select_w) AM_BASE(m_bg15_select) |
| r14896 | r14897 | |
| 429 | 429 | AM_RANGE(0x582000, 0x582fff) AM_RAM AM_BASE(m_vscroll[3]) // |
| 430 | 430 | AM_RANGE(0x583000, 0x583fff) AM_RAM AM_BASE(m_vscroll[2]) // |
| 431 | 431 | AM_RANGE(0x600000, 0x601fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 432 | AM_RANGE(0x700000, 0x700fff) AM_RAM_WRITE(paletteram | |
| 432 | AM_RANGE(0x700000, 0x700fff) AM_RAM_WRITE(paletteram | |
| 433 | 433 | AM_RANGE(0x800000, 0x80001f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(m_layers_0_regs) // Layers 0 Regs |
| 434 | 434 | AM_RANGE(0x900000, 0x90001f) AM_RAM_WRITE(kaneko16_sprites_regs_w) AM_BASE(m_sprites_regs ) // Sprites Regs |
| 435 | 435 | AM_RANGE(0xa80000, 0xa80001) AM_READ(watchdog_reset16_r) // Watchdog |
| r14896 | r14897 | |
| 449 | 449 | static ADDRESS_MAP_START( blazeon, AS_PROGRAM, 16, kaneko16_state ) |
| 450 | 450 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 451 | 451 | AM_RANGE(0x300000, 0x30ffff) AM_RAM // Work RAM |
| 452 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(paletteram | |
| 452 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(paletteram | |
| 453 | 453 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(m_vram[1]) // Layers 0 |
| 454 | 454 | AM_RANGE(0x601000, 0x601fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(m_vram[0]) // |
| 455 | 455 | AM_RANGE(0x602000, 0x602fff) AM_RAM AM_BASE(m_vscroll[1]) // |
| r14896 | r14897 | |
| 513 | 513 | AM_RANGE(0x2b0000, 0x2b0001) AM_WRITE(toybox_mcu_com1_w) |
| 514 | 514 | AM_RANGE(0x2c0000, 0x2c0001) AM_WRITE(toybox_mcu_com2_w) |
| 515 | 515 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(toybox_mcu_com3_w) |
| 516 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 516 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 517 | 517 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 518 | 518 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(m_vram[1]) // Layers 0 |
| 519 | 519 | AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(m_vram[0]) // |
| r14896 | r14897 | |
| 575 | 575 | AM_RANGE(0x2b0000, 0x2b0001) AM_WRITE(toybox_mcu_com1_w) |
| 576 | 576 | AM_RANGE(0x2c0000, 0x2c0001) AM_WRITE(toybox_mcu_com2_w) |
| 577 | 577 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(toybox_mcu_com3_w) |
| 578 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 578 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 579 | 579 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 580 | 580 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(m_vram[1]) // Layers 0 |
| 581 | 581 | AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(m_vram[0]) // |
| r14896 | r14897 | |
| 655 | 655 | AM_RANGE(0x2c0000, 0x2c0001) AM_WRITE(toybox_mcu_com2_w) |
| 656 | 656 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(toybox_mcu_com3_w) |
| 657 | 657 | |
| 658 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 658 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 659 | 659 | AM_RANGE(0x310000, 0x327fff) AM_RAM // |
| 660 | 660 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 661 | 661 | |
| r14896 | r14897 | |
| 731 | 731 | AM_RANGE(0x2c0000, 0x2c0001) AM_WRITE(toybox_mcu_com2_w) |
| 732 | 732 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(toybox_mcu_com3_w) |
| 733 | 733 | |
| 734 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 734 | AM_RANGE(0x300000, 0x30ffff) AM_RAM_WRITE(paletteram | |
| 735 | 735 | AM_RANGE(0x310000, 0x327fff) AM_RAM // |
| 736 | 736 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 737 | 737 | |
| r14896 | r14897 | |
| 778 | 778 | AM_RANGE(0x400000, 0x40001f) AM_DEVREADWRITE_LEGACY("ay1", kaneko16_YM2149_r, kaneko16_YM2149_w) // Sound |
| 779 | 779 | AM_RANGE(0x400200, 0x40021f) AM_DEVREADWRITE_LEGACY("ay2", kaneko16_YM2149_r, kaneko16_YM2149_w) |
| 780 | 780 | AM_RANGE(0x400400, 0x400401) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 781 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(paletteram | |
| 781 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(paletteram | |
| 782 | 782 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(kaneko16_vram_1_w) AM_BASE(m_vram[1]) // Layers 0 |
| 783 | 783 | AM_RANGE(0x601000, 0x601fff) AM_RAM_WRITE(kaneko16_vram_0_w) AM_BASE(m_vram[0]) // |
| 784 | 784 | AM_RANGE(0x602000, 0x602fff) AM_RAM AM_BASE(m_vscroll[1]) // |
| r14896 | r14897 | |
| 846 | 846 | AM_RANGE(0x2b0000, 0x2b0001) AM_WRITE(calc3_mcu_com2_w) |
| 847 | 847 | //AM_RANGE(0x2c0000, 0x2c0001) AM_WRITE_LEGACY(calc3_run) // guess, might be irqack |
| 848 | 848 | AM_RANGE(0x2d0000, 0x2d0001) AM_WRITE(calc3_mcu_com3_w) |
| 849 | AM_RANGE(0x380000, 0x380fff) AM_RAM_WRITE(paletteram | |
| 849 | AM_RANGE(0x380000, 0x380fff) AM_RAM_WRITE(paletteram | |
| 850 | 850 | AM_RANGE(0x400000, 0x400001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) // Samples |
| 851 | 851 | AM_RANGE(0x480000, 0x480001) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) |
| 852 | 852 | AM_RANGE(0x580000, 0x581fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| r14896 | r14897 | |
| 887 | 887 | static ADDRESS_MAP_START( blazeon_soundport, AS_IO, 8, kaneko16_state ) |
| 888 | 888 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 889 | 889 | AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 890 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r) | |
| 890 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r) | |
| 891 | 891 | ADDRESS_MAP_END |
| 892 | 892 | |
| 893 | 893 |
| r14896 | r14897 | |
|---|---|---|
| 170 | 170 | { |
| 171 | 171 | public: |
| 172 | 172 | cybertnk_state(const machine_config &mconfig, device_type type, const char *tag) |
| 173 | : driver_device(mconfig, type, tag) { } | |
| 173 | : driver_device(mconfig, type, tag) , | |
| 174 | m_spr_ram(*this, "spr_ram"), | |
| 175 | m_tx_vram(*this, "tx_vram"), | |
| 176 | m_bg_vram(*this, "bg_vram"), | |
| 177 | m_fg_vram(*this, "fg_vram"), | |
| 178 | m_io_ram(*this, "io_ram"), | |
| 179 | m_roadram(*this, "roadram"){ } | |
| 174 | 180 | |
| 175 | 181 | tilemap_t *m_tx_tilemap; |
| 176 | UINT16 *m_tx_vram; | |
| 177 | UINT16 *m_bg_vram; | |
| 178 | UINT16 *m_fg_vram; | |
| 179 | UINT16 *m_spr_ram; | |
| 180 | UINT16 *m_io_ram; | |
| 181 | UINT16 *m_roadram; | |
| 182 | required_shared_ptr<UINT16> m_spr_ram; | |
| 183 | required_shared_ptr<UINT16> m_tx_vram; | |
| 184 | required_shared_ptr<UINT16> m_bg_vram; | |
| 185 | required_shared_ptr<UINT16> m_fg_vram; | |
| 186 | required_shared_ptr<UINT16> m_io_ram; | |
| 187 | required_shared_ptr<UINT16> m_roadram; | |
| 182 | 188 | int m_test_x; |
| 183 | 189 | int m_test_y; |
| 184 | 190 | int m_start_offs; |
| r14896 | r14897 | |
| 195 | 201 | static TILE_GET_INFO( get_tx_tile_info ) |
| 196 | 202 | { |
| 197 | 203 | cybertnk_state *state = machine.driver_data<cybertnk_state>(); |
| 198 | int code = state->m_tx_vram[tile_index]; | |
| 204 | int code = state->m_tx_vram.target()[tile_index]; | |
| 199 | 205 | SET_TILE_INFO( |
| 200 | 206 | 0, |
| 201 | 207 | code & 0x1fff, |
| r14896 | r14897 | |
| 232 | 238 | |
| 233 | 239 | for (i=0;i<0x1000/4;i+=4) |
| 234 | 240 | { |
| 235 | UINT16 param1 = state->m_roadram[i+2]; | |
| 236 | UINT16 param2 = state->m_roadram[i+0]; | |
| 241 | UINT16 param1 = state->m_roadram.target()[i+2]; | |
| 242 | UINT16 param2 = state->m_roadram.target()[i+0]; | |
| 237 | 243 | |
| 238 | 244 | drawgfx_transpen(bitmap,cliprect,gfx,param1,0x23,0,0,-param2+screen_shift,i/4,0); |
| 239 | 245 | |
| r14896 | r14897 | |
| 253 | 259 | { |
| 254 | 260 | for (x=0;x<128;x++) |
| 255 | 261 | { |
| 256 | UINT16 tile = state->m_bg_vram[count] & 0x1fff; | |
| 257 | UINT16 color = (state->m_fg_vram[count] & 0xe000) >> 13; | |
| 262 | UINT16 tile = state->m_bg_vram.target()[count] & 0x1fff; | |
| 263 | UINT16 color = (state->m_fg_vram.target()[count] & 0xe000) >> 13; | |
| 258 | 264 | |
| 259 | 265 | drawgfx_transpen(bitmap,cliprect,gfx,tile,color+0x194,0,0,(x*8)+screen_shift,(y*8),0); |
| 260 | 266 | |
| r14896 | r14897 | |
| 274 | 280 | { |
| 275 | 281 | for (x=0;x<128;x++) |
| 276 | 282 | { |
| 277 | UINT16 tile = state->m_fg_vram[count] & 0x1fff; | |
| 278 | UINT16 color = (state->m_fg_vram[count] & 0xe000) >> 13; | |
| 283 | UINT16 tile = state->m_fg_vram.target()[count] & 0x1fff; | |
| 284 | UINT16 color = (state->m_fg_vram.target()[count] & 0xe000) >> 13; | |
| 279 | 285 | |
| 280 | 286 | drawgfx_transpen(bitmap,cliprect,gfx,tile,color+0x1c0,0,0,(x*8)+screen_shift,(y*8),0); |
| 281 | 287 | |
| r14896 | r14897 | |
| 295 | 301 | |
| 296 | 302 | for(offs=0;offs<0x1000/2;offs+=8) |
| 297 | 303 | { |
| 298 | z = (state->m_spr_ram[offs+(0x6/2)] & 0xffff); | |
| 299 | if(z == 0xffff || state->m_spr_ram[offs+(0x0/2)] == 0x0000) //TODO: check the correct bit | |
| 304 | z = (state->m_spr_ram.target()[offs+(0x6/2)] & 0xffff); | |
| 305 | if(z == 0xffff || state->m_spr_ram.target()[offs+(0x0/2)] == 0x0000) //TODO: check the correct bit | |
| 300 | 306 | continue; |
| 301 | x = (state->m_spr_ram[offs+(0xa/2)] & 0x3ff); | |
| 302 | y = (state->m_spr_ram[offs+(0x4/2)] & 0xff); | |
| 303 | if(state->m_spr_ram[offs+(0x4/2)] & 0x100) | |
| 307 | x = (state->m_spr_ram.target()[offs+(0xa/2)] & 0x3ff); | |
| 308 | y = (state->m_spr_ram.target()[offs+(0x4/2)] & 0xff); | |
| 309 | if(state->m_spr_ram.target()[offs+(0x4/2)] & 0x100) | |
| 304 | 310 | y = 0x100 - y; |
| 305 | spr_offs = (((state->m_spr_ram[offs+(0x0/2)] & 7) << 16) | (state->m_spr_ram[offs+(0x2/2)])) << 2; | |
| 306 | xsize = ((state->m_spr_ram[offs+(0xc/2)] & 0x000f)+1) << 3; | |
| 307 | ysize = (state->m_spr_ram[offs+(0x8/2)] & 0x00ff)+1; | |
| 308 | fx = (state->m_spr_ram[offs+(0xa/2)] & 0x8000) >> 15; | |
| 309 | zoom = (state->m_spr_ram[offs+(0xc/2)] & 0xff00) >> 8; | |
| 311 | spr_offs = (((state->m_spr_ram.target()[offs+(0x0/2)] & 7) << 16) | (state->m_spr_ram.target()[offs+(0x2/2)])) << 2; | |
| 312 | xsize = ((state->m_spr_ram.target()[offs+(0xc/2)] & 0x000f)+1) << 3; | |
| 313 | ysize = (state->m_spr_ram.target()[offs+(0x8/2)] & 0x00ff)+1; | |
| 314 | fx = (state->m_spr_ram.target()[offs+(0xa/2)] & 0x8000) >> 15; | |
| 315 | zoom = (state->m_spr_ram.target()[offs+(0xc/2)] & 0xff00) >> 8; | |
| 310 | 316 | |
| 311 | col_bank = (state->m_spr_ram[offs+(0x0/2)] & 0xff00) >> 8; | |
| 317 | col_bank = (state->m_spr_ram.target()[offs+(0x0/2)] & 0xff00) >> 8; | |
| 312 | 318 | |
| 313 | 319 | xf = 0; |
| 314 | 320 | yf = 0; |
| r14896 | r14897 | |
| 516 | 522 | |
| 517 | 523 | WRITE16_MEMBER(cybertnk_state::tx_vram_w) |
| 518 | 524 | { |
| 519 | COMBINE_DATA(&m_tx_vram[offset]); | |
| 525 | COMBINE_DATA(&m_tx_vram.target()[offset]); | |
| 520 | 526 | m_tx_tilemap->mark_tile_dirty(offset); |
| 521 | 527 | } |
| 522 | 528 | |
| r14896 | r14897 | |
| 531 | 537 | // 0x001100D5 is controller data |
| 532 | 538 | // 0x00110004 low is controller data ready |
| 533 | 539 | case 4/2: |
| 534 | switch( (m_io_ram[6/2]) & 0xff ) | |
| 540 | switch( (m_io_ram.target()[6/2]) & 0xff ) | |
| 535 | 541 | { |
| 536 | 542 | case 0: |
| 537 | m_io_ram[0xd4/2] = input_port_read(machine(), "TRAVERSE"); | |
| 543 | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "TRAVERSE"); | |
| 538 | 544 | break; |
| 539 | 545 | |
| 540 | 546 | case 0x20: |
| 541 | m_io_ram[0xd4/2] = input_port_read(machine(), "ELEVATE"); | |
| 547 | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "ELEVATE"); | |
| 542 | 548 | break; |
| 543 | 549 | |
| 544 | 550 | case 0x40: |
| 545 | m_io_ram[0xd4/2] = input_port_read(machine(), "ACCEL"); | |
| 551 | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "ACCEL"); | |
| 546 | 552 | break; |
| 547 | 553 | |
| 548 | 554 | case 0x42: |
| r14896 | r14897 | |
| 550 | 556 | // controller return value is stored in $42(a6) |
| 551 | 557 | // but I don't see it referenced again. |
| 552 | 558 | //popmessage("unknown controller device 0x42"); |
| 553 | m_io_ram[0xd4/2] = 0; | |
| 559 | m_io_ram.target()[0xd4/2] = 0; | |
| 554 | 560 | break; |
| 555 | 561 | |
| 556 | 562 | case 0x60: |
| 557 | m_io_ram[0xd4/2] = input_port_read(machine(), "HANDLE"); | |
| 563 | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "HANDLE"); | |
| 558 | 564 | break; |
| 559 | 565 | |
| 560 | 566 | //default: |
| r14896 | r14897 | |
| 572 | 578 | return input_port_read(machine(), "DSW2"); |
| 573 | 579 | |
| 574 | 580 | case 0xd4/2: |
| 575 | return m_io_ram[offset]; // controller data | |
| 581 | return m_io_ram.target()[offset]; // controller data | |
| 576 | 582 | |
| 577 | 583 | default: |
| 578 | 584 | { |
| 579 | 585 | //popmessage("unknown io read 0x%08x", offset); |
| 580 | return m_io_ram[offset]; | |
| 586 | return m_io_ram.target()[offset]; | |
| 581 | 587 | } |
| 582 | 588 | } |
| 583 | 589 | } |
| 584 | 590 | |
| 585 | 591 | WRITE16_MEMBER(cybertnk_state::io_w) |
| 586 | 592 | { |
| 587 | COMBINE_DATA(&m_io_ram[offset]); | |
| 593 | COMBINE_DATA(&m_io_ram.target()[offset]); | |
| 588 | 594 | |
| 589 | 595 | switch( offset ) |
| 590 | 596 | { |
| r14896 | r14897 | |
| 645 | 651 | case 0x80/2: |
| 646 | 652 | case 0x82/2: |
| 647 | 653 | case 0x84/2: |
| 648 | popmessage("%02x %02x %02x %02x %02x %02x %02x",m_io_ram[0x40/2],m_io_ram[0x42/2],m_io_ram[0x44/2],m_io_ram[0x46/2],m_io_ram[0x48/2],m_io_ram[0x4a/2],m_io_ram[0x4c/2]); | |
| 654 | popmessage("%02x %02x %02x %02x %02x %02x %02x",m_io_ram.target()[0x40/2],m_io_ram.target()[0x42/2],m_io_ram.target()[0x44/2],m_io_ram.target()[0x46/2],m_io_ram.target()[0x48/2],m_io_ram.target()[0x4a/2],m_io_ram.target()[0x4c/2]); | |
| 649 | 655 | break; |
| 650 | 656 | |
| 651 | 657 | default: |
| r14896 | r14897 | |
| 656 | 662 | |
| 657 | 663 | READ8_MEMBER(cybertnk_state::soundport_r) |
| 658 | 664 | { |
| 659 | return m_io_ram[0] & 0xff; | |
| 665 | return m_io_ram.target()[0] & 0xff; | |
| 660 | 666 | } |
| 661 | 667 | |
| 662 | 668 | static ADDRESS_MAP_START( master_mem, AS_PROGRAM, 16, cybertnk_state ) |
| 663 | 669 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 664 | 670 | AM_RANGE(0x080000, 0x087fff) AM_RAM /*Work RAM*/ |
| 665 | AM_RANGE(0x0a0000, 0x0a0fff) AM_RAM AM_BASE(m_spr_ram) // non-tile based sprite ram | |
| 666 | AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM_WRITE(tx_vram_w) AM_BASE(m_tx_vram) | |
| 667 | AM_RANGE(0x0c4000, 0x0c5fff) AM_RAM AM_BASE(m_bg_vram) | |
| 668 | AM_RANGE(0x0c8000, 0x0c9fff) AM_RAM AM_BASE(m_fg_vram) | |
| 671 | AM_RANGE(0x0a0000, 0x0a0fff) AM_RAM AM_SHARE("spr_ram") // non-tile based sprite ram | |
| 672 | AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM_WRITE(tx_vram_w) AM_SHARE("tx_vram") | |
| 673 | AM_RANGE(0x0c4000, 0x0c5fff) AM_RAM AM_SHARE("bg_vram") | |
| 674 | AM_RANGE(0x0c8000, 0x0c9fff) AM_RAM AM_SHARE("fg_vram") | |
| 669 | 675 | AM_RANGE(0x0e0000, 0x0e0fff) AM_RAM AM_SHARE("sharedram") |
| 670 | AM_RANGE(0x100000, 0x107fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 671 | AM_RANGE(0x110000, 0x1101ff) AM_READWRITE(io_r,io_w) AM_BASE(m_io_ram) | |
| 676 | AM_RANGE(0x100000, 0x107fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 677 | AM_RANGE(0x110000, 0x1101ff) AM_READWRITE(io_r,io_w) AM_SHARE("io_ram") | |
| 672 | 678 | ADDRESS_MAP_END |
| 673 | 679 | |
| 674 | 680 | static ADDRESS_MAP_START( slave_mem, AS_PROGRAM, 16, cybertnk_state ) |
| 675 | 681 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 676 | 682 | AM_RANGE(0x080000, 0x083fff) AM_RAM /*Work RAM*/ |
| 677 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM AM_ | |
| 683 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM AM_ | |
| 678 | 684 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_SHARE("sharedram") |
| 679 | 685 | AM_RANGE(0x140000, 0x140003) AM_NOP /*Watchdog? Written during loops and interrupts*/ |
| 680 | 686 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | WRITE8_MEMBER(wc90_state::wc90_sound_command_w) |
| 104 | 104 | { |
| 105 | soundlatch_w(space, offset, data); | |
| 105 | soundlatch_byte_w(space, offset, data); | |
| 106 | 106 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 107 | 107 | } |
| 108 | 108 | |
| r14896 | r14897 | |
| 145 | 145 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 146 | 146 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 147 | 147 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 148 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_SHARE("paletteram") | |
| 148 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_be_w) AM_SHARE("paletteram") | |
| 149 | 149 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("bank2") |
| 150 | 150 | AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE("share1") |
| 151 | 151 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(wc90_bankswitch1_w) |
| r14896 | r14897 | |
| 157 | 157 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 158 | 158 | AM_RANGE(0xf800, 0xf803) AM_DEVREADWRITE_LEGACY("ymsnd", ym2608_r, ym2608_w) |
| 159 | 159 | AM_RANGE(0xfc00, 0xfc00) AM_READNOP /* ??? adpcm ??? */ |
| 160 | AM_RANGE(0xfc10, 0xfc10) AM_READ(soundlatch_r) | |
| 160 | AM_RANGE(0xfc10, 0xfc10) AM_READ(soundlatch_byte_r) | |
| 161 | 161 | ADDRESS_MAP_END |
| 162 | 162 | |
| 163 | 163 |
| r14896 | r14897 | |
|---|---|---|
| 185 | 185 | * |
| 186 | 186 | *************************************/ |
| 187 | 187 | |
| 188 | ||
| 188 | ||
| 189 | 189 | { |
| 190 | gauntlet_state *state = space->machine().driver_data<gauntlet_state>(); | |
| 191 | int temp = input_port_read(space->machine(), "803008"); | |
| 192 | if (state->m_cpu_to_sound_ready) temp ^= 0x0020; | |
| 193 | if (state->m_sound_to_cpu_ready) temp ^= 0x0010; | |
| 190 | int temp = input_port_read(machine(), "803008"); | |
| 191 | if (m_cpu_to_sound_ready) temp ^= 0x0020; | |
| 192 | if (m_sound_to_cpu_ready) temp ^= 0x0010; | |
| 194 | 193 | return temp; |
| 195 | 194 | } |
| 196 | 195 | |
| r14896 | r14897 | |
| 202 | 201 | * |
| 203 | 202 | *************************************/ |
| 204 | 203 | |
| 205 | ||
| 204 | ||
| 206 | 205 | { |
| 207 | gauntlet_state *state = space->machine().driver_data<gauntlet_state>(); | |
| 208 | 206 | if (ACCESSING_BITS_0_7) |
| 209 | 207 | { |
| 210 | int oldword = state->m_sound_reset_val; | |
| 211 | COMBINE_DATA(&state->m_sound_reset_val); | |
| 208 | int oldword = m_sound_reset_val; | |
| 209 | COMBINE_DATA(&m_sound_reset_val); | |
| 212 | 210 | |
| 213 | if ((oldword ^ | |
| 211 | if ((oldword ^ | |
| 214 | 212 | { |
| 215 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (state->m_sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 216 | atarigen_sound_reset(space->machine()); | |
| 217 | if (state->m_sound_reset_val & 1) | |
| 213 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_RESET, (m_sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 214 | atarigen_sound_reset(machine()); | |
| 215 | if (m_sound_reset_val & 1) | |
| 218 | 216 | { |
| 219 | devtag_reset(space->machine(), "ymsnd"); | |
| 220 | devtag_reset(space->machine(), "tms"); | |
| 221 | tms5220_set_frequency(space->machine().device("tms"), ATARI_CLOCK_14MHz/2 / 11); | |
| 222 | atarigen_set_ym2151_vol(space->machine(), 0); | |
| 223 | atarigen_set_pokey_vol(space->machine(), 0); | |
| 224 | atarigen_set_tms5220_vol(space->machine(), 0); | |
| 217 | devtag_reset(machine(), "ymsnd"); | |
| 218 | devtag_reset(machine(), "tms"); | |
| 219 | tms5220_set_frequency(machine().device("tms"), ATARI_CLOCK_14MHz/2 / 11); | |
| 220 | atarigen_set_ym2151_vol(machine(), 0); | |
| 221 | atarigen_set_pokey_vol(machine(), 0); | |
| 222 | atarigen_set_tms5220_vol(machine(), 0); | |
| 225 | 223 | } |
| 226 | 224 | } |
| 227 | 225 | } |
| r14896 | r14897 | |
| 235 | 233 | * |
| 236 | 234 | *************************************/ |
| 237 | 235 | |
| 238 | ||
| 236 | ||
| 239 | 237 | { |
| 240 | gauntlet_state *state = space->machine().driver_data<gauntlet_state>(); | |
| 241 | 238 | int temp = 0x30; |
| 242 | 239 | |
| 243 | if (state->m_cpu_to_sound_ready) temp ^= 0x80; | |
| 244 | if (state->m_sound_to_cpu_ready) temp ^= 0x40; | |
| 245 | if (!tms5220_readyq_r(space->machine().device("tms"))) temp ^= 0x20; | |
| 246 | if (!(input_port_read(space->machine(), "803008") & 0x0008)) temp ^= 0x10; | |
| 240 | if (m_cpu_to_sound_ready) temp ^= 0x80; | |
| 241 | if (m_sound_to_cpu_ready) temp ^= 0x40; | |
| 242 | if (!tms5220_readyq_r(machine().device("tms"))) temp ^= 0x20; | |
| 243 | if (!(input_port_read(machine(), "803008") & 0x0008)) temp ^= 0x10; | |
| 247 | 244 | |
| 248 | 245 | return temp; |
| 249 | 246 | } |
| r14896 | r14897 | |
| 255 | 252 | * |
| 256 | 253 | *************************************/ |
| 257 | 254 | |
| 258 | ||
| 255 | ||
| 259 | 256 | { |
| 260 | device_t *tms = | |
| 257 | device_t *tms = | |
| 261 | 258 | switch (offset & 7) |
| 262 | 259 | { |
| 263 | 260 | case 0: /* music reset, bit D7, low reset */ |
| 264 | if (((data>>7)&1) == 0) devtag_reset( | |
| 261 | if (((data>>7)&1) == 0) devtag_reset( | |
| 265 | 262 | break; |
| 266 | 263 | |
| 267 | 264 | case 1: /* speech write, bit D7, active low */ |
| r14896 | r14897 | |
| 287 | 284 | * |
| 288 | 285 | *************************************/ |
| 289 | 286 | |
| 290 | ||
| 287 | ||
| 291 | 288 | { |
| 292 | atarigen_set_ym2151_vol(space->machine(), (data & 7) * 100 / 7); | |
| 293 | atarigen_set_pokey_vol(space->machine(), ((data >> 3) & 3) * 100 / 3); | |
| 294 | atarigen_set_tms5220_vol(space->machine(), ((data >> 5) & 7) * 100 / 7); | |
| 289 | atarigen_set_ym2151_vol(machine(), (data & 7) * 100 / 7); | |
| 290 | atarigen_set_pokey_vol(machine(), ((data >> 3) & 3) * 100 / 3); | |
| 291 | atarigen_set_tms5220_vol(machine(), ((data >> 5) & 7) * 100 / 7); | |
| 295 | 292 | } |
| 296 | 293 | |
| 297 | 294 | |
| r14896 | r14897 | |
| 316 | 313 | AM_RANGE(0x803002, 0x803003) AM_MIRROR(0x2fcef0) AM_READ_PORT("803002") |
| 317 | 314 | AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ_PORT("803004") |
| 318 | 315 | AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ_PORT("803006") |
| 319 | AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ | |
| 316 | AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ | |
| 320 | 317 | AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_READ_LEGACY(atarigen_sound_r) |
| 321 | 318 | AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_WRITE(watchdog_reset16_w) |
| 322 | AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_WRITE | |
| 319 | AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_WRITE | |
| 323 | 320 | AM_RANGE(0x803140, 0x803141) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 324 | 321 | AM_RANGE(0x803150, 0x803151) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 325 | 322 | AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_sound_w) |
| r14896 | r14897 | |
| 331 | 328 | AM_RANGE(0x905f6e, 0x905f6f) AM_MIRROR(0x2c8000) AM_RAM_WRITE_LEGACY(gauntlet_yscroll_w) AM_BASE(m_yscroll) |
| 332 | 329 | AM_RANGE(0x905000, 0x905f7f) AM_MIRROR(0x2c8000) AM_RAM_WRITE_LEGACY(atarigen_alpha_w) AM_BASE(m_alpha) |
| 333 | 330 | AM_RANGE(0x905f80, 0x905fff) AM_MIRROR(0x2c8000) AM_READWRITE_LEGACY(atarimo_0_slipram_r, atarimo_0_slipram_w) |
| 334 | AM_RANGE(0x910000, 0x9107ff) AM_MIRROR(0x2cf800) AM_RAM_WRITE(paletteram | |
| 331 | AM_RANGE(0x910000, 0x9107ff) AM_MIRROR(0x2cf800) AM_RAM_WRITE(paletteram | |
| 335 | 332 | AM_RANGE(0x930000, 0x930001) AM_MIRROR(0x2cfffe) AM_WRITE_LEGACY(gauntlet_xscroll_w) AM_BASE(m_xscroll) |
| 336 | 333 | ADDRESS_MAP_END |
| 337 | 334 | |
| r14896 | r14897 | |
| 349 | 346 | AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM |
| 350 | 347 | AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_WRITE_LEGACY(atarigen_6502_sound_w) |
| 351 | 348 | AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ_LEGACY(atarigen_6502_sound_r) |
| 352 | AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE_LEGACY(mixer_w) | |
| 353 | AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE_LEGACY(switch_6502_r, sound_ctl_w) | |
| 349 | AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE(mixer_w) | |
| 350 | AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE(switch_6502_r, sound_ctl_w) | |
| 354 | 351 | AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) |
| 355 | 352 | AM_RANGE(0x1810, 0x1811) AM_MIRROR(0x27ce) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 356 | 353 | AM_RANGE(0x1820, 0x182f) AM_MIRROR(0x27c0) AM_DEVWRITE_LEGACY("tms", tms5220_data_w) |
| r14896 | r14897 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | WRITE32_MEMBER(ms32_state::ms32_sound_w) |
| 221 | 221 | { |
| 222 | soundlatch_w(space, 0, data & 0xff); | |
| 222 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 223 | 223 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE); |
| 224 | 224 | |
| 225 | 225 | // give the Z80 time to respond |
| r14896 | r14897 | |
| 1347 | 1347 | READ8_MEMBER(ms32_state::latch_r) |
| 1348 | 1348 | { |
| 1349 | 1349 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 1350 | return soundlatch_r(space,0)^0xff; | |
| 1350 | return soundlatch_byte_r(space,0)^0xff; | |
| 1351 | 1351 | } |
| 1352 | 1352 | |
| 1353 | 1353 | WRITE8_MEMBER(ms32_state::ms32_snd_bank_w) |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | m_spriteram->copy(); |
| 33 | 33 | return; |
| 34 | 34 | case 8: /* Sound CPU write */ |
| 35 | soundlatch_w(space, 0, data & 0xff); | |
| 35 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 36 | 36 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 37 | 37 | return; |
| 38 | 38 | case 0xa: /* IRQ Ack (VBL) */ |
| r14896 | r14897 | |
| 88 | 88 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w) |
| 89 | 89 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 90 | 90 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 91 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 91 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 92 | 92 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 93 | 93 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 94 | 94 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | if (ACCESSING_BITS_8_15) |
| 54 | 54 | { |
| 55 | soundlatch_w(space,offset, (data >> 8) & 0xff); | |
| 55 | soundlatch_byte_w(space,offset, (data >> 8) & 0xff); | |
| 56 | 56 | device_set_input_line(m_audio_cpu, INPUT_LINE_NMI, PULSE_LINE); |
| 57 | 57 | } |
| 58 | 58 | } |
| r14896 | r14897 | |
| 101 | 101 | |
| 102 | 102 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, deniam_state ) |
| 103 | 103 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 104 | AM_RANGE(0x01, 0x01) AM_READ(soundlatch_r) | |
| 104 | AM_RANGE(0x01, 0x01) AM_READ(soundlatch_byte_r) | |
| 105 | 105 | AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 106 | 106 | AM_RANGE(0x05, 0x05) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 107 | 107 | AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("oki", deniam16b_oki_rom_bank_w) |
| r14896 | r14897 | |
|---|---|---|
| 158 | 158 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP |
| 159 | 159 | AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP |
| 160 | 160 | AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ_PORT("C020") AM_WRITENOP |
| 161 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 161 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 162 | 162 | AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_video_control) |
| 163 | 163 | AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_bitmap_color) |
| 164 | AM_RANGE(0xc060, 0xc060) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 164 | AM_RANGE(0xc060, 0xc060) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 165 | 165 | AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(redalert_interrupt_clear_r, redalert_interrupt_clear_w) |
| 166 | 166 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu", 0x8000) |
| 167 | 167 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 174 | 174 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP |
| 175 | 175 | AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP |
| 176 | 176 | AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ_PORT("C020") AM_WRITENOP |
| 177 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 177 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 178 | 178 | AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_video_control) |
| 179 | 179 | AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_bitmap_color) |
| 180 | 180 | AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(redalert_interrupt_clear_r, redalert_interrupt_clear_w) |
| r14896 | r14897 | |
| 189 | 189 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP |
| 190 | 190 | AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP |
| 191 | 191 | AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ(panther_unk_r) /* vblank? */ |
| 192 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 192 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 193 | 193 | AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_video_control) |
| 194 | 194 | AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_bitmap_color) |
| 195 | 195 | AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(panther_interrupt_clear_r, redalert_interrupt_clear_w) |
| r14896 | r14897 | |
| 204 | 204 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP |
| 205 | 205 | AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP |
| 206 | 206 | AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ_PORT("C020") AM_WRITENOP |
| 207 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 207 | AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE | |
| 208 | 208 | AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_video_control) |
| 209 | 209 | AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_BASE(m_bitmap_color) |
| 210 | 210 | AM_RANGE(0xc060, 0xc060) AM_MIRROR(0x0f80) AM_NOP /* unknown */ |
| r14896 | r14897 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | |
| 119 | ||
| 119 | ||
| 120 | 120 | { |
| 121 | 121 | /* |
| 122 | 122 | Bit layout is as follows: |
| r14896 | r14897 | |
| 130 | 130 | D0 = coin meter 1 |
| 131 | 131 | */ |
| 132 | 132 | |
| 133 | coin_counter_w( | |
| 133 | coin_counter_w( | |
| 134 | 134 | mcr_cocktail_flip = (data >> 6) & 1; |
| 135 | 135 | } |
| 136 | 136 | |
| r14896 | r14897 | |
| 141 | 141 | * |
| 142 | 142 | *************************************/ |
| 143 | 143 | |
| 144 | ||
| 144 | ||
| 145 | 145 | { |
| 146 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 147 | return input_port_read(space->machine(), "MONO.IP1") | | |
| 148 | (input_port_read(space->machine(), state->m_input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1") << 2); | |
| 146 | return input_port_read(machine(), "MONO.IP1") | | |
| 147 | (input_port_read(machine(), m_input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1") << 2); | |
| 149 | 148 | } |
| 150 | 149 | |
| 151 | 150 | |
| 152 | ||
| 151 | ||
| 153 | 152 | { |
| 154 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 155 | return input_port_read(space->machine(), "MONO.IP2") | | |
| 156 | (input_port_read(space->machine(), state->m_input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1") << 2); | |
| 153 | return input_port_read(machine(), "MONO.IP2") | | |
| 154 | (input_port_read(machine(), m_input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1") << 2); | |
| 157 | 155 | } |
| 158 | 156 | |
| 159 | 157 | |
| 160 | ||
| 158 | ||
| 161 | 159 | { |
| 162 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 163 | 160 | /* top 2 bits select the input */ |
| 164 | if (data & 0x80) state->m_input_mux = 0; | |
| 165 | if (data & 0x40) state->m_input_mux = 1; | |
| 161 | if (data & 0x80) m_input_mux = 0; | |
| 162 | if (data & 0x40) m_input_mux = 1; | |
| 166 | 163 | |
| 167 | 164 | /* low 5 bits control the turbo CS */ |
| 168 | 165 | turbocs_data_w(space, offset, data); |
| r14896 | r14897 | |
| 176 | 173 | * |
| 177 | 174 | *************************************/ |
| 178 | 175 | |
| 179 | ||
| 176 | ||
| 180 | 177 | { |
| 181 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 182 | return state->m_latched_input; | |
| 178 | return m_latched_input; | |
| 183 | 179 | } |
| 184 | 180 | |
| 185 | 181 | |
| 186 | ||
| 182 | ||
| 187 | 183 | { |
| 188 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 189 | 184 | static const UINT8 shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 }; |
| 190 | UINT8 start = input_port_read(space->machine(), "MONO.IP0"); | |
| 191 | UINT8 shift = input_port_read(space->machine(), "SHIFT"); | |
| 185 | UINT8 start = input_port_read(machine(), "MONO.IP0"); | |
| 186 | UINT8 shift = input_port_read(machine(), "SHIFT"); | |
| 192 | 187 | |
| 193 | 188 | /* reset on a start */ |
| 194 | 189 | if (!(start & 0x08)) |
| 195 | | |
| 190 | | |
| 196 | 191 | if (!(start & 0x04)) |
| 197 | | |
| 192 | | |
| 198 | 193 | |
| 199 | 194 | /* increment, decrement on falling edge */ |
| 200 | if (!(shift & 0x01) && ( | |
| 195 | if (!(shift & 0x01) && ( | |
| 201 | 196 | { |
| 202 | state->m_maxrpm_p1_shift++; | |
| 203 | if (state->m_maxrpm_p1_shift > 4) | |
| 204 | state->m_maxrpm_p1_shift = 4; | |
| 197 | m_maxrpm_p1_shift++; | |
| 198 | if (m_maxrpm_p1_shift > 4) | |
| 199 | m_maxrpm_p1_shift = 4; | |
| 205 | 200 | } |
| 206 | if (!(shift & 0x02) && ( | |
| 201 | if (!(shift & 0x02) && ( | |
| 207 | 202 | { |
| 208 | state->m_maxrpm_p1_shift--; | |
| 209 | if (state->m_maxrpm_p1_shift < 0) | |
| 210 | state->m_maxrpm_p1_shift = 0; | |
| 203 | m_maxrpm_p1_shift--; | |
| 204 | if (m_maxrpm_p1_shift < 0) | |
| 205 | m_maxrpm_p1_shift = 0; | |
| 211 | 206 | } |
| 212 | if (!(shift & 0x04) && ( | |
| 207 | if (!(shift & 0x04) && ( | |
| 213 | 208 | { |
| 214 | state->m_maxrpm_p2_shift++; | |
| 215 | if (state->m_maxrpm_p2_shift > 4) | |
| 216 | state->m_maxrpm_p2_shift = 4; | |
| 209 | m_maxrpm_p2_shift++; | |
| 210 | if (m_maxrpm_p2_shift > 4) | |
| 211 | m_maxrpm_p2_shift = 4; | |
| 217 | 212 | } |
| 218 | if (!(shift & 0x08) && ( | |
| 213 | if (!(shift & 0x08) && ( | |
| 219 | 214 | { |
| 220 | state->m_maxrpm_p2_shift--; | |
| 221 | if (state->m_maxrpm_p2_shift < 0) | |
| 222 | state->m_maxrpm_p2_shift = 0; | |
| 215 | m_maxrpm_p2_shift--; | |
| 216 | if (m_maxrpm_p2_shift < 0) | |
| 217 | m_maxrpm_p2_shift = 0; | |
| 223 | 218 | } |
| 224 | 219 | |
| 225 | | |
| 220 | | |
| 226 | 221 | |
| 227 | return ~((shift_bits[ | |
| 222 | return ~((shift_bits[ | |
| 228 | 223 | } |
| 229 | 224 | |
| 230 | 225 | |
| 231 | ||
| 226 | ||
| 232 | 227 | { |
| 233 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 234 | 228 | /* latch the low 4 bits as input to the ADC0844 */ |
| 235 | | |
| 229 | | |
| 236 | 230 | |
| 237 | 231 | /* remaining bits go to standard connections */ |
| 238 | 232 | mcrmono_control_port_w(space, offset, data); |
| 239 | 233 | } |
| 240 | 234 | |
| 241 | 235 | |
| 242 | ||
| 236 | ||
| 243 | 237 | { |
| 244 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 245 | 238 | static const char *const inputs[] = { "MONO.IP1", "MONO.IP1.ALT1", "MONO.IP1.ALT2", "MONO.IP1.ALT3" }; |
| 246 | 239 | /* |
| 247 | 240 | Reflective Sensor Control: |
| r14896 | r14897 | |
| 263 | 256 | |
| 264 | 257 | /* when the read is toggled is when the ADC value is latched */ |
| 265 | 258 | if (!(data & 0x80)) |
| 266 | | |
| 259 | | |
| 267 | 260 | |
| 268 | 261 | /* when both the write and the enable are low, it's a write to the ADC0844 */ |
| 269 | 262 | /* unfortunately the behavior below doesn't match up with the inputs on the */ |
| 270 | 263 | /* schematics and wiring diagrams, so they must be wrong */ |
| 271 | 264 | if (!(data & 0x40) && !(data & 0x20)) |
| 272 | | |
| 265 | | |
| 273 | 266 | |
| 274 | 267 | /* low 5 bits control the turbo CS */ |
| 275 | 268 | turbocs_data_w(space, offset, data); |
| r14896 | r14897 | |
| 283 | 276 | * |
| 284 | 277 | *************************************/ |
| 285 | 278 | |
| 286 | ||
| 279 | ||
| 287 | 280 | { |
| 288 | return input_port_read( | |
| 281 | return input_port_read( | |
| 289 | 282 | } |
| 290 | 283 | |
| 291 | 284 | |
| 292 | ||
| 285 | ||
| 293 | 286 | { |
| 294 | 287 | /* bit 5 controls reset of the Sounds Good board */ |
| 295 | soundsgood_reset_w( | |
| 288 | soundsgood_reset_w( | |
| 296 | 289 | |
| 297 | 290 | /* low 5 bits go directly to the Sounds Good board */ |
| 298 | 291 | soundsgood_data_w(space, offset, data); |
| r14896 | r14897 | |
| 306 | 299 | * |
| 307 | 300 | *************************************/ |
| 308 | 301 | |
| 309 | ||
| 302 | ||
| 310 | 303 | { |
| 311 | return input_port_read( | |
| 304 | return input_port_read( | |
| 312 | 305 | } |
| 313 | 306 | |
| 314 | 307 | |
| 315 | ||
| 308 | ||
| 316 | 309 | { |
| 317 | 310 | /* |
| 318 | 311 | Lamp Board: |
| r14896 | r14897 | |
| 324 | 317 | /* bit 3 -> J1-10 = lamp 1 */ |
| 325 | 318 | /* bit 2 -> J1-8 = lamp 2 */ |
| 326 | 319 | /* bit 1 -> J1-6 = lamp 3 */ |
| 327 | set_led_status(space->machine(), 0, (data >> 3) & 1); | |
| 328 | set_led_status(space->machine(), 1, (data >> 2) & 1); | |
| 329 | set_led_status(space->machine(), 2, (data >> 1) & 1); | |
| 320 | set_led_status(machine(), 0, (data >> 3) & 1); | |
| 321 | set_led_status(machine(), 1, (data >> 2) & 1); | |
| 322 | set_led_status(machine(), 2, (data >> 1) & 1); | |
| 330 | 323 | |
| 331 | 324 | /* remaining bits go to standard connections */ |
| 332 | 325 | mcrmono_control_port_w(space, offset, data); |
| 333 | 326 | } |
| 334 | 327 | |
| 335 | 328 | |
| 336 | ||
| 329 | ||
| 337 | 330 | { |
| 338 | 331 | /* bit 5 controls reset of the Sounds Good board */ |
| 339 | soundsgood_reset_w( | |
| 332 | soundsgood_reset_w( | |
| 340 | 333 | |
| 341 | 334 | /* low 5 bits go directly to the Sounds Good board */ |
| 342 | 335 | soundsgood_data_w(space, offset, data); |
| r14896 | r14897 | |
| 350 | 343 | * |
| 351 | 344 | *************************************/ |
| 352 | 345 | |
| 353 | ||
| 346 | ||
| 354 | 347 | { |
| 355 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 356 | UINT8 result = input_port_read(space->machine(), "MONO.IP0"); | |
| 357 | if (state->m_input_mux) | |
| 358 | result = (result & ~0x0a) | (input_port_read(space->machine(), "MONO.IP0.ALT") & 0x0a); | |
| 348 | UINT8 result = input_port_read(machine(), "MONO.IP0"); | |
| 349 | if (m_input_mux) | |
| 350 | result = (result & ~0x0a) | (input_port_read(machine(), "MONO.IP0.ALT") & 0x0a); | |
| 359 | 351 | return (result & ~0x10) | ((soundsgood_status_r(space, 0) << 4) & 0x10); |
| 360 | 352 | } |
| 361 | 353 | |
| 362 | 354 | |
| 363 | ||
| 355 | ||
| 364 | 356 | { |
| 365 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 366 | 357 | /* bit 1 controls input muxing on port 0 */ |
| 367 | | |
| 358 | | |
| 368 | 359 | |
| 369 | 360 | /* bit 2 controls light #0 */ |
| 370 | 361 | /* bit 3 controls light #1 */ |
| 371 | 362 | /* bit 4 controls light #2 */ |
| 372 | set_led_status(space->machine(), 0, (data >> 2) & 1); | |
| 373 | set_led_status(space->machine(), 1, (data >> 3) & 1); | |
| 374 | set_led_status(space->machine(), 2, (data >> 4) & 1); | |
| 363 | set_led_status(machine(), 0, (data >> 2) & 1); | |
| 364 | set_led_status(machine(), 1, (data >> 3) & 1); | |
| 365 | set_led_status(machine(), 2, (data >> 4) & 1); | |
| 375 | 366 | |
| 376 | 367 | /* remaining bits go to standard connections */ |
| 377 | 368 | mcrmono_control_port_w(space, offset, data); |
| 378 | 369 | } |
| 379 | 370 | |
| 380 | 371 | |
| 381 | ||
| 372 | ||
| 382 | 373 | { |
| 383 | 374 | /* bit 6 controls reset of the Sounds Good board */ |
| 384 | soundsgood_reset_w( | |
| 375 | soundsgood_reset_w( | |
| 385 | 376 | |
| 386 | 377 | /* unline the other games, the STROBE is in the high bit instead of the low bit */ |
| 387 | 378 | soundsgood_data_w(space, offset, (data << 1) | (data >> 7)); |
| r14896 | r14897 | |
| 395 | 386 | * |
| 396 | 387 | *************************************/ |
| 397 | 388 | |
| 398 | ||
| 389 | ||
| 399 | 390 | { |
| 400 | return input_port_read( | |
| 391 | return input_port_read( | |
| 401 | 392 | } |
| 402 | 393 | |
| 403 | 394 | |
| 404 | ||
| 395 | ||
| 405 | 396 | { |
| 406 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 407 | 397 | /* multiplexed steering wheel/gas pedal */ |
| 408 | return input_port_read( | |
| 398 | return input_port_read( | |
| 409 | 399 | } |
| 410 | 400 | |
| 411 | 401 | |
| 412 | ||
| 402 | ||
| 413 | 403 | { |
| 414 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 415 | 404 | /* Spy Hunter uses port 4 for talking to the Chip Squeak Deluxe */ |
| 416 | 405 | /* (and for toggling the lamps and muxing the analog inputs) */ |
| 417 | 406 | |
| 418 | 407 | /* mux select is in bit 7 */ |
| 419 | | |
| 408 | | |
| 420 | 409 | |
| 421 | 410 | /* |
| 422 | 411 | Lamp Driver: |
| r14896 | r14897 | |
| 427 | 416 | demuxer. The eight outputs directly control 8 lamps. |
| 428 | 417 | */ |
| 429 | 418 | /* bit 5 = STR1 (J1-13) */ |
| 430 | if ((( | |
| 419 | if ((( | |
| 431 | 420 | { |
| 432 | 421 | static const char *const lampname[8] = |
| 433 | 422 | { |
| r14896 | r14897 | |
| 440 | 429 | /* bit 0 -> J1-12 (A0) */ |
| 441 | 430 | output_set_value(lampname[data & 7], (data >> 3) & 1); |
| 442 | 431 | } |
| 443 | | |
| 432 | | |
| 444 | 433 | |
| 445 | 434 | /* low 5 bits go to control the Chip Squeak Deluxe */ |
| 446 | 435 | csdeluxe_data_w(space, offset, data); |
| r14896 | r14897 | |
| 454 | 443 | * |
| 455 | 444 | *************************************/ |
| 456 | 445 | |
| 457 | ||
| 446 | ||
| 458 | 447 | { |
| 459 | mcr3_state *state = space->machine().driver_data<mcr3_state>(); | |
| 460 | 448 | /* multiplexed steering wheel/gas pedal */ |
| 461 | if (state->m_input_mux) | |
| 462 | return input_port_read(space->machine(), "SSIO.IP2.ALT"); | |
| 449 | if (m_input_mux) | |
| 450 | return input_port_read(machine(), "SSIO.IP2.ALT"); | |
| 463 | 451 | |
| 464 | return input_port_read( | |
| 452 | return input_port_read( | |
| 465 | 453 | } |
| 466 | 454 | |
| 467 | 455 | |
| 468 | ||
| 456 | ||
| 469 | 457 | { |
| 470 | 458 | /* The checksum on the ttprog1.bin ROM seems to be bad by 1 bit */ |
| 471 | 459 | /* The checksum should come out to $82 but it should be $92 */ |
| 472 | 460 | /* Unfortunately, the game refuses to start if any bad ROM is */ |
| 473 | 461 | /* found; to work around this, we catch the checksum byte read */ |
| 474 | 462 | /* and modify it to what we know we will be getting. */ |
| 475 | if (cpu_get_previouspc(&space | |
| 463 | if (cpu_get_previouspc(&space. | |
| 476 | 464 | return 0x82; |
| 477 | 465 | else |
| 478 | 466 | return 0x92; |
| r14896 | r14897 | |
| 507 | 495 | AM_RANGE(0x02, 0x02) AM_MIRROR(0x78) AM_READ_PORT("MONO.IP2") |
| 508 | 496 | AM_RANGE(0x03, 0x03) AM_MIRROR(0x78) AM_READ_PORT("MONO.IP3") |
| 509 | 497 | AM_RANGE(0x04, 0x04) AM_MIRROR(0x78) AM_READ_PORT("MONO.IP4") |
| 510 | AM_RANGE(0x05, 0x05) AM_MIRROR(0x78) AM_WRITE | |
| 498 | AM_RANGE(0x05, 0x05) AM_MIRROR(0x78) AM_WRITE | |
| 511 | 499 | AM_RANGE(0x07, 0x07) AM_MIRROR(0x78) AM_WRITE(watchdog_reset_w) |
| 512 | 500 | AM_RANGE(0xf0, 0xf3) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ctc", z80ctc_r, z80ctc_w) |
| 513 | 501 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1539 | 1527 | static DRIVER_INIT( demoderm ) |
| 1540 | 1528 | { |
| 1541 | 1529 | mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK); |
| 1542 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x01, 0x01, FUNC(demoderm_ip1_r)); | |
| 1543 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(demoderm_ip2_r)); | |
| 1544 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(demoderm_op6_w)); | |
| 1530 | mcr3_state *state = machine.driver_data<mcr3_state>(); | |
| 1531 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::demoderm_ip1_r),state)); | |
| 1532 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::demoderm_ip2_r),state)); | |
| 1533 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::demoderm_op6_w),state)); | |
| 1545 | 1534 | } |
| 1546 | 1535 | |
| 1547 | 1536 | |
| 1548 | 1537 | static DRIVER_INIT( sarge ) |
| 1549 | 1538 | { |
| 1539 | mcr3_state *state = machine.driver_data<mcr3_state>(); | |
| 1550 | 1540 | mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK); |
| 1551 | machine.device("maincpu")->memory().space(AS_IO)->install_ | |
| 1541 | machine.device("maincpu")->memory().space(AS_IO)->install_ | |
| 1552 | 1542 | } |
| 1553 | 1543 | |
| 1554 | 1544 | |
| r14896 | r14897 | |
| 1556 | 1546 | { |
| 1557 | 1547 | mcr3_state *state = machine.driver_data<mcr3_state>(); |
| 1558 | 1548 | mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK); |
| 1559 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x01, 0x01, FUNC(maxrpm_ip1_r)); | |
| 1560 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(maxrpm_ip2_r)); | |
| 1561 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(maxrpm_op5_w)); | |
| 1562 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(maxrpm_op6_w)); | |
| 1549 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x01, 0x01, read8_delegate(FUNC(mcr3_state::maxrpm_ip1_r),state)); | |
| 1550 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::maxrpm_ip2_r),state)); | |
| 1551 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::maxrpm_op5_w),state)); | |
| 1552 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::maxrpm_op6_w),state)); | |
| 1563 | 1553 | |
| 1564 | 1554 | state_save_register_global(machine, state->m_maxrpm_adc_control); |
| 1565 | 1555 | state_save_register_global(machine, state->m_maxrpm_adc_select); |
| r14896 | r14897 | |
| 1571 | 1561 | |
| 1572 | 1562 | static DRIVER_INIT( rampage ) |
| 1573 | 1563 | { |
| 1564 | mcr3_state *state = machine.driver_data<mcr3_state>(); | |
| 1574 | 1565 | mcr_common_init(machine, MCR_SOUNDS_GOOD); |
| 1575 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x04, FUNC(rampage_ip4_r)); | |
| 1576 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(rampage_op6_w)); | |
| 1566 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x04, 0x04, read8_delegate(FUNC(mcr3_state::rampage_ip4_r),state)); | |
| 1567 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::rampage_op6_w),state)); | |
| 1577 | 1568 | } |
| 1578 | 1569 | |
| 1579 | 1570 | |
| 1580 | 1571 | static DRIVER_INIT( powerdrv ) |
| 1581 | 1572 | { |
| 1573 | mcr3_state *state = machine.driver_data<mcr3_state>(); | |
| 1582 | 1574 | mcr_common_init(machine, MCR_SOUNDS_GOOD); |
| 1583 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(powerdrv_ip2_r)); | |
| 1584 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(powerdrv_op5_w)); | |
| 1585 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(powerdrv_op6_w)); | |
| 1575 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x02, 0x02, read8_delegate(FUNC(mcr3_state::powerdrv_ip2_r),state)); | |
| 1576 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::powerdrv_op5_w),state)); | |
| 1577 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::powerdrv_op6_w),state)); | |
| 1586 | 1578 | } |
| 1587 | 1579 | |
| 1588 | 1580 | |
| 1589 | 1581 | static DRIVER_INIT( stargrds ) |
| 1590 | 1582 | { |
| 1583 | mcr3_state *state = machine.driver_data<mcr3_state>(); | |
| 1591 | 1584 | mcr_common_init(machine, MCR_SOUNDS_GOOD); |
| 1592 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(stargrds_ip0_r)); | |
| 1593 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(stargrds_op5_w)); | |
| 1594 | machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(stargrds_op6_w)); | |
| 1585 | machine.device("maincpu")->memory().space(AS_IO)->install_read_handler(0x00, 0x00, read8_delegate(FUNC(mcr3_state::stargrds_ip0_r),state)); | |
| 1586 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x05, 0x05, write8_delegate(FUNC(mcr3_state::stargrds_op5_w),state)); | |
| 1587 | machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x06, 0x06, write8_delegate(FUNC(mcr3_state::stargrds_op6_w),state)); | |
| 1595 | 1588 | } |
| 1596 | 1589 | |
| 1597 | 1590 | |
| r14896 | r14897 | |
| 1599 | 1592 | { |
| 1600 | 1593 | mcr3_state *state = machine.driver_data<mcr3_state>(); |
| 1601 | 1594 | mcr_common_init(machine, MCR_SSIO | MCR_CHIP_SQUEAK_DELUXE); |
| 1602 | ssio_set_custom_input(1, 0x60, spyhunt_ip1_r); | |
| 1603 | ssio_set_custom_input(2, 0xff, spyhunt_ip2_r); | |
| 1604 | ssio_set_custom_output(4, 0xff, spyhunt_op4_w); | |
| 1595 | ssio_set_custom_input(1, 0x60, read8_delegate(FUNC(mcr3_state::spyhunt_ip1_r),state)); | |
| 1596 | ssio_set_custom_input(2, 0xff, read8_delegate(FUNC(mcr3_state::spyhunt_ip2_r),state)); | |
| 1597 | ssio_set_custom_output(4, 0xff, write8_delegate(FUNC(mcr3_state::spyhunt_op4_w),state)); | |
| 1605 | 1598 | |
| 1606 | 1599 | state->m_spyhunt_sprite_color_mask = 0x00; |
| 1607 | 1600 | state->m_spyhunt_scroll_offset = 16; |
| r14896 | r14897 | |
| 1622 | 1615 | { |
| 1623 | 1616 | mcr3_state *state = machine.driver_data<mcr3_state>(); |
| 1624 | 1617 | mcr_common_init(machine, MCR_SSIO | MCR_CHIP_SQUEAK_DELUXE); |
| 1625 | ssio_set_custom_input(1, 0x60, spyhunt_ip1_r); | |
| 1626 | ssio_set_custom_input(2, 0xff, turbotag_ip2_r); | |
| 1627 | ssio_set_custom_output(4, 0xff, spyhunt_op4_w); | |
| 1618 | ssio_set_custom_input(1, 0x60, read8_delegate(FUNC(mcr3_state::spyhunt_ip1_r),state)); | |
| 1619 | ssio_set_custom_input(2, 0xff, read8_delegate(FUNC(mcr3_state::turbotag_ip2_r),state)); | |
| 1620 | ssio_set_custom_output(4, 0xff, write8_delegate(FUNC(mcr3_state::spyhunt_op4_w),state)); | |
| 1628 | 1621 | |
| 1629 | 1622 | state->m_spyhunt_sprite_color_mask = 0x00; |
| 1630 | 1623 | state->m_spyhunt_scroll_offset = 88; |
| r14896 | r14897 | |
| 1633 | 1626 | machine.device<cpu_device>("csdcpu")->suspend(SUSPEND_REASON_DISABLE, 1); |
| 1634 | 1627 | |
| 1635 | 1628 | /* kludge for bad ROM read */ |
| 1636 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1629 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1637 | 1630 | } |
| 1638 | 1631 | |
| 1639 | 1632 |
| r14896 | r14897 | |
|---|---|---|
| 76 | 76 | { |
| 77 | 77 | public: |
| 78 | 78 | pipeline_state(const machine_config &mconfig, device_type type, const char *tag) |
| 79 | : driver_device(mconfig, type, tag) { } | |
| 79 | : driver_device(mconfig, type, tag) , | |
| 80 | m_vram1(*this, "vram1"), | |
| 81 | m_vram2(*this, "vram2"){ } | |
| 80 | 82 | |
| 81 | 83 | tilemap_t *m_tilemap1; |
| 82 | 84 | tilemap_t *m_tilemap2; |
| 83 | UINT8 *m_vram1; | |
| 84 | UINT8 *m_vram2; | |
| 85 | required_shared_ptr<UINT8> m_vram1; | |
| 86 | required_shared_ptr<UINT8> m_vram2; | |
| 85 | 87 | UINT8 m_vidctrl; |
| 86 | 88 | UINT8 *m_palram; |
| 87 | 89 | UINT8 m_toMCU; |
| r14896 | r14897 | |
| 98 | 100 | static TILE_GET_INFO( get_tile_info ) |
| 99 | 101 | { |
| 100 | 102 | pipeline_state *state = machine.driver_data<pipeline_state>(); |
| 101 | int code = state->m_vram2[tile_index]+state->m_vram2[tile_index+0x800]*256; | |
| 103 | int code = state->m_vram2.target()[tile_index]+state->m_vram2.target()[tile_index+0x800]*256; | |
| 102 | 104 | SET_TILE_INFO( |
| 103 | 105 | 0, |
| 104 | 106 | code, |
| r14896 | r14897 | |
| 109 | 111 | static TILE_GET_INFO( get_tile_info2 ) |
| 110 | 112 | { |
| 111 | 113 | pipeline_state *state = machine.driver_data<pipeline_state>(); |
| 112 | int code =state->m_vram1[tile_index]+((state->m_vram1[tile_index+0x800]>>4))*256; | |
| 113 | int color=((state->m_vram1[tile_index+0x800])&0xf); | |
| 114 | int code =state->m_vram1.target()[tile_index]+((state->m_vram1.target()[tile_index+0x800]>>4))*256; | |
| 115 | int color=((state->m_vram1.target()[tile_index+0x800])&0xf); | |
| 114 | 116 | SET_TILE_INFO |
| 115 | 117 | ( |
| 116 | 118 | 1, |
| r14896 | r14897 | |
| 149 | 151 | if(!(m_vidctrl&1)) |
| 150 | 152 | { |
| 151 | 153 | m_tilemap1->mark_tile_dirty(offset&0x7ff); |
| 152 | m_vram2[offset]=data; | |
| 154 | m_vram2.target()[offset]=data; | |
| 153 | 155 | } |
| 154 | 156 | else |
| 155 | 157 | { |
| r14896 | r14897 | |
| 165 | 167 | WRITE8_MEMBER(pipeline_state::vram1_w) |
| 166 | 168 | { |
| 167 | 169 | m_tilemap2->mark_tile_dirty(offset&0x7ff); |
| 168 | m_vram1[offset]=data; | |
| 170 | m_vram1.target()[offset]=data; | |
| 169 | 171 | } |
| 170 | 172 | |
| 171 | 173 | static READ8_DEVICE_HANDLER(protection_r) |
| r14896 | r14897 | |
| 189 | 191 | static ADDRESS_MAP_START( cpu0_mem, AS_PROGRAM, 8, pipeline_state ) |
| 190 | 192 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 191 | 193 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 192 | AM_RANGE(0x8800, 0x97ff) AM_RAM_WRITE(vram1_w) AM_BASE(m_vram1) | |
| 193 | AM_RANGE(0x9800, 0xa7ff) AM_RAM_WRITE(vram2_w) AM_BASE(m_vram2) | |
| 194 | AM_RANGE(0x8800, 0x97ff) AM_RAM_WRITE(vram1_w) AM_SHARE("vram1") | |
| 195 | AM_RANGE(0x9800, 0xa7ff) AM_RAM_WRITE(vram2_w) AM_SHARE("vram2") | |
| 194 | 196 | AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 195 | 197 | AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 196 | 198 | AM_RANGE(0xb830, 0xb830) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | case 4: /* Interrupt ack (VBL - IRQ 5) */ |
| 46 | 46 | break; |
| 47 | 47 | case 6: /* 6502 sound cpu */ |
| 48 | soundlatch_w(space, 0, data & 0xff); | |
| 48 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 49 | 49 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 50 | 50 | break; |
| 51 | 51 | default: |
| r14896 | r14897 | |
| 64 | 64 | AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w) |
| 65 | 65 | AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w) |
| 66 | 66 | AM_RANGE(0x30c000, 0x30c00b) AM_READWRITE(stadhero_control_r, stadhero_control_w) |
| 67 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 67 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 68 | 68 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */ |
| 69 | 69 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_BASE(m_spriteram) |
| 70 | 70 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 75 | 75 | AM_RANGE(0x0000, 0x05ff) AM_RAM |
| 76 | 76 | AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 77 | 77 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3812_w) |
| 78 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 78 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 79 | 79 | AM_RANGE(0x3800, 0x3800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 80 | 80 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 81 | 81 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 164 | 164 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(wwfsstar_fg0_videoram_w) AM_BASE(m_fg0_videoram) /* FG0 Ram */ |
| 165 | 165 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(wwfsstar_bg0_videoram_w) AM_BASE(m_bg0_videoram) /* BG0 Ram */ |
| 166 | 166 | AM_RANGE(0x100000, 0x1003ff) AM_RAM AM_BASE(m_spriteram) /* SPR Ram */ |
| 167 | AM_RANGE(0x140000, 0x140fff) AM_WRITE(paletteram | |
| 167 | AM_RANGE(0x140000, 0x140fff) AM_WRITE(paletteram | |
| 168 | 168 | AM_RANGE(0x180000, 0x180003) AM_WRITE(wwfsstar_irqack_w) |
| 169 | 169 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("DSW1") |
| 170 | 170 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("DSW2") |
| r14896 | r14897 | |
| 182 | 182 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 183 | 183 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 184 | 184 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 185 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 185 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 186 | 186 | ADDRESS_MAP_END |
| 187 | 187 | |
| 188 | 188 | |
| r14896 | r14897 | |
| 208 | 208 | |
| 209 | 209 | WRITE16_MEMBER(wwfsstar_state::wwfsstar_soundwrite) |
| 210 | 210 | { |
| 211 | soundlatch_w(space, 1, data & 0xff); | |
| 211 | soundlatch_byte_w(space, 1, data & 0xff); | |
| 212 | 212 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE ); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | WRITE16_MEMBER(wwfsstar_state::wwfsstar_flipscreen_w) |
| 216 | 216 | { |
| 217 | flip_screen_set( | |
| 217 | flip_screen_set( | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | WRITE16_MEMBER(wwfsstar_state::wwfsstar_irqack_w) |
| r14896 | r14897 | |
|---|---|---|
| 515 | 515 | |
| 516 | 516 | static ADDRESS_MAP_START( rastsag2_map, AS_PROGRAM, 16, taitob_state ) |
| 517 | 517 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 518 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 518 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 519 | 519 | AM_RANGE(0x600000, 0x607fff) AM_RAM /* Main RAM */ /*ashura up to 603fff only*/ |
| 520 | 520 | TC0180VCU_MEMRW( 0x400000 ) |
| 521 | 521 | AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| r14896 | r14897 | |
| 530 | 530 | TC0180VCU_MEMRW( 0x400000 ) |
| 531 | 531 | AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 532 | 532 | AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 533 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 533 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 534 | 534 | AM_RANGE(0xa00000, 0xa0ffff) AM_RAM /* Main RAM */ |
| 535 | 535 | ADDRESS_MAP_END |
| 536 | 536 | |
| r14896 | r14897 | |
| 542 | 542 | TC0180VCU_MEMRW( 0x400000 ) |
| 543 | 543 | AM_RANGE(0x600000, 0x60000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00) |
| 544 | 544 | AM_RANGE(0x800000, 0x807fff) AM_RAM /* Main RAM */ |
| 545 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 545 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 546 | 546 | ADDRESS_MAP_END |
| 547 | 547 | |
| 548 | 548 | static ADDRESS_MAP_START( tetrista_map, AS_PROGRAM, 16, taitob_state ) |
| 549 | 549 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 550 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 550 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 551 | 551 | TC0180VCU_MEMRW( 0x400000 ) |
| 552 | 552 | AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0xff00) |
| 553 | 553 | AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0xff00) |
| r14896 | r14897 | |
| 565 | 565 | AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 566 | 566 | AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 567 | 567 | AM_RANGE(0x800000, 0x803fff) AM_RAM /* Main RAM */ |
| 568 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 568 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 569 | 569 | AM_RANGE(0xb00000, 0xb7ffff) AM_RAM_WRITE(hitice_pixelram_w) AM_BASE(m_pixelram) |
| 570 | 570 | // { 0xbffff0, 0xbffff1, ??? |
| 571 | 571 | AM_RANGE(0xbffff2, 0xbffff5) AM_WRITE(hitice_pixel_scroll_w) |
| r14896 | r14897 | |
| 588 | 588 | AM_RANGE(0x60001c, 0x60001d) AM_READ(trackx2_lo_r) |
| 589 | 589 | AM_RANGE(0x60001e, 0x60001f) AM_READ(trackx2_hi_r) |
| 590 | 590 | AM_RANGE(0x800000, 0x803fff) AM_RAM /* Main RAM */ |
| 591 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 591 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 592 | 592 | ADDRESS_MAP_END |
| 593 | 593 | |
| 594 | 594 | |
| r14896 | r14897 | |
| 603 | 603 | AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w) |
| 604 | 604 | AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 605 | 605 | AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 606 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 606 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 607 | 607 | AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */ |
| 608 | 608 | ADDRESS_MAP_END |
| 609 | 609 | |
| r14896 | r14897 | |
| 619 | 619 | AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w) |
| 620 | 620 | AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 621 | 621 | AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 622 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 622 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 623 | 623 | AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */ |
| 624 | 624 | ADDRESS_MAP_END |
| 625 | 625 | |
| r14896 | r14897 | |
| 631 | 631 | AM_RANGE(0x210000, 0x210001) AM_READ_PORT("IN3") |
| 632 | 632 | AM_RANGE(0x220000, 0x220001) AM_READ_PORT("IN4") |
| 633 | 633 | AM_RANGE(0x230000, 0x230001) AM_READ_PORT("IN5") |
| 634 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 634 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 635 | 635 | AM_RANGE(0x302000, 0x303fff) AM_READONLY |
| 636 | 636 | AM_RANGE(0x400000, 0x40ffff) AM_RAM /* Main RAM */ |
| 637 | 637 | TC0180VCU_MEMRW( 0x500000 ) |
| r14896 | r14897 | |
| 649 | 649 | AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 650 | 650 | AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 651 | 651 | AM_RANGE(0x700000, 0x700003) AM_WRITE(gain_control_w) |
| 652 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 652 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 653 | 653 | AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */ |
| 654 | 654 | ADDRESS_MAP_END |
| 655 | 655 | |
| r14896 | r14897 | |
| 659 | 659 | AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 660 | 660 | AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 661 | 661 | TC0180VCU_MEMRW( 0x400000 ) |
| 662 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 662 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 663 | 663 | AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00) |
| 664 | 664 | AM_RANGE(0xa00000, 0xa03fff) AM_RAM /* Main RAM */ |
| 665 | 665 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 669 | 669 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 670 | 670 | AM_RANGE(0x200000, 0x203fff) AM_RAM /* Main RAM */ |
| 671 | 671 | TC0180VCU_MEMRW( 0x400000 ) |
| 672 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 672 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 673 | 673 | AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0xff00) |
| 674 | 674 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0xff00) |
| 675 | 675 | AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| r14896 | r14897 | |
| 689 | 689 | AM_RANGE(0x230000, 0x230001) AM_READ_PORT("IN5") |
| 690 | 690 | AM_RANGE(0x240000, 0x240001) AM_WRITENOP // ??? |
| 691 | 691 | // AM_RANGE(0x240000, 0x240001) AM_READNOP /* read 4 times at init */ |
| 692 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 692 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 693 | 693 | AM_RANGE(0x400000, 0x403fff) AM_RAM /* Main RAM */ |
| 694 | 694 | TC0180VCU_MEMRW( 0x500000 ) |
| 695 | 695 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 699 | 699 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 700 | 700 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* Main RAM */ |
| 701 | 701 | TC0180VCU_MEMRW( 0x200000 ) |
| 702 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 702 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 703 | 703 | AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00) |
| 704 | 704 | AM_RANGE(0x410000, 0x41000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0xff00) /* mirror address - seems to be only used for coin control */ |
| 705 | 705 | AM_RANGE(0x500000, 0x500001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| r14896 | r14897 | |
| 710 | 710 | static ADDRESS_MAP_START( sbm_map, AS_PROGRAM, 16, taitob_state ) |
| 711 | 711 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 712 | 712 | AM_RANGE(0x100000, 0x10ffff) AM_RAM /* Main RAM */ |
| 713 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 713 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 714 | 714 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_wordswap_r, tc0510nio_halfword_wordswap_w) |
| 715 | 715 | AM_RANGE(0x320000, 0x320001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 716 | 716 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r14896 | r14897 | |
| 728 | 728 | AM_RANGE(0x188002, 0x188003) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_comm_w, 0xff00) |
| 729 | 729 | AM_RANGE(0x18c000, 0x18c001) AM_WRITE(realpunc_output_w) |
| 730 | 730 | TC0180VCU_MEMRW( 0x200000 ) |
| 731 | AM_RANGE(0x280000, 0x281fff) AM_RAM_WRITE(paletteram | |
| 731 | AM_RANGE(0x280000, 0x281fff) AM_RAM_WRITE(paletteram | |
| 732 | 732 | AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w) |
| 733 | 733 | AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w) |
| 734 | 734 | // AM_RANGE(0x320000, 0x320001) AM_READ_LEGACY(SMH_NOP) // ? |
| r14896 | r14897 | |
|---|---|---|
| 322 | 322 | int m_unk1_bit; |
| 323 | 323 | UINT32 m_voodoo3_pci_reg[0x100]; |
| 324 | 324 | |
| 325 | DECLARE_READ32_MEMBER(epic_r); | |
| 326 | DECLARE_WRITE32_MEMBER(epic_w); | |
| 327 | DECLARE_WRITE64_MEMBER(unk2_w); | |
| 328 | DECLARE_READ64_MEMBER(voodoo3_io_r); | |
| 329 | DECLARE_WRITE64_MEMBER(voodoo3_io_w); | |
| 330 | DECLARE_READ64_MEMBER(voodoo3_r); | |
| 331 | DECLARE_WRITE64_MEMBER(voodoo3_w); | |
| 332 | DECLARE_READ64_MEMBER(voodoo3_lfb_r); | |
| 333 | DECLARE_WRITE64_MEMBER(voodoo3_lfb_w); | |
| 334 | DECLARE_READ64_MEMBER(unk1_r); | |
| 335 | DECLARE_READ64_MEMBER(e70000_r); | |
| 336 | DECLARE_WRITE64_MEMBER(e70000_w); | |
| 337 | DECLARE_WRITE64_MEMBER(unk1a_w); | |
| 338 | DECLARE_WRITE64_MEMBER(unk1b_w); | |
| 339 | DECLARE_READ64_MEMBER(e00008_r); | |
| 340 | DECLARE_WRITE64_MEMBER(e00008_w); | |
| 341 | DECLARE_READ64_MEMBER(e00000_r); | |
| 325 | 342 | }; |
| 326 | 343 | |
| 327 | 344 | UINT32 m_mpc8240_regs[256/4]; |
| r14896 | r14897 | |
| 641 | 658 | } |
| 642 | 659 | } |
| 643 | 660 | |
| 644 | ||
| 661 | ||
| 645 | 662 | { |
| 646 | 663 | int reg; |
| 647 | 664 | reg = offset * 4; |
| r14896 | r14897 | |
| 651 | 668 | const char *regname = epic_get_register_name(reg); |
| 652 | 669 | if (regname) |
| 653 | 670 | { |
| 654 | printf("EPIC: read %08X (%s) at %08X\n", reg, regname, cpu_get_pc(&space | |
| 671 | printf("EPIC: read %08X (%s) at %08X\n", reg, regname, cpu_get_pc(&space. | |
| 655 | 672 | } |
| 656 | 673 | else |
| 657 | 674 | { |
| 658 | printf("EPIC: read %08X at %08X\n", reg, cpu_get_pc(&space | |
| 675 | printf("EPIC: read %08X at %08X\n", reg, cpu_get_pc(&space. | |
| 659 | 676 | } |
| 660 | 677 | } |
| 661 | 678 | |
| r14896 | r14897 | |
| 699 | 716 | if (epic.i2c_cr & 0x40) |
| 700 | 717 | { |
| 701 | 718 | printf("I2C interrupt\n"); |
| 702 | mpc8240_interrupt( | |
| 719 | mpc8240_interrupt( | |
| 703 | 720 | |
| 704 | 721 | // set interrupt flag in status register |
| 705 | 722 | epic.i2c_sr |= 0x2; |
| r14896 | r14897 | |
| 718 | 735 | /*if (epic.i2c_cr & 0x40) |
| 719 | 736 | { |
| 720 | 737 | printf("I2C interrupt\n"); |
| 721 | mpc8240_interrupt( | |
| 738 | mpc8240_interrupt( | |
| 722 | 739 | |
| 723 | 740 | // set interrupt flag in status register |
| 724 | 741 | epic.i2c_sr |= 0x2; |
| r14896 | r14897 | |
| 805 | 822 | { |
| 806 | 823 | case 0x00a0: // Offset 0x600A0 - IACK |
| 807 | 824 | { |
| 808 | epic_update_interrupts( | |
| 825 | epic_update_interrupts( | |
| 809 | 826 | |
| 810 | 827 | if (epic.active_irq >= 0) |
| 811 | 828 | { |
| r14896 | r14897 | |
| 826 | 843 | return 0; |
| 827 | 844 | } |
| 828 | 845 | |
| 829 | ||
| 846 | ||
| 830 | 847 | { |
| 831 | 848 | int reg; |
| 832 | 849 | reg = offset * 4; |
| r14896 | r14897 | |
| 836 | 853 | const char *regname = epic_get_register_name(reg); |
| 837 | 854 | if (regname) |
| 838 | 855 | { |
| 839 | printf("EPIC: write %08X, %08X (%s) at %08X\n", data, reg, regname, cpu_get_pc(&space | |
| 856 | printf("EPIC: write %08X, %08X (%s) at %08X\n", data, reg, regname, cpu_get_pc(&space. | |
| 840 | 857 | } |
| 841 | 858 | else |
| 842 | 859 | { |
| 843 | printf("EPIC: write %08X, %08X at %08X\n", data, reg, cpu_get_pc(&space | |
| 860 | printf("EPIC: write %08X, %08X at %08X\n", data, reg, cpu_get_pc(&space. | |
| 844 | 861 | } |
| 845 | 862 | } |
| 846 | 863 | |
| r14896 | r14897 | |
| 898 | 915 | if (epic.i2c_cr & 0x40) |
| 899 | 916 | { |
| 900 | 917 | printf("I2C interrupt\n"); |
| 901 | mpc8240_interrupt( | |
| 918 | mpc8240_interrupt( | |
| 902 | 919 | |
| 903 | 920 | // set interrupt flag in status register |
| 904 | 921 | epic.i2c_sr |= 0x2; |
| r14896 | r14897 | |
| 916 | 933 | if (epic.i2c_cr & 0x40) |
| 917 | 934 | { |
| 918 | 935 | printf("I2C interrupt\n"); |
| 919 | mpc8240_interrupt( | |
| 936 | mpc8240_interrupt( | |
| 920 | 937 | |
| 921 | 938 | // set interrupt flag in status register |
| 922 | 939 | epic.i2c_sr |= 0x2; |
| r14896 | r14897 | |
| 957 | 974 | epic.irq[MPC8240_GTIMER0_IRQ + timer_num].priority = (data >> 16) & 0xf; |
| 958 | 975 | epic.irq[MPC8240_GTIMER0_IRQ + timer_num].vector = data & 0xff; |
| 959 | 976 | |
| 960 | epic_update_interrupts( | |
| 977 | epic_update_interrupts( | |
| 961 | 978 | break; |
| 962 | 979 | } |
| 963 | 980 | case 0x1130: // Offset 0x41130 - Global timer 0 destination register |
| r14896 | r14897 | |
| 969 | 986 | |
| 970 | 987 | epic.irq[MPC8240_GTIMER0_IRQ + timer_num].destination = data & 0x1; |
| 971 | 988 | |
| 972 | epic_update_interrupts( | |
| 989 | epic_update_interrupts( | |
| 973 | 990 | break; |
| 974 | 991 | } |
| 975 | 992 | case 0x1110: // Offset 0x41110 - Global timer 0 base count register |
| r14896 | r14897 | |
| 1029 | 1046 | epic.irq[MPC8240_IRQ0 + irq].priority = (data >> 16) & 0xf; |
| 1030 | 1047 | epic.irq[MPC8240_IRQ0 + irq].vector = data & 0xff; |
| 1031 | 1048 | |
| 1032 | epic_update_interrupts( | |
| 1049 | epic_update_interrupts( | |
| 1033 | 1050 | break; |
| 1034 | 1051 | } |
| 1035 | 1052 | case 0x1020: // Offset 0x51020 - I2C IRQ vector/priority register |
| r14896 | r14897 | |
| 1038 | 1055 | epic.irq[MPC8240_I2C_IRQ].priority = (data >> 16) & 0xf; |
| 1039 | 1056 | epic.irq[MPC8240_I2C_IRQ].vector = data & 0xff; |
| 1040 | 1057 | |
| 1041 | epic_update_interrupts( | |
| 1058 | epic_update_interrupts( | |
| 1042 | 1059 | break; |
| 1043 | 1060 | } |
| 1044 | 1061 | case 0x0210: // Offset 0x50210 - IRQ0 destination register |
| r14896 | r14897 | |
| 1062 | 1079 | |
| 1063 | 1080 | epic.irq[MPC8240_IRQ0 + irq].destination = data & 0x1; |
| 1064 | 1081 | |
| 1065 | epic_update_interrupts( | |
| 1082 | epic_update_interrupts( | |
| 1066 | 1083 | break; |
| 1067 | 1084 | } |
| 1068 | 1085 | case 0x1030: // Offset 0x51030 - I2C IRQ destination register |
| 1069 | 1086 | { |
| 1070 | 1087 | epic.irq[MPC8240_I2C_IRQ].destination = data & 0x1; |
| 1071 | epic_update_interrupts( | |
| 1088 | epic_update_interrupts( | |
| 1072 | 1089 | break; |
| 1073 | 1090 | } |
| 1074 | 1091 | } |
| r14896 | r14897 | |
| 1088 | 1105 | epic.irq[epic.active_irq].active = 0; |
| 1089 | 1106 | epic.active_irq = -1; |
| 1090 | 1107 | |
| 1091 | epic_update_interrupts( | |
| 1108 | epic_update_interrupts( | |
| 1092 | 1109 | break; |
| 1093 | 1110 | } |
| 1094 | 1111 | break; |
| 1095 | 1112 | } |
| 1096 | 1113 | } |
| 1097 | 1114 | } |
| 1098 | ||
| 1099 | static READ64_HANDLER(epic_64be_r) | |
| 1115 | /* | |
| 1116 | READ64_MEMBER(viper_state::epic_64be_r) | |
| 1100 | 1117 | { |
| 1101 | return read64be_with_32le_handler(epic_r, space, offset, mem_mask); | |
| 1118 | return read64be_with_32le_handler(epic_r, &space, offset, mem_mask); | |
| 1102 | 1119 | } |
| 1103 | ||
| 1120 | ||
| 1104 | 1121 | { |
| 1105 | write64be_with_32le_handler(epic_w, space, offset, data, mem_mask); | |
| 1122 | write64be_with_32le_handler(epic_w, &space, offset, data, mem_mask); | |
| 1106 | 1123 | } |
| 1124 | */ | |
| 1107 | 1125 | |
| 1108 | ||
| 1109 | 1126 | static void mpc8240_interrupt(running_machine &machine, int irq) |
| 1110 | 1127 | { |
| 1111 | 1128 | epic.irq[irq].pending = 1; |
| r14896 | r14897 | |
| 1341 | 1358 | } |
| 1342 | 1359 | } |
| 1343 | 1360 | |
| 1344 | ||
| 1361 | ||
| 1345 | 1362 | { |
| 1346 | viper_state *state = space->machine().driver_data<viper_state>(); | |
| 1347 | 1363 | |
| 1348 | 1364 | if (ACCESSING_BITS_56_63) |
| 1349 | 1365 | { |
| 1350 | | |
| 1366 | | |
| 1351 | 1367 | } |
| 1352 | 1368 | } |
| 1353 | 1369 | |
| r14896 | r14897 | |
| 1488 | 1504 | } |
| 1489 | 1505 | } |
| 1490 | 1506 | |
| 1491 | ||
| 1507 | ||
| 1492 | 1508 | { |
| 1493 | device_t *device = | |
| 1509 | device_t *device = | |
| 1494 | 1510 | return read64be_with_32le_device_handler(banshee_io_r, device, offset, mem_mask); |
| 1495 | 1511 | } |
| 1496 | ||
| 1512 | ||
| 1497 | 1513 | { |
| 1498 | // printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space | |
| 1514 | // printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space. | |
| 1499 | 1515 | |
| 1500 | device_t *device = | |
| 1516 | device_t *device = | |
| 1501 | 1517 | write64be_with_32le_device_handler(banshee_io_w, device, offset, data, mem_mask); |
| 1502 | 1518 | } |
| 1503 | 1519 | |
| 1504 | ||
| 1520 | ||
| 1505 | 1521 | { |
| 1506 | device_t *device = | |
| 1522 | device_t *device = | |
| 1507 | 1523 | return read64be_with_32le_device_handler(banshee_r, device, offset, mem_mask); |
| 1508 | 1524 | } |
| 1509 | ||
| 1525 | ||
| 1510 | 1526 | { |
| 1511 | // printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space | |
| 1527 | // printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space. | |
| 1512 | 1528 | |
| 1513 | device_t *device = | |
| 1529 | device_t *device = | |
| 1514 | 1530 | write64be_with_32le_device_handler(banshee_w, device, offset, data, mem_mask); |
| 1515 | 1531 | } |
| 1516 | 1532 | |
| 1517 | ||
| 1533 | ||
| 1518 | 1534 | { |
| 1519 | device_t *device = | |
| 1535 | device_t *device = | |
| 1520 | 1536 | return read64be_with_32le_device_handler(banshee_fb_r, device, offset, mem_mask); |
| 1521 | 1537 | } |
| 1522 | ||
| 1538 | ||
| 1523 | 1539 | { |
| 1524 | // printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space | |
| 1540 | // printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(&space. | |
| 1525 | 1541 | |
| 1526 | device_t *device = | |
| 1542 | device_t *device = | |
| 1527 | 1543 | write64be_with_32le_device_handler(banshee_fb_w, device, offset, data, mem_mask); |
| 1528 | 1544 | } |
| 1529 | 1545 | |
| r14896 | r14897 | |
| 1563 | 1579 | } |
| 1564 | 1580 | } |
| 1565 | 1581 | |
| 1566 | ||
| 1582 | ||
| 1567 | 1583 | { |
| 1568 | 1584 | UINT64 r = 0; |
| 1569 | 1585 | //return 0;//U64(0x0000400000000000); |
| r14896 | r14897 | |
| 1588 | 1604 | } |
| 1589 | 1605 | if (ACCESSING_BITS_32_39) |
| 1590 | 1606 | { |
| 1591 | UINT64 reg = input_port_read( | |
| 1607 | UINT64 reg = input_port_read( | |
| 1592 | 1608 | r |= reg << 32; |
| 1593 | 1609 | } |
| 1594 | 1610 | if (ACCESSING_BITS_24_31) |
| 1595 | 1611 | { |
| 1596 | UINT64 reg = input_port_read( | |
| 1612 | UINT64 reg = input_port_read( | |
| 1597 | 1613 | r |= reg << 24; |
| 1598 | 1614 | } |
| 1599 | 1615 | if (ACCESSING_BITS_16_23) |
| r14896 | r14897 | |
| 1711 | 1727 | |
| 1712 | 1728 | } |
| 1713 | 1729 | |
| 1714 | ||
| 1730 | ||
| 1715 | 1731 | { |
| 1716 | 1732 | if (ACCESSING_BITS_56_63) |
| 1717 | 1733 | { |
| 1718 | 1734 | ds2430_bit_timer->reset(); |
| 1719 | 1735 | ds2430_bit_timer->start_time(); |
| 1720 | 1736 | |
| 1721 | // printf("e70000_r: %08X (mask %08X%08X) at %08X\n", offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc( | |
| 1737 | // printf("e70000_r: %08X (mask %08X%08X) at %08X\n", offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc( | |
| 1722 | 1738 | } |
| 1723 | 1739 | |
| 1724 | 1740 | return 0; |
| 1725 | 1741 | } |
| 1726 | 1742 | |
| 1727 | ||
| 1743 | ||
| 1728 | 1744 | { |
| 1729 | 1745 | if (ACCESSING_BITS_56_63) |
| 1730 | 1746 | { |
| r14896 | r14897 | |
| 1733 | 1749 | ds2430_timer->adjust(attotime::from_usec(40), 1); // presence pulse for 240 microsecs |
| 1734 | 1750 | |
| 1735 | 1751 | unk1_bit = 1; |
| 1736 | // printf("e70000_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc(&space | |
| 1752 | // printf("e70000_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc(&space. | |
| 1737 | 1753 | } |
| 1738 | 1754 | else |
| 1739 | 1755 | { |
| r14896 | r14897 | |
| 1754 | 1770 | } |
| 1755 | 1771 | } |
| 1756 | 1772 | |
| 1757 | ||
| 1773 | ||
| 1758 | 1774 | { |
| 1759 | 1775 | if (ACCESSING_BITS_56_63) |
| 1760 | 1776 | { |
| 1761 | // printf("unk1a_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc( | |
| 1777 | // printf("unk1a_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc( | |
| 1762 | 1778 | } |
| 1763 | 1779 | } |
| 1764 | 1780 | |
| 1765 | ||
| 1781 | ||
| 1766 | 1782 | { |
| 1767 | 1783 | if (ACCESSING_BITS_56_63) |
| 1768 | 1784 | { |
| 1769 | 1785 | unk1_bit = 0; |
| 1770 | // printf("unk1b_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc( | |
| 1786 | // printf("unk1b_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu_get_pc( | |
| 1771 | 1787 | } |
| 1772 | 1788 | } |
| 1773 | 1789 | |
| 1774 | 1790 | static UINT64 e00008_data; |
| 1775 | 1791 | |
| 1776 | ||
| 1792 | ||
| 1777 | 1793 | { |
| 1778 | 1794 | UINT64 r = 0; |
| 1779 | 1795 | if (ACCESSING_BITS_0_7) |
| r14896 | r14897 | |
| 1784 | 1800 | return r; |
| 1785 | 1801 | } |
| 1786 | 1802 | |
| 1787 | ||
| 1803 | ||
| 1788 | 1804 | { |
| 1789 | 1805 | if (ACCESSING_BITS_0_7) |
| 1790 | 1806 | { |
| r14896 | r14897 | |
| 1792 | 1808 | } |
| 1793 | 1809 | } |
| 1794 | 1810 | |
| 1795 | ||
| 1811 | ||
| 1796 | 1812 | { |
| 1797 | 1813 | UINT64 r = 0;//U64(0xffffffffffffffff); |
| 1798 | 1814 | return r; |
| r14896 | r14897 | |
| 1804 | 1820 | |
| 1805 | 1821 | static ADDRESS_MAP_START(viper_map, AS_PROGRAM, 64, viper_state ) |
| 1806 | 1822 | AM_RANGE(0x00000000, 0x00ffffff) AM_MIRROR(0x1000000) AM_RAM |
| 1807 | AM_RANGE(0x80000000, 0x800fffff) AM_READWRITE_LEGACY(epic_64be_r, epic_64be_w) | |
| 1808 | AM_RANGE(0x82000000, 0x83ffffff) AM_READWRITE_LEGACY(voodoo3_r, voodoo3_w) | |
| 1809 | AM_RANGE(0x84000000, 0x85ffffff) AM_READWRITE_LEGACY(voodoo3_lfb_r, voodoo3_lfb_w) | |
| 1810 | AM_RANGE(0xfe800000, 0xfe8000ff) AM_READWRITE_LEGACY(voodoo3_io_r, voodoo3_io_w) | |
| 1823 | AM_RANGE(0x80000000, 0x800fffff) AM_READWRITE32(epic_r, epic_w,U64(0xffffffffffffffff)) | |
| 1824 | AM_RANGE(0x82000000, 0x83ffffff) AM_READWRITE(voodoo3_r, voodoo3_w) | |
| 1825 | AM_RANGE(0x84000000, 0x85ffffff) AM_READWRITE(voodoo3_lfb_r, voodoo3_lfb_w) | |
| 1826 | AM_RANGE(0xfe800000, 0xfe8000ff) AM_READWRITE(voodoo3_io_r, voodoo3_io_w) | |
| 1811 | 1827 | AM_RANGE(0xfec00000, 0xfedfffff) AM_DEVREADWRITE_LEGACY("pcibus", pci_config_addr_r, pci_config_addr_w) |
| 1812 | 1828 | AM_RANGE(0xfee00000, 0xfeefffff) AM_DEVREADWRITE_LEGACY("pcibus", pci_config_data_r, pci_config_data_w) |
| 1813 | 1829 | // 0xff000000, 0xff000fff - cf_card_data_r/w (installed in DRIVER_INIT(vipercf)) |
| 1814 | 1830 | // 0xff200000, 0xff200fff - cf_card_r/w (installed in DRIVER_INIT(vipercf)) |
| 1815 | 1831 | AM_RANGE(0xff300000, 0xff300fff) AM_DEVREADWRITE_LEGACY("ide", ata_r, ata_w) |
| 1816 | AM_RANGE(0xffe00000, 0xffe00007) AM_READ_LEGACY(e00000_r) | |
| 1817 | AM_RANGE(0xffe00008, 0xffe0000f) AM_READWRITE_LEGACY(e00008_r, e00008_w) | |
| 1818 | AM_RANGE(0xffe10000, 0xffe10007) AM_READ_LEGACY(unk1_r) | |
| 1832 | AM_RANGE(0xffe00000, 0xffe00007) AM_READ(e00000_r) | |
| 1833 | AM_RANGE(0xffe00008, 0xffe0000f) AM_READWRITE(e00008_r, e00008_w) | |
| 1834 | AM_RANGE(0xffe10000, 0xffe10007) AM_READ(unk1_r) | |
| 1819 | 1835 | AM_RANGE(0xffe30000, 0xffe31fff) AM_DEVREADWRITE8_LEGACY("m48t58", timekeeper_r, timekeeper_w, U64(0xffffffffffffffff)) |
| 1820 | 1836 | AM_RANGE(0xffe40000, 0xffe4000f) AM_NOP |
| 1821 | AM_RANGE(0xffe50000, 0xffe50007) AM_WRITE_LEGACY(unk2_w) | |
| 1822 | AM_RANGE(0xffe70000, 0xffe7000f) AM_READWRITE_LEGACY(e70000_r, e70000_w) | |
| 1823 | AM_RANGE(0xffe80000, 0xffe80007) AM_WRITE_LEGACY(unk1a_w) | |
| 1824 | AM_RANGE(0xffe88000, 0xffe88007) AM_WRITE_LEGACY(unk1b_w) | |
| 1837 | AM_RANGE(0xffe50000, 0xffe50007) AM_WRITE(unk2_w) | |
| 1838 | AM_RANGE(0xffe70000, 0xffe7000f) AM_READWRITE(e70000_r, e70000_w) | |
| 1839 | AM_RANGE(0xffe80000, 0xffe80007) AM_WRITE(unk1a_w) | |
| 1840 | AM_RANGE(0xffe88000, 0xffe88007) AM_WRITE(unk1b_w) | |
| 1825 | 1841 | AM_RANGE(0xffe9a000, 0xffe9bfff) AM_RAM // World Combat uses this |
| 1826 | 1842 | AM_RANGE(0xfff00000, 0xfff3ffff) AM_ROM AM_REGION("user1", 0) // Boot ROM |
| 1827 | 1843 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 91 | 91 | WRITE8_MEMBER(jackal_state::jackal_flipscreen_w) |
| 92 | 92 | { |
| 93 | 93 | m_irq_enable = data & 0x02; |
| 94 | flip_screen_set( | |
| 94 | flip_screen_set( | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | READ8_MEMBER(jackal_state::jackal_zram_r) |
| r14896 | r14897 | |
|---|---|---|
| 331 | 331 | AM_RANGE(0x02, 0x02) AM_WRITE(seawolf_periscope_lamp_w) |
| 332 | 332 | AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 333 | 333 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 334 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 334 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 335 | 335 | ADDRESS_MAP_END |
| 336 | 336 | |
| 337 | 337 | |
| r14896 | r14897 | |
| 421 | 421 | WRITE8_MEMBER(mw8080bw_state::gunfight_io_w) |
| 422 | 422 | { |
| 423 | 423 | if (offset & 0x01) |
| 424 | gunfight_audio_w( | |
| 424 | gunfight_audio_w( | |
| 425 | 425 | |
| 426 | 426 | if (offset & 0x02) |
| 427 | 427 | mb14241_shift_count_w(m_mb14241, 0, data); |
| r14896 | r14897 | |
| 754 | 754 | AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2") |
| 755 | 755 | AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) |
| 756 | 756 | |
| 757 | AM_RANGE(0x02, 0x02) AM_WRITE | |
| 757 | AM_RANGE(0x02, 0x02) AM_WRITE | |
| 758 | 758 | AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 759 | 759 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 760 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 760 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 761 | 761 | AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w) |
| 762 | 762 | ADDRESS_MAP_END |
| 763 | 763 | |
| r14896 | r14897 | |
| 1520 | 1520 | |
| 1521 | 1521 | AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w) |
| 1522 | 1522 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1523 | AM_RANGE(0x03, 0x03) AM_WRITE | |
| 1523 | AM_RANGE(0x03, 0x03) AM_WRITE | |
| 1524 | 1524 | AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w) |
| 1525 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1525 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1526 | 1526 | /* also writes 0x00 to 0x06, but it is not connected */ |
| 1527 | AM_RANGE(0x07, 0x07) AM_WRITE | |
| 1527 | AM_RANGE(0x07, 0x07) AM_WRITE | |
| 1528 | 1528 | ADDRESS_MAP_END |
| 1529 | 1529 | |
| 1530 | 1530 | |
| r14896 | r14897 | |
| 1616 | 1616 | |
| 1617 | 1617 | AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w) |
| 1618 | 1618 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1619 | AM_RANGE(0x03, 0x03) AM_WRITE | |
| 1619 | AM_RANGE(0x03, 0x03) AM_WRITE | |
| 1620 | 1620 | AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w) |
| 1621 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1621 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1622 | 1622 | ADDRESS_MAP_END |
| 1623 | 1623 | |
| 1624 | 1624 | |
| r14896 | r14897 | |
| 1731 | 1731 | |
| 1732 | 1732 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 1733 | 1733 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1734 | AM_RANGE(0x03, 0x03) AM_WRITE | |
| 1734 | AM_RANGE(0x03, 0x03) AM_WRITE | |
| 1735 | 1735 | AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w) |
| 1736 | 1736 | AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_lo_w) |
| 1737 | 1737 | AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("discrete", midway_tone_generator_hi_w) |
| r14896 | r14897 | |
| 2312 | 2312 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 2313 | 2313 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 2314 | 2314 | AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w) |
| 2315 | AM_RANGE(0x05, 0x05) AM_WRITE_LEGACY(phantom2_audio_1_w) | |
| 2316 | AM_RANGE(0x06, 0x06) AM_WRITE_LEGACY(phantom2_audio_2_w) | |
| 2315 | AM_RANGE(0x05, 0x05) AM_WRITE(phantom2_audio_1_w) | |
| 2316 | AM_RANGE(0x06, 0x06) AM_WRITE(phantom2_audio_2_w) | |
| 2317 | 2317 | ADDRESS_MAP_END |
| 2318 | 2318 | |
| 2319 | 2319 | |
| r14896 | r14897 | |
| 2440 | 2440 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 2441 | 2441 | AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w) |
| 2442 | 2442 | AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("discrete", bowler_audio_1_w) |
| 2443 | AM_RANGE(0x06, 0x06) AM_WRITE | |
| 2443 | AM_RANGE(0x06, 0x06) AM_WRITE | |
| 2444 | 2444 | AM_RANGE(0x07, 0x07) AM_WRITE(bowler_lights_1_w) |
| 2445 | AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(bowler_audio_3_w) | |
| 2446 | AM_RANGE(0x09, 0x09) AM_WRITE_LEGACY(bowler_audio_4_w) | |
| 2447 | AM_RANGE(0x0a, 0x0a) AM_WRITE_LEGACY(bowler_audio_5_w) | |
| 2445 | AM_RANGE(0x08, 0x08) AM_WRITE(bowler_audio_3_w) | |
| 2446 | AM_RANGE(0x09, 0x09) AM_WRITE(bowler_audio_4_w) | |
| 2447 | AM_RANGE(0x0a, 0x0a) AM_WRITE(bowler_audio_5_w) | |
| 2448 | 2448 | AM_RANGE(0x0e, 0x0e) AM_WRITE(bowler_lights_2_w) |
| 2449 | AM_RANGE(0x0f, 0x0f) AM_WRITE | |
| 2449 | AM_RANGE(0x0f, 0x0f) AM_WRITE | |
| 2450 | 2450 | ADDRESS_MAP_END |
| 2451 | 2451 | |
| 2452 | 2452 |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | { |
| 40 | 40 | public: |
| 41 | 41 | pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag) |
| 42 | : driver_device(mconfig, type, tag) { } | |
| 42 | : driver_device(mconfig, type, tag) , | |
| 43 | m_janshi_back_vram(*this, "janshi_back_vram"), | |
| 44 | m_janshi_vram1(*this, "janshi_vram1"), | |
| 45 | m_janshi_unk1(*this, "janshi_unk1"), | |
| 46 | m_janshi_widthflags(*this, "janshi_widthflags"), | |
| 47 | m_janshi_unk2(*this, "janshi_unk2"), | |
| 48 | m_janshi_vram2(*this, "janshi_vram2"), | |
| 49 | m_janshi_crtc_regs(*this, "janshi_crtc_regs"){ } | |
| 43 | 50 | |
| 44 | UINT8* m_janshi_vram1; | |
| 45 | UINT8* m_janshi_vram2; | |
| 46 | UINT8* m_janshi_back_vram; | |
| 47 | UINT8* m_janshi_crtc_regs; | |
| 48 | UINT8* m_janshi_unk1; | |
| 49 | UINT8* m_janshi_widthflags; | |
| 50 | UINT8* m_janshi_unk2; | |
| 51 | required_shared_ptr<UINT8> m_janshi_back_vram; | |
| 52 | required_shared_ptr<UINT8> m_janshi_vram1; | |
| 53 | required_shared_ptr<UINT8> m_janshi_unk1; | |
| 54 | required_shared_ptr<UINT8> m_janshi_widthflags; | |
| 55 | required_shared_ptr<UINT8> m_janshi_unk2; | |
| 56 | required_shared_ptr<UINT8> m_janshi_vram2; | |
| 57 | required_shared_ptr<UINT8> m_janshi_crtc_regs; | |
| 51 | 58 | UINT32 m_vram_addr; |
| 52 | 59 | int m_prev_writes; |
| 53 | 60 | UINT8 m_mux_data; |
| r14896 | r14897 | |
| 68 | 75 | |
| 69 | 76 | static ADDRESS_MAP_START( janshi_vdp_map8, AS_0, 8, pinkiri8_state ) |
| 70 | 77 | |
| 71 | AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_BASE(m_janshi_back_vram) // bg tilemap? | |
| 72 | AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_BASE(m_janshi_vram1) // xpos, colour, tile number etc. | |
| 78 | AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_SHARE("janshi_back_vram") // bg tilemap? | |
| 79 | AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_SHARE("janshi_vram1") // xpos, colour, tile number etc. | |
| 73 | 80 | |
| 74 | AM_RANGE(0xfc3700, 0xfc377f) AM_RAM AM_BASE(m_janshi_unk1) // ?? height related? | |
| 75 | AM_RANGE(0xfc3780, 0xfc37bf) AM_RAM AM_BASE(m_janshi_widthflags) | |
| 76 | AM_RANGE(0xfc37c0, 0xfc37ff) AM_RAM AM_BASE(m_janshi_unk2) // 2x increasing tables 00 10 20 30 etc. | |
| 81 | AM_RANGE(0xfc3700, 0xfc377f) AM_RAM AM_SHARE("janshi_unk1") // ?? height related? | |
| 82 | AM_RANGE(0xfc3780, 0xfc37bf) AM_RAM AM_SHARE("janshi_widthflags") | |
| 83 | AM_RANGE(0xfc37c0, 0xfc37ff) AM_RAM AM_SHARE("janshi_unk2") // 2x increasing tables 00 10 20 30 etc. | |
| 77 | 84 | |
| 78 | AM_RANGE(0xfc3800, 0xfc3fff) AM_RAM AM_ | |
| 85 | AM_RANGE(0xfc3800, 0xfc3fff) AM_RAM AM_ | |
| 79 | 86 | |
| 80 | AM_RANGE(0xff0000, 0xff07ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_SHARE("paletteram") | |
| 81 | AM_RANGE(0xff2000, 0xff27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_SHARE("paletteram2") | |
| 87 | AM_RANGE(0xff0000, 0xff07ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 88 | AM_RANGE(0xff2000, 0xff27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 82 | 89 | |
| 83 | AM_RANGE(0xff6000, 0xff601f) AM_RAM AM_ | |
| 90 | AM_RANGE(0xff6000, 0xff601f) AM_RAM AM_ | |
| 84 | 91 | ADDRESS_MAP_END |
| 85 | 92 | |
| 86 | 93 | |
| r14896 | r14897 | |
| 198 | 205 | for (i=0x00;i<0x40;i+=2) |
| 199 | 206 | { |
| 200 | 207 | |
| 201 | printf("%02x, ", state->m_janshi_widthflags[i+1]); | |
| 208 | printf("%02x, ", state->m_janshi_widthflags.target()[i+1]); | |
| 202 | 209 | |
| 203 | 210 | count2++; |
| 204 | 211 | |
| r14896 | r14897 | |
| 216 | 223 | |
| 217 | 224 | |
| 218 | 225 | |
| 219 | //popmessage("%02x",state->m_janshi_crtc_regs[0x0a]); | |
| 220 | col_bank = (state->m_janshi_crtc_regs[0x0a] & 0x40) >> 6; | |
| 226 | //popmessage("%02x",state->m_janshi_crtc_regs.target()[0x0a]); | |
| 227 | col_bank = (state->m_janshi_crtc_regs.target()[0x0a] & 0x40) >> 6; | |
| 221 | 228 | |
| 222 | 229 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 223 | 230 | |
| r14896 | r14897 | |
| 231 | 238 | { |
| 232 | 239 | for(x=0;x<32;x++) |
| 233 | 240 | { |
| 234 | tile = state->m_janshi_back_vram[count+1]<<8 | state->m_janshi_back_vram[count+0]; | |
| 235 | attr = state->m_janshi_back_vram[count+2] ^ 0xf0; | |
| 241 | tile = state->m_janshi_back_vram.target()[count+1]<<8 | state->m_janshi_back_vram.target()[count+0]; | |
| 242 | attr = state->m_janshi_back_vram.target()[count+2] ^ 0xf0; | |
| 236 | 243 | col = (attr >> 4) | 0x10; |
| 237 | 244 | |
| 238 | 245 | drawgfx_transpen(bitmap,cliprect,gfx,tile,col,0,0,x*16,y*8,0); |
| r14896 | r14897 | |
| 268 | 275 | |
| 269 | 276 | */ |
| 270 | 277 | |
| 271 | spr_offs = ((state->m_janshi_vram1[(i*4)+0] & 0xff) | (state->m_janshi_vram1[(i*4)+1]<<8)) & 0xffff; | |
| 272 | col = (state->m_janshi_vram1[(i*4)+2] & 0xf8) >> 3; | |
| 273 | x = state->m_janshi_vram1[(i*4)+3]; | |
| 278 | spr_offs = ((state->m_janshi_vram1.target()[(i*4)+0] & 0xff) | (state->m_janshi_vram1.target()[(i*4)+1]<<8)) & 0xffff; | |
| 279 | col = (state->m_janshi_vram1.target()[(i*4)+2] & 0xf8) >> 3; | |
| 280 | x = state->m_janshi_vram1.target()[(i*4)+3]; | |
| 274 | 281 | |
| 275 | 282 | x &= 0xff; |
| 276 | 283 | x *= 2; |
| 277 | 284 | |
| 278 | // unk2 = state->m_janshi_vram2[(i*2)+1]; | |
| 279 | y = (state->m_janshi_vram2[(i*2)+0]); | |
| 285 | // unk2 = state->m_janshi_vram2.target()[(i*2)+1]; | |
| 286 | y = (state->m_janshi_vram2.target()[(i*2)+0]); | |
| 280 | 287 | |
| 281 | 288 | y = 0x100-y; |
| 282 | 289 | |
| r14896 | r14897 | |
| 289 | 296 | |
| 290 | 297 | |
| 291 | 298 | // these bits seem to somehow determine the sprite height / widths for the sprite ram region? |
| 292 | int bit = state->m_janshi_widthflags[(i/0x20)*2 + 1]; | |
| 299 | int bit = state->m_janshi_widthflags.target()[(i/0x20)*2 + 1]; | |
| 293 | 300 | |
| 294 | 301 | if (bit) |
| 295 | 302 | { |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | /* Force synchronisation between CPUs with fake timer */ |
| 27 | 27 | machine().scheduler().synchronize(); |
| 28 | soundlatch_w(space, 0, data & 0xff); | |
| 28 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 29 | 29 | device_set_input_line(m_audiocpu, 0, ASSERT_LINE); |
| 30 | 30 | } |
| 31 | 31 | |
| r14896 | r14897 | |
| 72 | 72 | READ8_MEMBER(vaportra_state::vaportra_soundlatch_r) |
| 73 | 73 | { |
| 74 | 74 | device_set_input_line(m_audiocpu, 0, CLEAR_LINE); |
| 75 | return soundlatch_r(space, offset); | |
| 75 | return soundlatch_byte_r(space, offset); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, vaportra_state ) |
| r14896 | r14897 | |
|---|---|---|
| 502 | 502 | */ |
| 503 | 503 | WRITE8_MEMBER(suna8_state::hardhead_flipscreen_w) |
| 504 | 504 | { |
| 505 | flip_screen_set( | |
| 505 | flip_screen_set( | |
| 506 | 506 | coin_lockout_w ( machine(), 0, data & 0x08); |
| 507 | 507 | coin_lockout_w ( machine(), 1, data & 0x10); |
| 508 | 508 | } |
| r14896 | r14897 | |
| 511 | 511 | AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM |
| 512 | 512 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // Banked ROM |
| 513 | 513 | AM_RANGE(0xc000, 0xd7ff) AM_RAM // RAM |
| 514 | AM_RANGE(0xd800, 0xd9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") // Palette | |
| 514 | AM_RANGE(0xd800, 0xd9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") // Palette | |
| 515 | 515 | AM_RANGE(0xda00, 0xda00) AM_RAM_READ(hardhead_ip_r) AM_BASE(m_hardhead_ip) // Input Port Select |
| 516 | AM_RANGE(0xda80, 0xda80) AM_READ(soundlatch2_r) AM_WRITE(hardhead_bankswitch_w ) // ROM Banking | |
| 517 | AM_RANGE(0xdb00, 0xdb00) AM_WRITE(soundlatch_w ) // To Sound CPU | |
| 516 | AM_RANGE(0xda80, 0xda80) AM_READ(soundlatch2_byte_r) AM_WRITE(hardhead_bankswitch_w ) // ROM Banking | |
| 517 | AM_RANGE(0xdb00, 0xdb00) AM_WRITE(soundlatch_byte_w ) // To Sound CPU | |
| 518 | 518 | AM_RANGE(0xdb80, 0xdb80) AM_WRITE(hardhead_flipscreen_w ) // Flip Screen + Coin Lockout |
| 519 | 519 | AM_RANGE(0xdc00, 0xdc00) AM_NOP // <- R (after bank select) |
| 520 | 520 | AM_RANGE(0xdc80, 0xdc80) AM_NOP // <- R (after bank select) |
| r14896 | r14897 | |
| 549 | 549 | |
| 550 | 550 | memory_set_bank(machine(), "bank1", bank); |
| 551 | 551 | |
| 552 | flip_screen_set( | |
| 552 | flip_screen_set( | |
| 553 | 553 | coin_lockout_w ( machine(), 0, data & 0x40); |
| 554 | 554 | coin_lockout_w ( machine(), 1, data & 0x80); |
| 555 | 555 | } |
| r14896 | r14897 | |
| 564 | 564 | */ |
| 565 | 565 | READ8_MEMBER(suna8_state::rranger_soundstatus_r) |
| 566 | 566 | { |
| 567 | soundlatch2_r(space, offset); | |
| 567 | soundlatch2_byte_r(space, offset); | |
| 568 | 568 | return 0x02; |
| 569 | 569 | } |
| 570 | 570 | |
| r14896 | r14897 | |
| 578 | 578 | static ADDRESS_MAP_START( rranger_map, AS_PROGRAM, 8, suna8_state ) |
| 579 | 579 | AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM |
| 580 | 580 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // Banked ROM |
| 581 | AM_RANGE(0xc000, 0xc000) AM_READWRITE(watchdog_reset_r, soundlatch_w) // To Sound CPU | |
| 581 | AM_RANGE(0xc000, 0xc000) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) // To Sound CPU | |
| 582 | 582 | AM_RANGE(0xc002, 0xc002) AM_WRITE(rranger_bankswitch_w ) // ROM Banking |
| 583 | 583 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P1") // P1 (Inputs) |
| 584 | 584 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("P2") // P2 |
| r14896 | r14897 | |
| 587 | 587 | AM_RANGE(0xc280, 0xc280) AM_WRITENOP // ? NMI Ack |
| 588 | 588 | AM_RANGE(0xc280, 0xc280) AM_READ_PORT("DSW1") // DSW 1 |
| 589 | 589 | AM_RANGE(0xc2c0, 0xc2c0) AM_READ_PORT("DSW2") // DSW 2 |
| 590 | AM_RANGE(0xc600, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") // Palette | |
| 590 | AM_RANGE(0xc600, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") // Palette | |
| 591 | 591 | AM_RANGE(0xc800, 0xdfff) AM_RAM // RAM |
| 592 | 592 | AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(suna8_spriteram_w) AM_BASE(m_spriteram) // Sprites |
| 593 | 593 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 619 | 619 | if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown palettebank bits: %02X\n",cpu_get_pc(&space.device()),data); |
| 620 | 620 | |
| 621 | 621 | /* Also used as soundlatch - depending on c0c0? */ |
| 622 | soundlatch_w(space,0,data); | |
| 622 | soundlatch_byte_w(space,0,data); | |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | /* |
| r14896 | r14897 | |
| 632 | 632 | |
| 633 | 633 | m_spritebank = (data >> 1) & 1; |
| 634 | 634 | if (data & ~0x03) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(&space.device()),data); |
| 635 | flip_screen_set( | |
| 635 | flip_screen_set( | |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | WRITE8_MEMBER(suna8_state::brickzn_unknown_w) |
| r14896 | r14897 | |
| 693 | 693 | */ |
| 694 | 694 | WRITE8_MEMBER(suna8_state::hardhea2_flipscreen_w) |
| 695 | 695 | { |
| 696 | flip_screen_set( | |
| 696 | flip_screen_set( | |
| 697 | 697 | if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(&space.device()),data); |
| 698 | 698 | } |
| 699 | 699 | |
| r14896 | r14897 | |
| 773 | 773 | AM_RANGE(0xc380, 0xc380) AM_WRITE(hardhea2_nmi_w ) // ? NMI related ? |
| 774 | 774 | AM_RANGE(0xc400, 0xc400) AM_WRITE(hardhea2_leds_w ) // Leds + Coin Counter |
| 775 | 775 | AM_RANGE(0xc480, 0xc480) AM_WRITENOP // ~ROM Bank |
| 776 | AM_RANGE(0xc500, 0xc500) AM_WRITE(soundlatch_w ) // To Sound CPU | |
| 776 | AM_RANGE(0xc500, 0xc500) AM_WRITE(soundlatch_byte_w ) // To Sound CPU | |
| 777 | 777 | |
| 778 | 778 | // *** Protection |
| 779 | 779 | AM_RANGE(0xc50f, 0xc50f) AM_WRITE(hardhea2_spritebank_1_w ) |
| r14896 | r14897 | |
| 789 | 789 | AM_RANGE(0xc533, 0xc533) AM_WRITE(hardhea2_rambank_0_w ) |
| 790 | 790 | // Protection *** |
| 791 | 791 | |
| 792 | AM_RANGE(0xc600, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram" ) // Palette (Banked??) | |
| 792 | AM_RANGE(0xc600, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram" ) // Palette (Banked??) | |
| 793 | 793 | AM_RANGE(0xc800, 0xdfff) AM_RAMBANK("bank2") // RAM (Banked?) |
| 794 | 794 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(suna8_banked_spriteram_r, suna8_banked_spriteram_w) // Sprites (Banked) |
| 795 | 795 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 824 | 824 | AM_RANGE(0xc280, 0xc280) AM_WRITE(hardhea2_rombank_w ) // ROM Bank (?mirrored up to c2ff?) |
| 825 | 825 | AM_RANGE(0xc300, 0xc300) AM_WRITE(hardhea2_flipscreen_w ) // Flip Screen |
| 826 | 826 | AM_RANGE(0xc400, 0xc400) AM_WRITE(hardhea2_leds_w ) // Leds + Coin Counter |
| 827 | AM_RANGE(0xc500, 0xc500) AM_WRITE(soundlatch_w ) // To Sound CPU | |
| 828 | AM_RANGE(0xc600, 0xc7ff) AM_READWRITE(banked_paletteram_r, paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram" ) // Palette (Banked??) | |
| 827 | AM_RANGE(0xc500, 0xc500) AM_WRITE(soundlatch_byte_w ) // To Sound CPU | |
| 828 | AM_RANGE(0xc600, 0xc7ff) AM_READWRITE(banked_paletteram_r, paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram" ) // Palette (Banked??) | |
| 829 | 829 | AM_RANGE(0xc800, 0xdfff) AM_RAM // RAM |
| 830 | 830 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(suna8_banked_spriteram_r, suna8_banked_spriteram_w) // Sprites (Banked) |
| 831 | 831 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 884 | 884 | */ |
| 885 | 885 | WRITE8_MEMBER(suna8_state::sparkman_flipscreen_w) |
| 886 | 886 | { |
| 887 | flip_screen_set( | |
| 887 | flip_screen_set( | |
| 888 | 888 | //if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(&space.device()),data); |
| 889 | 889 | } |
| 890 | 890 | |
| r14896 | r14897 | |
| 957 | 957 | AM_RANGE(0xc380, 0xc3ff) AM_WRITE(sparkman_cmd_prot_w ) // Protection |
| 958 | 958 | AM_RANGE(0xc400, 0xc400) AM_WRITE(sparkman_leds_w ) // Leds |
| 959 | 959 | AM_RANGE(0xc480, 0xc480) AM_WRITE(sparkman_coin_counter_w ) // Coin Counter |
| 960 | AM_RANGE(0xc500, 0xc500) AM_WRITE(soundlatch_w ) // To Sound CPU | |
| 961 | AM_RANGE(0xc600, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram" ) // Palette (Banked??) | |
| 960 | AM_RANGE(0xc500, 0xc500) AM_WRITE(soundlatch_byte_w ) // To Sound CPU | |
| 961 | AM_RANGE(0xc600, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram" ) // Palette (Banked??) | |
| 962 | 962 | AM_RANGE(0xc800, 0xdfff) AM_RAM_WRITE(suna8_wram_w) AM_BASE(m_wram) // RAM |
| 963 | 963 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(suna8_banked_spriteram_r, suna8_banked_spriteram_w) // Sprites (Banked) |
| 964 | 964 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 982 | 982 | AM_RANGE(0xa002, 0xa003) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w ) |
| 983 | 983 | AM_RANGE(0xc000, 0xc7ff) AM_RAM // RAM |
| 984 | 984 | AM_RANGE(0xc800, 0xc800) AM_DEVREAD_LEGACY("ymsnd", ym3812_status_port_r) // ? unsure |
| 985 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch2_w ) // | |
| 986 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r ) // From Main CPU | |
| 985 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch2_byte_w ) // | |
| 986 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r ) // From Main CPU | |
| 987 | 987 | ADDRESS_MAP_END |
| 988 | 988 | |
| 989 | 989 | |
| r14896 | r14897 | |
| 1002 | 1002 | AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ym1", ym2203_w ) // Samples + Music |
| 1003 | 1003 | AM_RANGE(0xa002, 0xa003) AM_DEVWRITE_LEGACY("ym2", ym2203_w ) // Music + FX |
| 1004 | 1004 | AM_RANGE(0xc000, 0xc7ff) AM_RAM // RAM |
| 1005 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch2_w ) // To Sound CPU | |
| 1006 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r ) // From Main CPU | |
| 1005 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch2_byte_w ) // To Sound CPU | |
| 1006 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r ) // From Main CPU | |
| 1007 | 1007 | ADDRESS_MAP_END |
| 1008 | 1008 | |
| 1009 | 1009 | |
| r14896 | r14897 | |
| 1016 | 1016 | AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w ) |
| 1017 | 1017 | AM_RANGE(0xc002, 0xc003) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w ) |
| 1018 | 1018 | AM_RANGE(0xe000, 0xe7ff) AM_RAM // RAM |
| 1019 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch2_w ) // To PCM CPU | |
| 1020 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r ) // From Main CPU | |
| 1019 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch2_byte_w ) // To PCM CPU | |
| 1020 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r ) // From Main CPU | |
| 1021 | 1021 | ADDRESS_MAP_END |
| 1022 | 1022 | |
| 1023 | 1023 | |
| r14896 | r14897 | |
| 1037 | 1037 | |
| 1038 | 1038 | static ADDRESS_MAP_START( brickzn_pcm_io_map, AS_IO, 8, suna8_state ) |
| 1039 | 1039 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1040 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r ) // From Sound CPU | |
| 1040 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r ) // From Sound CPU | |
| 1041 | 1041 | AM_RANGE(0x00, 0x03) AM_WRITE(brickzn_pcm_w ) // 4 x DAC |
| 1042 | 1042 | ADDRESS_MAP_END |
| 1043 | 1043 |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | public: |
| 59 | 59 | chanbara_state(const machine_config &mconfig, device_type type, const char *tag) |
| 60 | : driver_device(mconfig, type, tag) { } | |
| 60 | : driver_device(mconfig, type, tag) , | |
| 61 | m_videoram(*this, "videoram"), | |
| 62 | m_colorram(*this, "colorram"), | |
| 63 | m_spriteram(*this, "spriteram"), | |
| 64 | m_videoram2(*this, "videoram2"), | |
| 65 | m_colorram2(*this, "colorram2"){ } | |
| 61 | 66 | |
| 62 | 67 | /* memory pointers */ |
| 63 | UINT8 * m_videoram; | |
| 64 | UINT8 * m_videoram2; | |
| 65 | UINT8 * m_colorram; | |
| 66 | UINT8 * m_colorram2; | |
| 67 | UINT8 * m_spriteram; | |
| 68 | required_shared_ptr<UINT8> m_videoram; | |
| 69 | required_shared_ptr<UINT8> m_colorram; | |
| 70 | required_shared_ptr<UINT8> m_spriteram; | |
| 71 | required_shared_ptr<UINT8> m_videoram2; | |
| 72 | required_shared_ptr<UINT8> m_colorram2; | |
| 68 | 73 | |
| 69 | 74 | /* video-related */ |
| 70 | 75 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 98 | 103 | WRITE8_MEMBER(chanbara_state::chanbara_videoram_w) |
| 99 | 104 | { |
| 100 | 105 | |
| 101 | m_videoram[offset] = data; | |
| 106 | m_videoram.target()[offset] = data; | |
| 102 | 107 | m_bg_tilemap->mark_tile_dirty(offset); |
| 103 | 108 | } |
| 104 | 109 | |
| 105 | 110 | WRITE8_MEMBER(chanbara_state::chanbara_colorram_w) |
| 106 | 111 | { |
| 107 | 112 | |
| 108 | m_colorram[offset] = data; | |
| 113 | m_colorram.target()[offset] = data; | |
| 109 | 114 | m_bg_tilemap->mark_tile_dirty(offset); |
| 110 | 115 | } |
| 111 | 116 | |
| 112 | 117 | WRITE8_MEMBER(chanbara_state::chanbara_videoram2_w) |
| 113 | 118 | { |
| 114 | 119 | |
| 115 | m_videoram2[offset] = data; | |
| 120 | m_videoram2.target()[offset] = data; | |
| 116 | 121 | m_bg2_tilemap->mark_tile_dirty(offset); |
| 117 | 122 | } |
| 118 | 123 | |
| 119 | 124 | WRITE8_MEMBER(chanbara_state::chanbara_colorram2_w) |
| 120 | 125 | { |
| 121 | 126 | |
| 122 | m_colorram2[offset] = data; | |
| 127 | m_colorram2.target()[offset] = data; | |
| 123 | 128 | m_bg2_tilemap->mark_tile_dirty(offset); |
| 124 | 129 | } |
| 125 | 130 | |
| r14896 | r14897 | |
| 127 | 132 | static TILE_GET_INFO( get_bg_tile_info ) |
| 128 | 133 | { |
| 129 | 134 | chanbara_state *state = machine.driver_data<chanbara_state>(); |
| 130 | int code = state->m_videoram[tile_index] + ((state->m_colorram[tile_index] & 1) << 8); | |
| 131 | int color = (state->m_colorram[tile_index] >> 1) & 0x1f; | |
| 135 | int code = state->m_videoram.target()[tile_index] + ((state->m_colorram.target()[tile_index] & 1) << 8); | |
| 136 | int color = (state->m_colorram.target()[tile_index] >> 1) & 0x1f; | |
| 132 | 137 | |
| 133 | 138 | SET_TILE_INFO(0, code, color, 0); |
| 134 | 139 | } |
| r14896 | r14897 | |
| 136 | 141 | static TILE_GET_INFO( get_bg2_tile_info ) |
| 137 | 142 | { |
| 138 | 143 | chanbara_state *state = machine.driver_data<chanbara_state>(); |
| 139 | int code = state->m_videoram2[tile_index]; | |
| 140 | int color = (state->m_colorram2[tile_index] >> 1) & 0x1f; | |
| 144 | int code = state->m_videoram2.target()[tile_index]; | |
| 145 | int color = (state->m_colorram2.target()[tile_index] >> 1) & 0x1f; | |
| 141 | 146 | |
| 142 | 147 | SET_TILE_INFO(2, code, color, 0); |
| 143 | 148 | } |
| r14896 | r14897 | |
| 157 | 162 | |
| 158 | 163 | for (offs = 0; offs < 0x80; offs += 4) |
| 159 | 164 | { |
| 160 | if (state->m_spriteram[offs + 0x80] & 0x80) | |
| 165 | if (state->m_spriteram.target()[offs + 0x80] & 0x80) | |
| 161 | 166 | { |
| 162 | int attr = state->m_spriteram[offs + 0]; | |
| 163 | int code = state->m_spriteram[offs + 1]; | |
| 164 | int color = state->m_spriteram[offs + 0x80] & 0x1f; | |
| 167 | int attr = state->m_spriteram.target()[offs + 0]; | |
| 168 | int code = state->m_spriteram.target()[offs + 1]; | |
| 169 | int color = state->m_spriteram.target()[offs + 0x80] & 0x1f; | |
| 165 | 170 | int flipx = 0; |
| 166 | 171 | int flipy = attr & 2; |
| 167 | int sx = 240 - state->m_spriteram[offs + 3]; | |
| 168 | int sy = 232 - state->m_spriteram[offs + 2]; | |
| 172 | int sx = 240 - state->m_spriteram.target()[offs + 3]; | |
| 173 | int sy = 232 - state->m_spriteram.target()[offs + 2]; | |
| 169 | 174 | |
| 170 | 175 | sy+=16; |
| 171 | 176 | |
| 172 | if (state->m_spriteram[offs + 0x80] & 0x10) code += 0x200; | |
| 173 | if (state->m_spriteram[offs + 0x80] & 0x20) code += 0x400; | |
| 174 | if (state->m_spriteram[offs + 0x80] & 0x40) code += 0x100; | |
| 177 | if (state->m_spriteram.target()[offs + 0x80] & 0x10) code += 0x200; | |
| 178 | if (state->m_spriteram.target()[offs + 0x80] & 0x20) code += 0x400; | |
| 179 | if (state->m_spriteram.target()[offs + 0x80] & 0x40) code += 0x100; | |
| 175 | 180 | |
| 176 | 181 | if (attr & 0x10) |
| 177 | 182 | { |
| r14896 | r14897 | |
| 209 | 214 | |
| 210 | 215 | static ADDRESS_MAP_START( chanbara_map, AS_PROGRAM, 8, chanbara_state ) |
| 211 | 216 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 212 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(chanbara_videoram_w) AM_BASE(m_videoram) | |
| 213 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(chanbara_colorram_w) AM_BASE(m_colorram) | |
| 214 | AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE(m_spriteram) | |
| 215 | AM_RANGE(0x1800, 0x19ff) AM_RAM_WRITE(chanbara_videoram2_w) AM_BASE(m_videoram2) | |
| 216 | AM_RANGE(0x1a00, 0x1bff) AM_RAM_WRITE(chanbara_colorram2_w) AM_BASE(m_colorram2) | |
| 217 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(chanbara_videoram_w) AM_SHARE("videoram") | |
| 218 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(chanbara_colorram_w) AM_SHARE("colorram") | |
| 219 | AM_RANGE(0x1000, 0x10ff) AM_RAM AM_SHARE("spriteram") | |
| 220 | AM_RANGE(0x1800, 0x19ff) AM_RAM_WRITE(chanbara_videoram2_w) AM_SHARE("videoram2") | |
| 221 | AM_RANGE(0x1a00, 0x1bff) AM_RAM_WRITE(chanbara_colorram2_w) AM_SHARE("colorram2") | |
| 217 | 222 | AM_RANGE(0x2000, 0x2000) AM_READ_PORT("DSW1") |
| 218 | 223 | AM_RANGE(0x2001, 0x2001) AM_READ_PORT("SYSTEM") |
| 219 | 224 | AM_RANGE(0x2002, 0x2002) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 349 | 354 | |
| 350 | 355 | state->m_scrollhi = data & 0x01; |
| 351 | 356 | |
| 352 | flip_screen_set( | |
| 357 | state->flip_screen_set( | |
| 353 | 358 | |
| 354 | 359 | memory_set_bank(device->machine(), "bank1", (data & 0x04) >> 2); |
| 355 | 360 |
| r14896 | r14897 | |
|---|---|---|
| 511 | 511 | AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 512 | 512 | AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 513 | 513 | AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| 514 | AM_RANGE(0x8000, 0x8fff) AM_READ(soundlatch_r) AM_WRITENOP /* ack ? */ | |
| 514 | AM_RANGE(0x8000, 0x8fff) AM_READ(soundlatch_byte_r) AM_WRITENOP /* ack ? */ | |
| 515 | 515 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 516 | 516 | ADDRESS_MAP_END |
| 517 | 517 | |
| r14896 | r14897 | |
| 541 | 541 | |
| 542 | 542 | WRITE8_MEMBER(btime_state::audio_command_w) |
| 543 | 543 | { |
| 544 | soundlatch_w(space, offset, data); | |
| 544 | soundlatch_byte_w(space, offset, data); | |
| 545 | 545 | device_set_input_line(m_audiocpu, 0, ASSERT_LINE); |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | READ8_MEMBER(btime_state::audio_command_r) |
| 549 | 549 | { |
| 550 | 550 | device_set_input_line(m_audiocpu, 0, CLEAR_LINE); |
| 551 | return soundlatch_r(space, offset); | |
| 551 | return soundlatch_byte_r(space, offset); | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | READ8_MEMBER(btime_state::zoar_dsw1_read) |
| r14896 | r14897 | |
|---|---|---|
| 58 | 58 | { |
| 59 | 59 | public: |
| 60 | 60 | m14_state(const machine_config &mconfig, device_type type, const char *tag) |
| 61 | : driver_device(mconfig, type, tag) { } | |
| 61 | : driver_device(mconfig, type, tag) , | |
| 62 | m_video_ram(*this, "video_ram"), | |
| 63 | m_color_ram(*this, "color_ram"){ } | |
| 62 | 64 | |
| 63 | 65 | /* video-related */ |
| 64 | 66 | tilemap_t *m_m14_tilemap; |
| 65 | UINT8 * m_video_ram; | |
| 66 | UINT8 * m_color_ram; | |
| 67 | required_shared_ptr<UINT8> m_video_ram; | |
| 68 | required_shared_ptr<UINT8> m_color_ram; | |
| 67 | 69 | |
| 68 | 70 | /* input-related */ |
| 69 | 71 | UINT8 m_hop_mux; |
| r14896 | r14897 | |
| 107 | 109 | { |
| 108 | 110 | m14_state *state = machine.driver_data<m14_state>(); |
| 109 | 111 | |
| 110 | int code = state->m_video_ram[tile_index]; | |
| 111 | int color = state->m_color_ram[tile_index] & 0x0f; | |
| 112 | int code = state->m_video_ram.target()[tile_index]; | |
| 113 | int color = state->m_color_ram.target()[tile_index] & 0x0f; | |
| 112 | 114 | |
| 113 | 115 | /* colorram & 0xf0 used but unknown purpose*/ |
| 114 | 116 | |
| r14896 | r14897 | |
| 138 | 140 | WRITE8_MEMBER(m14_state::m14_vram_w) |
| 139 | 141 | { |
| 140 | 142 | |
| 141 | m_video_ram[offset] = data; | |
| 143 | m_video_ram.target()[offset] = data; | |
| 142 | 144 | m_m14_tilemap->mark_tile_dirty(offset); |
| 143 | 145 | } |
| 144 | 146 | |
| 145 | 147 | WRITE8_MEMBER(m14_state::m14_cram_w) |
| 146 | 148 | { |
| 147 | 149 | |
| 148 | m_color_ram[offset] = data; | |
| 150 | m_color_ram.target()[offset] = data; | |
| 149 | 151 | m_m14_tilemap->mark_tile_dirty(offset); |
| 150 | 152 | } |
| 151 | 153 | |
| r14896 | r14897 | |
| 203 | 205 | static ADDRESS_MAP_START( m14_map, AS_PROGRAM, 8, m14_state ) |
| 204 | 206 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 205 | 207 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 206 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(m14_vram_w) AM_BASE(m_video_ram) | |
| 207 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(m14_cram_w) AM_BASE(m_color_ram) | |
| 208 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(m14_vram_w) AM_SHARE("video_ram") | |
| 209 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(m14_cram_w) AM_SHARE("color_ram") | |
| 208 | 210 | ADDRESS_MAP_END |
| 209 | 211 | |
| 210 | 212 | static ADDRESS_MAP_START( m14_io_map, AS_IO, 8, m14_state ) |
| r14896 | r14897 | |
|---|---|---|
| 28 | 28 | AM_RANGE(0x8c800, 0x8cfff) AM_RAM_WRITE(dcon_foreground_w) AM_BASE(m_fore_data) |
| 29 | 29 | AM_RANGE(0x8d000, 0x8d7ff) AM_RAM_WRITE(dcon_midground_w) AM_BASE(m_mid_data) |
| 30 | 30 | AM_RANGE(0x8d800, 0x8e7ff) AM_RAM_WRITE(dcon_text_w) AM_BASE(m_textram) |
| 31 | AM_RANGE(0x8e800, 0x8f7ff) AM_RAM_WRITE(paletteram | |
| 31 | AM_RANGE(0x8e800, 0x8f7ff) AM_RAM_WRITE(paletteram | |
| 32 | 32 | AM_RANGE(0x8f800, 0x8ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 33 | 33 | AM_RANGE(0x9d000, 0x9d7ff) AM_WRITE(dcon_gfxbank_w) |
| 34 | 34 |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | public: |
| 19 | 19 | photon2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 20 | 20 | : driver_device(mconfig, type, tag), |
| 21 | m_maincpu(*this,"maincpu") | |
| 22 | { } | |
| 21 | m_maincpu(*this,"maincpu"), | |
| 22 | m_spectrum_video_ram(*this, "spectruvideo_ram"){ } | |
| 23 | 23 | |
| 24 | UINT8 *m_spectrum_video_ram; | |
| 24 | required_device<cpu_device> m_maincpu; | |
| 25 | required_shared_ptr<UINT8> m_spectrum_video_ram; | |
| 25 | 26 | int m_spectrum_frame_number; |
| 26 | 27 | int m_spectrum_flash_invert; |
| 27 | 28 | UINT8 m_spectrum_port_fe; |
| 28 | 29 | UINT8 m_nmi_enable; |
| 29 | 30 | |
| 30 | required_device<cpu_device> m_maincpu; | |
| 31 | 31 | DECLARE_WRITE8_MEMBER(photon2_membank_w); |
| 32 | 32 | DECLARE_READ8_MEMBER(photon2_fe_r); |
| 33 | 33 | DECLARE_WRITE8_MEMBER(photon2_fe_w); |
| r14896 | r14897 | |
| 133 | 133 | unsigned char *attr, *scr; |
| 134 | 134 | // int full_refresh = 1; |
| 135 | 135 | |
| 136 | scr=state->m_spectrum_video_ram; | |
| 136 | scr=state->m_spectrum_video_ram.target(); | |
| 137 | 137 | |
| 138 | 138 | bitmap.fill(state->m_spectrum_port_fe & 0x07, cliprect); |
| 139 | 139 |
| r14896 | r14897 | |
|---|---|---|
| 194 | 194 | if (ACCESSING_BITS_0_7) |
| 195 | 195 | { |
| 196 | 196 | m_pending_command = 1; |
| 197 | soundlatch_w(space, offset, data & 0xff); | |
| 197 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 198 | 198 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 199 | 199 | } |
| 200 | 200 | } |
| r14896 | r14897 | |
| 282 | 282 | AM_RANGE(0x140000, 0x141fff) AM_RAM AM_BASE(m_CG10103[0].vram) |
| 283 | 283 | AM_RANGE(0x180000, 0x180fff) AM_RAM_WRITE(VS920A_0_vram_w) AM_BASE(m_VS920A[0].vram) |
| 284 | 284 | AM_RANGE(0x181000, 0x181fff) AM_RAM AM_BASE(m_lineram) |
| 285 | AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_WRITE(paletteram | |
| 285 | AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_WRITE(paletteram | |
| 286 | 286 | |
| 287 | 287 | AM_RANGE(0x200000, 0x20000f) AM_RAM_WRITE(MB60553_0_regs_w) |
| 288 | 288 | AM_RANGE(0x200040, 0x20005f) AM_RAM //AM_BASE_LEGACY(&gs_mixer_regs) |
| r14896 | r14897 | |
| 309 | 309 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 310 | 310 | AM_RANGE(0x04, 0x04) AM_WRITE(gs_sh_bankswitch_w) |
| 311 | 311 | AM_RANGE(0x08, 0x08) AM_WRITE(gs_sh_pending_command_clear_w) |
| 312 | AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_r) | |
| 312 | AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r) | |
| 313 | 313 | ADDRESS_MAP_END |
| 314 | 314 | |
| 315 | 315 | |
| r14896 | r14897 | |
| 319 | 319 | AM_RANGE(0x140000, 0x141fff) AM_RAM AM_BASE(m_CG10103[0].vram) |
| 320 | 320 | AM_RANGE(0x180000, 0x180fff) AM_RAM_WRITE(VS920A_0_vram_w) AM_BASE(m_VS920A[0].vram) |
| 321 | 321 | AM_RANGE(0x181000, 0x181fff) AM_RAM AM_BASE(m_lineram) |
| 322 | AM_RANGE(0x1c0000, 0x1c4fff) AM_RAM_WRITE(paletteram | |
| 322 | AM_RANGE(0x1c0000, 0x1c4fff) AM_RAM_WRITE(paletteram | |
| 323 | 323 | AM_RANGE(0x200000, 0x20000f) AM_RAM_WRITE(MB60553_0_regs_w) |
| 324 | 324 | AM_RANGE(0x200040, 0x20005f) AM_RAM //AM_BASE_LEGACY(&gs_mixer_regs) |
| 325 | 325 |
| r14896 | r14897 | |
|---|---|---|
| 318 | 318 | { |
| 319 | 319 | |
| 320 | 320 | m_marvins_sound_busy_flag = 1; |
| 321 | soundlatch_w(space, offset, data); | |
| 321 | soundlatch_byte_w(space, offset, data); | |
| 322 | 322 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 323 | 323 | } |
| 324 | 324 | |
| r14896 | r14897 | |
| 326 | 326 | { |
| 327 | 327 | |
| 328 | 328 | m_marvins_sound_busy_flag = 0; |
| 329 | return soundlatch_r(space, 0); | |
| 329 | return soundlatch_byte_r(space, 0); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | CUSTOM_INPUT_MEMBER(snk_state::marvins_sound_busy) |
| r14896 | r14897 | |
| 368 | 368 | |
| 369 | 369 | WRITE8_MEMBER(snk_state::sgladiat_soundlatch_w) |
| 370 | 370 | { |
| 371 | soundlatch_w(space, offset, data); | |
| 371 | soundlatch_byte_w(space, offset, data); | |
| 372 | 372 | machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), CMDIRQ_BUSY_ASSERT); |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | READ8_MEMBER(snk_state::sgladiat_soundlatch_r) |
| 376 | 376 | { |
| 377 | 377 | machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), BUSY_CLEAR); |
| 378 | return soundlatch_r(space,0); | |
| 378 | return soundlatch_byte_r(space,0); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | READ8_MEMBER(snk_state::sgladiat_sound_nmi_ack_r) |
| r14896 | r14897 | |
| 491 | 491 | |
| 492 | 492 | WRITE8_MEMBER(snk_state::snk_soundlatch_w) |
| 493 | 493 | { |
| 494 | soundlatch_w(space, offset, data); | |
| 494 | soundlatch_byte_w(space, offset, data); | |
| 495 | 495 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_BUSY_ASSERT); |
| 496 | 496 | } |
| 497 | 497 | |
| r14896 | r14897 | |
| 541 | 541 | READ8_MEMBER(snk_state::tnk3_busy_clear_r) |
| 542 | 542 | { |
| 543 | 543 | // it's uncertain whether the latch should be cleared here or when it's read |
| 544 | soundlatch_clear_w(space, 0, 0); | |
| 544 | soundlatch_clear_byte_w(space, 0, 0); | |
| 545 | 545 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), BUSY_CLEAR); |
| 546 | 546 | return 0xff; |
| 547 | 547 | } |
| r14896 | r14897 | |
| 1434 | 1434 | static ADDRESS_MAP_START( tnk3_YM3526_sound_map, AS_PROGRAM, 8, snk_state ) |
| 1435 | 1435 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1436 | 1436 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 1437 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 1437 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 1438 | 1438 | AM_RANGE(0xc000, 0xc000) AM_READ(tnk3_busy_clear_r) |
| 1439 | 1439 | AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE_LEGACY("ym1", ym3526_r, ym3526_w) |
| 1440 | 1440 | AM_RANGE(0xe004, 0xe004) AM_READ(tnk3_cmdirq_ack_r) |
| r14896 | r14897 | |
| 1444 | 1444 | static ADDRESS_MAP_START( aso_YM3526_sound_map, AS_PROGRAM, 8, snk_state ) |
| 1445 | 1445 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 1446 | 1446 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 1447 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) | |
| 1447 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) | |
| 1448 | 1448 | AM_RANGE(0xe000, 0xe000) AM_READ(tnk3_busy_clear_r) |
| 1449 | 1449 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ym1", ym3526_r, ym3526_w) |
| 1450 | 1450 | // AM_RANGE(0xf002, 0xf002) AM_READNOP unknown |
| r14896 | r14897 | |
| 1455 | 1455 | static ADDRESS_MAP_START( YM3526_YM3526_sound_map, AS_PROGRAM, 8, snk_state ) |
| 1456 | 1456 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 1457 | 1457 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 1458 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 1458 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 1459 | 1459 | AM_RANGE(0xe800, 0xe800) AM_DEVREADWRITE_LEGACY("ym1", ym3526_status_port_r, ym3526_control_port_w) |
| 1460 | 1460 | AM_RANGE(0xec00, 0xec00) AM_DEVWRITE_LEGACY("ym1", ym3526_write_port_w) |
| 1461 | 1461 | AM_RANGE(0xf000, 0xf000) AM_DEVREADWRITE_LEGACY("ym2", ym3526_status_port_r, ym3526_control_port_w) |
| r14896 | r14897 | |
| 1466 | 1466 | static ADDRESS_MAP_START( YM3812_sound_map, AS_PROGRAM, 8, snk_state ) |
| 1467 | 1467 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 1468 | 1468 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 1469 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 1469 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 1470 | 1470 | AM_RANGE(0xe800, 0xe800) AM_DEVREADWRITE_LEGACY("ym1", ym3812_status_port_r, ym3812_control_port_w) |
| 1471 | 1471 | AM_RANGE(0xec00, 0xec00) AM_DEVWRITE_LEGACY("ym1", ym3812_write_port_w) |
| 1472 | 1472 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_status_r, snk_sound_status_w) |
| r14896 | r14897 | |
| 1475 | 1475 | static ADDRESS_MAP_START( YM3526_Y8950_sound_map, AS_PROGRAM, 8, snk_state ) |
| 1476 | 1476 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 1477 | 1477 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 1478 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 1478 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 1479 | 1479 | AM_RANGE(0xe800, 0xe800) AM_DEVREADWRITE_LEGACY("ym1", ym3526_status_port_r, ym3526_control_port_w) |
| 1480 | 1480 | AM_RANGE(0xec00, 0xec00) AM_DEVWRITE_LEGACY("ym1", ym3526_write_port_w) |
| 1481 | 1481 | AM_RANGE(0xf000, 0xf000) AM_DEVREADWRITE_LEGACY("ym2", y8950_status_port_r, y8950_control_port_w) |
| r14896 | r14897 | |
| 1486 | 1486 | static ADDRESS_MAP_START( YM3812_Y8950_sound_map, AS_PROGRAM, 8, snk_state ) |
| 1487 | 1487 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 1488 | 1488 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 1489 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 1489 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 1490 | 1490 | AM_RANGE(0xe800, 0xe800) AM_DEVREADWRITE_LEGACY("ym1", ym3812_status_port_r, ym3812_control_port_w) |
| 1491 | 1491 | AM_RANGE(0xec00, 0xec00) AM_DEVWRITE_LEGACY("ym1", ym3812_write_port_w) |
| 1492 | 1492 | AM_RANGE(0xf000, 0xf000) AM_DEVREADWRITE_LEGACY("ym2", y8950_status_port_r, y8950_control_port_w) |
| r14896 | r14897 | |
| 1497 | 1497 | static ADDRESS_MAP_START( Y8950_sound_map, AS_PROGRAM, 8, snk_state ) |
| 1498 | 1498 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 1499 | 1499 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 1500 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 1500 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 1501 | 1501 | AM_RANGE(0xf000, 0xf000) AM_DEVREADWRITE_LEGACY("ym2", y8950_status_port_r, y8950_control_port_w) |
| 1502 | 1502 | AM_RANGE(0xf400, 0xf400) AM_DEVWRITE_LEGACY("ym2", y8950_write_port_w) |
| 1503 | 1503 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_status_r, snk_sound_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 94 | 94 | { |
| 95 | 95 | public: |
| 96 | 96 | highvdeo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 97 | : driver_device(mconfig, type, tag) { } | |
| 97 | : driver_device(mconfig, type, tag) , | |
| 98 | m_blit_ram(*this, "blit_ram"){ } | |
| 98 | 99 | |
| 99 | UINT16 | |
| 100 | required_shared_ptr<UINT16> | |
| 100 | 101 | UINT16 m_vblank_bit; |
| 101 | 102 | UINT16 m_brasil_prot_latch; |
| 102 | 103 | struct { int r,g,b,offs,offs_internal; } m_pal; |
| r14896 | r14897 | |
| 140 | 141 | { |
| 141 | 142 | UINT32 color; |
| 142 | 143 | |
| 143 | color = ((state->m_blit_ram[count]) & 0x00ff)>>0; | |
| 144 | color = ((state->m_blit_ram.target()[count]) & 0x00ff)>>0; | |
| 144 | 145 | |
| 145 | 146 | if(cliprect.contains((x*2)+0, y)) |
| 146 | 147 | bitmap.pix32(y, (x*2)+0) = screen.machine().pens[color]; |
| 147 | 148 | |
| 148 | color = ((state->m_blit_ram[count]) & 0xff00)>>8; | |
| 149 | color = ((state->m_blit_ram.target()[count]) & 0xff00)>>8; | |
| 149 | 150 | |
| 150 | 151 | if(cliprect.contains((x*2)+1, y)) |
| 151 | 152 | bitmap.pix32(y, (x*2)+1) = screen.machine().pens[color]; |
| r14896 | r14897 | |
| 174 | 175 | UINT32 g; |
| 175 | 176 | UINT32 r; |
| 176 | 177 | |
| 177 | color = (state->m_blit_ram[count]) & 0xffff; | |
| 178 | color = (state->m_blit_ram.target()[count]) & 0xffff; | |
| 178 | 179 | |
| 179 | 180 | b = (color & 0x001f) << 3; |
| 180 | 181 | g = (color & 0x07e0) >> 3; |
| r14896 | r14897 | |
| 297 | 298 | static ADDRESS_MAP_START( tv_vcf_map, AS_PROGRAM, 16, highvdeo_state ) |
| 298 | 299 | AM_RANGE(0x00000, 0x003ff) AM_RAM /*irq vector area*/ |
| 299 | 300 | AM_RANGE(0x00400, 0x03fff) AM_RAM AM_SHARE("nvram") |
| 300 | AM_RANGE(0x40000, 0x4ffff) AM_RAM AM_ | |
| 301 | AM_RANGE(0x40000, 0x4ffff) AM_RAM AM_ | |
| 301 | 302 | AM_RANGE(0x80000, 0xbffff) AM_ROMBANK("bank1") |
| 302 | 303 | AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0) |
| 303 | 304 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 344 | 345 | static ADDRESS_MAP_START( tv_ncf_map, AS_PROGRAM, 16, highvdeo_state ) |
| 345 | 346 | AM_RANGE(0x00000, 0x003ff) AM_RAM /*irq vector area*/ |
| 346 | 347 | AM_RANGE(0x00400, 0x03fff) AM_RAM AM_SHARE("nvram") |
| 347 | AM_RANGE(0x20000, 0x2ffff) AM_RAM AM_ | |
| 348 | AM_RANGE(0x20000, 0x2ffff) AM_RAM AM_ | |
| 348 | 349 | AM_RANGE(0x40000, 0xbffff) AM_ROM AM_REGION("user1",0x40000) |
| 349 | 350 | AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0) |
| 350 | 351 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 388 | 389 | static ADDRESS_MAP_START( tv_tcf_map, AS_PROGRAM, 16, highvdeo_state ) |
| 389 | 390 | AM_RANGE(0x00000, 0x003ff) AM_RAM /*irq vector area*/ |
| 390 | 391 | AM_RANGE(0x00400, 0x03fff) AM_RAM AM_SHARE("nvram") |
| 391 | AM_RANGE(0x40000, 0x5d4bf) AM_RAM AM_ | |
| 392 | AM_RANGE(0x40000, 0x5d4bf) AM_RAM AM_ | |
| 392 | 393 | AM_RANGE(0x7fe00, 0x7ffff) AM_RAM_WRITE(tv_tcf_paletteram_w ) AM_SHARE("paletteram") |
| 393 | 394 | AM_RANGE(0x80000, 0xbffff) AM_ROMBANK("bank1") |
| 394 | 395 | AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0) |
| r14896 | r14897 | |
| 445 | 446 | static ADDRESS_MAP_START( newmcard_map, AS_PROGRAM, 16, highvdeo_state ) |
| 446 | 447 | AM_RANGE(0x00000, 0x003ff) AM_RAM /*irq vector area*/ |
| 447 | 448 | AM_RANGE(0x00400, 0x0ffff) AM_RAM AM_SHARE("nvram") |
| 448 | AM_RANGE(0x40000, 0x7ffff) AM_RAM AM_ | |
| 449 | AM_RANGE(0x40000, 0x7ffff) AM_RAM AM_ | |
| 449 | 450 | AM_RANGE(0x80000, 0xbffff) AM_ROMBANK("bank1") |
| 450 | 451 | AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0) |
| 451 | 452 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 512 | 513 | static ADDRESS_MAP_START( brasil_map, AS_PROGRAM, 16, highvdeo_state ) |
| 513 | 514 | AM_RANGE(0x00000, 0x003ff) AM_RAM /*irq vector area*/ |
| 514 | 515 | AM_RANGE(0x00400, 0x0ffff) AM_RAM AM_SHARE("nvram") |
| 515 | AM_RANGE(0x40000, 0x7ffff) AM_RAM AM_ | |
| 516 | AM_RANGE(0x40000, 0x7ffff) AM_RAM AM_ | |
| 516 | 517 | AM_RANGE(0x80000, 0xbffff) AM_ROMBANK("bank1") |
| 517 | 518 | AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0) |
| 518 | 519 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | ||
| 474 | ||
| 475 | 475 | { |
| 476 | 476 | if(mem_mask & 0xff000000) |
| 477 | namconb1_cpureg8_w( | |
| 477 | namconb1_cpureg8_w( | |
| 478 | 478 | if(mem_mask & 0x00ff0000) |
| 479 | namconb1_cpureg8_w( | |
| 479 | namconb1_cpureg8_w( | |
| 480 | 480 | if(mem_mask & 0x0000ff00) |
| 481 | namconb1_cpureg8_w( | |
| 481 | namconb1_cpureg8_w( | |
| 482 | 482 | if(mem_mask & 0x000000ff) |
| 483 | namconb1_cpureg8_w( | |
| 483 | namconb1_cpureg8_w( | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | |
| r14896 | r14897 | |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | ||
| 542 | ||
| 543 | 543 | { |
| 544 | 544 | if(mem_mask & 0xff000000) |
| 545 | namconb2_cpureg8_w( | |
| 545 | namconb2_cpureg8_w( | |
| 546 | 546 | if(mem_mask & 0x00ff0000) |
| 547 | namconb2_cpureg8_w( | |
| 547 | namconb2_cpureg8_w( | |
| 548 | 548 | if(mem_mask & 0x0000ff00) |
| 549 | namconb2_cpureg8_w( | |
| 549 | namconb2_cpureg8_w( | |
| 550 | 550 | if(mem_mask & 0x000000ff) |
| 551 | namconb2_cpureg8_w( | |
| 551 | namconb2_cpureg8_w( | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | ||
| 554 | ||
| 555 | 555 | { |
| 556 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 557 | return (state->m_namconb_cpureg[offset*4] << 24) | (state->m_namconb_cpureg[offset*4+1] << 16) | |
| 558 | | (state->m_namconb_cpureg[offset*4+2] << 8) | state->m_namconb_cpureg[offset*4+3]; | |
| 556 | return (m_namconb_cpureg[offset*4] << 24) | (m_namconb_cpureg[offset*4+1] << 16) | |
| 557 | | (m_namconb_cpureg[offset*4+2] << 8) | m_namconb_cpureg[offset*4+3]; | |
| 559 | 558 | } |
| 560 | 559 | |
| 561 | 560 | |
| r14896 | r14897 | |
| 661 | 660 | namcos2_gametype = NAMCONB2_OUTFOXIES; |
| 662 | 661 | } |
| 663 | 662 | |
| 664 | ||
| 663 | ||
| 665 | 664 | { |
| 666 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 667 | UINT16 old_count = state->m_count; | |
| 665 | UINT16 old_count = m_count; | |
| 668 | 666 | |
| 669 | 667 | do |
| 670 | 668 | { /* pick a random number, but don't pick the same twice in a row */ |
| 671 | state->m_count = space->machine().rand(); | |
| 672 | } while( state->m_count==old_count ); | |
| 669 | m_count = machine().rand(); | |
| 670 | } while( m_count==old_count ); | |
| 673 | 671 | |
| 674 | 672 | switch( namcos2_gametype ) |
| 675 | 673 | { |
| r14896 | r14897 | |
| 680 | 678 | switch( offset ) |
| 681 | 679 | { |
| 682 | 680 | case 0: return 0x0189; |
| 683 | case 1: return | |
| 681 | case 1: return | |
| 684 | 682 | } |
| 685 | 683 | break; |
| 686 | 684 | |
| r14896 | r14897 | |
| 688 | 686 | switch( offset ) |
| 689 | 687 | { |
| 690 | 688 | case 0: return 0x01aa<<16; |
| 691 | case 4: return | |
| 689 | case 4: return | |
| 692 | 690 | } |
| 693 | 691 | break; |
| 694 | 692 | |
| r14896 | r14897 | |
| 696 | 694 | switch( offset ) |
| 697 | 695 | { |
| 698 | 696 | case 2: return 0x1b2<<16; |
| 699 | case 5: return | |
| 697 | case 5: return | |
| 700 | 698 | } |
| 701 | 699 | break; |
| 702 | 700 | |
| r14896 | r14897 | |
| 704 | 702 | switch( offset ) |
| 705 | 703 | { |
| 706 | 704 | case 0: return 0x0167; |
| 707 | case 1: return | |
| 705 | case 1: return | |
| 708 | 706 | } |
| 709 | 707 | break; |
| 710 | 708 | |
| r14896 | r14897 | |
| 712 | 710 | switch( offset ) |
| 713 | 711 | { |
| 714 | 712 | case 1: return 0; |
| 715 | case 3: return (0x0171<<16) | | |
| 713 | case 3: return (0x0171<<16) | | |
| 716 | 714 | } |
| 717 | 715 | break; |
| 718 | 716 | |
| r14896 | r14897 | |
| 720 | 718 | switch( offset ) |
| 721 | 719 | { |
| 722 | 720 | case 1: return 0x016e; |
| 723 | case 3: return | |
| 721 | case 3: return | |
| 724 | 722 | } |
| 725 | 723 | break; |
| 726 | 724 | |
| 727 | 725 | case NAMCONB1_VSHOOT: |
| 728 | 726 | switch( offset ) |
| 729 | 727 | { |
| 730 | case 2: return | |
| 728 | case 2: return | |
| 731 | 729 | case 3: return 0x0170<<16; |
| 732 | 730 | } |
| 733 | 731 | break; |
| r14896 | r14897 | |
| 736 | 734 | switch( offset ) |
| 737 | 735 | { |
| 738 | 736 | case 0: return 0x0186; |
| 739 | case 1: return | |
| 737 | case 1: return | |
| 740 | 738 | } |
| 741 | 739 | break; |
| 742 | 740 | |
| r14896 | r14897 | |
| 744 | 742 | break; /* no protection? */ |
| 745 | 743 | } |
| 746 | 744 | |
| 747 | logerror( "custom_key_r(%d); pc=%08x\n", offset, cpu_get_pc(&space | |
| 745 | logerror( "custom_key_r(%d); pc=%08x\n", offset, cpu_get_pc(&space. | |
| 748 | 746 | return 0; |
| 749 | 747 | } /* custom_key_r */ |
| 750 | 748 | |
| r14896 | r14897 | |
| 809 | 807 | |
| 810 | 808 | /***************************************************************/ |
| 811 | 809 | |
| 812 | ||
| 810 | ||
| 813 | 811 | { |
| 814 | 812 | int result = 0; |
| 815 | 813 | |
| 816 | 814 | switch( offset ) |
| 817 | 815 | { |
| 818 | case 0: case 1: result = (UINT8)(0x0f + input_port_read(space->machine(), "LIGHT1_Y") * 224/255); break; /* Y (p2) */ | |
| 819 | case 2: case 3: result = (UINT8)(0x26 + input_port_read(space->machine(), "LIGHT1_X") * 288/314); break; /* X (p2) */ | |
| 820 | case 4: case 5: result = (UINT8)(0x0f + input_port_read(space->machine(), "LIGHT0_Y") * 224/255); break; /* Y (p1) */ | |
| 821 | case 6: case 7: result = (UINT8)(0x26 + input_port_read(space->machine(), "LIGHT0_X") * 288/314); break; /* X (p1) */ | |
| 816 | case 0: case 1: result = (UINT8)(0x0f + input_port_read(machine(), "LIGHT1_Y") * 224/255); break; /* Y (p2) */ | |
| 817 | case 2: case 3: result = (UINT8)(0x26 + input_port_read(machine(), "LIGHT1_X") * 288/314); break; /* X (p2) */ | |
| 818 | case 4: case 5: result = (UINT8)(0x0f + input_port_read(machine(), "LIGHT0_Y") * 224/255); break; /* Y (p1) */ | |
| 819 | case 6: case 7: result = (UINT8)(0x26 + input_port_read(machine(), "LIGHT0_X") * 288/314); break; /* X (p1) */ | |
| 822 | 820 | } |
| 823 | 821 | return result<<24; |
| 824 | 822 | } /* gunbulet_gun_r */ |
| r14896 | r14897 | |
| 836 | 834 | */ |
| 837 | 835 | } /* srand_w */ |
| 838 | 836 | |
| 839 | ||
| 837 | ||
| 840 | 838 | { |
| 841 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 842 | return (state->m_namconb_shareram[offset*2] << 16) | state->m_namconb_shareram[offset*2+1]; | |
| 839 | return (m_namconb_shareram[offset*2] << 16) | m_namconb_shareram[offset*2+1]; | |
| 843 | 840 | } |
| 844 | 841 | |
| 845 | ||
| 842 | ||
| 846 | 843 | { |
| 847 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 848 | COMBINE_DATA(state->m_namconb_shareram+offset*2+1); | |
| 844 | COMBINE_DATA(m_namconb_shareram+offset*2+1); | |
| 849 | 845 | data >>= 16; |
| 850 | 846 | mem_mask >>= 16; |
| 851 | COMBINE_DATA( | |
| 847 | COMBINE_DATA( | |
| 852 | 848 | } |
| 853 | 849 | |
| 854 | 850 | static ADDRESS_MAP_START( namconb1_am, AS_PROGRAM, 32, namconb1_state ) |
| 855 | 851 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 856 | AM_RANGE(0x100000, 0x10001f) AM_READ | |
| 852 | AM_RANGE(0x100000, 0x10001f) AM_READ | |
| 857 | 853 | AM_RANGE(0x1c0000, 0x1cffff) AM_RAM |
| 858 | 854 | AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w) |
| 859 | AM_RANGE(0x200000, 0x207fff) AM_READWRITE | |
| 855 | AM_RANGE(0x200000, 0x207fff) AM_READWRITE | |
| 860 | 856 | AM_RANGE(0x208000, 0x2fffff) AM_RAM |
| 861 | AM_RANGE(0x400000, 0x40001f) AM_READWRITE | |
| 857 | AM_RANGE(0x400000, 0x40001f) AM_READWRITE | |
| 862 | 858 | AM_RANGE(0x580000, 0x5807ff) AM_RAM AM_BASE(m_nvmem32) |
| 863 | 859 | AM_RANGE(0x600000, 0x61ffff) AM_READWRITE_LEGACY(namco_obj32_r,namco_obj32_w) |
| 864 | 860 | AM_RANGE(0x620000, 0x620007) AM_READWRITE_LEGACY(namco_spritepos32_r,namco_spritepos32_w) |
| 865 | 861 | AM_RANGE(0x640000, 0x64ffff) AM_READWRITE_LEGACY(namco_tilemapvideoram32_r,namco_tilemapvideoram32_w ) |
| 866 | 862 | AM_RANGE(0x660000, 0x66003f) AM_READWRITE_LEGACY(namco_tilemapcontrol32_r,namco_tilemapcontrol32_w) |
| 867 | 863 | AM_RANGE(0x680000, 0x68000f) AM_RAM AM_BASE(m_spritebank32) |
| 868 | AM_RANGE(0x6e0000, 0x6e001f) AM_READ | |
| 864 | AM_RANGE(0x6e0000, 0x6e001f) AM_READ | |
| 869 | 865 | AM_RANGE(0x700000, 0x707fff) AM_RAM AM_SHARE("paletteram") |
| 870 | 866 | ADDRESS_MAP_END |
| 871 | 867 | |
| r14896 | r14897 | |
| 873 | 869 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 874 | 870 | AM_RANGE(0x1c0000, 0x1cffff) AM_RAM |
| 875 | 871 | AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w) |
| 876 | AM_RANGE(0x200000, 0x207fff) AM_READWRITE | |
| 872 | AM_RANGE(0x200000, 0x207fff) AM_READWRITE | |
| 877 | 873 | AM_RANGE(0x208000, 0x2fffff) AM_RAM |
| 878 | 874 | AM_RANGE(0x400000, 0x4fffff) AM_ROM AM_REGION("data", 0) |
| 879 | 875 | AM_RANGE(0x600000, 0x61ffff) AM_READWRITE_LEGACY(namco_obj32_r,namco_obj32_w) |
| r14896 | r14897 | |
| 888 | 884 | AM_RANGE(0x940000, 0x94000f) AM_RAM AM_BASE(m_tilebank32) |
| 889 | 885 | AM_RANGE(0x980000, 0x98000f) AM_READ_LEGACY(namco_rozbank32_r) AM_WRITE_LEGACY(namco_rozbank32_w) |
| 890 | 886 | AM_RANGE(0xa00000, 0xa007ff) AM_RAM AM_BASE(m_nvmem32) |
| 891 | AM_RANGE(0xc00000, 0xc0001f) AM_READ_LEGACY(custom_key_r) AM_WRITENOP | |
| 892 | AM_RANGE(0xf00000, 0xf0001f) AM_READWRITE_LEGACY(namconb_cpureg_r, namconb2_cpureg_w) | |
| 887 | AM_RANGE(0xc00000, 0xc0001f) AM_READ(custom_key_r) AM_WRITENOP | |
| 888 | AM_RANGE(0xf00000, 0xf0001f) AM_READWRITE(namconb_cpureg_r, namconb2_cpureg_w) | |
| 893 | 889 | ADDRESS_MAP_END |
| 894 | 890 | |
| 895 | ||
| 891 | ||
| 896 | 892 | { |
| 897 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 898 | 893 | // HACK! Many games data ROM routines redirect the vector from the sound command read to an RTS. |
| 899 | 894 | // This needs more investigation. nebulray and vshoot do NOT do this. |
| 900 | 895 | // Timers A2 and A3 are set up in "external input counter" mode, this may be related. |
| r14896 | r14897 | |
| 905 | 900 | } |
| 906 | 901 | #endif |
| 907 | 902 | |
| 908 | COMBINE_DATA(& | |
| 903 | COMBINE_DATA(& | |
| 909 | 904 | |
| 910 | 905 | // C74 BIOS has a very short window on the CPU sync signal, so immediately let the '020 at it |
| 911 | 906 | if ((offset == 0x6000/2) && (data & 0x80)) |
| 912 | 907 | { |
| 913 | device_spin_until_time(&space | |
| 908 | device_spin_until_time(&space. | |
| 914 | 909 | } |
| 915 | 910 | } |
| 916 | 911 | |
| 917 | 912 | static ADDRESS_MAP_START( namcoc75_am, AS_PROGRAM, 16, namconb1_state ) |
| 918 | 913 | AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE("c352", c352_device, read, write) |
| 919 | AM_RANGE(0x004000, 0x00bfff) AM_RAM_WRITE | |
| 914 | AM_RANGE(0x004000, 0x00bfff) AM_RAM_WRITE | |
| 920 | 915 | AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c75", 0) |
| 921 | 916 | AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("c75data", 0) |
| 922 | 917 | ADDRESS_MAP_END |
| 923 | 918 | |
| 924 | 919 | |
| 925 | ||
| 920 | ||
| 926 | 921 | { |
| 927 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 928 | return state->m_nbx_port6; | |
| 922 | return m_nbx_port6; | |
| 929 | 923 | } |
| 930 | 924 | |
| 931 | ||
| 925 | ||
| 932 | 926 | { |
| 933 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 934 | state->m_nbx_port6 = data; | |
| 927 | m_nbx_port6 = data; | |
| 935 | 928 | } |
| 936 | 929 | |
| 937 | ||
| 930 | ||
| 938 | 931 | { |
| 939 | namconb1_state *state = space->machine().driver_data<namconb1_state>(); | |
| 940 | switch (state->m_nbx_port6 & 0xf0) | |
| 932 | switch (m_nbx_port6 & 0xf0) | |
| 941 | 933 | { |
| 942 | 934 | case 0x00: |
| 943 | return input_port_read_safe( | |
| 935 | return input_port_read_safe( | |
| 944 | 936 | |
| 945 | 937 | case 0x20: |
| 946 | return input_port_read( | |
| 938 | return input_port_read( | |
| 947 | 939 | |
| 948 | 940 | case 0x40: |
| 949 | return input_port_read( | |
| 941 | return input_port_read( | |
| 950 | 942 | |
| 951 | 943 | case 0x60: |
| 952 | return input_port_read( | |
| 944 | return input_port_read( | |
| 953 | 945 | |
| 954 | 946 | default: |
| 955 | 947 | break; |
| r14896 | r14897 | |
| 961 | 953 | // Is this madness? No, this is Namco. They didn't have enough digital ports for all 4 players, |
| 962 | 954 | // so the 8 bits of player 3 got routed to the 8 analog inputs. +5V on the analog input will |
| 963 | 955 | // register full scale, so it works... |
| 964 | ||
| 956 | ||
| 965 | 957 | { |
| 966 | return input_port_read_safe( | |
| 958 | return input_port_read_safe( | |
| 967 | 959 | } |
| 968 | 960 | |
| 969 | ||
| 961 | ||
| 970 | 962 | { |
| 971 | return (input_port_read_safe( | |
| 963 | return (input_port_read_safe( | |
| 972 | 964 | } |
| 973 | 965 | |
| 974 | ||
| 966 | ||
| 975 | 967 | { |
| 976 | return (input_port_read_safe( | |
| 968 | return (input_port_read_safe( | |
| 977 | 969 | } |
| 978 | 970 | |
| 979 | ||
| 971 | ||
| 980 | 972 | { |
| 981 | return (input_port_read_safe( | |
| 973 | return (input_port_read_safe( | |
| 982 | 974 | } |
| 983 | 975 | |
| 984 | ||
| 976 | ||
| 985 | 977 | { |
| 986 | return (input_port_read_safe( | |
| 978 | return (input_port_read_safe( | |
| 987 | 979 | } |
| 988 | 980 | |
| 989 | ||
| 981 | ||
| 990 | 982 | { |
| 991 | return (input_port_read_safe( | |
| 983 | return (input_port_read_safe( | |
| 992 | 984 | } |
| 993 | 985 | |
| 994 | ||
| 986 | ||
| 995 | 987 | { |
| 996 | return (input_port_read_safe( | |
| 988 | return (input_port_read_safe( | |
| 997 | 989 | } |
| 998 | 990 | |
| 999 | ||
| 991 | ||
| 1000 | 992 | { |
| 1001 | return (input_port_read_safe( | |
| 993 | return (input_port_read_safe( | |
| 1002 | 994 | } |
| 1003 | 995 | |
| 1004 | 996 | static ADDRESS_MAP_START( namcoc75_io, AS_IO, 8, namconb1_state ) |
| 1005 | AM_RANGE(M37710_PORT6, M37710_PORT6) AM_READWRITE_LEGACY(port6_r, port6_w) | |
| 1006 | AM_RANGE(M37710_PORT7, M37710_PORT7) AM_READ_LEGACY(port7_r) | |
| 1007 | AM_RANGE(M37710_ADC7_L, M37710_ADC7_L) AM_READ_LEGACY(dac7_r) | |
| 1008 | AM_RANGE(M37710_ADC6_L, M37710_ADC6_L) AM_READ_LEGACY(dac6_r) | |
| 1009 | AM_RANGE(M37710_ADC5_L, M37710_ADC5_L) AM_READ_LEGACY(dac5_r) | |
| 1010 | AM_RANGE(M37710_ADC4_L, M37710_ADC4_L) AM_READ_LEGACY(dac4_r) | |
| 1011 | AM_RANGE(M37710_ADC3_L, M37710_ADC3_L) AM_READ_LEGACY(dac3_r) | |
| 1012 | AM_RANGE(M37710_ADC2_L, M37710_ADC2_L) AM_READ_LEGACY(dac2_r) | |
| 1013 | AM_RANGE(M37710_ADC1_L, M37710_ADC1_L) AM_READ_LEGACY(dac1_r) | |
| 1014 | AM_RANGE(M37710_ADC0_L, M37710_ADC0_L) AM_READ_LEGACY(dac0_r) | |
| 997 | AM_RANGE(M37710_PORT6, M37710_PORT6) AM_READWRITE(port6_r, port6_w) | |
| 998 | AM_RANGE(M37710_PORT7, M37710_PORT7) AM_READ(port7_r) | |
| 999 | AM_RANGE(M37710_ADC7_L, M37710_ADC7_L) AM_READ(dac7_r) | |
| 1000 | AM_RANGE(M37710_ADC6_L, M37710_ADC6_L) AM_READ(dac6_r) | |
| 1001 | AM_RANGE(M37710_ADC5_L, M37710_ADC5_L) AM_READ(dac5_r) | |
| 1002 | AM_RANGE(M37710_ADC4_L, M37710_ADC4_L) AM_READ(dac4_r) | |
| 1003 | AM_RANGE(M37710_ADC3_L, M37710_ADC3_L) AM_READ(dac3_r) | |
| 1004 | AM_RANGE(M37710_ADC2_L, M37710_ADC2_L) AM_READ(dac2_r) | |
| 1005 | AM_RANGE(M37710_ADC1_L, M37710_ADC1_L) AM_READ(dac1_r) | |
| 1006 | AM_RANGE(M37710_ADC0_L, M37710_ADC0_L) AM_READ(dac0_r) | |
| 1015 | 1007 | ADDRESS_MAP_END |
| 1016 | 1008 | |
| 1017 | 1009 | #define MASTER_CLOCK_HZ 48384000 |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | { |
| 69 | 69 | public: |
| 70 | 70 | nsmpoker_state(const machine_config &mconfig, device_type type, const char *tag) |
| 71 | : driver_device(mconfig, type, tag) { } | |
| 71 | : driver_device(mconfig, type, tag) , | |
| 72 | m_videoram(*this, "videoram"), | |
| 73 | m_colorram(*this, "colorram"){ } | |
| 72 | 74 | |
| 73 | UINT8 *m_videoram; | |
| 74 | UINT8 *m_colorram; | |
| 75 | required_shared_ptr<UINT8> m_videoram; | |
| 76 | required_shared_ptr<UINT8> m_colorram; | |
| 75 | 77 | tilemap_t *m_bg_tilemap; |
| 76 | 78 | DECLARE_WRITE8_MEMBER(nsmpoker_videoram_w); |
| 77 | 79 | DECLARE_WRITE8_MEMBER(nsmpoker_colorram_w); |
| r14896 | r14897 | |
| 87 | 89 | |
| 88 | 90 | WRITE8_MEMBER(nsmpoker_state::nsmpoker_videoram_w) |
| 89 | 91 | { |
| 90 | m_videoram[offset] = data; | |
| 92 | m_videoram.target()[offset] = data; | |
| 91 | 93 | m_bg_tilemap->mark_tile_dirty(offset); |
| 92 | 94 | } |
| 93 | 95 | |
| 94 | 96 | |
| 95 | 97 | WRITE8_MEMBER(nsmpoker_state::nsmpoker_colorram_w) |
| 96 | 98 | { |
| 97 | m_colorram[offset] = data; | |
| 99 | m_colorram.target()[offset] = data; | |
| 98 | 100 | m_bg_tilemap->mark_tile_dirty(offset); |
| 99 | 101 | } |
| 100 | 102 | |
| r14896 | r14897 | |
| 108 | 110 | ---- ---- color code. |
| 109 | 111 | ---- ---- seems unused. |
| 110 | 112 | */ |
| 111 | // int attr = state->m_colorram[tile_index]; | |
| 112 | int code = state->m_videoram[tile_index]; | |
| 113 | // int attr = state->m_colorram.target()[tile_index]; | |
| 114 | int code = state->m_videoram.target()[tile_index]; | |
| 113 | 115 | // int bank = (attr & 0x08) >> 3; |
| 114 | 116 | // int color = (attr & 0x03); |
| 115 | 117 | |
| r14896 | r14897 | |
| 166 | 168 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 167 | 169 | AM_RANGE(0x9000, 0xafff) AM_RAM // OK... cleared at beginning. |
| 168 | 170 | AM_RANGE(0xb000, 0xcfff) AM_ROM // WRONG... just to map the last rom somewhere. |
| 169 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(nsmpoker_videoram_w) AM_BASE(m_videoram) // WRONG... just a placeholder. | |
| 170 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(nsmpoker_colorram_w) AM_BASE(m_colorram) // WRONG... just a placeholder. | |
| 171 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(nsmpoker_videoram_w) AM_SHARE("videoram") // WRONG... just a placeholder. | |
| 172 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(nsmpoker_colorram_w) AM_SHARE("colorram") // WRONG... just a placeholder. | |
| 171 | 173 | ADDRESS_MAP_END |
| 172 | 174 | |
| 173 | 175 | static ADDRESS_MAP_START( nsmpoker_portmap, AS_IO, 8, nsmpoker_state ) |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | if (ACCESSING_BITS_0_7) |
| 48 | 48 | { |
| 49 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 49 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 50 | 50 | device_set_input_line(state->m_audiocpu, 0, HOLD_LINE); |
| 51 | 51 | } |
| 52 | 52 | } |
| r14896 | r14897 | |
| 224 | 224 | int videocontrol = state->m_cps_a_regs[0x22 / 2]; |
| 225 | 225 | |
| 226 | 226 | |
| 227 | flip_screen_set( | |
| 227 | state->flip_screen_set( | |
| 228 | 228 | |
| 229 | 229 | layercontrol = state->m_cps_b_regs[0x20 / 2]; |
| 230 | 230 | |
| r14896 | r14897 | |
| 304 | 304 | int layercontrol, l0, l1, l2, l3; |
| 305 | 305 | int videocontrol = state->m_cps_a_regs[0x22 / 2]; |
| 306 | 306 | |
| 307 | flip_screen_set( | |
| 307 | state->flip_screen_set( | |
| 308 | 308 | |
| 309 | 309 | layercontrol = state->m_cps_b_regs[0x20 / 2]; |
| 310 | 310 | |
| r14896 | r14897 | |
| 399 | 399 | AM_RANGE(0xd800, 0xd801) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 400 | 400 | AM_RANGE(0xdc00, 0xdc01) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 401 | 401 | AM_RANGE(0xe000, 0xe000) AM_WRITE_LEGACY(fcrash_snd_bankswitch_w) |
| 402 | AM_RANGE(0xe400, 0xe400) AM_READ(soundlatch_r) | |
| 402 | AM_RANGE(0xe400, 0xe400) AM_READ(soundlatch_byte_r) | |
| 403 | 403 | AM_RANGE(0xe800, 0xe800) AM_WRITE_LEGACY(fcrash_msm5205_0_data_w) |
| 404 | 404 | AM_RANGE(0xec00, 0xec00) AM_WRITE_LEGACY(fcrash_msm5205_1_data_w) |
| 405 | 405 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | public: |
| 53 | 53 | othello_state(const machine_config &mconfig, device_type type, const char *tag) |
| 54 | : driver_device(mconfig, type, tag) { } | |
| 54 | : driver_device(mconfig, type, tag) , | |
| 55 | m_videoram(*this, "videoram"){ } | |
| 55 | 56 | |
| 56 | 57 | /* memory pointers */ |
| 57 | UINT8 | |
| 58 | required_shared_ptr<UINT8> | |
| 58 | 59 | |
| 59 | 60 | /* video-related */ |
| 60 | 61 | int m_tile_bank; |
| r14896 | r14897 | |
| 103 | 104 | |
| 104 | 105 | for(cx = 0; cx < x_count; ++cx) |
| 105 | 106 | { |
| 106 | data_address = ((state->m_videoram[ma + cx] + state->m_tile_bank) << 4) | ra; | |
| 107 | data_address = ((state->m_videoram.target()[ma + cx] + state->m_tile_bank) << 4) | ra; | |
| 107 | 108 | tmp = gfx[data_address] | (gfx[data_address + 0x2000] << 8) | (gfx[data_address + 0x4000] << 16); |
| 108 | 109 | |
| 109 | 110 | for(x = 0; x < TILE_WIDTH; ++x) |
| r14896 | r14897 | |
| 135 | 136 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, othello_state ) |
| 136 | 137 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 137 | 138 | AM_RANGE(0x8000, 0x97ff) AM_NOP /* not populated */ |
| 138 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_ | |
| 139 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_ | |
| 139 | 140 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 140 | 141 | ADDRESS_MAP_END |
| 141 | 142 | |
| r14896 | r14897 | |
| 196 | 197 | AM_RANGE(0x87, 0x87) AM_READ(unk_87_r) |
| 197 | 198 | AM_RANGE(0x8a, 0x8a) AM_WRITE(unk_8a_w) |
| 198 | 199 | AM_RANGE(0x8c, 0x8c) AM_READWRITE(unk_8c_r, unk_8c_w) |
| 199 | AM_RANGE(0x8d, 0x8d) AM_READWRITE(sound_ack_r, soundlatch_w) | |
| 200 | AM_RANGE(0x8d, 0x8d) AM_READWRITE(sound_ack_r, soundlatch_byte_w) | |
| 200 | 201 | AM_RANGE(0x8f, 0x8f) AM_WRITE(unk_8f_w) |
| 201 | 202 | ADDRESS_MAP_END |
| 202 | 203 | |
| 203 | 204 | READ8_MEMBER(othello_state::latch_r) |
| 204 | 205 | { |
| 205 | int retval = soundlatch_r(space, 0); | |
| 206 | soundlatch_clear_w(space, 0, 0); | |
| 206 | int retval = soundlatch_byte_r(space, 0); | |
| 207 | soundlatch_clear_byte_w(space, 0, 0); | |
| 207 | 208 | return retval; |
| 208 | 209 | } |
| 209 | 210 |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | public: |
| 23 | 23 | mosaicf2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | 24 | : driver_device(mconfig, type, tag), |
| 25 | m_maincpu(*this, "maincpu") { } | |
| 25 | m_maincpu(*this, "maincpu") , | |
| 26 | m_videoram(*this, "videoram"){ } | |
| 26 | 27 | |
| 27 | 28 | /* memory pointers */ |
| 28 | 29 | required_device<e132xn_device> m_maincpu; |
| 29 | UINT32 | |
| 30 | required_shared_ptr<UINT32> | |
| 30 | 31 | DECLARE_READ32_MEMBER(f32_input_port_1_r); |
| 31 | 32 | }; |
| 32 | 33 | |
| r14896 | r14897 | |
| 43 | 44 | |
| 44 | 45 | if ((x < 0xa0) && (y < 0xe0)) |
| 45 | 46 | { |
| 46 | bitmap.pix16(y, (x * 2) + 0) = (state->m_videoram[offs] >> 16) & 0x7fff; | |
| 47 | bitmap.pix16(y, (x * 2) + 1) = (state->m_videoram[offs] >> 0) & 0x7fff; | |
| 47 | bitmap.pix16(y, (x * 2) + 0) = (state->m_videoram.target()[offs] >> 16) & 0x7fff; | |
| 48 | bitmap.pix16(y, (x * 2) + 1) = (state->m_videoram.target()[offs] >> 0) & 0x7fff; | |
| 48 | 49 | } |
| 49 | 50 | } |
| 50 | 51 | |
| r14896 | r14897 | |
| 55 | 56 | |
| 56 | 57 | static ADDRESS_MAP_START( common_map, AS_PROGRAM, 32, mosaicf2_state ) |
| 57 | 58 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM |
| 58 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_ | |
| 59 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_ | |
| 59 | 60 | AM_RANGE(0x80000000, 0x80ffffff) AM_ROM AM_REGION("user2",0) |
| 60 | 61 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("user1",0) |
| 61 | 62 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 347 | 347 | |
| 348 | 348 | WRITE8_MEMBER(cosmic_state::flip_screen_w) |
| 349 | 349 | { |
| 350 | flip_screen_set( | |
| 350 | flip_screen_set( | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 |
| r14896 | r14897 | |
|---|---|---|
| 43 | 43 | static INPUT_PORTS_START( sc5 ) |
| 44 | 44 | INPUT_PORTS_END |
| 45 | 45 | |
| 46 | static INTERRUPT_GEN( sc5_fake_timer_int ) | |
| 47 | { | |
| 48 | // this should be coming from the Timer / SIM modules of the Coldfire | |
| 49 | device_set_input_line_and_vector((legacy_cpu_device*)device->machine().device("maincpu"), 5, HOLD_LINE, 0x8c); | |
| 50 | } | |
| 51 | ||
| 46 | 52 | static MACHINE_CONFIG_START( sc5, sc5_state ) |
| 47 | 53 | MCFG_CPU_ADD("maincpu", MCF5206E, 40000000) /* MCF5206eFT */ |
| 48 | 54 | MCFG_CPU_PROGRAM_MAP(sc5_map) |
| 55 | MCFG_CPU_PERIODIC_INT(sc5_fake_timer_int,1000) | |
| 49 | 56 | |
| 50 | 57 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 51 | 58 | /* unknown sound */ |
| r14896 | r14897 | |
| 275 | 282 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 276 | 283 | ROM_LOAD16_BYTE( "p1744p11.hi", 0x00000, 0x080000, CRC(c4634163) SHA1(6d7ed6afcabbe38f3315140b7aa985c0acab1af5) ) |
| 277 | 284 | ROM_LOAD16_BYTE( "p1744p11.lo", 0x00001, 0x080000, CRC(aaeef50f) SHA1(eccdbe5951314105ec5a06724582fc021e0dbd2c) ) |
| 278 | | |
| 285 | PR1743_CASINO_BULLSEYE_SOUNDS11 | |
| 279 | 286 | ROM_END |
| 280 | 287 | |
| 281 | 288 | ROM_START( sc5btripa ) |
| 282 | 289 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 283 | 290 | ROM_LOAD16_BYTE( "p1744s11.hi", 0x00000, 0x080000, CRC(89649f68) SHA1(3e785dce35cab75d1e8eaa98b11db7af2bb08b0a) ) |
| 284 | 291 | ROM_LOAD16_BYTE( "p1744s11.lo", 0x00001, 0x080000, CRC(08bf00ea) SHA1(9eec569703d71db15d553b9f7a72931fa738f91a) ) |
| 285 | | |
| 292 | PR1743_CASINO_BULLSEYE_SOUNDS11 | |
| 286 | 293 | ROM_END |
| 287 | 294 | |
| 288 | 295 | |
| r14896 | r14897 | |
| 604 | 611 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 605 | 612 | ROM_LOAD16_BYTE( "p3317p71.hi", 0x00000, 0x080000, CRC(6b3964f1) SHA1(4f464ca86a59e30a7f05fe1d6ed8f30f8260d186) ) |
| 606 | 613 | ROM_LOAD16_BYTE( "p3317p71.lo", 0x00001, 0x080000, CRC(af2a8342) SHA1(4865f3ff996b67bebf38c93aad3f7b32afcb2d7e) ) |
| 607 | | |
| 614 | PR3317_COLOUR_OF_MONEY_SOUNDS11 | |
| 608 | 615 | ROM_END |
| 609 | 616 | |
| 610 | 617 | ROM_START( sc5colmoa ) |
| 611 | 618 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 612 | 619 | ROM_LOAD16_BYTE( "p3317p73.hi", 0x00000, 0x080000, CRC(fad957ba) SHA1(56446892d5ef88488e4ee223bee489ce822a78ce) ) |
| 613 | 620 | ROM_LOAD16_BYTE( "p3317p73.lo", 0x00001, 0x080000, CRC(28ebb95e) SHA1(0dcde4f0fb1ffdc3f5efeadbf119fb89097da9fb) ) |
| 614 | | |
| 621 | PR3317_COLOUR_OF_MONEY_SOUNDS11 | |
| 615 | 622 | ROM_END |
| 616 | 623 | |
| 617 | 624 | ROM_START( sc5colmob ) |
| 618 | 625 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 619 | 626 | ROM_LOAD16_BYTE( "p3317s71.hi", 0x00000, 0x080000, CRC(2883db1b) SHA1(a3cd5cc0f6e17425e4de4a81d18c710ec873da86) ) |
| 620 | 627 | ROM_LOAD16_BYTE( "p3317s71.lo", 0x00001, 0x080000, CRC(074f7cc2) SHA1(159071cce2a2c834e0e1b9bdd448b16b46577637) ) |
| 621 | | |
| 628 | PR3317_COLOUR_OF_MONEY_SOUNDS11 | |
| 622 | 629 | ROM_END |
| 623 | 630 | |
| 624 | 631 | ROM_START( sc5colmoc ) |
| 625 | 632 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 626 | 633 | ROM_LOAD16_BYTE( "p3317s73.hi", 0x00000, 0x080000, CRC(3a9fdba2) SHA1(6bd035186e28bff42d2fc285b07c5c9ec683db7b) ) |
| 627 | 634 | ROM_LOAD16_BYTE( "p3317s73.lo", 0x00001, 0x080000, CRC(6ee18188) SHA1(73b01c51d12ba5d971b9a0da94e781a08788a6fa) ) |
| 628 | | |
| 635 | PR3317_COLOUR_OF_MONEY_SOUNDS11 | |
| 629 | 636 | ROM_END |
| 630 | 637 | |
| 631 | 638 | |
| r14896 | r14897 | |
| 635 | 642 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 636 | 643 | ROM_LOAD16_BYTE( "95426926.lo", 0x00001, 0x080000, CRC(905a15ce) SHA1(987782cd163f1a8869970912ad412e5440dacdf3) ) |
| 637 | 644 | ROM_LOAD16_BYTE( "95426927.hi", 0x00000, 0x080000, CRC(70fa9626) SHA1(e9a58b489665e8b540adaa220995d5237de1c820) ) |
| 638 | | |
| 645 | PR3502_C | |
| 639 | 646 | ROM_END |
| 640 | 647 | |
| 641 | 648 | ROM_START( sc5newcma ) |
| 642 | 649 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 643 | 650 | ROM_LOAD16_BYTE( "95427926.lo", 0x00001, 0x080000, CRC(5897abbc) SHA1(7714218e76a1d2ebdda65c1403c4fc3f5a5263f6) ) |
| 644 | 651 | ROM_LOAD16_BYTE( "95427927.hi", 0x00000, 0x080000, CRC(4c44681c) SHA1(ed808ab3d06157da9dbe65b1e27925b3a3b53f91) ) |
| 645 | | |
| 652 | PR3502_C | |
| 646 | 653 | ROM_END |
| 647 | 654 | |
| 648 | 655 | ROM_START( sc5newcmb ) |
| 649 | 656 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 650 | 657 | ROM_LOAD16_BYTE( "95426818.lo", 0x00001, 0x080000, CRC(898b5c17) SHA1(5e090bec5d9dc303e3d6d80a4b27c095c285eb29) ) |
| 651 | 658 | ROM_LOAD16_BYTE( "95426819.hi", 0x00000, 0x080000, CRC(d6eeeddd) SHA1(70d11f51b257d7d565bad65a9f0b0e7bde716bf7) ) |
| 652 | | |
| 659 | PR3502_C | |
| 653 | 660 | ROM_END |
| 654 | 661 | |
| 655 | 662 | ROM_START( sc5newcmc ) |
| 656 | 663 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 657 | 664 | ROM_LOAD16_BYTE( "95427818.lo", 0x00001, 0x080000, CRC(f696797d) SHA1(fd1ae9bf1e248cadf547d18601a7df54f6384b91) ) |
| 658 | 665 | ROM_LOAD16_BYTE( "95427819.hi", 0x00000, 0x080000, CRC(ee6fadce) SHA1(47d14fcc8040f72c97e1cade26f1a62cf1ead511) ) |
| 659 | | |
| 666 | PR3502_C | |
| 660 | 667 | ROM_END |
| 661 | 668 | |
| 662 | 669 | ROM_START( sc5crcpt ) |
| r14896 | r14897 | |
| 974 | 981 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 975 | 982 | ROM_LOAD16_BYTE( "95422086.lo", 0x00001, 0x080000, CRC(5deb6c03) SHA1(2ac729194d1e6b0fb71f5f248bf4918140f4ab2a) ) |
| 976 | 983 | ROM_LOAD16_BYTE( "95422087.hi", 0x00000, 0x080000, CRC(e194968f) SHA1(ca2a17f826671025c6cdd7b1361107b7ffe3ea07) ) |
| 977 | | |
| 984 | PR3068_BEAT | |
| 978 | 985 | ROM_END |
| 979 | 986 | |
| 980 | 987 | ROM_START( sc5dndbla ) |
| 981 | 988 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 982 | 989 | ROM_LOAD16_BYTE( "95422148.lo", 0x00001, 0x080000, CRC(825d9ed9) SHA1(b123fd2190d10888286a5e58b3a796890b673bd6) ) |
| 983 | 990 | ROM_LOAD16_BYTE( "95422149.hi", 0x00000, 0x080000, CRC(b9dff341) SHA1(a27f5e7d1a2f78898c74eae1f87cb6c6b242791e) ) |
| 984 | | |
| 991 | PR3068_BEAT | |
| 985 | 992 | ROM_END |
| 986 | 993 | |
| 987 | 994 | ROM_START( sc5dndblb ) |
| 988 | 995 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 989 | 996 | ROM_LOAD16_BYTE( "95422206.lo", 0x00001, 0x080000, CRC(b50bc3df) SHA1(29e5edddbc8f67fd5d13eef44b6dd03f714110f0) ) |
| 990 | 997 | ROM_LOAD16_BYTE( "95422207.hi", 0x00000, 0x080000, CRC(98a749aa) SHA1(0e3eecc9f257994dba4907e735b9371e81a25e8f) ) |
| 991 | | |
| 998 | PR3068_BEAT | |
| 992 | 999 | ROM_END |
| 993 | 1000 | |
| 994 | 1001 | ROM_START( sc5dndblc ) |
| 995 | 1002 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 996 | 1003 | ROM_LOAD16_BYTE( "95422210.lo", 0x00001, 0x080000, CRC(ef3c7726) SHA1(7f9d2e548800c295731b8c15c5cc8119017069ba) ) |
| 997 | 1004 | ROM_LOAD16_BYTE( "95422211.hi", 0x00000, 0x080000, CRC(07545d4c) SHA1(d3dd3ff04c1d2f485dacd13b4214f2462254a6d5) ) |
| 998 | | |
| 1005 | PR3068_BEAT | |
| 999 | 1006 | ROM_END |
| 1000 | 1007 | |
| 1001 | 1008 | ROM_START( sc5dndbld ) |
| 1002 | 1009 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1003 | 1010 | ROM_LOAD16_BYTE( "95422246.lo", 0x00001, 0x080000, CRC(ab3326ea) SHA1(d511f252f1acf76fc59d3f343c4d1db54bb8de8a) ) |
| 1004 | 1011 | ROM_LOAD16_BYTE( "95422247.hi", 0x00000, 0x080000, CRC(b9c05994) SHA1(e6ca9c7f8e6df6aa2277a329ab211134dae684aa) ) |
| 1005 | | |
| 1012 | PR3068_BEAT | |
| 1006 | 1013 | ROM_END |
| 1007 | 1014 | |
| 1008 | 1015 | ROM_START( sc5dndble ) |
| 1009 | 1016 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1010 | 1017 | ROM_LOAD16_BYTE( "95422248.lo", 0x00001, 0x080000, CRC(45192ed6) SHA1(21980888e1deb5e4d8cf140b957d10e18cd7315a) ) |
| 1011 | 1018 | ROM_LOAD16_BYTE( "95422249.hi", 0x00000, 0x080000, CRC(5b671826) SHA1(202f1b63e64c71fd7a1ef8c3159ed7a778d7d6f5) ) |
| 1012 | | |
| 1019 | PR3068_BEAT | |
| 1013 | 1020 | ROM_END |
| 1014 | 1021 | |
| 1015 | 1022 | ROM_START( sc5dndblf ) |
| 1016 | 1023 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1017 | 1024 | ROM_LOAD16_BYTE( "95422324.lo", 0x00001, 0x080000, CRC(681980ea) SHA1(11520621d11bc6642fa1ef6a81f36e4c2c5c2349) ) |
| 1018 | 1025 | ROM_LOAD16_BYTE( "95422325.hi", 0x00000, 0x080000, CRC(9337c3c8) SHA1(55313e2658ebd3fe314d5d2fe7fc846b54cb6b6d) ) |
| 1019 | | |
| 1026 | PR3068_BEAT | |
| 1020 | 1027 | ROM_END |
| 1021 | 1028 | |
| 1022 | 1029 | ROM_START( sc5dndblg ) |
| 1023 | 1030 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1024 | 1031 | ROM_LOAD16_BYTE( "95422326.lo", 0x00001, 0x080000, CRC(5f886988) SHA1(6b97194b2da2ba32b36652b0cf6f033ca364e297) ) |
| 1025 | 1032 | ROM_LOAD16_BYTE( "95422327.hi", 0x00000, 0x080000, CRC(71fdb9df) SHA1(c39ac2a70572bc4a337c1b578430e881cf5c0dc6) ) |
| 1026 | | |
| 1033 | PR3068_BEAT | |
| 1027 | 1034 | ROM_END |
| 1028 | 1035 | |
| 1029 | 1036 | ROM_START( sc5dndblh ) |
| 1030 | 1037 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1031 | 1038 | ROM_LOAD16_BYTE( "95423086.lo", 0x00001, 0x080000, CRC(330ad71d) SHA1(e80e38e0a7dc00271f589a35fa1666027ce7f764) ) |
| 1032 | 1039 | ROM_LOAD16_BYTE( "95423087.hi", 0x00000, 0x080000, CRC(2c028fb9) SHA1(5ba125d474f6d916967ad90bddfc8ebabcdb18aa) ) |
| 1033 | | |
| 1040 | PR3068_BEAT | |
| 1034 | 1041 | ROM_END |
| 1035 | 1042 | |
| 1036 | 1043 | ROM_START( sc5dndbli ) |
| 1037 | 1044 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1038 | 1045 | ROM_LOAD16_BYTE( "95423148.lo", 0x00001, 0x080000, CRC(b2c47c77) SHA1(f788eaf4aaf8509de48d661341d5d46bee5ee1d9) ) |
| 1039 | 1046 | ROM_LOAD16_BYTE( "95423149.hi", 0x00000, 0x080000, CRC(55164612) SHA1(06d666a611a89ee0e79072a54959508a5cd55981) ) |
| 1040 | | |
| 1047 | PR3068_BEAT | |
| 1041 | 1048 | ROM_END |
| 1042 | 1049 | |
| 1043 | 1050 | ROM_START( sc5dndblj ) |
| 1044 | 1051 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1045 | 1052 | ROM_LOAD16_BYTE( "95423206.lo", 0x00001, 0x080000, CRC(e734b65f) SHA1(04f38218aeb61305df1dd26574a24efb1cf04a33) ) |
| 1046 | 1053 | ROM_LOAD16_BYTE( "95423207.hi", 0x00000, 0x080000, CRC(c0384d57) SHA1(c1841c1b06e47edeb760538a89b6302e67f6473d) ) |
| 1047 | | |
| 1054 | PR3068_BEAT | |
| 1048 | 1055 | ROM_END |
| 1049 | 1056 | |
| 1050 | 1057 | ROM_START( sc5dndblk ) |
| 1051 | 1058 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1052 | 1059 | ROM_LOAD16_BYTE( "95423210.lo", 0x00001, 0x080000, CRC(6db7b68f) SHA1(db23b755758bee7706ee1504743ef6fa84e542d0) ) |
| 1053 | 1060 | ROM_LOAD16_BYTE( "95423211.hi", 0x00000, 0x080000, CRC(fc572112) SHA1(27b3bd337ce82b8029b0e2ab9bbcc45c1d2f5244) ) |
| 1054 | | |
| 1061 | PR3068_BEAT | |
| 1055 | 1062 | ROM_END |
| 1056 | 1063 | |
| 1057 | 1064 | ROM_START( sc5dndbll ) |
| 1058 | 1065 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1059 | 1066 | ROM_LOAD16_BYTE( "95423246.lo", 0x00001, 0x080000, CRC(36bdbe7a) SHA1(f8de104bafa301dc653b3aa01bbee08f57f42d33) ) |
| 1060 | 1067 | ROM_LOAD16_BYTE( "95423247.hi", 0x00000, 0x080000, CRC(7432ef89) SHA1(1c71c4fc96afd6bf1b644cce9312a77370f1e201) ) |
| 1061 | | |
| 1068 | PR3068_BEAT | |
| 1062 | 1069 | ROM_END |
| 1063 | 1070 | |
| 1064 | 1071 | ROM_START( sc5dndblm ) |
| 1065 | 1072 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1066 | 1073 | ROM_LOAD16_BYTE( "95423248.lo", 0x00001, 0x080000, CRC(e3fe8ce9) SHA1(503ac6f37a24e36ce268f77e13cb7ef3719abca2) ) |
| 1067 | 1074 | ROM_LOAD16_BYTE( "95423249.hi", 0x00000, 0x080000, CRC(cfc95a9e) SHA1(a9f235f3688ccd978c28c6425a4aeff68e433a75) ) |
| 1068 | | |
| 1075 | PR3068_BEAT | |
| 1069 | 1076 | ROM_END |
| 1070 | 1077 | |
| 1071 | 1078 | ROM_START( sc5dndbln ) |
| 1072 | 1079 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1073 | 1080 | ROM_LOAD16_BYTE( "95423324.lo", 0x00001, 0x080000, CRC(0d2469ff) SHA1(b219ee90cefb52ab495ec976f8554e834e2c8088) ) |
| 1074 | 1081 | ROM_LOAD16_BYTE( "95423325.hi", 0x00000, 0x080000, CRC(4eabcf0c) SHA1(295b4771f64493466cd75098f71f0e118460e2f3) ) |
| 1075 | | |
| 1082 | PR3068_BEAT | |
| 1076 | 1083 | ROM_END |
| 1077 | 1084 | |
| 1078 | 1085 | ROM_START( sc5dndblo ) |
| 1079 | 1086 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 1080 | 1087 | ROM_LOAD16_BYTE( "95423326.lo", 0x00001, 0x080000, CRC(8bfe21a2) SHA1(1fc13b53cda62531322a12f210daa0e510391ba3) ) |
| 1081 | 1088 | ROM_LOAD16_BYTE( "95423327.hi", 0x00000, 0x080000, CRC(883e7518) SHA1(8a437306751932f04a72cd532c567616e4d10315) ) |
| 1082 | | |
| 1089 | PR3068_BEAT | |
| 1083 | 1090 | ROM_END |
| 1084 | 1091 | |
| 1085 | 1092 | |
| r14896 | r14897 | |
| 3852 | 3859 | ROM_LOAD( "39211344.bin", 0x0000, 0x4d2ac4, CRC(2c20765f) SHA1(0856649f6ebef51e1159fdf6a146136a50cf5325) ) |
| 3853 | 3860 | ROM_LOAD( "39212339.bin", 0x0000, 0xa91458, CRC(73ed1ef5) SHA1(a8132e47d4b5644a2da26d512fa68c9078fb2bc1) ) |
| 3854 | 3861 | ROM_LOAD( "39212344.bin", 0x0000, 0x4d2ac4, CRC(01c3c686) SHA1(1c5bb9da7f7ffbf3d2086de3c2a22fa0240187b3) ) |
| 3862 | ROM_LOAD( "39211337.bin", 0x0000, 0xa9136a, CRC(4e984598) SHA1(8e5af7faeb7fb650f7bd44e5e7b3c1162514d15f) ) | |
| 3855 | 3863 | ROM_REGION( 0x5000, "pics", 0 ) |
| 3856 | 3864 | ROM_LOAD( "95890492.bin", 0x0000, 0x5000, CRC(5bddee9e) SHA1(7c2af91793f1f8c3c7f12535874c032129af7c8c) ) |
| 3857 | 3865 | ROM_LOAD( "95890494.bin", 0x0000, 0x5000, CRC(84513cb2) SHA1(8d45cff91953263c4aa8e7cb4a437c27371bd8a1) ) |
| r14896 | r14897 | |
| 4242 | 4250 | |
| 4243 | 4251 | |
| 4244 | 4252 | |
| 4245 | ROM_START( ad5u1337 ) | |
| 4246 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 4247 | 4253 | |
| 4248 | ROM_REGION( 0x1000000, "adder5", ROMREGION_ERASEFF ) | |
| 4249 | ROM_LOAD( "39211337.bin", 0x0000, 0xa9136a, CRC(4e984598) SHA1(8e5af7faeb7fb650f7bd44e5e7b3c1162514d15f) ) | |
| 4250 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) | |
| 4251 | ROM_END | |
| 4252 | ||
| 4253 | ||
| 4254 | ||
| 4255 | ||
| 4256 | 4254 | /*************************************************************************************************************************************************************************/ |
| 4257 | 4255 | /*************************************************************************************************************************************************************************/ |
| 4258 | 4256 | /*************************************************************************************************************************************************************************/ |
| r14896 | r14897 | |
| 4457 | 4455 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 4458 | 4456 | ROM_LOAD16_BYTE( "95412716.lo", 0x00001, 0x080000, CRC(9b1fe8a2) SHA1(9d813b3001d9577faa26a44cfffbc2496ac64af8) ) |
| 4459 | 4457 | ROM_LOAD16_BYTE( "95412717.hi", 0x00000, 0x080000, CRC(84e6009f) SHA1(f0ce4ca874d30d3cf3d365f4fe569ab7f710294c) ) |
| 4460 | | |
| 4458 | PR1492_CAS | |
| 4461 | 4459 | ROM_END |
| 4462 | 4460 | |
| 4463 | 4461 | ROM_START( sc5bar7a ) |
| 4464 | 4462 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 4465 | 4463 | ROM_LOAD16_BYTE( "95413716.lo", 0x00001, 0x080000, CRC(2bb811f4) SHA1(4b12168b4fc9a79d8495ac5e8948546c8ba0a942) ) |
| 4466 | 4464 | ROM_LOAD16_BYTE( "95413717.hi", 0x00000, 0x080000, CRC(9bb208dd) SHA1(08e09486a622e17e5cc0c3f948770e9656fa9096) ) |
| 4467 | | |
| 4465 | PR1492_CAS | |
| 4468 | 4466 | ROM_END |
| 4469 | 4467 | |
| 4470 | 4468 | ROM_START( sc5bar7b ) |
| r14896 | r14897 | |
| 4588 | 4586 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 4589 | 4587 | ROM_LOAD16_BYTE( "p3318p71.hi", 0x00000, 0x080000, CRC(eb94716e) SHA1(f9ed42da57519b68eb7d9be48115aaf8607d6c93) ) |
| 4590 | 4588 | ROM_LOAD16_BYTE( "p3318p71.lo", 0x00001, 0x080000, CRC(c55f25a4) SHA1(2554e8d1c3547f0e93e1fc5f7e6b42c43c7654b3) ) |
| 4591 | | |
| 4589 | PR3318_BULLSEYE_SOUNDS11 | |
| 4592 | 4590 | ROM_END |
| 4593 | 4591 | |
| 4594 | 4592 | ROM_START( sc5bull5a ) |
| 4595 | 4593 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 4596 | 4594 | ROM_LOAD16_BYTE( "p3318p72.hi", 0x00000, 0x080000, CRC(a8693b6b) SHA1(380fdf5dd8518995d915583e547e94562a4c0f7b) ) |
| 4597 | 4595 | ROM_LOAD16_BYTE( "p3318p72.lo", 0x00001, 0x080000, CRC(657bba1e) SHA1(f8fa202c4057d3e37540d32c15965368bb73accd) ) |
| 4598 | | |
| 4596 | PR3318_BULLSEYE_SOUNDS11 | |
| 4599 | 4597 | ROM_END |
| 4600 | 4598 | |
| 4601 | 4599 | ROM_START( sc5bull5b ) |
| 4602 | 4600 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 4603 | 4601 | ROM_LOAD16_BYTE( "p3318s71.hi", 0x00000, 0x080000, CRC(7481c408) SHA1(13b12c77c66973df75ee32d151ce5be072b0b02e) ) |
| 4604 | 4602 | ROM_LOAD16_BYTE( "p3318s71.lo", 0x00001, 0x080000, CRC(32bf3031) SHA1(e1c1b2207c988d3d4c8bbba386518760dc6c5245) ) |
| 4605 | | |
| 4603 | PR3318_BULLSEYE_SOUNDS11 | |
| 4606 | 4604 | ROM_END |
| 4607 | 4605 | |
| 4608 | 4606 | ROM_START( sc5bull5c ) |
| 4609 | 4607 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 4610 | 4608 | ROM_LOAD16_BYTE( "p3318s72.hi", 0x00000, 0x080000, CRC(20c23a5e) SHA1(c6aa64a99b04fdf87cb56d1f2a15f16f3d3d075b) ) |
| 4611 | 4609 | ROM_LOAD16_BYTE( "p3318s72.lo", 0x00001, 0x080000, CRC(03203e08) SHA1(70566d3d011b0d09dad6edf0812c6c2a6f4a68a6) ) |
| 4612 | | |
| 4610 | PR3318_BULLSEYE_SOUNDS11 | |
| 4613 | 4611 | ROM_END |
| 4614 | 4612 | |
| 4615 | ROM_START( ad5bull ) | |
| 4616 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 4617 | ROM_REGION( 0x400000, "ymz", ROMREGION_ERASE00 ) | |
| 4618 | ROM_LOAD( "95008520.bin", 0x0000, 0x100000, CRC(ab418ce0) SHA1(39afbd449a21a31016acaffcfb4f6d684db300e7) ) // PR1702 BULLSEYE | |
| 4619 | ROM_LOAD( "95008521.bin", 0x0000, 0x100000, CRC(7fd0f70c) SHA1(e6bf85b9e2528dac5811277ee89599e58e6358b0) ) | |
| 4620 | ROM_LOAD( "95008544.bin", 0x0000, 0x100000, CRC(19777f20) SHA1(da0cc08b00f9ab565a0e559761adbf7bcd7c327b) ) // PR1743 CASINO BULLSEYE | |
| 4621 | ROM_LOAD( "95008575.bin", 0x0000, 0x100000, CRC(715901d2) SHA1(a7d3d0c7b9fc3eefb0df372cdf0cae7abe8bd959) ) // PR1758 BULLSEYE TRIPLE | |
| 4622 | ROM_LOAD( "95009116.bin", 0x0000, 0x100000, CRC(5a01e206) SHA1(38ee3706d9edb68d17c90bb627aa17b4f908d721) ) // PR3318 BULLSEYE | |
| 4623 | ROM_LOAD( "95009117.bin", 0x0000, 0x100000, CRC(c3623829) SHA1(92b0cf89678023bb02394699e2e214389317ec6c) ) | |
| 4613 | ROM_START( ad5bull ) // we only seem to have the sounds of the adder unit for this? | |
| 4614 | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASEFF ) | |
| 4615 | ROM_LOAD( "program.bin", 0x00000, 0x1000000, NO_DUMP ) | |
| 4616 | PR1758_BULLSEYE_TRIPLE_SOUNDS11 | |
| 4624 | 4617 | ROM_END |
| 4625 | 4618 | |
| 4626 | 4619 | ROM_START( sc5butch ) |
| r14896 | r14897 | |
| 5436 | 5429 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5437 | 5430 | ROM_LOAD16_BYTE( "g95426714.lo", 0x00001, 0x080000, CRC(c2d3f6d6) SHA1(fb5532a9f23c7f9740d55eb411f543b75e3b8ae6) ) |
| 5438 | 5431 | ROM_LOAD16_BYTE( "g95426715.hi", 0x00000, 0x080000, CRC(bd812886) SHA1(2452499bc7c6ca51e8f6ed53c182a756e90bf9a0) ) |
| 5439 | | |
| 5432 | PR000055_CJEWELS | |
| 5440 | 5433 | ROM_END |
| 5441 | 5434 | |
| 5442 | 5435 | ROM_START( sc5cjqpsa ) |
| 5443 | 5436 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5444 | 5437 | ROM_LOAD16_BYTE( "g95426894.lo", 0x00001, 0x080000, CRC(cc1d8324) SHA1(aae871fb7400e661f60f174491f4f2192dd12ebd) ) |
| 5445 | 5438 | ROM_LOAD16_BYTE( "g95426895.hi", 0x00000, 0x080000, CRC(40820ce7) SHA1(e65c939563acd9ebe2d342116f884418b5562279) ) |
| 5446 | | |
| 5439 | PR000055_CJEWELS | |
| 5447 | 5440 | ROM_END |
| 5448 | 5441 | |
| 5449 | 5442 | ROM_START( sc5cjqpsb ) |
| 5450 | 5443 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5451 | 5444 | ROM_LOAD16_BYTE( "g95427714.lo", 0x00001, 0x080000, CRC(1866575e) SHA1(7f772562a7a2d961777c5df55e4a62931934522e) ) |
| 5452 | 5445 | ROM_LOAD16_BYTE( "g95427715.hi", 0x00000, 0x080000, CRC(db62827f) SHA1(96086d1976e443d026fc9534d861f3117b2d901a) ) |
| 5453 | | |
| 5446 | PR000055_CJEWELS | |
| 5454 | 5447 | ROM_END |
| 5455 | 5448 | |
| 5456 | 5449 | ROM_START( sc5cjqpsc ) |
| 5457 | 5450 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5458 | 5451 | ROM_LOAD16_BYTE( "g95427894.lo", 0x00001, 0x080000, CRC(f18d39dd) SHA1(9633a857faa91cde927978bc3d06c2b1840d65ec) ) |
| 5459 | 5452 | ROM_LOAD16_BYTE( "g95427895.hi", 0x00000, 0x080000, CRC(961802c6) SHA1(ae8da626d508e4a7697ef1911c2183da97b0f0cc) ) |
| 5460 | | |
| 5453 | PR000055_CJEWELS | |
| 5461 | 5454 | ROM_END |
| 5462 | 5455 | |
| 5463 | 5456 | |
| r14896 | r14897 | |
| 5466 | 5459 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5467 | 5460 | ROM_LOAD16_BYTE( "95418428.lo", 0x00001, 0x080000, CRC(e3402379) SHA1(54eb1c75e174083fb6e913c231706fd192ca8b22) ) |
| 5468 | 5461 | ROM_LOAD16_BYTE( "95418429.hi", 0x00000, 0x080000, CRC(a7c8a115) SHA1(987485c9db6b9e05b6fc60307535533a931db7f2) ) |
| 5469 | | |
| 5462 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5470 | 5463 | ROM_END |
| 5471 | 5464 | |
| 5472 | 5465 | ROM_START( sc5dndcs ) |
| 5473 | 5466 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5474 | 5467 | ROM_LOAD16_BYTE( "95418446.lo", 0x00001, 0x080000, CRC(bb3df08e) SHA1(d1ae172cff3776b008d1b08772e2589dcc06f75e) ) |
| 5475 | 5468 | ROM_LOAD16_BYTE( "95418447.hi", 0x00000, 0x080000, CRC(03ade18d) SHA1(c74f431245c1854577232c1c10b3a9868e59d38f) ) |
| 5476 | | |
| 5469 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5477 | 5470 | ROM_END |
| 5478 | 5471 | |
| 5479 | 5472 | ROM_START( sc5dndcsa ) |
| 5480 | 5473 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5481 | 5474 | ROM_LOAD16_BYTE( "95418582.lo", 0x00001, 0x080000, CRC(e77addb2) SHA1(37655aba352008d468b0b155a8178addf1f1bb85) ) |
| 5482 | 5475 | ROM_LOAD16_BYTE( "95418583.hi", 0x00000, 0x080000, CRC(01c82328) SHA1(367ae0f2b4b08d194c567ea48f4576f68c921dde) ) |
| 5483 | | |
| 5476 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5484 | 5477 | ROM_END |
| 5485 | 5478 | |
| 5486 | 5479 | ROM_START( sc5dndcsb ) |
| 5487 | 5480 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5488 | 5481 | ROM_LOAD16_BYTE( "95418610.lo", 0x00001, 0x080000, CRC(6b25fe94) SHA1(f926758df4fceb8422fb6165497d5353cb51355b) ) |
| 5489 | 5482 | ROM_LOAD16_BYTE( "95418611.hi", 0x00000, 0x080000, CRC(b1dd987d) SHA1(46e8e8015da8cdee87c202fbdfaf5b5ab157fcef) ) |
| 5490 | | |
| 5483 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5491 | 5484 | ROM_END |
| 5492 | 5485 | |
| 5486 | ||
| 5487 | ROM_START( sc5dndcsc ) | |
| 5488 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5489 | ROM_LOAD16_BYTE( "95418740.lo", 0x00001, 0x080000, CRC(d1cc7151) SHA1(c350c2a61e6dc927fdde3f57dadf07ffb7a74172) ) | |
| 5490 | ROM_LOAD16_BYTE( "95418741.hi", 0x00000, 0x080000, CRC(369f411b) SHA1(e24e60c2707a99e664b049bb2bace837423871ab) ) | |
| 5491 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5492 | ROM_END | |
| 5493 | ||
| 5494 | ROM_START( sc5dndcsd ) | |
| 5495 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5496 | ROM_LOAD16_BYTE( "95419446.lo", 0x00001, 0x080000, CRC(7f5dc09c) SHA1(022d368063398c3ec206c5576fff54e20ffc73c3) ) | |
| 5497 | ROM_LOAD16_BYTE( "95419447.hi", 0x00000, 0x080000, CRC(dd8b1ee5) SHA1(8d59e3f762dd4338706017d1717d06a7a718fbd9) ) | |
| 5498 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5499 | ROM_END | |
| 5500 | ||
| 5501 | ROM_START( sc5dndcse ) | |
| 5502 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5503 | ROM_LOAD16_BYTE( "95419582.lo", 0x00001, 0x080000, CRC(43e7545f) SHA1(53356002ab07f5e9e1df13eef1f1b65c44a9b7b7) ) | |
| 5504 | ROM_LOAD16_BYTE( "95419583.hi", 0x00000, 0x080000, CRC(39bf2015) SHA1(1884f7f79c5e6cc6b78929d7f4e743dd02fceddc) ) | |
| 5505 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5506 | ROM_END | |
| 5507 | ||
| 5508 | ROM_START( sc5dndcsf ) | |
| 5509 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5510 | ROM_LOAD16_BYTE( "95419610.lo", 0x00001, 0x080000, CRC(cfb87779) SHA1(c8df9cce5f3bc58fad35702f653f1ea5613f3cac) ) | |
| 5511 | ROM_LOAD16_BYTE( "95419611.hi", 0x00000, 0x080000, CRC(89aa9b40) SHA1(1369d2c92b41ecbf930c67adc1ca1ff74896d85c) ) | |
| 5512 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5513 | ROM_END | |
| 5514 | ||
| 5515 | ROM_START( sc5dndcsg ) | |
| 5516 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5517 | ROM_LOAD16_BYTE( "95419740.lo", 0x00001, 0x080000, CRC(be5583a6) SHA1(62889d112060f7876fee9d88315a6f6082ac3a81) ) | |
| 5518 | ROM_LOAD16_BYTE( "95419741.hi", 0x00000, 0x080000, CRC(d051eb76) SHA1(7fb107cfdd628f2196e15b98b38eb90540883ddf) ) | |
| 5519 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5520 | ROM_END | |
| 5521 | ||
| 5522 | ROM_START( sc5dndcsh ) | |
| 5523 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5524 | ROM_LOAD16_BYTE( "95423940.lo", 0x00001, 0x080000, CRC(845e82af) SHA1(7ebbe59e8eafc3517806e72fd759a61da282e5fc) ) | |
| 5525 | ROM_LOAD16_BYTE( "95423941.hi", 0x00000, 0x080000, CRC(2aef2c9a) SHA1(8a940c6f6f3fe4ee6625012cf61bde7b78260ddd) ) | |
| 5526 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5527 | ROM_END | |
| 5528 | ||
| 5529 | ROM_START( sc5dndcsi ) | |
| 5530 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5531 | ROM_LOAD16_BYTE( "95426464.lo", 0x00001, 0x080000, CRC(6dbb8ceb) SHA1(f79bc7f047ab5fca012d1d92672d34309ec159dc) ) | |
| 5532 | ROM_LOAD16_BYTE( "95426465.hi", 0x00000, 0x080000, CRC(89e9b45c) SHA1(246e69129bc80ec0263be7cd6dd02f859f550606) ) | |
| 5533 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5534 | ROM_END | |
| 5535 | ||
| 5536 | ROM_START( sc5dndcsj ) | |
| 5537 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5538 | ROM_LOAD16_BYTE( "95427464.lo", 0x00001, 0x080000, CRC(ab9bc5f4) SHA1(c36f5b6acdce0432c0227832618cb0ab8fec3dd2) ) | |
| 5539 | ROM_LOAD16_BYTE( "95427465.hi", 0x00000, 0x080000, CRC(a744775e) SHA1(78591fa7a4c733a456d442903003e4dc3ab7ba8d) ) | |
| 5540 | PR1954_CASINO_DOND_R_SOUNDS11 | |
| 5541 | ROM_END | |
| 5542 | ||
| 5493 | 5543 | ROM_START( sc5dndc3 ) |
| 5494 | 5544 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5495 | 5545 | ROM_LOAD16_BYTE( "95418624.lo", 0x00001, 0x080000, CRC(d92cc819) SHA1(dbb5879b5290d3c217b237bd4c59865cf57e154c) ) |
| 5496 | 5546 | ROM_LOAD16_BYTE( "95418625.hi", 0x00000, 0x080000, CRC(52f037cf) SHA1(0a4b8b2937577b103cf1e4eb47234687aae643c3) ) |
| 5497 | | |
| 5547 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5498 | 5548 | ROM_END |
| 5499 | 5549 | |
| 5500 | 5550 | ROM_START( sc5dnda ) |
| 5501 | 5551 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5502 | 5552 | ROM_LOAD16_BYTE( "95418626.lo", 0x00001, 0x080000, CRC(8825bac7) SHA1(b732499056718e0002e69ad92fd1a0dc1ddecfee) ) |
| 5503 | 5553 | ROM_LOAD16_BYTE( "95418627.hi", 0x00000, 0x080000, CRC(38dde058) SHA1(74c729a4f7597a38ed645a638d1f09ab13b1fa93) ) |
| 5504 | | |
| 5554 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5505 | 5555 | ROM_END |
| 5506 | 5556 | |
| 5507 | 5557 | ROM_START( sc5dndc3a ) |
| 5508 | 5558 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5509 | 5559 | ROM_LOAD16_BYTE( "95418708.lo", 0x00001, 0x080000, CRC(30a98bc2) SHA1(5caf982d2853ce39294445ab89474906e2e41981) ) |
| 5510 | 5560 | ROM_LOAD16_BYTE( "95418709.hi", 0x00000, 0x080000, CRC(9c657c50) SHA1(e72296e193693c3a9ff33632fb0db9c64fe75a97) ) |
| 5511 | | |
| 5561 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5512 | 5562 | ROM_END |
| 5513 | 5563 | |
| 5514 | ROM_START( sc5dndcsc ) | |
| 5515 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5516 | ROM_LOAD16_BYTE( "95418740.lo", 0x00001, 0x080000, CRC(d1cc7151) SHA1(c350c2a61e6dc927fdde3f57dadf07ffb7a74172) ) | |
| 5517 | ROM_LOAD16_BYTE( "95418741.hi", 0x00000, 0x080000, CRC(369f411b) SHA1(e24e60c2707a99e664b049bb2bace837423871ab) ) | |
| 5518 | sc_dnd_others | |
| 5519 | ROM_END | |
| 5520 | 5564 | |
| 5521 | 5565 | ROM_START( sc5dndb ) |
| 5522 | 5566 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5523 | 5567 | ROM_LOAD16_BYTE( "95419428.lo", 0x00001, 0x080000, CRC(72a46f10) SHA1(933a5990fbe1ede6f3527315d8ea111e2814fa83) ) |
| 5524 | 5568 | ROM_LOAD16_BYTE( "95419429.hi", 0x00000, 0x080000, CRC(7aadaaed) SHA1(19c452644db9da1ed5741173473b23a95e2133f5) ) |
| 5525 | | |
| 5569 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5526 | 5570 | ROM_END |
| 5527 | 5571 | |
| 5528 | ROM_START( sc5dndcsd ) | |
| 5529 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5530 | ROM_LOAD16_BYTE( "95419446.lo", 0x00001, 0x080000, CRC(7f5dc09c) SHA1(022d368063398c3ec206c5576fff54e20ffc73c3) ) | |
| 5531 | ROM_LOAD16_BYTE( "95419447.hi", 0x00000, 0x080000, CRC(dd8b1ee5) SHA1(8d59e3f762dd4338706017d1717d06a7a718fbd9) ) | |
| 5532 | sc_dnd_others | |
| 5533 | ROM_END | |
| 5534 | 5572 | |
| 5535 | ROM_START( sc5dndcse ) | |
| 5536 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5537 | ROM_LOAD16_BYTE( "95419582.lo", 0x00001, 0x080000, CRC(43e7545f) SHA1(53356002ab07f5e9e1df13eef1f1b65c44a9b7b7) ) | |
| 5538 | ROM_LOAD16_BYTE( "95419583.hi", 0x00000, 0x080000, CRC(39bf2015) SHA1(1884f7f79c5e6cc6b78929d7f4e743dd02fceddc) ) | |
| 5539 | sc_dnd_others | |
| 5540 | ROM_END | |
| 5541 | ||
| 5542 | ROM_START( sc5dndcsf ) | |
| 5543 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5544 | ROM_LOAD16_BYTE( "95419610.lo", 0x00001, 0x080000, CRC(cfb87779) SHA1(c8df9cce5f3bc58fad35702f653f1ea5613f3cac) ) | |
| 5545 | ROM_LOAD16_BYTE( "95419611.hi", 0x00000, 0x080000, CRC(89aa9b40) SHA1(1369d2c92b41ecbf930c67adc1ca1ff74896d85c) ) | |
| 5546 | sc_dnd_others | |
| 5547 | ROM_END | |
| 5548 | ||
| 5549 | 5573 | ROM_START( sc5dndc3b ) |
| 5550 | 5574 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5551 | 5575 | ROM_LOAD16_BYTE( "95419624.lo", 0x00001, 0x080000, CRC(ac6733b8) SHA1(7f67cdf1b3b8d3ac5d2424aadd9c81fe8340f613) ) |
| 5552 | 5576 | ROM_LOAD16_BYTE( "95419625.hi", 0x00000, 0x080000, CRC(a3733571) SHA1(3bbf7087b8446120f2f3e8d664efef5196ce9b0d) ) |
| 5553 | | |
| 5577 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5554 | 5578 | ROM_END |
| 5555 | 5579 | |
| 5556 | 5580 | ROM_START( sc5dndc ) |
| 5557 | 5581 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5558 | 5582 | ROM_LOAD16_BYTE( "95419626.lo", 0x00001, 0x080000, CRC(17b5d2ad) SHA1(7068b73fb1ec4a56d7121be4e548674ad2bb7ef6) ) |
| 5559 | 5583 | ROM_LOAD16_BYTE( "95419627.hi", 0x00000, 0x080000, CRC(39e34c28) SHA1(b75456e108c8acf363cd83f80be294b6bfecce90) ) |
| 5560 | | |
| 5584 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5561 | 5585 | ROM_END |
| 5562 | 5586 | |
| 5563 | 5587 | ROM_START( sc5dndc3c ) |
| 5564 | 5588 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5565 | 5589 | ROM_LOAD16_BYTE( "95419708.lo", 0x00001, 0x080000, CRC(2c553048) SHA1(6c550e359226386612163f0a018ce20c66af530a) ) |
| 5566 | 5590 | ROM_LOAD16_BYTE( "95419709.hi", 0x00000, 0x080000, CRC(872d1f42) SHA1(bb249b3aadfb8448d144f36bbda7397ff7464057) ) |
| 5567 | | |
| 5591 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5568 | 5592 | ROM_END |
| 5569 | 5593 | |
| 5570 | ROM_START( sc5dndcsg ) | |
| 5571 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5572 | ROM_LOAD16_BYTE( "95419740.lo", 0x00001, 0x080000, CRC(be5583a6) SHA1(62889d112060f7876fee9d88315a6f6082ac3a81) ) | |
| 5573 | ROM_LOAD16_BYTE( "95419741.hi", 0x00000, 0x080000, CRC(d051eb76) SHA1(7fb107cfdd628f2196e15b98b38eb90540883ddf) ) | |
| 5574 | sc_dnd_others | |
| 5575 | ROM_END | |
| 5576 | 5594 | |
| 5577 | 5595 | ROM_START( sc5dndd ) |
| 5578 | 5596 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5579 | 5597 | ROM_LOAD16_BYTE( "95422024.lo", 0x00001, 0x080000, CRC(b5481bbb) SHA1(43e6e81e0ddcf6f2bf6bf301348cf17f37ec7d6c) ) |
| 5580 | 5598 | ROM_LOAD16_BYTE( "95422025.hi", 0x00000, 0x080000, CRC(8a28b1a4) SHA1(bc895c4e3061f95c3136437df30a5d88df794146) ) |
| 5581 | | |
| 5599 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5582 | 5600 | ROM_END |
| 5583 | 5601 | |
| 5584 | ROM_START( sc5dndc2 ) | |
| 5585 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5586 | ROM_LOAD16_BYTE( "95422440.lo", 0x00001, 0x080000, CRC(a4c27e23) SHA1(1de762b8e78da0249c36316f3af25c5c2ee1c68f) ) | |
| 5587 | ROM_LOAD16_BYTE( "95422441.hi", 0x00000, 0x080000, CRC(7a8e9785) SHA1(4510a86664d6c50c1b62d63c679fde203bfb31ef) ) | |
| 5588 | sc_dnd_others | |
| 5589 | ROM_END | |
| 5590 | 5602 | |
| 5591 | ROM_START( sc5dndc2e ) | |
| 5592 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5593 | ROM_LOAD16_BYTE( "95422442.lo", 0x00001, 0x080000, CRC(77d044a9) SHA1(e13af74b1aa5a35e0a041607ea4fd9a3e472c173) ) | |
| 5594 | ROM_LOAD16_BYTE( "95422443.hi", 0x00000, 0x080000, CRC(1b40f9e2) SHA1(1bdeeb429e4669964d805d3cb0f22038427dd567) ) | |
| 5595 | sc_dnd_others | |
| 5596 | ROM_END | |
| 5597 | ||
| 5598 | ROM_START( sc5dndc2f ) | |
| 5599 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5600 | ROM_LOAD16_BYTE( "95422450.lo", 0x00001, 0x080000, CRC(d300fe2c) SHA1(f2a5770d5c51a316fdbe31fa588eaccf94cb6639) ) | |
| 5601 | ROM_LOAD16_BYTE( "95422451.hi", 0x00000, 0x080000, CRC(af1e0a64) SHA1(e494bb57cb26100ce31b9ef2b9ab1963d434973d) ) | |
| 5602 | sc_dnd_others | |
| 5603 | ROM_END | |
| 5604 | ||
| 5605 | 5603 | ROM_START( sc5dnde ) |
| 5606 | 5604 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5607 | 5605 | ROM_LOAD16_BYTE( "95422564.lo", 0x00001, 0x080000, CRC(1f63b69b) SHA1(733cb1959e4f63b7a45ba39e93375d49271cc2ba) ) |
| 5608 | 5606 | ROM_LOAD16_BYTE( "95422565.hi", 0x00000, 0x080000, CRC(dbf27ae1) SHA1(4bd2be6f2fccf050bbbd2ea4d0a5b4246ca9da2c) ) |
| 5609 | | |
| 5607 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5610 | 5608 | ROM_END |
| 5611 | 5609 | |
| 5612 | 5610 | ROM_START( sc5dndf ) |
| 5613 | 5611 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5614 | 5612 | ROM_LOAD16_BYTE( "95422568.lo", 0x00001, 0x080000, CRC(2999d09e) SHA1(806275be7850b48332fdb85f4d78e616a16c12ab) ) |
| 5615 | 5613 | ROM_LOAD16_BYTE( "95422569.hi", 0x00000, 0x080000, CRC(273c2338) SHA1(b44e176fa97b40975825cdb6b3f8dfa753535162) ) |
| 5616 | | |
| 5614 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5617 | 5615 | ROM_END |
| 5618 | 5616 | |
| 5619 | 5617 | ROM_START( sc5dndg ) |
| 5620 | 5618 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5621 | 5619 | ROM_LOAD16_BYTE( "95422832.lo", 0x00001, 0x080000, CRC(44fbc398) SHA1(dc84091f82a718401c967c25ffe756ae1186a38d) ) |
| 5622 | 5620 | ROM_LOAD16_BYTE( "95422833.hi", 0x00000, 0x080000, CRC(80729e3f) SHA1(6d5fd934548c6254ed2ec9c9c77ffcce1eca039b) ) |
| 5623 | | |
| 5621 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5624 | 5622 | ROM_END |
| 5625 | 5623 | |
| 5626 | 5624 | ROM_START( sc5dndh ) |
| 5627 | 5625 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5628 | 5626 | ROM_LOAD16_BYTE( "95422862.lo", 0x00001, 0x080000, CRC(41f7ba62) SHA1(a7ad0dfdc477194e09df97331b75309c7aa976ea) ) |
| 5629 | 5627 | ROM_LOAD16_BYTE( "95422863.hi", 0x00000, 0x080000, CRC(a7883de1) SHA1(812b17621f3ac4b0252b44ec32b81145b4212637) ) |
| 5630 | | |
| 5628 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5631 | 5629 | ROM_END |
| 5632 | 5630 | |
| 5633 | 5631 | ROM_START( sc5dndi ) |
| 5634 | 5632 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5635 | 5633 | ROM_LOAD16_BYTE( "95422886.lo", 0x00001, 0x080000, CRC(1b926605) SHA1(f97b91c73dd330f1848a879faf949085c23d53b6) ) |
| 5636 | 5634 | ROM_LOAD16_BYTE( "95422887.hi", 0x00000, 0x080000, CRC(5f37e87a) SHA1(f1b86a3fb968be14787fb508d1fccb464cec2c4d) ) |
| 5637 | | |
| 5635 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5638 | 5636 | ROM_END |
| 5639 | 5637 | |
| 5640 | 5638 | ROM_START( sc5dndj ) |
| 5641 | 5639 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5642 | 5640 | ROM_LOAD16_BYTE( "95423024.lo", 0x00001, 0x080000, CRC(a825a790) SHA1(5bb676900881c93ef885e72c07a29b001a911a09) ) |
| 5643 | 5641 | ROM_LOAD16_BYTE( "95423025.hi", 0x00000, 0x080000, CRC(a98a0ead) SHA1(e1624b73b4f058edcdc3aa49f6ea55afd642938c) ) |
| 5644 | | |
| 5642 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5645 | 5643 | ROM_END |
| 5646 | 5644 | |
| 5647 | ROM_START( sc5dndc2a ) | |
| 5648 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5649 | ROM_LOAD16_BYTE( "95423440.lo", 0x00001, 0x080000, CRC(214d9f3a) SHA1(bf693dd08db022b51123dc0fdb07d16315444be0) ) | |
| 5650 | ROM_LOAD16_BYTE( "95423441.hi", 0x00000, 0x080000, CRC(4558b059) SHA1(cd37a546499b7314614edffb3e9f311cbcf8b510) ) | |
| 5651 | sc_dnd_others | |
| 5652 | ROM_END | |
| 5653 | 5645 | |
| 5654 | ROM_START( sc5dndc2g ) | |
| 5655 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5656 | ROM_LOAD16_BYTE( "95423442.lo", 0x00001, 0x080000, CRC(a3b28d50) SHA1(42646bc8b3f8d36e9450f74fa7f77a67e60f82cc) ) | |
| 5657 | ROM_LOAD16_BYTE( "95423443.hi", 0x00000, 0x080000, CRC(0fb14bef) SHA1(3c80f62f86e0e248e8cc9cefc94e4d12c9cf63ca) ) | |
| 5658 | sc_dnd_others | |
| 5659 | ROM_END | |
| 5660 | 5646 | |
| 5661 | ROM_START( sc5dndc2h ) | |
| 5662 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5663 | ROM_LOAD16_BYTE( "95423450.lo", 0x00001, 0x080000, CRC(6c884748) SHA1(72b458ef784c380d06074c3c5ae3dcbadd896307) ) | |
| 5664 | ROM_LOAD16_BYTE( "95423451.hi", 0x00000, 0x080000, CRC(f25bf41d) SHA1(47324b8c747405d68b193ca376929b3e49225037) ) | |
| 5665 | sc_dnd_others | |
| 5666 | ROM_END | |
| 5667 | ||
| 5668 | 5647 | ROM_START( sc5dndk ) |
| 5669 | 5648 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5670 | 5649 | ROM_LOAD16_BYTE( "95423564.lo", 0x00001, 0x080000, CRC(13a2bc2d) SHA1(646dd4abff1c2a7f08aabcde1aa7850505f0893f) ) |
| 5671 | 5650 | ROM_LOAD16_BYTE( "95423565.hi", 0x00000, 0x080000, CRC(aa269dbc) SHA1(7b91147ebbc48d1ff6a79d16b381989db829add8) ) |
| 5672 | | |
| 5651 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5673 | 5652 | ROM_END |
| 5674 | 5653 | |
| 5675 | 5654 | ROM_START( sc5dndl ) |
| 5676 | 5655 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5677 | 5656 | ROM_LOAD16_BYTE( "95423832.lo", 0x00001, 0x080000, CRC(62329f06) SHA1(7d531a7afaa0e7a04969afb4f1ef765f8552af3d) ) |
| 5678 | 5657 | ROM_LOAD16_BYTE( "95423833.hi", 0x00000, 0x080000, CRC(ae915afa) SHA1(20938b42fa53c04ea4ac0eb563615bd1ce6f0725) ) |
| 5679 | | |
| 5658 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5680 | 5659 | ROM_END |
| 5681 | 5660 | |
| 5682 | 5661 | ROM_START( sc5dndm ) |
| 5683 | 5662 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5684 | 5663 | ROM_LOAD16_BYTE( "95423862.lo", 0x00001, 0x080000, CRC(758f1697) SHA1(ca40ee7d8f9d32745e1fb26f1d08fc3d7f9857f4) ) |
| 5685 | 5664 | ROM_LOAD16_BYTE( "95423863.hi", 0x00000, 0x080000, CRC(9ce6e813) SHA1(55ab2bba5b2bb356807e9b0182d5260b1b6efa10) ) |
| 5686 | | |
| 5665 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5687 | 5666 | ROM_END |
| 5688 | 5667 | |
| 5689 | 5668 | ROM_START( sc5dndn ) |
| 5690 | 5669 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5691 | 5670 | ROM_LOAD16_BYTE( "95423886.lo", 0x00001, 0x080000, CRC(6e0b8c7e) SHA1(cac697895f0a8a7d3a31389b7719a54eb300f465) ) |
| 5692 | 5671 | ROM_LOAD16_BYTE( "95423887.hi", 0x00000, 0x080000, CRC(8b04bb99) SHA1(fea2cd96a2cc0f7bf5439020a2fbc35ee26cc558) ) |
| 5693 | | |
| 5672 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5694 | 5673 | ROM_END |
| 5695 | 5674 | |
| 5696 | ROM_START( sc5dndcsh ) | |
| 5697 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5698 | ROM_LOAD16_BYTE( "95423940.lo", 0x00001, 0x080000, CRC(845e82af) SHA1(7ebbe59e8eafc3517806e72fd759a61da282e5fc) ) | |
| 5699 | ROM_LOAD16_BYTE( "95423941.hi", 0x00000, 0x080000, CRC(2aef2c9a) SHA1(8a940c6f6f3fe4ee6625012cf61bde7b78260ddd) ) | |
| 5700 | sc_dnd_others | |
| 5701 | ROM_END | |
| 5702 | 5675 | |
| 5703 | 5676 | ROM_START( sc5dndo ) |
| 5704 | 5677 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5705 | 5678 | ROM_LOAD16_BYTE( "95426152.lo", 0x00001, 0x080000, CRC(b304710b) SHA1(443568b0acc8381992a1a8bfe77c9bed714fb05c) ) |
| 5706 | 5679 | ROM_LOAD16_BYTE( "95426153.hi", 0x00000, 0x080000, CRC(f02a1df7) SHA1(9fc0fc6ecc5287012cf9ad2e01c4781f91b9541c) ) |
| 5707 | | |
| 5680 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5708 | 5681 | ROM_END |
| 5709 | 5682 | |
| 5710 | 5683 | ROM_START( sc5dndp ) |
| 5711 | 5684 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5712 | 5685 | ROM_LOAD16_BYTE( "95426168.lo", 0x00001, 0x080000, CRC(be51f52d) SHA1(e61b385c52ea1f2dca2c615518f9a419075d1a4e) ) |
| 5713 | 5686 | ROM_LOAD16_BYTE( "95426169.hi", 0x00000, 0x080000, CRC(c4c30953) SHA1(33645e956be7c5367dfab4704a7c8fbdd79f4126) ) |
| 5714 | | |
| 5687 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5715 | 5688 | ROM_END |
| 5716 | 5689 | |
| 5717 | ROM_START( sc5dndcsi ) | |
| 5718 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5719 | ROM_LOAD16_BYTE( "95426464.lo", 0x00001, 0x080000, CRC(6dbb8ceb) SHA1(f79bc7f047ab5fca012d1d92672d34309ec159dc) ) | |
| 5720 | ROM_LOAD16_BYTE( "95426465.hi", 0x00000, 0x080000, CRC(89e9b45c) SHA1(246e69129bc80ec0263be7cd6dd02f859f550606) ) | |
| 5721 | sc_dnd_others | |
| 5722 | ROM_END | |
| 5723 | ||
| 5724 | 5690 | ROM_START( sc5dndq ) |
| 5725 | 5691 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5726 | 5692 | ROM_LOAD16_BYTE( "95427152.lo", 0x00001, 0x080000, CRC(58da107f) SHA1(297916acc353ac2c70218b84a5ed870513d649f1) ) |
| 5727 | 5693 | ROM_LOAD16_BYTE( "95427153.hi", 0x00000, 0x080000, CRC(6f0b8161) SHA1(41f2454b05fb226720a813626b387b8f29a7e203) ) |
| 5728 | | |
| 5694 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5729 | 5695 | ROM_END |
| 5730 | 5696 | |
| 5731 | 5697 | ROM_START( sc5dndr ) |
| 5732 | 5698 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5733 | 5699 | ROM_LOAD16_BYTE( "95427168.lo", 0x00001, 0x080000, CRC(3f2659e2) SHA1(37db9a4c54fb790a5d4bc7b335c4b92e1d88261e) ) |
| 5734 | 5700 | ROM_LOAD16_BYTE( "95427169.hi", 0x00000, 0x080000, CRC(af31b846) SHA1(ac168ce36c09f1770520a2a9d3f4ace88f97c463) ) |
| 5735 | | |
| 5701 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5736 | 5702 | ROM_END |
| 5737 | 5703 | |
| 5738 | 5704 | ROM_START( sc5dnds ) |
| 5739 | 5705 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5740 | 5706 | ROM_LOAD16_BYTE( "95422028.lo", 0x00001, 0x080000, CRC(55ecfc66) SHA1(ba6b8befe37318ecec9cce1ea3029afa701f1cff) ) |
| 5741 | 5707 | ROM_LOAD16_BYTE( "95422029.hi", 0x00000, 0x080000, CRC(d53e86be) SHA1(72f1b6b21f284b27bd63fcea90826a88c6b16bef) ) |
| 5742 | | |
| 5708 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5743 | 5709 | ROM_END |
| 5744 | 5710 | |
| 5745 | 5711 | ROM_START( sc5dndt ) |
| 5746 | 5712 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5747 | 5713 | ROM_LOAD16_BYTE( "95423028.lo", 0x00001, 0x080000, CRC(6a81fb48) SHA1(9e75c7601efd70aa91f9306b0ffd8d0a515912f6) ) |
| 5748 | 5714 | ROM_LOAD16_BYTE( "95423029.hi", 0x00000, 0x080000, CRC(29828640) SHA1(a90ae840318f4ea3d662645735a352d0e7382b6b) ) |
| 5749 | | |
| 5715 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 5750 | 5716 | ROM_END |
| 5751 | 5717 | |
| 5752 | ROM_START( sc5dndcsj ) | |
| 5718 | ||
| 5719 | ROM_START( sc5dndc2 ) | |
| 5753 | 5720 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5754 | ROM_LOAD16_BYTE( "95427464.lo", 0x00001, 0x080000, CRC(ab9bc5f4) SHA1(c36f5b6acdce0432c0227832618cb0ab8fec3dd2) ) | |
| 5755 | ROM_LOAD16_BYTE( "95427465.hi", 0x00000, 0x080000, CRC(a744775e) SHA1(78591fa7a4c733a456d442903003e4dc3ab7ba8d) ) | |
| 5756 | sc_dnd_others | |
| 5721 | ROM_LOAD16_BYTE( "95422440.lo", 0x00001, 0x080000, CRC(a4c27e23) SHA1(1de762b8e78da0249c36316f3af25c5c2ee1c68f) ) | |
| 5722 | ROM_LOAD16_BYTE( "95422441.hi", 0x00000, 0x080000, CRC(7a8e9785) SHA1(4510a86664d6c50c1b62d63c679fde203bfb31ef) ) | |
| 5723 | PR1964_DND | |
| 5757 | 5724 | ROM_END |
| 5758 | 5725 | |
| 5726 | ROM_START( sc5dndc2e ) | |
| 5727 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5728 | ROM_LOAD16_BYTE( "95422442.lo", 0x00001, 0x080000, CRC(77d044a9) SHA1(e13af74b1aa5a35e0a041607ea4fd9a3e472c173) ) | |
| 5729 | ROM_LOAD16_BYTE( "95422443.hi", 0x00000, 0x080000, CRC(1b40f9e2) SHA1(1bdeeb429e4669964d805d3cb0f22038427dd567) ) | |
| 5730 | PR1964_DND | |
| 5731 | ROM_END | |
| 5732 | ||
| 5733 | ROM_START( sc5dndc2f ) | |
| 5734 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5735 | ROM_LOAD16_BYTE( "95422450.lo", 0x00001, 0x080000, CRC(d300fe2c) SHA1(f2a5770d5c51a316fdbe31fa588eaccf94cb6639) ) | |
| 5736 | ROM_LOAD16_BYTE( "95422451.hi", 0x00000, 0x080000, CRC(af1e0a64) SHA1(e494bb57cb26100ce31b9ef2b9ab1963d434973d) ) | |
| 5737 | PR1964_DND | |
| 5738 | ROM_END | |
| 5739 | ||
| 5740 | ROM_START( sc5dndc2a ) | |
| 5741 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5742 | ROM_LOAD16_BYTE( "95423440.lo", 0x00001, 0x080000, CRC(214d9f3a) SHA1(bf693dd08db022b51123dc0fdb07d16315444be0) ) | |
| 5743 | ROM_LOAD16_BYTE( "95423441.hi", 0x00000, 0x080000, CRC(4558b059) SHA1(cd37a546499b7314614edffb3e9f311cbcf8b510) ) | |
| 5744 | PR1964_DND | |
| 5745 | ROM_END | |
| 5746 | ||
| 5747 | ROM_START( sc5dndc2g ) | |
| 5748 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5749 | ROM_LOAD16_BYTE( "95423442.lo", 0x00001, 0x080000, CRC(a3b28d50) SHA1(42646bc8b3f8d36e9450f74fa7f77a67e60f82cc) ) | |
| 5750 | ROM_LOAD16_BYTE( "95423443.hi", 0x00000, 0x080000, CRC(0fb14bef) SHA1(3c80f62f86e0e248e8cc9cefc94e4d12c9cf63ca) ) | |
| 5751 | PR1964_DND | |
| 5752 | ROM_END | |
| 5753 | ||
| 5754 | ROM_START( sc5dndc2h ) | |
| 5755 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 5756 | ROM_LOAD16_BYTE( "95423450.lo", 0x00001, 0x080000, CRC(6c884748) SHA1(72b458ef784c380d06074c3c5ae3dcbadd896307) ) | |
| 5757 | ROM_LOAD16_BYTE( "95423451.hi", 0x00000, 0x080000, CRC(f25bf41d) SHA1(47324b8c747405d68b193ca376929b3e49225037) ) | |
| 5758 | PR1964_DND | |
| 5759 | ROM_END | |
| 5760 | ||
| 5759 | 5761 | ROM_START( sc5dndc2i ) |
| 5760 | 5762 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5761 | 5763 | ROM_LOAD16_BYTE( "p1964p01.hi", 0x00000, 0x080000, CRC(b99ee66e) SHA1(3f0a046661070b29604e85e29c233b31e5de1c83) ) |
| 5762 | 5764 | ROM_LOAD16_BYTE( "p1964p01.lo", 0x00001, 0x080000, CRC(50480af0) SHA1(fbd5dd20e7e23700d4e039a1a9b17e8d83b86421) ) |
| 5763 | | |
| 5765 | PR1964_DND | |
| 5764 | 5766 | ROM_END |
| 5765 | 5767 | |
| 5766 | 5768 | ROM_START( sc5dndc2q ) |
| 5767 | 5769 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5768 | 5770 | ROM_LOAD16_BYTE( "p1964p12.hi", 0x00000, 0x080000, CRC(44c95076) SHA1(aa0bd2dff04e5d1c8973612fb57c88095eb2b40e) ) |
| 5769 | 5771 | ROM_LOAD16_BYTE( "p1964p12.lo", 0x00001, 0x080000, CRC(fcf337ed) SHA1(fc4bf9d1564e54f23f4d9c216c1ec2587c846c47) ) |
| 5770 | | |
| 5772 | PR1964_DND | |
| 5771 | 5773 | ROM_END |
| 5772 | 5774 | |
| 5773 | 5775 | ROM_START( sc5dndc2r ) |
| 5774 | 5776 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5775 | 5777 | ROM_LOAD16_BYTE( "p1964p13.hi", 0x00000, 0x080000, CRC(84e732e0) SHA1(80bb7f1046791f94f895fa14b4c5fc7b768e81db) ) |
| 5776 | 5778 | ROM_LOAD16_BYTE( "p1964p13.lo", 0x00001, 0x080000, CRC(6028bc0d) SHA1(f060e2bd4ad362a6e99ccc44b965fc1d5389e137) ) |
| 5777 | | |
| 5779 | PR1964_DND | |
| 5778 | 5780 | ROM_END |
| 5779 | 5781 | |
| 5780 | 5782 | ROM_START( sc5dndc2b ) |
| 5781 | 5783 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5782 | 5784 | ROM_LOAD16_BYTE( "p1964p14.hi", 0x00000, 0x080000, CRC(7af2660b) SHA1(692532287053cc899bcf94bebb5526fda5e094b4) ) |
| 5783 | 5785 | ROM_LOAD16_BYTE( "p1964p14.lo", 0x00001, 0x080000, CRC(f2786267) SHA1(a7fcfe231284c142a8bdb6a4361b5bcff9cf168b) ) |
| 5784 | | |
| 5786 | PR1964_DND | |
| 5785 | 5787 | ROM_END |
| 5786 | 5788 | |
| 5787 | 5789 | ROM_START( sc5dndc2u ) |
| 5788 | 5790 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5789 | 5791 | ROM_LOAD16_BYTE( "p1964p21.hi", 0x00000, 0x080000, CRC(a32b78aa) SHA1(1acd470d7023dfce9a88f74cf28cce939dac4d5b) ) |
| 5790 | 5792 | ROM_LOAD16_BYTE( "p1964p21.lo", 0x00001, 0x080000, CRC(e8dc4915) SHA1(d1ba8c081cf2ea3fd95e7a8d296239e18fde9908) ) |
| 5791 | | |
| 5793 | PR1964_DND | |
| 5792 | 5794 | ROM_END |
| 5793 | 5795 | |
| 5794 | 5796 | ROM_START( sc5dndc2c ) |
| 5795 | 5797 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5796 | 5798 | ROM_LOAD16_BYTE( "p1964pa2.hi", 0x00000, 0x080000, CRC(039d2202) SHA1(74dff4553a67cde468655b849f67c08f9bbeba00) ) |
| 5797 | 5799 | ROM_LOAD16_BYTE( "p1964pa2.lo", 0x00001, 0x080000, CRC(d59725a5) SHA1(50babe37853e776c88e2be9b44a4422e3391f2dc) ) |
| 5798 | | |
| 5800 | PR1964_DND | |
| 5799 | 5801 | ROM_END |
| 5800 | 5802 | |
| 5801 | 5803 | ROM_START( sc5dndc2n ) |
| 5802 | 5804 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5803 | 5805 | ROM_LOAD16_BYTE( "p1964pa3.hi", 0x00000, 0x080000, CRC(a1dab479) SHA1(2be3549906ac681842a5269e6014e78cc95715e4) ) |
| 5804 | 5806 | ROM_LOAD16_BYTE( "p1964pa3.lo", 0x00001, 0x080000, CRC(24cb5334) SHA1(e0c1d3ad6ca14a9ab66531dabf70f2cc4c7d2166) ) |
| 5805 | | |
| 5807 | PR1964_DND | |
| 5806 | 5808 | ROM_END |
| 5807 | 5809 | |
| 5808 | 5810 | ROM_START( sc5dndc2j ) |
| 5809 | 5811 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5810 | 5812 | ROM_LOAD16_BYTE( "p1964pa5.hi", 0x00000, 0x080000, CRC(d3a4858d) SHA1(bb818752ae761c7ff379df4903eb2771b05d059f) ) |
| 5811 | 5813 | ROM_LOAD16_BYTE( "p1964pa5.lo", 0x00001, 0x080000, CRC(dc8a4f2b) SHA1(18883c15fb9ed19a3ee7b436fa8327be942fdd29) ) |
| 5812 | | |
| 5814 | PR1964_DND | |
| 5813 | 5815 | ROM_END |
| 5814 | 5816 | |
| 5815 | 5817 | ROM_START( sc5dndc2p ) |
| 5816 | 5818 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5817 | 5819 | ROM_LOAD16_BYTE( "p1964pb1.hi", 0x00000, 0x080000, CRC(658e3793) SHA1(4b142c79031d053a614c62c964e02645bb6d28dd) ) |
| 5818 | 5820 | ROM_LOAD16_BYTE( "p1964pb1.lo", 0x00001, 0x080000, CRC(04eface9) SHA1(7a3f93c63d6cfa5b7814d76fd875f704ec617df4) ) |
| 5819 | | |
| 5821 | PR1964_DND | |
| 5820 | 5822 | ROM_END |
| 5821 | 5823 | |
| 5822 | 5824 | ROM_START( sc5dndc2k ) |
| 5823 | 5825 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5824 | 5826 | ROM_LOAD16_BYTE( "p1964s01.hi", 0x00000, 0x080000, CRC(d0fcdf89) SHA1(00ff2b7131ec0f3d87f58aa843f9a1aad2c33f61) ) |
| 5825 | 5827 | ROM_LOAD16_BYTE( "p1964s01.lo", 0x00001, 0x080000, CRC(549c0843) SHA1(f706cbc7be60a1261304398d876ef10ad695ad5d) ) |
| 5826 | | |
| 5828 | PR1964_DND | |
| 5827 | 5829 | ROM_END |
| 5828 | 5830 | |
| 5829 | 5831 | ROM_START( sc5dndc2s ) |
| 5830 | 5832 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5831 | 5833 | ROM_LOAD16_BYTE( "p1964s12.hi", 0x00000, 0x080000, CRC(f4d29330) SHA1(b86e601fb176ed963d6ef68e76f4d306b595e911) ) |
| 5832 | 5834 | ROM_LOAD16_BYTE( "p1964s12.lo", 0x00001, 0x080000, CRC(6efc8f49) SHA1(b13bd8f7f740f27a79c583d51c398c481081ea81) ) |
| 5833 | | |
| 5835 | PR1964_DND | |
| 5834 | 5836 | ROM_END |
| 5835 | 5837 | |
| 5836 | 5838 | ROM_START( sc5dndc2t ) |
| 5837 | 5839 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5838 | 5840 | ROM_LOAD16_BYTE( "p1964s13.hi", 0x00000, 0x080000, CRC(45935f32) SHA1(25d5411d8d247075ee3421f65e2d2a6c51451848) ) |
| 5839 | 5841 | ROM_LOAD16_BYTE( "p1964s13.lo", 0x00001, 0x080000, CRC(1ae19e19) SHA1(05e0ee034e7185b51f0e1b6ef77ae8670b020cbf) ) |
| 5840 | | |
| 5842 | PR1964_DND | |
| 5841 | 5843 | ROM_END |
| 5842 | 5844 | |
| 5843 | 5845 | ROM_START( sc5dndc2w ) |
| 5844 | 5846 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5845 | 5847 | ROM_LOAD16_BYTE( "p1964s14.hi", 0x00000, 0x080000, CRC(14319187) SHA1(9f678b14287c96dc586259d1a6ecda91cc62e434) ) |
| 5846 | 5848 | ROM_LOAD16_BYTE( "p1964s14.lo", 0x00001, 0x080000, CRC(24e13c44) SHA1(53e0c49e510245615bb6cd5acf6bf5b8cc8de173) ) |
| 5847 | | |
| 5849 | PR1964_DND | |
| 5848 | 5850 | ROM_END |
| 5849 | 5851 | |
| 5850 | 5852 | ROM_START( sc5dndc2v ) |
| 5851 | 5853 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5852 | 5854 | ROM_LOAD16_BYTE( "p1964s21.hi", 0x00000, 0x080000, CRC(0a12b6c4) SHA1(4a5ff6647d3e63aaf917d9d21dabe270dab179d1) ) |
| 5853 | 5855 | ROM_LOAD16_BYTE( "p1964s21.lo", 0x00001, 0x080000, CRC(e77a2694) SHA1(1cdcf91b5a7d6ec252af19930c9533798e1679a6) ) |
| 5854 | | |
| 5856 | PR1964_DND | |
| 5855 | 5857 | ROM_END |
| 5856 | 5858 | |
| 5857 | 5859 | ROM_START( sc5dndc2d ) |
| 5858 | 5860 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5859 | 5861 | ROM_LOAD16_BYTE( "p1964sa2.hi", 0x00000, 0x080000, CRC(361beeff) SHA1(cbd6aa20247df7b9e540b38b7e9199e557f62be7) ) |
| 5860 | 5862 | ROM_LOAD16_BYTE( "p1964sa2.lo", 0x00001, 0x080000, CRC(491d0137) SHA1(e5ad054adc7bbbb89bf7112d564f51b3c1924afa) ) |
| 5861 | | |
| 5863 | PR1964_DND | |
| 5862 | 5864 | ROM_END |
| 5863 | 5865 | |
| 5864 | 5866 | ROM_START( sc5dndc2m ) |
| 5865 | 5867 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5866 | 5868 | ROM_LOAD16_BYTE( "p1964sa3.hi", 0x00000, 0x080000, CRC(fcf198da) SHA1(60280812fd7148edfe52eb07f2c81b77384641a9) ) |
| 5867 | 5869 | ROM_LOAD16_BYTE( "p1964sa3.lo", 0x00001, 0x080000, CRC(be729a5a) SHA1(34d29c9d041b97a008112f6c18a194767f1839ca) ) |
| 5868 | | |
| 5870 | PR1964_DND | |
| 5869 | 5871 | ROM_END |
| 5870 | 5872 | |
| 5871 | 5873 | ROM_START( sc5dndc2l ) |
| 5872 | 5874 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5873 | 5875 | ROM_LOAD16_BYTE( "p1964sa5.hi", 0x00000, 0x080000, CRC(6e97cb56) SHA1(a6335601c8163430be430cff6d075562cc49200b) ) |
| 5874 | 5876 | ROM_LOAD16_BYTE( "p1964sa5.lo", 0x00001, 0x080000, CRC(80d9d806) SHA1(ae089e2618e80dac8afbb5b97b9c75512974488a) ) |
| 5875 | | |
| 5877 | PR1964_DND | |
| 5876 | 5878 | ROM_END |
| 5877 | 5879 | |
| 5878 | 5880 | ROM_START( sc5dndc2o ) |
| 5879 | 5881 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5880 | 5882 | ROM_LOAD16_BYTE( "p1964sb1.hi", 0x00000, 0x080000, CRC(03c6811c) SHA1(32ea6379932589076dec0bbdf5c9255c374ec334) ) |
| 5881 | 5883 | ROM_LOAD16_BYTE( "p1964sb1.lo", 0x00001, 0x080000, CRC(7254d4b6) SHA1(7f4ef8e05fddc1d03c3073ae7b3cb5894200a039) ) |
| 5882 | | |
| 5884 | PR1964_DND | |
| 5883 | 5885 | ROM_END |
| 5884 | 5886 | |
| 5885 | 5887 | |
| r14896 | r14897 | |
| 5910 | 5912 | |
| 5911 | 5913 | ROM_LOAD( "39211171.bin", 0x0000, 0x1000000, CRC(a80f967a) SHA1(bc8dc5c2d30ec38a9119d577114f5e5813f38749) ) // PR3078 DOND |
| 5912 | 5914 | ROM_LOAD( "39212171.bin", 0x0000, 0x1000000, CRC(666fe2b4) SHA1(8baf5f8682f3937b4b49f8db93f3a21e8764c990) ) |
| 5915 | ||
| 5916 | ROM_REGION( 0x1000000, "ymz", ROMREGION_ERASE00 ) | |
| 5917 | PR1945_CASINO_D_O_N_D_SOUNDS11 | |
| 5918 | PR1945_CASINO_DOND_R_SOUNDS12 | |
| 5913 | 5919 | ROM_END |
| 5914 | 5920 | |
| 5915 | 5921 | ROM_START( sc5dndbb ) |
| r14896 | r14897 | |
| 5974 | 5980 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5975 | 5981 | ROM_LOAD16_BYTE( "95418892.lo", 0x00001, 0x080000, CRC(2368bbb6) SHA1(61a13578ac2516c9821ba875691c1f8009785b03) ) |
| 5976 | 5982 | ROM_LOAD16_BYTE( "95418893.hi", 0x00000, 0x080000, CRC(1c2d5159) SHA1(3bafb9c60a9f4237f89519fa07158f53000c08a8) ) |
| 5977 | | |
| 5983 | PR3068_BEAT | |
| 5978 | 5984 | ROM_END |
| 5979 | 5985 | |
| 5980 | 5986 | ROM_START( sc5dndcla ) |
| 5981 | 5987 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 5982 | 5988 | ROM_LOAD16_BYTE( "95419892.lo", 0x00001, 0x080000, CRC(6fb61650) SHA1(2a89170ddca11fb86edb5072ed4841260c7b1501) ) |
| 5983 | 5989 | ROM_LOAD16_BYTE( "95419893.hi", 0x00000, 0x080000, CRC(ec0fa9af) SHA1(880aebf71e327ea4275c4ddc0756143e807ee98a) ) |
| 5984 | | |
| 5990 | PR3068_BEAT | |
| 5985 | 5991 | ROM_END |
| 5986 | 5992 | |
| 5987 | 5993 | ROM_START( ad5dndcl ) |
| r14896 | r14897 | |
| 7563 | 7569 | ROM_END |
| 7564 | 7570 | |
| 7565 | 7571 | |
| 7572 | ROM_START( sc5dndcb ) | |
| 7573 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 7574 | ROM_LOAD16_BYTE( "95418992.lo", 0x00001, 0x080000, CRC(2bddf06e) SHA1(59e2c78e8da681fa842605b4834eb2e1440f9ad7) ) | |
| 7575 | ROM_LOAD16_BYTE( "95418993.hi", 0x00000, 0x080000, CRC(27a65baf) SHA1(506b20c825698210ea07096c6b0892fd0ce7ee42) ) | |
| 7576 | PR3068_BEAT_THE_BANKER_SOUNDS11 | |
| 7577 | ROM_END | |
| 7566 | 7578 | |
| 7579 | ROM_START( sc5dndcba ) | |
| 7580 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 7581 | ROM_LOAD16_BYTE( "95419992.lo", 0x00001, 0x080000, CRC(79d9ebe5) SHA1(cc0e75af683a742407de65d2854644a9be9937df) ) | |
| 7582 | ROM_LOAD16_BYTE( "95419993.hi", 0x00000, 0x080000, CRC(e546a0e7) SHA1(070677430430c35ab5ca616f7688e700b72e9e5f) ) | |
| 7583 | PR3068_BEAT_THE_BANKER_SOUNDS11 | |
| 7584 | ROM_END | |
| 7567 | 7585 | |
| 7586 | ||
| 7568 | 7587 | ROM_START( sc5dndww ) |
| 7569 | 7588 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 7570 | 7589 | ROM_LOAD16_BYTE( "95418860.lo", 0x00001, 0x080000, CRC(955480f9) SHA1(a35484c215cc966bfd3309054ef9e00c470e6644) ) |
| r14896 | r14897 | |
| 7579 | 7598 | sc_dndww_others |
| 7580 | 7599 | ROM_END |
| 7581 | 7600 | |
| 7582 | ROM_START( sc5dndcb ) | |
| 7583 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 7584 | ROM_LOAD16_BYTE( "95418992.lo", 0x00001, 0x080000, CRC(2bddf06e) SHA1(59e2c78e8da681fa842605b4834eb2e1440f9ad7) ) | |
| 7585 | ROM_LOAD16_BYTE( "95418993.hi", 0x00000, 0x080000, CRC(27a65baf) SHA1(506b20c825698210ea07096c6b0892fd0ce7ee42) ) | |
| 7586 | sc_dndww_others | |
| 7587 | ROM_END | |
| 7588 | 7601 | |
| 7602 | ||
| 7603 | ||
| 7589 | 7604 | ROM_START( sc5dndwwb ) |
| 7590 | 7605 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 7591 | 7606 | ROM_LOAD16_BYTE( "95419860.lo", 0x00001, 0x080000, CRC(68f7a054) SHA1(eaaab4e7d5dac40e50f098df2edf1109ac5f6d1c) ) |
| r14896 | r14897 | |
| 7600 | 7615 | sc_dndww_others |
| 7601 | 7616 | ROM_END |
| 7602 | 7617 | |
| 7603 | ROM_START( sc5dndcba ) | |
| 7604 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 7605 | ROM_LOAD16_BYTE( "95419992.lo", 0x00001, 0x080000, CRC(79d9ebe5) SHA1(cc0e75af683a742407de65d2854644a9be9937df) ) | |
| 7606 | ROM_LOAD16_BYTE( "95419993.hi", 0x00000, 0x080000, CRC(e546a0e7) SHA1(070677430430c35ab5ca616f7688e700b72e9e5f) ) | |
| 7607 | sc_dndww_others | |
| 7608 | ROM_END | |
| 7609 | 7618 | |
| 7610 | 7619 | ROM_START( sc5dndwwd ) |
| 7611 | 7620 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| r14896 | r14897 | |
| 13943 | 13952 | GAME( 200?, ad5tornc ,0, sc5, sc5, sc5, ROT0, "BFM","Tornado Club (Bellfruit) (Scorpion 5, Adder 5)", GAME_IS_SKELETON_MECHANICAL ) |
| 13944 | 13953 | GAME( 200?, ad5vpa ,0, sc5, sc5, sc5, ROT0, "BFM","Video Poker Ace (Bellfruit) (Scorpion 5, Adder 5)", GAME_IS_SKELETON_MECHANICAL ) |
| 13945 | 13954 | GAME( 200?, ad5vlv ,0, sc5, sc5, sc5, ROT0, "BFM","Viva Las Vegas (Bellfruit) (Scorpion 5, Adder 5)", GAME_IS_SKELETON_MECHANICAL ) |
| 13946 | GAME( 200?, ad5u1337 ,0, sc5, sc5, sc5, ROT0, "Mazooma","unknown Scorpion '39211337' (Mazooma) (Scorpion 5, Adder 5)", GAME_IS_SKELETON_MECHANICAL ) | |
| 13947 | 13955 | |
| 13948 | 13956 | GAME( 200?, ad5crcpt ,0, sc5, sc5, sc5, ROT0, "BFM","Cops 'n' Robbers Community Party (Bellfruit) (Adder 5)", GAME_IS_SKELETON_MECHANICAL ) |
| 13949 | 13957 | GAME( 200?, ad5bull ,0, sc5, sc5, sc5, ROT0, "BFM","Bullseye (Bellfruit) (Adder 5)", GAME_IS_SKELETON_MECHANICAL ) |
| r14896 | r14897 | |
|---|---|---|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /* Timers - these count down at 25 MHz and pull IRQ2 when they hit 0 */ |
| 261 | ||
| 261 | ||
| 262 | 262 | { |
| 263 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 264 | i960_noburst(&space->device()); | |
| 263 | i960_noburst(&space.device()); | |
| 265 | 264 | |
| 266 | 265 | // if timer is running, calculate current value |
| 267 | if ( | |
| 266 | if ( | |
| 268 | 267 | { |
| 269 | 268 | // get elapsed time, convert to units of 25 MHz |
| 270 | UINT32 cur = ( | |
| 269 | UINT32 cur = ( | |
| 271 | 270 | |
| 272 | 271 | // subtract units from starting value |
| 273 | | |
| 272 | | |
| 274 | 273 | } |
| 275 | 274 | |
| 276 | return | |
| 275 | return | |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | ||
| 278 | ||
| 280 | 279 | { |
| 281 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 282 | 280 | attotime period; |
| 283 | 281 | |
| 284 | i960_noburst(&space->device()); | |
| 285 | COMBINE_DATA(&state->m_timervals[offset]); | |
| 282 | i960_noburst(&space.device()); | |
| 283 | COMBINE_DATA(&m_timervals[offset]); | |
| 286 | 284 | |
| 287 | state->m_timerorig[offset] = state->m_timervals[offset]; | |
| 288 | period = attotime::from_hz(25000000) * state->m_timerorig[offset]; | |
| 289 | state->m_timers[offset]->adjust(period); | |
| 290 | state->m_timerrun[offset] = 1; | |
| 285 | m_timerorig[offset] = m_timervals[offset]; | |
| 286 | period = attotime::from_hz(25000000) * m_timerorig[offset]; | |
| 287 | m_timers[offset]->adjust(period); | |
| 288 | m_timerrun[offset] = 1; | |
| 291 | 289 | } |
| 292 | 290 | |
| 293 | 291 | static TIMER_DEVICE_CALLBACK( model2_timer_cb ) |
| r14896 | r14897 | |
| 409 | 407 | palette_set_color_rgb(machine, color, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10)); |
| 410 | 408 | } |
| 411 | 409 | |
| 412 | ||
| 410 | ||
| 413 | 411 | { |
| 414 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 415 | COMBINE_DATA(state->m_paletteram32 + offset); | |
| 412 | COMBINE_DATA(m_paletteram32 + offset); | |
| 416 | 413 | if(ACCESSING_BITS_0_15) |
| 417 | chcolor( | |
| 414 | chcolor( | |
| 418 | 415 | if(ACCESSING_BITS_16_31) |
| 419 | chcolor( | |
| 416 | chcolor( | |
| 420 | 417 | } |
| 421 | 418 | |
| 422 | ||
| 419 | ||
| 423 | 420 | { |
| 424 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 425 | 421 | if(ACCESSING_BITS_0_7) |
| 426 | 422 | { |
| 427 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 428 | state->m_ctrlmode = data & 0x01; | |
| 423 | eeprom_device *eeprom = machine().device<eeprom_device>("eeprom"); | |
| 424 | m_ctrlmode = data & 0x01; | |
| 429 | 425 | eeprom->write_bit(data & 0x20); |
| 430 | 426 | eeprom->set_clock_line((data & 0x80) ? ASSERT_LINE : CLEAR_LINE); |
| 431 | 427 | eeprom->set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE); |
| 432 | 428 | } |
| 433 | 429 | } |
| 434 | 430 | |
| 435 | ||
| 431 | ||
| 436 | 432 | { |
| 437 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 438 | state->m_analog_channel = (data >> 16) & 0x07; | |
| 433 | m_analog_channel = (data >> 16) & 0x07; | |
| 439 | 434 | } |
| 440 | 435 | |
| 441 | 436 | |
| 442 | ||
| 437 | ||
| 443 | 438 | { |
| 444 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 445 | 439 | UINT32 r = 0; |
| 446 | 440 | |
| 447 | if ( | |
| 441 | if ( | |
| 448 | 442 | { |
| 449 | 443 | r |= 1; |
| 450 | 444 | } |
| r14896 | r14897 | |
| 453 | 447 | return r | 0x04; |
| 454 | 448 | } |
| 455 | 449 | |
| 456 | ||
| 450 | ||
| 457 | 451 | { |
| 458 | return ( | |
| 452 | return ( | |
| 459 | 453 | } |
| 460 | 454 | |
| 461 | 455 | CUSTOM_INPUT_MEMBER(model2_state::_1c00000_r) |
| r14896 | r14897 | |
| 561 | 555 | return 0xffff; |
| 562 | 556 | } |
| 563 | 557 | |
| 564 | ||
| 558 | ||
| 565 | 559 | { |
| 566 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 567 | 560 | /* |
| 568 | 561 | 0x00040000 start 1 lamp |
| 569 | 562 | 0x00080000 start 2 lamp |
| 570 | 563 | */ |
| 571 | 564 | |
| 572 | 565 | if(mem_mask == 0x0000ffff) |
| 573 | | |
| 566 | | |
| 574 | 567 | } |
| 575 | 568 | |
| 576 | 569 | |
| 577 | ||
| 570 | ||
| 578 | 571 | { |
| 579 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 580 | 572 | /* |
| 581 | 573 | 0x00040000 start 1 lamp |
| 582 | 574 | 0x00200000 vr lamp |
| r14896 | r14897 | |
| 585 | 577 | |
| 586 | 578 | if(mem_mask == 0x000000ff || mem_mask == 0x0000ffff) |
| 587 | 579 | { |
| 588 | state->m_driveio_comm_data = data & 0xff; | |
| 589 | cputag_set_input_line(space->machine(), "drivecpu", 0, HOLD_LINE); | |
| 580 | m_driveio_comm_data = data & 0xff; | |
| 581 | cputag_set_input_line(machine(), "drivecpu", 0, HOLD_LINE); | |
| 590 | 582 | } |
| 591 | 583 | } |
| 592 | 584 | |
| 593 | 585 | /*****************************************************************************/ |
| 594 | 586 | /* COPRO */ |
| 595 | 587 | |
| 596 | ||
| 588 | ||
| 597 | 589 | { |
| 598 | 590 | |
| 599 | 591 | return 0xffffffff; |
| 600 | 592 | } |
| 601 | 593 | |
| 602 | ||
| 594 | ||
| 603 | 595 | { |
| 604 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 605 | if (state->m_coproctl & 0x80000000) | |
| 596 | if (m_coproctl & 0x80000000) | |
| 606 | 597 | { |
| 607 | logerror("copro_prg_w: %08X: %08X\n", state->m_coprocnt, data); | |
| 608 | state->m_coprocnt++; | |
| 598 | logerror("copro_prg_w: %08X: %08X\n", m_coprocnt, data); | |
| 599 | m_coprocnt++; | |
| 609 | 600 | } |
| 610 | 601 | else |
| 611 | 602 | { |
| r14896 | r14897 | |
| 613 | 604 | } |
| 614 | 605 | } |
| 615 | 606 | |
| 616 | ||
| 607 | ||
| 617 | 608 | { |
| 618 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 619 | 609 | // did hi bit change? |
| 620 | if ((data ^ | |
| 610 | if ((data ^ | |
| 621 | 611 | { |
| 622 | 612 | if (data & 0x80000000) |
| 623 | 613 | { |
| 624 | 614 | logerror("Start copro upload\n"); |
| 625 | | |
| 615 | | |
| 626 | 616 | } |
| 627 | 617 | else |
| 628 | 618 | { |
| 629 | logerror("Boot copro, %d dwords\n", state->m_coprocnt); | |
| 630 | if (state->m_dsp_type != DSP_TYPE_TGPX4) | |
| 619 | logerror("Boot copro, %d dwords\n", m_coprocnt); | |
| 620 | if (m_dsp_type != DSP_TYPE_TGPX4) | |
| 631 | 621 | { |
| 632 | if (state->m_dsp_type == DSP_TYPE_SHARC) | |
| 633 | cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_HALT, CLEAR_LINE); | |
| 622 | if (m_dsp_type == DSP_TYPE_SHARC) | |
| 623 | cputag_set_input_line(machine(), "dsp", INPUT_LINE_HALT, CLEAR_LINE); | |
| 634 | 624 | else |
| 635 | cputag_set_input_line( | |
| 625 | cputag_set_input_line( | |
| 636 | 626 | } |
| 637 | 627 | } |
| 638 | 628 | } |
| 639 | 629 | |
| 640 | | |
| 630 | | |
| 641 | 631 | } |
| 642 | 632 | |
| 643 | ||
| 633 | ||
| 644 | 634 | { |
| 645 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 646 | 635 | UINT32 d = data & 0x800fffff; |
| 647 | 636 | UINT32 a = (offset >> 2) & 0xff; |
| 648 | 637 | d |= a << 23; |
| 649 | 638 | |
| 650 | 639 | //logerror("copro_function_port_w: %08X, %08X, %08X\n", data, offset, mem_mask); |
| 651 | if (state->m_dsp_type == DSP_TYPE_SHARC) | |
| 652 | copro_fifoin_push(space->machine().device("dsp"), d); | |
| 640 | if (m_dsp_type == DSP_TYPE_SHARC) | |
| 641 | copro_fifoin_push(machine().device("dsp"), d); | |
| 653 | 642 | else |
| 654 | copro_fifoin_push( | |
| 643 | copro_fifoin_push( | |
| 655 | 644 | } |
| 656 | 645 | |
| 657 | ||
| 646 | ||
| 658 | 647 | { |
| 659 | 648 | //logerror("copro_fifo_r: %08X, %08X\n", offset, mem_mask); |
| 660 | return copro_fifoout_pop(space); | |
| 649 | return copro_fifoout_pop(&space); | |
| 661 | 650 | } |
| 662 | 651 | |
| 663 | ||
| 652 | ||
| 664 | 653 | { |
| 665 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 666 | if (state->m_coproctl & 0x80000000) | |
| 654 | if (m_coproctl & 0x80000000) | |
| 667 | 655 | { |
| 668 | if ( | |
| 656 | if ( | |
| 669 | 657 | { |
| 670 | sharc_external_dma_write( | |
| 658 | sharc_external_dma_write( | |
| 671 | 659 | } |
| 672 | else if ( | |
| 660 | else if ( | |
| 673 | 661 | { |
| 674 | | |
| 662 | | |
| 675 | 663 | } |
| 676 | 664 | |
| 677 | | |
| 665 | | |
| 678 | 666 | } |
| 679 | 667 | else |
| 680 | 668 | { |
| 681 | //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space->device())); | |
| 682 | if (state->m_dsp_type == DSP_TYPE_SHARC) | |
| 683 | copro_fifoin_push(space->machine().device("dsp"), data); | |
| 669 | //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space.device())); | |
| 670 | if (m_dsp_type == DSP_TYPE_SHARC) | |
| 671 | copro_fifoin_push(machine().device("dsp"), data); | |
| 684 | 672 | else |
| 685 | copro_fifoin_push( | |
| 673 | copro_fifoin_push( | |
| 686 | 674 | } |
| 687 | 675 | } |
| 688 | 676 | |
| 689 | ||
| 677 | ||
| 690 | 678 | { |
| 691 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 692 | 679 | /* FIXME: clean this up */ |
| 693 | if ((strcmp(space->machine().system().name, "schamp" ) == 0) || | |
| 694 | (strcmp(space->machine().system().name, "sfight" ) == 0) || | |
| 695 | (strcmp(space->machine().system().name, "fvipers" ) == 0) || | |
| 696 | (strcmp(space->machine().system().name, "vstriker" ) == 0) || | |
| 697 | (strcmp(space->machine().system().name, "vstrikero" ) == 0) || | |
| 698 | (strcmp(space->machine().system().name, "gunblade" ) == 0) || | |
| 699 | (strcmp(space->machine().system().name, "von" ) == 0) || | |
| 700 | (strcmp(space->machine().system().name, "vonj" ) == 0) || | |
| 701 | (strcmp(space->machine().system().name, "rchase2" ) == 0)) | |
| 680 | if ((strcmp(machine().system().name, "schamp" ) == 0) || | |
| 681 | (strcmp(machine().system().name, "sfight" ) == 0) || | |
| 682 | (strcmp(machine().system().name, "fvipers" ) == 0) || | |
| 683 | (strcmp(machine().system().name, "vstriker" ) == 0) || | |
| 684 | (strcmp(machine().system().name, "vstrikero" ) == 0) || | |
| 685 | (strcmp(machine().system().name, "gunblade" ) == 0) || | |
| 686 | (strcmp(machine().system().name, "von" ) == 0) || | |
| 687 | (strcmp(machine().system().name, "vonj" ) == 0) || | |
| 688 | (strcmp(machine().system().name, "rchase2" ) == 0)) | |
| 702 | 689 | { |
| 703 | sharc_external_iop_write( | |
| 690 | sharc_external_iop_write( | |
| 704 | 691 | } |
| 705 | 692 | else |
| 706 | 693 | { |
| 707 | if (( | |
| 694 | if (( | |
| 708 | 695 | { |
| 709 | | |
| 696 | | |
| 710 | 697 | } |
| 711 | 698 | else |
| 712 | 699 | { |
| 713 | state->m_iop_data |= (data & 0xffff) << 16; | |
| 714 | sharc_external_iop_write(space->machine().device("dsp"), offset, state->m_iop_data); | |
| 700 | m_iop_data |= (data & 0xffff) << 16; | |
| 701 | sharc_external_iop_write(machine().device("dsp"), offset, m_iop_data); | |
| 715 | 702 | } |
| 716 | | |
| 703 | | |
| 717 | 704 | } |
| 718 | 705 | } |
| 719 | 706 | |
| r14896 | r14897 | |
| 725 | 712 | /* GEO */ |
| 726 | 713 | |
| 727 | 714 | |
| 728 | ||
| 715 | ||
| 729 | 716 | { |
| 730 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 731 | 717 | // did hi bit change? |
| 732 | if ((data ^ | |
| 718 | if ((data ^ | |
| 733 | 719 | { |
| 734 | 720 | if (data & 0x80000000) |
| 735 | 721 | { |
| 736 | 722 | logerror("Start geo upload\n"); |
| 737 | | |
| 723 | | |
| 738 | 724 | } |
| 739 | 725 | else |
| 740 | 726 | { |
| 741 | logerror("Boot geo, %d dwords\n", | |
| 727 | logerror("Boot geo, %d dwords\n", | |
| 742 | 728 | } |
| 743 | 729 | } |
| 744 | 730 | |
| 745 | | |
| 731 | | |
| 746 | 732 | } |
| 747 | 733 | |
| 748 | 734 | |
| 749 | 735 | #ifdef UNUSED_FUNCTION |
| 750 | ||
| 736 | ||
| 751 | 737 | { |
| 752 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 753 | 738 | // did hi bit change? |
| 754 | if ((data ^ | |
| 739 | if ((data ^ | |
| 755 | 740 | { |
| 756 | 741 | if (data & 0x80000000) |
| 757 | 742 | { |
| 758 | 743 | logerror("Start geo upload\n"); |
| 759 | | |
| 744 | | |
| 760 | 745 | } |
| 761 | 746 | else |
| 762 | 747 | { |
| 763 | logerror("Boot geo, %d dwords\n", state->m_geocnt); | |
| 764 | cputag_set_input_line(space->machine(), "dsp2", INPUT_LINE_HALT, CLEAR_LINE); | |
| 765 | //device_spin_until_time(&space->device(), attotime::from_usec(1000)); // Give the SHARC enough time to boot itself | |
| 748 | logerror("Boot geo, %d dwords\n", m_geocnt); | |
| 749 | cputag_set_input_line(machine(), "dsp2", INPUT_LINE_HALT, CLEAR_LINE); | |
| 750 | //device_spin_until_time(&space.device(), attotime::from_usec(1000)); // Give the SHARC enough time to boot itself | |
| 766 | 751 | } |
| 767 | 752 | } |
| 768 | 753 | |
| 769 | | |
| 754 | | |
| 770 | 755 | } |
| 771 | 756 | |
| 772 | ||
| 757 | ||
| 773 | 758 | { |
| 774 | if ((strcmp( | |
| 759 | if ((strcmp( | |
| 775 | 760 | { |
| 776 | 761 | return 8; |
| 777 | 762 | } |
| r14896 | r14897 | |
| 782 | 767 | } |
| 783 | 768 | } |
| 784 | 769 | |
| 785 | ||
| 770 | ||
| 786 | 771 | { |
| 787 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 788 | if (state->m_geoctl & 0x80000000) | |
| 772 | if (m_geoctl & 0x80000000) | |
| 789 | 773 | { |
| 790 | sharc_external_dma_write( | |
| 774 | sharc_external_dma_write( | |
| 791 | 775 | |
| 792 | | |
| 776 | | |
| 793 | 777 | } |
| 794 | 778 | else |
| 795 | 779 | { |
| 796 | //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space | |
| 780 | //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space. | |
| 797 | 781 | } |
| 798 | 782 | } |
| 799 | 783 | |
| 800 | ||
| 784 | ||
| 801 | 785 | { |
| 802 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 803 | if ((strcmp(space->machine().system().name, "schamp" ) == 0)) | |
| 786 | if ((strcmp(machine().system().name, "schamp" ) == 0)) | |
| 804 | 787 | { |
| 805 | sharc_external_iop_write( | |
| 788 | sharc_external_iop_write( | |
| 806 | 789 | } |
| 807 | 790 | else |
| 808 | 791 | { |
| 809 | if (( | |
| 792 | if (( | |
| 810 | 793 | { |
| 811 | | |
| 794 | | |
| 812 | 795 | } |
| 813 | 796 | else |
| 814 | 797 | { |
| 815 | state->m_geo_iop_data |= (data & 0xffff) << 16; | |
| 816 | sharc_external_iop_write(space->machine().device("dsp2"), offset, state->m_geo_iop_data); | |
| 798 | m_geo_iop_data |= (data & 0xffff) << 16; | |
| 799 | sharc_external_iop_write(machine().device("dsp2"), offset, m_geo_iop_data); | |
| 817 | 800 | } |
| 818 | | |
| 801 | | |
| 819 | 802 | } |
| 820 | 803 | } |
| 821 | 804 | #endif |
| 822 | 805 | |
| 823 | 806 | |
| 824 | ||
| 807 | ||
| 825 | 808 | { |
| 826 | //mame_printf_debug("push_geo_data: %08X: %08X\n", 0x900000+state->m_geo_write_start_address, data); | |
| 827 | state->m_bufferram[state->m_geo_write_start_address/4] = data; | |
| 828 | state->m_geo_write_start_address += 4; | |
| 809 | //mame_printf_debug("push_geo_data: %08X: %08X\n", 0x900000+m_geo_write_start_address, data); | |
| 810 | m_bufferram[m_geo_write_start_address/4] = data; | |
| 811 | m_geo_write_start_address += 4; | |
| 829 | 812 | } |
| 830 | 813 | |
| 831 | ||
| 814 | ||
| 832 | 815 | { |
| 833 | 816 | return 0xffffffff; |
| 834 | 817 | } |
| 835 | 818 | |
| 836 | ||
| 819 | ||
| 837 | 820 | { |
| 838 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 839 | if (state->m_geoctl & 0x80000000) | |
| 821 | if (m_geoctl & 0x80000000) | |
| 840 | 822 | { |
| 841 | //logerror("geo_prg_w: %08X: %08X\n", state->m_geocnt, data); | |
| 842 | state->m_geocnt++; | |
| 823 | //logerror("geo_prg_w: %08X: %08X\n", m_geocnt, data); | |
| 824 | m_geocnt++; | |
| 843 | 825 | } |
| 844 | 826 | else |
| 845 | 827 | { |
| 846 | //mame_printf_debug("GEO: %08X: push %08X\n", state->m_geo_write_start_address, data); | |
| 847 | push_geo_data(state, data); | |
| 828 | //mame_printf_debug("GEO: %08X: push %08X\n", m_geo_write_start_address, data); | |
| 829 | push_geo_data(data); | |
| 848 | 830 | } |
| 849 | 831 | } |
| 850 | 832 | |
| 851 | ||
| 833 | ||
| 852 | 834 | { |
| 853 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 854 | 835 | int address = offset * 4; |
| 855 | 836 | if (address == 0x2008) |
| 856 | 837 | { |
| 857 | return | |
| 838 | return | |
| 858 | 839 | } |
| 859 | 840 | else if (address == 0x3008) |
| 860 | 841 | { |
| 861 | return | |
| 842 | return | |
| 862 | 843 | } |
| 863 | 844 | |
| 864 | 845 | // fatalerror("geo_r: %08X, %08X\n", address, mem_mask); |
| 865 | mame_printf_debug("geo_r: PC:%08x - %08X\n", cpu_get_pc(&space | |
| 846 | mame_printf_debug("geo_r: PC:%08x - %08X\n", cpu_get_pc(&space. | |
| 866 | 847 | |
| 867 | 848 | return 0; |
| 868 | 849 | } |
| 869 | 850 | |
| 870 | ||
| 851 | ||
| 871 | 852 | { |
| 872 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 873 | 853 | int address = offset * 4; |
| 874 | 854 | |
| 875 | 855 | if (address < 0x1000) |
| r14896 | r14897 | |
| 883 | 863 | for (i=0; i < 4; i++) |
| 884 | 864 | { |
| 885 | 865 | mame_printf_debug(" %08X: %08X %08X %08X %08X\n", 0x900000+(a*4)+(i*16), |
| 886 | | |
| 866 | | |
| 887 | 867 | } |
| 888 | 868 | } |
| 889 | 869 | else |
| r14896 | r14897 | |
| 907 | 887 | UINT32 r = 0; |
| 908 | 888 | r |= data & 0x800fffff; |
| 909 | 889 | r |= ((address >> 4) & 0x3f) << 23; |
| 910 | push_geo_data( | |
| 890 | push_geo_data( | |
| 911 | 891 | } |
| 912 | 892 | else |
| 913 | 893 | { |
| r14896 | r14897 | |
| 916 | 896 | UINT32 r = 0; |
| 917 | 897 | r |= data & 0x000fffff; |
| 918 | 898 | r |= ((address >> 4) & 0x3f) << 23; |
| 919 | push_geo_data( | |
| 899 | push_geo_data( | |
| 920 | 900 | } |
| 921 | 901 | } |
| 922 | 902 | } |
| 923 | 903 | else if (address == 0x1008) |
| 924 | 904 | { |
| 925 | 905 | //mame_printf_debug("GEO: Write Start Address: %08X\n", data); |
| 926 | | |
| 906 | | |
| 927 | 907 | } |
| 928 | 908 | else if (address == 0x3008) |
| 929 | 909 | { |
| 930 | 910 | //mame_printf_debug("GEO: Read Start Address: %08X\n", data); |
| 931 | | |
| 911 | | |
| 932 | 912 | } |
| 933 | 913 | else |
| 934 | 914 | { |
| r14896 | r14897 | |
| 939 | 919 | /*****************************************************************************/ |
| 940 | 920 | |
| 941 | 921 | |
| 942 | ||
| 922 | ||
| 943 | 923 | { |
| 944 | 924 | return 0x000c0000; |
| 945 | 925 | } |
| 946 | 926 | |
| 947 | 927 | #ifdef UNUSED_FUNCTION |
| 948 | ||
| 928 | ||
| 949 | 929 | { |
| 950 | 930 | return 0x001a0000; |
| 951 | 931 | } |
| 952 | 932 | #endif |
| 953 | 933 | |
| 954 | ||
| 934 | ||
| 955 | 935 | { |
| 956 | 936 | return 0x00400000; |
| 957 | 937 | } |
| 958 | 938 | |
| 959 | ||
| 939 | ||
| 960 | 940 | { |
| 961 | 941 | // vcop needs bit 3 clear (infinite loop otherwise) |
| 962 | 942 | // desert needs other bits set (not sure which specifically) |
| r14896 | r14897 | |
| 964 | 944 | return 0x00ff00f7; |
| 965 | 945 | } |
| 966 | 946 | |
| 967 | ||
| 947 | ||
| 968 | 948 | { |
| 969 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 970 | i960_noburst(&space->device()); | |
| 949 | i960_noburst(&space.device()); | |
| 971 | 950 | |
| 972 | 951 | if (offset) |
| 973 | 952 | { |
| 974 | return | |
| 953 | return | |
| 975 | 954 | } |
| 976 | 955 | |
| 977 | return | |
| 956 | return | |
| 978 | 957 | } |
| 979 | 958 | |
| 980 | ||
| 959 | ||
| 981 | 960 | { |
| 982 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 983 | i960_noburst(&space->device()); | |
| 961 | i960_noburst(&space.device()); | |
| 984 | 962 | |
| 985 | 963 | if (offset) |
| 986 | 964 | { |
| 987 | COMBINE_DATA(& | |
| 965 | COMBINE_DATA(& | |
| 988 | 966 | return; |
| 989 | 967 | } |
| 990 | 968 | |
| 991 | | |
| 969 | | |
| 992 | 970 | } |
| 993 | 971 | |
| 994 | 972 | |
| r14896 | r14897 | |
| 1021 | 999 | device_spin_until_time(&space->device(), attotime::from_usec(40)); |
| 1022 | 1000 | } |
| 1023 | 1001 | |
| 1024 | ||
| 1002 | ||
| 1025 | 1003 | { |
| 1026 | 1004 | if ((offset == 0) && (mem_mask == 0xffff0000)) |
| 1027 | 1005 | { |
| r14896 | r14897 | |
| 1031 | 1009 | return 0xffffffff; |
| 1032 | 1010 | } |
| 1033 | 1011 | |
| 1034 | ||
| 1012 | ||
| 1035 | 1013 | { |
| 1036 | 1014 | if (mem_mask == 0x0000ffff) |
| 1037 | 1015 | { |
| 1038 | snd_latch_to_68k_w(space, data&0xff); | |
| 1016 | snd_latch_to_68k_w(&space, data&0xff); | |
| 1039 | 1017 | } |
| 1040 | 1018 | } |
| 1041 | 1019 | |
| 1042 | ||
| 1020 | ||
| 1043 | 1021 | { |
| 1044 | 1022 | if (ACCESSING_BITS_0_7 && (offset == 0)) |
| 1045 | 1023 | { |
| 1046 | scsp_midi_in( | |
| 1024 | scsp_midi_in( | |
| 1047 | 1025 | |
| 1048 | 1026 | // give the 68k time to notice |
| 1049 | device_spin_until_time(&space | |
| 1027 | device_spin_until_time(&space. | |
| 1050 | 1028 | } |
| 1051 | 1029 | } |
| 1052 | 1030 | |
| r14896 | r14897 | |
| 1068 | 1046 | 0x43,0x66,0x54,0x11,0x99,0xfe,0xcc,0x8e,0xdd,0x87,0x11,0x89,0x22,0xdf,0x44,0x09 |
| 1069 | 1047 | }; |
| 1070 | 1048 | |
| 1071 | ||
| 1049 | ||
| 1072 | 1050 | { |
| 1073 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1074 | 1051 | UINT32 retval = 0; |
| 1075 | 1052 | |
| 1076 | 1053 | if (offset == 0x10000/4) |
| r14896 | r14897 | |
| 1080 | 1057 | } |
| 1081 | 1058 | else if (offset == 0x1000e/4) |
| 1082 | 1059 | { |
| 1083 | retval = | |
| 1060 | retval = | |
| 1084 | 1061 | retval <<= 16; |
| 1085 | | |
| 1062 | | |
| 1086 | 1063 | } |
| 1087 | 1064 | else if (offset == 0x7ff8/4) |
| 1088 | 1065 | { |
| 1089 | retval = state->m_protram[state->m_protstate+1] | state->m_protram[state->m_protstate]<<8; | |
| 1090 | state->m_protstate+=2; | |
| 1066 | retval = m_protram[m_protstate+1] | m_protram[m_protstate]<<8; | |
| 1067 | m_protstate+=2; | |
| 1091 | 1068 | } |
| 1092 | 1069 | else if (offset == 0x400c/4) |
| 1093 | 1070 | { |
| 1094 | state->m_prot_a = !state->m_prot_a; | |
| 1095 | if (state->m_prot_a) | |
| 1071 | m_prot_a = !m_prot_a; | |
| 1072 | if (m_prot_a) | |
| 1096 | 1073 | return 0xffff; |
| 1097 | 1074 | else |
| 1098 | 1075 | return 0xfff0; |
| 1099 | 1076 | } |
| 1100 | else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, cpu_get_pc(&space | |
| 1077 | else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, cpu_get_pc(&space. | |
| 1101 | 1078 | |
| 1102 | 1079 | return retval; |
| 1103 | 1080 | } |
| 1104 | 1081 | |
| 1105 | ||
| 1082 | ||
| 1106 | 1083 | { |
| 1107 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1108 | 1084 | if (mem_mask == 0xffff0000) |
| 1109 | 1085 | { |
| 1110 | 1086 | data >>= 16; |
| r14896 | r14897 | |
| 1112 | 1088 | |
| 1113 | 1089 | if (offset == 0x10008/4) |
| 1114 | 1090 | { |
| 1115 | | |
| 1091 | | |
| 1116 | 1092 | } |
| 1117 | 1093 | else if (offset == 0x1000c/4) |
| 1118 | 1094 | { |
| r14896 | r14897 | |
| 1120 | 1096 | { |
| 1121 | 1097 | // dynamcop |
| 1122 | 1098 | case 0x7700: |
| 1123 | strcpy((char *) | |
| 1099 | strcpy((char *) | |
| 1124 | 1100 | break; |
| 1125 | 1101 | |
| 1126 | 1102 | // dynamcop |
| 1127 | 1103 | case 0x1326: |
| 1128 | state->m_protstate = 0; | |
| 1129 | memcpy(state->m_protram+2, DCOPKey1326, sizeof(DCOPKey1326)); | |
| 1104 | m_protstate = 0; | |
| 1105 | memcpy(m_protram+2, DCOPKey1326, sizeof(DCOPKey1326)); | |
| 1130 | 1106 | break; |
| 1131 | 1107 | |
| 1132 | 1108 | // zerogun |
| r14896 | r14897 | |
| 1145 | 1121 | case 0x98CC: |
| 1146 | 1122 | case 0x3422: |
| 1147 | 1123 | case 0x10: |
| 1148 | state->m_protstate = 0; | |
| 1149 | memcpy(state->m_protram+2, ZGUNProt+((2*state->m_protpos)/12)*8, sizeof(ZGUNProt)); | |
| 1124 | m_protstate = 0; | |
| 1125 | memcpy(m_protram+2, ZGUNProt+((2*m_protpos)/12)*8, sizeof(ZGUNProt)); | |
| 1150 | 1126 | break; |
| 1151 | 1127 | |
| 1152 | 1128 | // pltkids |
| 1153 | 1129 | case 0x7140: |
| 1154 | state->m_protstate = 0; | |
| 1155 | strcpy((char *)state->m_protram+2, "98-PILOT "); | |
| 1130 | m_protstate = 0; | |
| 1131 | strcpy((char *)m_protram+2, "98-PILOT "); | |
| 1156 | 1132 | break; |
| 1157 | 1133 | |
| 1158 | 1134 | default: |
| 1159 | | |
| 1135 | | |
| 1160 | 1136 | break; |
| 1161 | 1137 | } |
| 1162 | 1138 | } |
| r14896 | r14897 | |
| 1164 | 1140 | { |
| 1165 | 1141 | if (data == 0) |
| 1166 | 1142 | { |
| 1167 | state->m_protstate = 0; | |
| 1168 | strcpy((char *)state->m_protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00"); | |
| 1143 | m_protstate = 0; | |
| 1144 | strcpy((char *)m_protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00"); | |
| 1169 | 1145 | } |
| 1170 | 1146 | } |
| 1171 | else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(&space | |
| 1147 | else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(&space. | |
| 1172 | 1148 | |
| 1173 | 1149 | } |
| 1174 | 1150 | |
| 1175 | 1151 | /* Daytona "To The MAXX" PIC protection simulation */ |
| 1176 | 1152 | |
| 1177 | 1153 | |
| 1178 | ||
| 1154 | ||
| 1179 | 1155 | { |
| 1180 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1181 | UINT32 *ROM = (UINT32 *)space->machine().region("maincpu")->base(); | |
| 1156 | UINT32 *ROM = (UINT32 *)machine().region("maincpu")->base(); | |
| 1182 | 1157 | |
| 1183 | 1158 | if (offset <= 0x1f/4) |
| 1184 | 1159 | { |
| r14896 | r14897 | |
| 1186 | 1161 | if (mem_mask == 0xffff0000) |
| 1187 | 1162 | { |
| 1188 | 1163 | // 16-bit protection reads |
| 1189 | state->m_maxxstate++; | |
| 1190 | state->m_maxxstate &= 0xf; | |
| 1191 | if (!state->m_maxxstate) | |
| 1164 | m_maxxstate++; | |
| 1165 | m_maxxstate &= 0xf; | |
| 1166 | if (!m_maxxstate) | |
| 1192 | 1167 | { |
| 1193 | 1168 | return 0x00070000; |
| 1194 | 1169 | } |
| 1195 | 1170 | else |
| 1196 | 1171 | { |
| 1197 | if ( | |
| 1172 | if ( | |
| 1198 | 1173 | { |
| 1199 | 1174 | return 0; |
| 1200 | 1175 | } |
| r14896 | r14897 | |
| 1221 | 1196 | |
| 1222 | 1197 | |
| 1223 | 1198 | |
| 1224 | ||
| 1199 | ||
| 1225 | 1200 | { |
| 1226 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1227 | 1201 | if ((mem_mask == 0xffffffff) || (mem_mask == 0x0000ffff) || (mem_mask == 0xffff0000)) |
| 1228 | 1202 | { |
| 1229 | 1203 | return 0xffffffff; |
| r14896 | r14897 | |
| 1231 | 1205 | |
| 1232 | 1206 | if (offset < 0x4000/4) |
| 1233 | 1207 | { |
| 1234 | return | |
| 1208 | return | |
| 1235 | 1209 | } |
| 1236 | 1210 | |
| 1237 | 1211 | if (mem_mask == 0x00ff0000) |
| 1238 | 1212 | { |
| 1239 | return | |
| 1213 | return | |
| 1240 | 1214 | } |
| 1241 | 1215 | else if (mem_mask == 0x000000ff) |
| 1242 | 1216 | { |
| 1243 | return | |
| 1217 | return | |
| 1244 | 1218 | } |
| 1245 | 1219 | |
| 1246 | 1220 | return 0xffffffff; |
| 1247 | 1221 | } |
| 1248 | 1222 | |
| 1249 | ||
| 1223 | ||
| 1250 | 1224 | { |
| 1251 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1252 | 1225 | if ((mem_mask == 0xffffffff) || (mem_mask == 0x0000ffff) || (mem_mask == 0xffff0000)) |
| 1253 | 1226 | { |
| 1254 | COMBINE_DATA(& | |
| 1227 | COMBINE_DATA(& | |
| 1255 | 1228 | return; |
| 1256 | 1229 | } |
| 1257 | 1230 | |
| 1258 | 1231 | if (offset < 0x4000/4) |
| 1259 | 1232 | { |
| 1260 | COMBINE_DATA(& | |
| 1233 | COMBINE_DATA(& | |
| 1261 | 1234 | return; |
| 1262 | 1235 | } |
| 1263 | 1236 | |
| 1264 | 1237 | if (mem_mask == 0x00ff0000) |
| 1265 | 1238 | { |
| 1266 | | |
| 1239 | | |
| 1267 | 1240 | } |
| 1268 | 1241 | else if (mem_mask == 0x000000ff) |
| 1269 | 1242 | { |
| 1270 | state->m_zflagi = data; | |
| 1271 | state->m_zflag = 0; | |
| 1272 | if (data & 0x01) state->m_zflag |= 0x80; | |
| 1273 | if (data & 0x80) state->m_zflag |= 0x01; | |
| 1243 | m_zflagi = data; | |
| 1244 | m_zflag = 0; | |
| 1245 | if (data & 0x01) m_zflag |= 0x80; | |
| 1246 | if (data & 0x80) m_zflag |= 0x01; | |
| 1274 | 1247 | } |
| 1275 | 1248 | } |
| 1276 | 1249 | |
| 1277 | 1250 | #ifdef UNUSED_FUNCTION |
| 1278 | ||
| 1251 | ||
| 1279 | 1252 | { |
| 1280 | 1253 | int address = offset * 4; |
| 1281 | 1254 | |
| r14896 | r14897 | |
| 1294 | 1267 | } |
| 1295 | 1268 | #endif |
| 1296 | 1269 | |
| 1297 | ||
| 1270 | ||
| 1298 | 1271 | { |
| 1299 | 1272 | mame_printf_debug("Mode = %08X\n", data); |
| 1300 | 1273 | } |
| 1301 | 1274 | |
| 1302 | ||
| 1275 | ||
| 1303 | 1276 | { |
| 1304 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1305 | 1277 | if ( (offset & 1) == 0 ) |
| 1306 | 1278 | { |
| 1307 | state->m_textureram0[offset>>1] &= 0xffff0000; | |
| 1308 | state->m_textureram0[offset>>1] |= data & 0xffff; | |
| 1279 | m_textureram0[offset>>1] &= 0xffff0000; | |
| 1280 | m_textureram0[offset>>1] |= data & 0xffff; | |
| 1309 | 1281 | } |
| 1310 | 1282 | else |
| 1311 | 1283 | { |
| 1312 | state->m_textureram0[offset>>1] &= 0x0000ffff; | |
| 1313 | state->m_textureram0[offset>>1] |= (data & 0xffff) << 16; | |
| 1284 | m_textureram0[offset>>1] &= 0x0000ffff; | |
| 1285 | m_textureram0[offset>>1] |= (data & 0xffff) << 16; | |
| 1314 | 1286 | } |
| 1315 | 1287 | } |
| 1316 | 1288 | |
| 1317 | ||
| 1289 | ||
| 1318 | 1290 | { |
| 1319 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1320 | 1291 | if ( (offset & 1) == 0 ) |
| 1321 | 1292 | { |
| 1322 | state->m_textureram1[offset>>1] &= 0xffff0000; | |
| 1323 | state->m_textureram1[offset>>1] |= data & 0xffff; | |
| 1293 | m_textureram1[offset>>1] &= 0xffff0000; | |
| 1294 | m_textureram1[offset>>1] |= data & 0xffff; | |
| 1324 | 1295 | } |
| 1325 | 1296 | else |
| 1326 | 1297 | { |
| 1327 | state->m_textureram1[offset>>1] &= 0x0000ffff; | |
| 1328 | state->m_textureram1[offset>>1] |= (data & 0xffff) << 16; | |
| 1298 | m_textureram1[offset>>1] &= 0x0000ffff; | |
| 1299 | m_textureram1[offset>>1] |= (data & 0xffff) << 16; | |
| 1329 | 1300 | } |
| 1330 | 1301 | } |
| 1331 | 1302 | |
| 1332 | ||
| 1303 | ||
| 1333 | 1304 | { |
| 1334 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1335 | 1305 | if ( (offset & 1) == 0 ) |
| 1336 | 1306 | { |
| 1337 | state->m_lumaram[offset>>1] &= 0xffff0000; | |
| 1338 | state->m_lumaram[offset>>1] |= data & 0xffff; | |
| 1307 | m_lumaram[offset>>1] &= 0xffff0000; | |
| 1308 | m_lumaram[offset>>1] |= data & 0xffff; | |
| 1339 | 1309 | } |
| 1340 | 1310 | else |
| 1341 | 1311 | { |
| 1342 | state->m_lumaram[offset>>1] &= 0x0000ffff; | |
| 1343 | state->m_lumaram[offset>>1] |= (data & 0xffff) << 16; | |
| 1312 | m_lumaram[offset>>1] &= 0x0000ffff; | |
| 1313 | m_lumaram[offset>>1] |= (data & 0xffff) << 16; | |
| 1344 | 1314 | } |
| 1345 | 1315 | } |
| 1346 | 1316 | |
| 1347 | ||
| 1317 | ||
| 1348 | 1318 | { |
| 1349 | model2_3d_set_zclip( | |
| 1319 | model2_3d_set_zclip( | |
| 1350 | 1320 | } |
| 1351 | 1321 | |
| 1352 | 1322 | /* common map for all Model 2 versions */ |
| r14896 | r14897 | |
| 1355 | 1325 | |
| 1356 | 1326 | AM_RANGE(0x00500000, 0x005fffff) AM_RAM AM_BASE(m_workram) |
| 1357 | 1327 | |
| 1358 | AM_RANGE(0x00800000, 0x00803fff) AM_READWRITE | |
| 1328 | AM_RANGE(0x00800000, 0x00803fff) AM_READWRITE | |
| 1359 | 1329 | //AM_RANGE(0x00800010, 0x00800013) AM_WRITENOP |
| 1360 | 1330 | //AM_RANGE(0x008000b0, 0x008000b3) AM_WRITENOP |
| 1361 | 1331 | //AM_RANGE(0x00804004, 0x0080400f) AM_WRITENOP // quiet psikyo games |
| 1362 | 1332 | |
| 1363 | //AM_RANGE(0x00880000, 0x00883fff) AM_WRITE | |
| 1333 | //AM_RANGE(0x00880000, 0x00883fff) AM_WRITE | |
| 1364 | 1334 | |
| 1365 | 1335 | AM_RANGE(0x00900000, 0x0097ffff) AM_RAM AM_BASE(m_bufferram) |
| 1366 | 1336 | |
| 1367 | 1337 | |
| 1368 | AM_RANGE(0x00980004, 0x00980007) AM_READ_LEGACY(fifoctl_r) | |
| 1369 | AM_RANGE(0x0098000c, 0x0098000f) AM_READ_LEGACY(videoctl_r) | |
| 1338 | AM_RANGE(0x00980004, 0x00980007) AM_READ(fifoctl_r) | |
| 1339 | AM_RANGE(0x0098000c, 0x0098000f) AM_READ(videoctl_r) | |
| 1370 | 1340 | |
| 1371 | AM_RANGE(0x00e80000, 0x00e80007) AM_READWRITE | |
| 1341 | AM_RANGE(0x00e80000, 0x00e80007) AM_READWRITE | |
| 1372 | 1342 | |
| 1373 | AM_RANGE(0x00f00000, 0x00f0000f) AM_READWRITE | |
| 1343 | AM_RANGE(0x00f00000, 0x00f0000f) AM_READWRITE | |
| 1374 | 1344 | |
| 1375 | 1345 | AM_RANGE(0x01000000, 0x0100ffff) AM_DEVREADWRITE("tile", segas24_tile, tile32_r, tile32_w) AM_MIRROR(0x110000) |
| 1376 | 1346 | AM_RANGE(0x01020000, 0x01020003) AM_WRITENOP AM_MIRROR(0x100000) // Unknown, always 0 |
| r14896 | r14897 | |
| 1379 | 1349 | AM_RANGE(0x01070000, 0x01070003) AM_WRITENOP AM_MIRROR(0x100000) // Video synchronization switch |
| 1380 | 1350 | AM_RANGE(0x01080000, 0x010fffff) AM_DEVREADWRITE("tile", segas24_tile, char32_r, char32_w) AM_MIRROR(0x100000) |
| 1381 | 1351 | |
| 1382 | AM_RANGE(0x01800000, 0x01803fff) AM_RAM_WRITE | |
| 1352 | AM_RANGE(0x01800000, 0x01803fff) AM_RAM_WRITE | |
| 1383 | 1353 | AM_RANGE(0x01810000, 0x0181bfff) AM_RAM AM_BASE(m_colorxlat) |
| 1384 | AM_RANGE(0x0181c000, 0x0181c003) AM_WRITE_LEGACY(model2_3d_zclip_w) | |
| 1385 | AM_RANGE(0x01a10000, 0x01a1ffff) AM_READWRITE_LEGACY(network_r, network_w) | |
| 1354 | AM_RANGE(0x0181c000, 0x0181c003) AM_WRITE(model2_3d_zclip_w) | |
| 1355 | AM_RANGE(0x01a10000, 0x01a1ffff) AM_READWRITE(network_r, network_w) | |
| 1386 | 1356 | AM_RANGE(0x01d00000, 0x01d03fff) AM_RAM AM_SHARE("backup1") // Backup sram |
| 1387 | 1357 | AM_RANGE(0x02000000, 0x03ffffff) AM_ROM AM_REGION("user1", 0) |
| 1388 | 1358 | |
| 1389 | 1359 | // "extra" data |
| 1390 | 1360 | AM_RANGE(0x06000000, 0x06ffffff) AM_ROM AM_REGION("user1", 0x1000000) |
| 1391 | 1361 | |
| 1392 | AM_RANGE(0x10000000, 0x101fffff) AM_WRITE | |
| 1362 | AM_RANGE(0x10000000, 0x101fffff) AM_WRITE | |
| 1393 | 1363 | |
| 1394 | 1364 | AM_RANGE(0x11600000, 0x1167ffff) AM_RAM AM_SHARE("share1") // framebuffer (last bronx) |
| 1395 | 1365 | AM_RANGE(0x11680000, 0x116fffff) AM_RAM AM_SHARE("share1") // FB mirror |
| r14896 | r14897 | |
| 1400 | 1370 | AM_RANGE(0x00200000, 0x0021ffff) AM_RAM |
| 1401 | 1371 | AM_RANGE(0x00220000, 0x0023ffff) AM_ROM AM_REGION("maincpu", 0x20000) |
| 1402 | 1372 | |
| 1403 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE | |
| 1373 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE | |
| 1404 | 1374 | |
| 1405 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE_LEGACY(geo_prg_r, geo_prg_w) | |
| 1406 | AM_RANGE(0x00880000, 0x00883fff) AM_WRITE_LEGACY(copro_function_port_w) | |
| 1407 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE_LEGACY(copro_fifo_r, copro_fifo_w) | |
| 1375 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w) | |
| 1376 | AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_function_port_w) | |
| 1377 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_fifo_r, copro_fifo_w) | |
| 1408 | 1378 | |
| 1409 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE_LEGACY(copro_ctl1_w ) | |
| 1410 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE_LEGACY(geo_ctl1_w ) | |
| 1411 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE_LEGACY(model2_serial_r, model2o_serial_w ) | |
| 1379 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE(copro_ctl1_w ) | |
| 1380 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w ) | |
| 1381 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE(model2_serial_r, model2o_serial_w ) | |
| 1412 | 1382 | |
| 1413 | AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE_LEGACY(model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(m_textureram0) // texture RAM 0 | |
| 1414 | AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE_LEGACY(model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(m_textureram1) // texture RAM 1 | |
| 1415 | AM_RANGE(0x12800000, 0x1281ffff) AM_RAM_WRITE_LEGACY(model2o_luma_w) AM_BASE(m_lumaram) // polygon "luma" RAM | |
| 1383 | AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE(model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(m_textureram0) // texture RAM 0 | |
| 1384 | AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE(model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(m_textureram1) // texture RAM 1 | |
| 1385 | AM_RANGE(0x12800000, 0x1281ffff) AM_RAM_WRITE(model2o_luma_w) AM_BASE(m_lumaram) // polygon "luma" RAM | |
| 1416 | 1386 | |
| 1417 | 1387 | AM_RANGE(0x01c00000, 0x01c00003) AM_READ_PORT("1c00000") |
| 1418 | 1388 | AM_RANGE(0x01c00004, 0x01c00007) AM_READ_PORT("1c00004") |
| 1419 | 1389 | AM_RANGE(0x01c00010, 0x01c00013) AM_READ_PORT("1c00010") |
| 1420 | 1390 | AM_RANGE(0x01c00014, 0x01c00017) AM_READ_PORT("1c00014") |
| 1421 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_LEGACY(desert_unk_r ) | |
| 1422 | AM_RANGE(0x01c00040, 0x01c00043) AM_READ_LEGACY(daytona_unk_r ) | |
| 1391 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ(desert_unk_r ) | |
| 1392 | AM_RANGE(0x01c00040, 0x01c00043) AM_READ(daytona_unk_r ) | |
| 1423 | 1393 | AM_RANGE(0x01c00200, 0x01c002ff) AM_RAM AM_SHARE("backup2") |
| 1424 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE | |
| 1394 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE | |
| 1425 | 1395 | |
| 1426 | 1396 | AM_IMPORT_FROM(model2_base_mem) |
| 1427 | 1397 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1430 | 1400 | static ADDRESS_MAP_START( model2a_crx_mem, AS_PROGRAM, 32, model2_state ) |
| 1431 | 1401 | AM_RANGE(0x00200000, 0x0023ffff) AM_RAM |
| 1432 | 1402 | |
| 1433 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE | |
| 1403 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE | |
| 1434 | 1404 | |
| 1435 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE_LEGACY(geo_prg_r, geo_prg_w) | |
| 1436 | AM_RANGE(0x00880000, 0x00883fff) AM_WRITE_LEGACY(copro_function_port_w) | |
| 1437 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE_LEGACY(copro_fifo_r, copro_fifo_w) | |
| 1405 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w) | |
| 1406 | AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_function_port_w) | |
| 1407 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_fifo_r, copro_fifo_w) | |
| 1438 | 1408 | |
| 1439 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE_LEGACY(copro_ctl1_w ) | |
| 1440 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE_LEGACY(geo_ctl1_w ) | |
| 1441 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE_LEGACY(model2_serial_r, model2_serial_w ) | |
| 1409 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE(copro_ctl1_w ) | |
| 1410 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w ) | |
| 1411 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE(model2_serial_r, model2_serial_w ) | |
| 1442 | 1412 | |
| 1443 | AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE_LEGACY(model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(m_textureram0) // texture RAM 0 | |
| 1444 | AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE_LEGACY(model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(m_textureram1) // texture RAM 1 | |
| 1445 | AM_RANGE(0x12800000, 0x1281ffff) AM_RAM_WRITE_LEGACY(model2o_luma_w) AM_BASE(m_lumaram) // polygon "luma" RAM | |
| 1413 | AM_RANGE(0x12000000, 0x121fffff) AM_RAM_WRITE(model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(m_textureram0) // texture RAM 0 | |
| 1414 | AM_RANGE(0x12400000, 0x125fffff) AM_RAM_WRITE(model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(m_textureram1) // texture RAM 1 | |
| 1415 | AM_RANGE(0x12800000, 0x1281ffff) AM_RAM_WRITE(model2o_luma_w) AM_BASE(m_lumaram) // polygon "luma" RAM | |
| 1446 | 1416 | |
| 1447 | AM_RANGE(0x01c00000, 0x01c00003) AM_READ_PORT("1c00000") AM_WRITE | |
| 1417 | AM_RANGE(0x01c00000, 0x01c00003) AM_READ_PORT("1c00000") AM_WRITE | |
| 1448 | 1418 | AM_RANGE(0x01c00004, 0x01c00007) AM_READ_PORT("1c00004") |
| 1449 | 1419 | AM_RANGE(0x01c00010, 0x01c00013) AM_READ_PORT("1c00010") |
| 1450 | 1420 | AM_RANGE(0x01c00014, 0x01c00017) AM_READ_PORT("1c00014") |
| 1451 | AM_RANGE(0x01c00018, 0x01c0001b) AM_READ_LEGACY(hotd_unk_r ) | |
| 1452 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_PORT("1c0001c") AM_WRITE_LEGACY(analog_2b_w ) | |
| 1453 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE_LEGACY(model2_serial_r, model2_serial_w ) | |
| 1421 | AM_RANGE(0x01c00018, 0x01c0001b) AM_READ(hotd_unk_r ) | |
| 1422 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_PORT("1c0001c") AM_WRITE(analog_2b_w ) | |
| 1423 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2_serial_w ) | |
| 1454 | 1424 | |
| 1455 | 1425 | AM_IMPORT_FROM(model2_base_mem) |
| 1456 | 1426 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1459 | 1429 | static ADDRESS_MAP_START( model2b_crx_mem, AS_PROGRAM, 32, model2_state ) |
| 1460 | 1430 | AM_RANGE(0x00200000, 0x0023ffff) AM_RAM |
| 1461 | 1431 | |
| 1462 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE_LEGACY(geo_prg_r, geo_prg_w) | |
| 1463 | //AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE_LEGACY(geo_sharc_fifo_r, geo_sharc_fifo_w) | |
| 1464 | //AM_RANGE(0x00840000, 0x00840fff) AM_WRITE_LEGACY(geo_sharc_iop_w) | |
| 1432 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w) | |
| 1433 | //AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_sharc_fifo_r, geo_sharc_fifo_w) | |
| 1434 | //AM_RANGE(0x00840000, 0x00840fff) AM_WRITE(geo_sharc_iop_w) | |
| 1465 | 1435 | |
| 1466 | AM_RANGE(0x00880000, 0x00883fff) AM_WRITE_LEGACY(copro_function_port_w) | |
| 1467 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE_LEGACY(copro_fifo_r, copro_fifo_w) | |
| 1468 | AM_RANGE(0x008c0000, 0x008c0fff) AM_WRITE_LEGACY(copro_sharc_iop_w) | |
| 1436 | AM_RANGE(0x00880000, 0x00883fff) AM_WRITE(copro_function_port_w) | |
| 1437 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_fifo_r, copro_fifo_w) | |
| 1438 | AM_RANGE(0x008c0000, 0x008c0fff) AM_WRITE(copro_sharc_iop_w) | |
| 1469 | 1439 | |
| 1470 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE | |
| 1440 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE | |
| 1471 | 1441 | |
| 1472 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE_LEGACY(geo_ctl1_w ) | |
| 1473 | //AM_RANGE(0x00980008, 0x0098000b) AM_WRITE_LEGACY(geo_sharc_ctl1_w ) | |
| 1442 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w ) | |
| 1443 | //AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_sharc_ctl1_w ) | |
| 1474 | 1444 | |
| 1475 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE | |
| 1445 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE | |
| 1476 | 1446 | |
| 1477 | 1447 | AM_RANGE(0x11000000, 0x111fffff) AM_RAM AM_BASE(m_textureram0) // texture RAM 0 (2b/2c) |
| 1478 | 1448 | AM_RANGE(0x11200000, 0x113fffff) AM_RAM AM_BASE(m_textureram1) // texture RAM 1 (2b/2c) |
| 1479 | 1449 | AM_RANGE(0x11400000, 0x1140ffff) AM_RAM AM_BASE(m_lumaram) // polygon "luma" RAM (2b/2c) |
| 1480 | 1450 | |
| 1481 | 1451 | |
| 1482 | AM_RANGE(0x01c00000, 0x01c00003) AM_READ_PORT("1c00000") AM_WRITE | |
| 1452 | AM_RANGE(0x01c00000, 0x01c00003) AM_READ_PORT("1c00000") AM_WRITE | |
| 1483 | 1453 | AM_RANGE(0x01c00004, 0x01c00007) AM_READ_PORT("1c00004") |
| 1484 | 1454 | AM_RANGE(0x01c00010, 0x01c00013) AM_READ_PORT("1c00010") |
| 1485 | 1455 | AM_RANGE(0x01c00014, 0x01c00017) AM_READ_PORT("1c00014") |
| 1486 | AM_RANGE(0x01c00018, 0x01c0001b) AM_READ_LEGACY(hotd_unk_r ) | |
| 1487 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_PORT("1c0001c") AM_WRITE_LEGACY(analog_2b_w ) | |
| 1488 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE_LEGACY(model2_serial_r, model2_serial_w ) | |
| 1456 | AM_RANGE(0x01c00018, 0x01c0001b) AM_READ(hotd_unk_r ) | |
| 1457 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_PORT("1c0001c") AM_WRITE(analog_2b_w ) | |
| 1458 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2_serial_w ) | |
| 1489 | 1459 | |
| 1490 | 1460 | AM_IMPORT_FROM(model2_base_mem) |
| 1491 | 1461 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1494 | 1464 | static ADDRESS_MAP_START( model2c_crx_mem, AS_PROGRAM, 32, model2_state ) |
| 1495 | 1465 | AM_RANGE(0x00200000, 0x0023ffff) AM_RAM |
| 1496 | 1466 | |
| 1497 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE_LEGACY(geo_prg_r, geo_prg_w) | |
| 1498 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE_LEGACY(copro_prg_r, copro_prg_w) | |
| 1467 | AM_RANGE(0x00804000, 0x00807fff) AM_READWRITE(geo_prg_r, geo_prg_w) | |
| 1468 | AM_RANGE(0x00884000, 0x00887fff) AM_READWRITE(copro_prg_r, copro_prg_w) | |
| 1499 | 1469 | |
| 1500 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE_LEGACY(copro_ctl1_w ) | |
| 1501 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE_LEGACY(geo_ctl1_w ) | |
| 1502 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE_LEGACY(model2_serial_r, model2_serial_w ) | |
| 1470 | AM_RANGE(0x00980000, 0x00980003) AM_WRITE(copro_ctl1_w ) | |
| 1471 | AM_RANGE(0x00980008, 0x0098000b) AM_WRITE(geo_ctl1_w ) | |
| 1472 | AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE(model2_serial_r, model2_serial_w ) | |
| 1503 | 1473 | |
| 1504 | 1474 | AM_RANGE(0x11000000, 0x111fffff) AM_RAM AM_BASE(m_textureram0) // texture RAM 0 (2b/2c) |
| 1505 | 1475 | AM_RANGE(0x11200000, 0x113fffff) AM_RAM AM_BASE(m_textureram1) // texture RAM 1 (2b/2c) |
| 1506 | 1476 | AM_RANGE(0x11400000, 0x1140ffff) AM_RAM AM_BASE(m_lumaram) // polygon "luma" RAM (2b/2c) |
| 1507 | 1477 | |
| 1508 | AM_RANGE(0x01c00000, 0x01c00003) AM_READ_PORT("1c00000") AM_WRITE | |
| 1478 | AM_RANGE(0x01c00000, 0x01c00003) AM_READ_PORT("1c00000") AM_WRITE | |
| 1509 | 1479 | AM_RANGE(0x01c00004, 0x01c00007) AM_READ_PORT("1c00004") |
| 1510 | 1480 | AM_RANGE(0x01c00010, 0x01c00013) AM_READ_PORT("1c00010") |
| 1511 | 1481 | AM_RANGE(0x01c00014, 0x01c00017) AM_READ_PORT("1c00014") |
| 1512 | AM_RANGE(0x01c00018, 0x01c0001b) AM_READ_LEGACY(hotd_unk_r ) | |
| 1513 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_PORT("1c0001c") AM_WRITE_LEGACY(analog_2b_w ) | |
| 1514 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE_LEGACY(model2_serial_r, model2_serial_w ) | |
| 1482 | AM_RANGE(0x01c00018, 0x01c0001b) AM_READ(hotd_unk_r ) | |
| 1483 | AM_RANGE(0x01c0001c, 0x01c0001f) AM_READ_PORT("1c0001c") AM_WRITE(analog_2b_w ) | |
| 1484 | AM_RANGE(0x01c80000, 0x01c80003) AM_READWRITE(model2_serial_r, model2_serial_w ) | |
| 1515 | 1485 | |
| 1516 | 1486 | AM_IMPORT_FROM(model2_base_mem) |
| 1517 | 1487 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1832 | 1802 | |
| 1833 | 1803 | /* Model 1 sound board emulation */ |
| 1834 | 1804 | |
| 1835 | ||
| 1805 | ||
| 1836 | 1806 | { |
| 1837 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1838 | return state->m_to_68k; | |
| 1807 | return m_to_68k; | |
| 1839 | 1808 | } |
| 1840 | 1809 | |
| 1841 | ||
| 1810 | ||
| 1842 | 1811 | { |
| 1843 | 1812 | return 1; |
| 1844 | 1813 | } |
| r14896 | r14897 | |
| 1848 | 1817 | multipcm_set_bank(device, 0x100000 * (data & 0xf), 0x100000 * (data & 0xf)); |
| 1849 | 1818 | } |
| 1850 | 1819 | |
| 1851 | ||
| 1820 | ||
| 1852 | 1821 | { |
| 1853 | 1822 | } |
| 1854 | 1823 | |
| 1855 | ||
| 1824 | ||
| 1856 | 1825 | { |
| 1857 | 1826 | } |
| 1858 | 1827 | |
| 1859 | 1828 | static ADDRESS_MAP_START( model1_snd, AS_PROGRAM, 16, model2_state ) |
| 1860 | 1829 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1861 | 1830 | AM_RANGE(0x080000, 0x0bffff) AM_ROM AM_REGION("audiocpu", 0x20000) // mirror of second program ROM |
| 1862 | AM_RANGE(0xc20000, 0xc20001) AM_READWRITE_LEGACY(m1_snd_68k_latch_r, m1_snd_68k_latch1_w ) | |
| 1863 | AM_RANGE(0xc20002, 0xc20003) AM_READWRITE_LEGACY(m1_snd_v60_ready_r, m1_snd_68k_latch2_w ) | |
| 1831 | AM_RANGE(0xc20000, 0xc20001) AM_READWRITE(m1_snd_68k_latch_r, m1_snd_68k_latch1_w ) | |
| 1832 | AM_RANGE(0xc20002, 0xc20003) AM_READWRITE(m1_snd_v60_ready_r, m1_snd_68k_latch2_w ) | |
| 1864 | 1833 | AM_RANGE(0xc40000, 0xc40007) AM_DEVREADWRITE8_LEGACY("sega1", multipcm_r, multipcm_w, 0x00ff ) |
| 1865 | 1834 | AM_RANGE(0xc40012, 0xc40013) AM_WRITENOP |
| 1866 | 1835 | AM_RANGE(0xc50000, 0xc50001) AM_DEVWRITE_LEGACY("sega1", m1_snd_mpcm_bnk_w ) |
| r14896 | r14897 | |
| 1872 | 1841 | |
| 1873 | 1842 | /* Model 2 sound board emulation */ |
| 1874 | 1843 | |
| 1875 | ||
| 1844 | ||
| 1876 | 1845 | { |
| 1877 | 1846 | // handle sample banking |
| 1878 | if ( | |
| 1847 | if ( | |
| 1879 | 1848 | { |
| 1880 | UINT8 *snd = | |
| 1849 | UINT8 *snd = | |
| 1881 | 1850 | if (data & 0x20) |
| 1882 | 1851 | { |
| 1883 | memory_set_bankptr(space->machine(), "bank4", snd + 0x200000); | |
| 1884 | memory_set_bankptr(space->machine(), "bank5", snd + 0x600000); | |
| 1852 | memory_set_bankptr(machine(), "bank4", snd + 0x200000); | |
| 1853 | memory_set_bankptr(machine(), "bank5", snd + 0x600000); | |
| 1885 | 1854 | } |
| 1886 | 1855 | else |
| 1887 | 1856 | { |
| 1888 | memory_set_bankptr(space->machine(), "bank4", snd + 0x800000); | |
| 1889 | memory_set_bankptr(space->machine(), "bank5", snd + 0xa00000); | |
| 1857 | memory_set_bankptr(machine(), "bank4", snd + 0x800000); | |
| 1858 | memory_set_bankptr(machine(), "bank5", snd + 0xa00000); | |
| 1890 | 1859 | } |
| 1891 | 1860 | } |
| 1892 | 1861 | } |
| r14896 | r14897 | |
| 1894 | 1863 | static ADDRESS_MAP_START( model2_snd, AS_PROGRAM, 16, model2_state ) |
| 1895 | 1864 | AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_REGION("audiocpu", 0) AM_BASE(m_soundram) |
| 1896 | 1865 | AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("scsp", scsp_r, scsp_w) |
| 1897 | AM_RANGE(0x400000, 0x400001) AM_WRITE | |
| 1866 | AM_RANGE(0x400000, 0x400001) AM_WRITE | |
| 1898 | 1867 | AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION("audiocpu", 0x80000) |
| 1899 | 1868 | AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION("scsp", 0) |
| 1900 | 1869 | AM_RANGE(0xa00000, 0xdfffff) AM_ROMBANK("bank4") |
| r14896 | r14897 | |
| 1926 | 1895 | /*****************************************************************************/ |
| 1927 | 1896 | // SHARC memory maps |
| 1928 | 1897 | |
| 1929 | ||
| 1898 | ||
| 1930 | 1899 | { |
| 1931 | 1900 | UINT32 result = 0; |
| 1932 | //mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(&space | |
| 1901 | //mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(&space. | |
| 1933 | 1902 | |
| 1934 | copro_fifoin_pop( | |
| 1903 | copro_fifoin_pop( | |
| 1935 | 1904 | return result; |
| 1936 | 1905 | } |
| 1937 | 1906 | |
| 1938 | ||
| 1907 | ||
| 1939 | 1908 | { |
| 1940 | 1909 | //mame_printf_debug("SHARC FIFOOUT push %08X\n", data); |
| 1941 | copro_fifoout_push( | |
| 1910 | copro_fifoout_push( | |
| 1942 | 1911 | } |
| 1943 | 1912 | |
| 1944 | ||
| 1913 | ||
| 1945 | 1914 | { |
| 1946 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1947 | return state->m_bufferram[offset & 0x7fff]; | |
| 1915 | return m_bufferram[offset & 0x7fff]; | |
| 1948 | 1916 | } |
| 1949 | 1917 | |
| 1950 | ||
| 1918 | ||
| 1951 | 1919 | { |
| 1952 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1953 | //mame_printf_debug("sharc_buffer_w: %08X at %08X, %08X, %f\n", offset, cpu_get_pc(&space->device()), data, *(float*)&data); | |
| 1954 | state->m_bufferram[offset & 0x7fff] = data; | |
| 1920 | //mame_printf_debug("sharc_buffer_w: %08X at %08X, %08X, %f\n", offset, cpu_get_pc(&space.device()), data, *(float*)&data); | |
| 1921 | m_bufferram[offset & 0x7fff] = data; | |
| 1955 | 1922 | } |
| 1956 | 1923 | |
| 1957 | 1924 | static ADDRESS_MAP_START( copro_sharc_map, AS_DATA, 32, model2_state ) |
| 1958 | AM_RANGE(0x0400000, 0x0bfffff) AM_READ_LEGACY(copro_sharc_input_fifo_r) | |
| 1959 | AM_RANGE(0x0c00000, 0x13fffff) AM_WRITE_LEGACY(copro_sharc_output_fifo_w) | |
| 1960 | AM_RANGE(0x1400000, 0x1bfffff) AM_READWRITE_LEGACY(copro_sharc_buffer_r, copro_sharc_buffer_w) | |
| 1925 | AM_RANGE(0x0400000, 0x0bfffff) AM_READ(copro_sharc_input_fifo_r) | |
| 1926 | AM_RANGE(0x0c00000, 0x13fffff) AM_WRITE(copro_sharc_output_fifo_w) | |
| 1927 | AM_RANGE(0x1400000, 0x1bfffff) AM_READWRITE(copro_sharc_buffer_r, copro_sharc_buffer_w) | |
| 1961 | 1928 | AM_RANGE(0x1c00000, 0x1dfffff) AM_ROM AM_REGION("user5", 0) |
| 1962 | 1929 | ADDRESS_MAP_END |
| 1963 | 1930 | |
| r14896 | r14897 | |
| 1969 | 1936 | /*****************************************************************************/ |
| 1970 | 1937 | /* TGP memory maps */ |
| 1971 | 1938 | |
| 1972 | ||
| 1939 | ||
| 1973 | 1940 | { |
| 1974 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1975 | return state->m_bufferram[offset & 0x7fff]; | |
| 1941 | return m_bufferram[offset & 0x7fff]; | |
| 1976 | 1942 | } |
| 1977 | 1943 | |
| 1978 | ||
| 1944 | ||
| 1979 | 1945 | { |
| 1980 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 1981 | state->m_bufferram[offset&0x7fff] = data; | |
| 1946 | m_bufferram[offset&0x7fff] = data; | |
| 1982 | 1947 | } |
| 1983 | 1948 | |
| 1984 | 1949 | static ADDRESS_MAP_START( copro_tgp_map, AS_PROGRAM, 32, model2_state ) |
| 1985 | 1950 | AM_RANGE(0x00000000, 0x00007fff) AM_RAM AM_BASE(m_tgp_program) |
| 1986 | AM_RANGE(0x00400000, 0x00407fff) AM_READWRITE | |
| 1951 | AM_RANGE(0x00400000, 0x00407fff) AM_READWRITE | |
| 1987 | 1952 | AM_RANGE(0xff800000, 0xff9fffff) AM_ROM AM_REGION("tgp", 0) |
| 1988 | 1953 | ADDRESS_MAP_END |
| 1989 | 1954 | |
| r14896 | r14897 | |
| 2108 | 2073 | MCFG_SOUND_ROUTE(0, "rspeaker", 2.0) |
| 2109 | 2074 | MACHINE_CONFIG_END |
| 2110 | 2075 | |
| 2111 | ||
| 2076 | ||
| 2112 | 2077 | { |
| 2113 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 2114 | return state->m_driveio_comm_data; | |
| 2078 | return m_driveio_comm_data; | |
| 2115 | 2079 | } |
| 2116 | 2080 | |
| 2117 | ||
| 2081 | ||
| 2118 | 2082 | { |
| 2119 | 2083 | // TODO: hook up to the main CPU |
| 2120 | 2084 | // popmessage("%02x",data); |
| 2121 | 2085 | } |
| 2122 | 2086 | |
| 2123 | ||
| 2087 | ||
| 2124 | 2088 | { |
| 2125 | 2089 | static const char sega_str[4] = { 'S', 'E', 'G', 'A' }; |
| 2126 | 2090 | |
| r14896 | r14897 | |
| 2135 | 2099 | static ADDRESS_MAP_START( drive_io_map, AS_IO, 8, model2_state ) |
| 2136 | 2100 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2137 | 2101 | AM_RANGE(0x00, 0x00) AM_WRITENOP //watchdog |
| 2138 | AM_RANGE(0x23, 0x23) AM_WRITE_LEGACY(driveio_port_w) | |
| 2139 | AM_RANGE(0x26, 0x27) AM_READ_LEGACY(driveio_port_r) | |
| 2140 | AM_RANGE(0x28, 0x2b) AM_READ_LEGACY(driveio_port_str_r) | |
| 2102 | AM_RANGE(0x23, 0x23) AM_WRITE(driveio_port_w) | |
| 2103 | AM_RANGE(0x26, 0x27) AM_READ(driveio_port_r) | |
| 2104 | AM_RANGE(0x28, 0x2b) AM_READ(driveio_port_str_r) | |
| 2141 | 2105 | AM_RANGE(0x40, 0x4f) AM_WRITENOP //Oki M6253 |
| 2142 | 2106 | AM_RANGE(0x80, 0x83) AM_NOP //r/w it during irq |
| 2143 | 2107 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 5146 | 5110 | static DRIVER_INIT( genprot ) |
| 5147 | 5111 | { |
| 5148 | 5112 | model2_state *state = machine.driver_data<model2_state>(); |
| 5149 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5113 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5150 | 5114 | state->m_protstate = state->m_protpos = 0; |
| 5151 | 5115 | } |
| 5152 | 5116 | |
| r14896 | r14897 | |
| 5155 | 5119 | model2_state *state = machine.driver_data<model2_state>(); |
| 5156 | 5120 | UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base(); |
| 5157 | 5121 | |
| 5158 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5122 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5159 | 5123 | state->m_protstate = state->m_protpos = 0; |
| 5160 | 5124 | |
| 5161 | 5125 | // fix bug in program: it destroys the interrupt table and never fixes it |
| r14896 | r14897 | |
| 5167 | 5131 | model2_state *state = machine.driver_data<model2_state>(); |
| 5168 | 5132 | UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base(); |
| 5169 | 5133 | |
| 5170 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5134 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5171 | 5135 | state->m_protstate = state->m_protpos = 0; |
| 5172 | 5136 | |
| 5173 | 5137 | // fix bug in program: it destroys the interrupt table and never fixes it |
| r14896 | r14897 | |
| 5176 | 5140 | |
| 5177 | 5141 | static DRIVER_INIT( daytonam ) |
| 5178 | 5142 | { |
| 5179 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x240000, 0x24ffff, FUNC(maxx_r) ); | |
| 5143 | model2_state *state = machine.driver_data<model2_state>(); | |
| 5144 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x240000, 0x24ffff, read32_delegate(FUNC(model2_state::maxx_r),state)); | |
| 5180 | 5145 | } |
| 5181 | 5146 | |
| 5182 | 5147 | /* very crude support for let the game set itself into stand-alone mode */ |
| 5183 | 5148 | |
| 5184 | ||
| 5149 | ||
| 5185 | 5150 | { |
| 5186 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 5187 | 5151 | if(offset == 0x4000/4) |
| 5188 | 5152 | { |
| 5189 | if(state->m_netram[offset] == 0x00000000) | |
| 5190 | state->m_jnet_time_out = 0; | |
| 5153 | if(m_netram[offset] == 0x00000000) | |
| 5154 | m_jnet_time_out = 0; | |
| 5191 | 5155 | |
| 5192 | if((state->m_netram[offset] & 0xffff) == 0x0001) | |
| 5193 | state->m_jnet_time_out++; | |
| 5156 | if((m_netram[offset] & 0xffff) == 0x0001) | |
| 5157 | m_jnet_time_out++; | |
| 5194 | 5158 | |
| 5195 | if(state->m_jnet_time_out > 0x80) | |
| 5196 | state->m_netram[offset]|= 0x00800000; | |
| 5159 | if(m_jnet_time_out > 0x80) | |
| 5160 | m_netram[offset]|= 0x00800000; | |
| 5197 | 5161 | |
| 5198 | return | |
| 5162 | return | |
| 5199 | 5163 | } |
| 5200 | 5164 | |
| 5201 | return | |
| 5165 | return | |
| 5202 | 5166 | } |
| 5203 | 5167 | |
| 5204 | ||
| 5168 | ||
| 5205 | 5169 | { |
| 5206 | model2_state *state = space->machine().driver_data<model2_state>(); | |
| 5207 | COMBINE_DATA(&state->m_netram[offset]); | |
| 5170 | COMBINE_DATA(&m_netram[offset]); | |
| 5208 | 5171 | } |
| 5209 | 5172 | |
| 5210 | 5173 | static DRIVER_INIT( sgt24h ) |
| r14896 | r14897 | |
| 5212 | 5175 | model2_state *state = machine.driver_data<model2_state>(); |
| 5213 | 5176 | UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base(); |
| 5214 | 5177 | |
| 5215 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w)); | |
| 5216 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01a10000, 0x01a1ffff, FUNC(jaleco_network_r), FUNC(jaleco_network_w)); | |
| 5178 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),state), write32_delegate(FUNC(model2_state::model2_prot_w),state)); | |
| 5179 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),state), write32_delegate(FUNC(model2_state::jaleco_network_w),state)); | |
| 5217 | 5180 | |
| 5218 | 5181 | state->m_protstate = state->m_protpos = 0; |
| 5219 | 5182 | |
| r14896 | r14897 | |
| 5223 | 5186 | |
| 5224 | 5187 | static DRIVER_INIT( overrev ) |
| 5225 | 5188 | { |
| 5226 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01a10000, 0x01a1ffff, FUNC(jaleco_network_r), FUNC(jaleco_network_w)); | |
| 5189 | model2_state *state = machine.driver_data<model2_state>(); | |
| 5190 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),state), write32_delegate(FUNC(model2_state::jaleco_network_w),state)); | |
| 5227 | 5191 | |
| 5228 | 5192 | //TODO: cache patch? |
| 5229 | 5193 | } |
| r14896 | r14897 | |
| 5234 | 5198 | model2_state *state = machine.driver_data<model2_state>(); |
| 5235 | 5199 | UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base(); |
| 5236 | 5200 | |
| 5237 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5201 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5238 | 5202 | state->m_protstate = state->m_protpos = 0; |
| 5239 | 5203 | |
| 5240 | 5204 | ROM[0x630/4] = 0x08000004; |
| r14896 | r14897 | |
| 5243 | 5207 | |
| 5244 | 5208 | static DRIVER_INIT( rchase2 ) |
| 5245 | 5209 | { |
| 5246 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c00008, 0x01c0000b, FUNC(rchase2_devices_w)); | |
| 5210 | model2_state *state = machine.driver_data<model2_state>(); | |
| 5211 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x01c00008, 0x01c0000b, write32_delegate(FUNC(model2_state::rchase2_devices_w),state)); | |
| 5247 | 5212 | } |
| 5248 | 5213 | |
| 5249 | 5214 | static DRIVER_INIT( srallyc ) |
| 5250 | 5215 | { |
| 5251 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c00008, 0x01c0000b, FUNC(srallyc_devices_w)); | |
| 5216 | model2_state *state = machine.driver_data<model2_state>(); | |
| 5217 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x01c00008, 0x01c0000b, write32_delegate(FUNC(model2_state::srallyc_devices_w),state)); | |
| 5252 | 5218 | } |
| 5253 | 5219 | |
| 5254 | 5220 |
| r14896 | r14897 | |
|---|---|---|
| 163 | 163 | { |
| 164 | 164 | public: |
| 165 | 165 | supershot_state(const machine_config &mconfig, device_type type, const char *tag) |
| 166 | : driver_device(mconfig, type, tag) { } | |
| 166 | : driver_device(mconfig, type, tag) , | |
| 167 | m_videoram(*this, "videoram"){ } | |
| 167 | 168 | |
| 168 | UINT8 | |
| 169 | required_shared_ptr<UINT8> | |
| 169 | 170 | tilemap_t *m_tilemap; |
| 170 | 171 | DECLARE_WRITE8_MEMBER(supershot_vidram_w); |
| 171 | 172 | DECLARE_WRITE8_MEMBER(supershot_output0_w); |
| r14896 | r14897 | |
| 182 | 183 | { |
| 183 | 184 | supershot_state *state = machine.driver_data<supershot_state>(); |
| 184 | 185 | |
| 185 | UINT8 code = state->m_videoram[tile_index]; | |
| 186 | UINT8 code = state->m_videoram.target()[tile_index]; | |
| 186 | 187 | SET_TILE_INFO(0, code, 0, 0); |
| 187 | 188 | } |
| 188 | 189 | |
| r14896 | r14897 | |
| 202 | 203 | WRITE8_MEMBER(supershot_state::supershot_vidram_w) |
| 203 | 204 | { |
| 204 | 205 | |
| 205 | m_videoram[offset] = data; | |
| 206 | m_videoram.target()[offset] = data; | |
| 206 | 207 | m_tilemap->mark_tile_dirty(offset); |
| 207 | 208 | } |
| 208 | 209 |
| r14896 | r14897 | |
|---|---|---|
| 395 | 395 | { |
| 396 | 396 | popeye_state *state = device->machine().driver_data<popeye_state>(); |
| 397 | 397 | /* bit 0 flips screen */ |
| 398 | flip_screen_set( | |
| 398 | state->flip_screen_set( | |
| 399 | 399 | |
| 400 | 400 | /* bits 1-3 select DSW1 bit to read */ |
| 401 | 401 | state->m_dswbit = (data & 0x0e) >> 1; |
| r14896 | r14897 | |
|---|---|---|
| 132 | 132 | : driver_device(mconfig, type, tag), |
| 133 | 133 | m_maincpu(*this, "maincpu"), |
| 134 | 134 | m_oki_1(*this, "oki1"), |
| 135 | m_oki_2(*this, "oki2") { } | |
| 135 | m_oki_2(*this, "oki2") , | |
| 136 | m_workram(*this, "workram"), | |
| 137 | m_vram(*this, "vram"), | |
| 138 | m_paletteram(*this, "paletteram"){ } | |
| 136 | 139 | |
| 140 | /* devices */ | |
| 141 | required_device<e132xt_device> m_maincpu; | |
| 142 | required_device<okim6295_device> m_oki_1; | |
| 143 | required_device<okim6295_device> m_oki_2; | |
| 144 | ||
| 137 | 145 | /* memory pointers */ |
| 138 | UINT32 * m_vram; | |
| 139 | UINT32 * m_workram; | |
| 140 | UINT32 * m_paletteram; | |
| 146 | required_shared_ptr<UINT32> m_workram; | |
| 147 | required_shared_ptr<UINT32> m_vram; | |
| 148 | required_shared_ptr<UINT32> m_paletteram; | |
| 141 | 149 | // UINT32 * m_nvram; // currently this uses generic nvram handling |
| 142 | 150 | |
| 143 | 151 | /* video-related */ |
| r14896 | r14897 | |
| 155 | 163 | int m_oki_bank_0; |
| 156 | 164 | int m_oki_bank_1; |
| 157 | 165 | |
| 158 | /* devices */ | |
| 159 | required_device<e132xt_device> m_maincpu; | |
| 160 | required_device<okim6295_device> m_oki_1; | |
| 161 | required_device<okim6295_device> m_oki_2; | |
| 162 | 166 | DECLARE_WRITE32_MEMBER(gstream_palette_w); |
| 163 | 167 | DECLARE_WRITE32_MEMBER(gstream_vram_w); |
| 164 | 168 | DECLARE_WRITE32_MEMBER(gstream_tilemap1_scrollx_w); |
| r14896 | r14897 | |
| 207 | 211 | |
| 208 | 212 | WRITE32_MEMBER(gstream_state::gstream_palette_w) |
| 209 | 213 | { |
| 210 | COMBINE_DATA(&m_paletteram[offset]); | |
| 214 | COMBINE_DATA(&m_paletteram.target()[offset]); | |
| 211 | 215 | |
| 212 | palette_set_color_rgb(machine(), offset * 2, pal5bit(m_paletteram[offset] >> (0 + 16)), | |
| 213 | pal5bit(m_paletteram[offset] >> (6 + 16)), | |
| 214 | pal5bit(m_paletteram[offset] >> (11 + 16))); | |
| 216 | palette_set_color_rgb(machine(), offset * 2, pal5bit(m_paletteram.target()[offset] >> (0 + 16)), | |
| 217 | pal5bit(m_paletteram.target()[offset] >> (6 + 16)), | |
| 218 | pal5bit(m_paletteram.target()[offset] >> (11 + 16))); | |
| 215 | 219 | |
| 216 | 220 | |
| 217 | palette_set_color_rgb(machine(),offset * 2 + 1,pal5bit(m_paletteram[offset] >> (0)), | |
| 218 | pal5bit(m_paletteram[offset] >> (6)), | |
| 219 | pal5bit(m_paletteram[offset] >> (11))); | |
| 221 | palette_set_color_rgb(machine(),offset * 2 + 1,pal5bit(m_paletteram.target()[offset] >> (0)), | |
| 222 | pal5bit(m_paletteram.target()[offset] >> (6)), | |
| 223 | pal5bit(m_paletteram.target()[offset] >> (11))); | |
| 220 | 224 | } |
| 221 | 225 | |
| 222 | 226 | WRITE32_MEMBER(gstream_state::gstream_vram_w) |
| 223 | 227 | { |
| 224 | COMBINE_DATA(&m_vram[offset]); | |
| 228 | COMBINE_DATA(&m_vram.target()[offset]); | |
| 225 | 229 | |
| 226 | 230 | if (ACCESSING_BITS_24_31) |
| 227 | 231 | { |
| r14896 | r14897 | |
| 271 | 275 | } |
| 272 | 276 | |
| 273 | 277 | static ADDRESS_MAP_START( gstream_32bit_map, AS_PROGRAM, 32, gstream_state ) |
| 274 | AM_RANGE(0x00000000, 0x003FFFFF) AM_RAM AM_ | |
| 278 | AM_RANGE(0x00000000, 0x003FFFFF) AM_RAM AM_ | |
| 275 | 279 | // AM_RANGE(0x40000000, 0x40FFFFFF) AM_RAM // ?? lots of data gets copied here if present, but game runs without it?? |
| 276 | AM_RANGE(0x80000000, 0x80003FFF) AM_RAM_WRITE(gstream_vram_w) AM_ | |
| 280 | AM_RANGE(0x80000000, 0x80003FFF) AM_RAM_WRITE(gstream_vram_w) AM_ | |
| 277 | 281 | AM_RANGE(0x4E000000, 0x4E1FFFFF) AM_ROM AM_REGION("user2",0) // main game rom |
| 278 | 282 | AM_RANGE(0x4F000000, 0x4F000003) AM_WRITE(gstream_tilemap3_scrollx_w) |
| 279 | 283 | AM_RANGE(0x4F200000, 0x4F200003) AM_WRITE(gstream_tilemap3_scrolly_w) |
| 280 | AM_RANGE(0x4F400000, 0x4F406FFF) AM_RAM_WRITE(gstream_palette_w) AM_ | |
| 284 | AM_RANGE(0x4F400000, 0x4F406FFF) AM_RAM_WRITE(gstream_palette_w) AM_ | |
| 281 | 285 | AM_RANGE(0x4F800000, 0x4F800003) AM_WRITE(gstream_tilemap1_scrollx_w) |
| 282 | 286 | AM_RANGE(0x4FA00000, 0x4FA00003) AM_WRITE(gstream_tilemap1_scrolly_w) |
| 283 | 287 | AM_RANGE(0x4FC00000, 0x4FC00003) AM_WRITE(gstream_tilemap2_scrollx_w) |
| r14896 | r14897 | |
| 443 | 447 | static TILE_GET_INFO( get_gs1_tile_info ) |
| 444 | 448 | { |
| 445 | 449 | gstream_state *state = machine.driver_data<gstream_state>(); |
| 446 | int tileno = (state->m_vram[tile_index + 0x000 / 4] & 0x0fff0000) >> 16; | |
| 447 | int palette = (state->m_vram[tile_index + 0x000 / 4] & 0xc0000000) >> 30; | |
| 450 | int tileno = (state->m_vram.target()[tile_index + 0x000 / 4] & 0x0fff0000) >> 16; | |
| 451 | int palette = (state->m_vram.target()[tile_index + 0x000 / 4] & 0xc0000000) >> 30; | |
| 448 | 452 | SET_TILE_INFO(0, tileno, palette + 0x10, 0); |
| 449 | 453 | } |
| 450 | 454 | |
| 451 | 455 | static TILE_GET_INFO( get_gs2_tile_info ) |
| 452 | 456 | { |
| 453 | 457 | gstream_state *state = machine.driver_data<gstream_state>(); |
| 454 | int tileno = (state->m_vram[tile_index + 0x400 / 4] & 0x0fff0000) >> 16; | |
| 455 | int palette = (state->m_vram[tile_index + 0x400 / 4] & 0xc0000000) >> 30; | |
| 458 | int tileno = (state->m_vram.target()[tile_index + 0x400 / 4] & 0x0fff0000) >> 16; | |
| 459 | int palette = (state->m_vram.target()[tile_index + 0x400 / 4] & 0xc0000000) >> 30; | |
| 456 | 460 | SET_TILE_INFO(0, tileno + 0x1000, palette + 0x14, 0); |
| 457 | 461 | } |
| 458 | 462 | |
| r14896 | r14897 | |
| 460 | 464 | static TILE_GET_INFO( get_gs3_tile_info ) |
| 461 | 465 | { |
| 462 | 466 | gstream_state *state = machine.driver_data<gstream_state>(); |
| 463 | int tileno = (state->m_vram[tile_index + 0x800 / 4] & 0x0fff0000) >> 16; | |
| 464 | int palette = (state->m_vram[tile_index + 0x800 / 4] & 0xc0000000) >> 30; | |
| 467 | int tileno = (state->m_vram.target()[tile_index + 0x800 / 4] & 0x0fff0000) >> 16; | |
| 468 | int palette = (state->m_vram.target()[tile_index + 0x800 / 4] & 0xc0000000) >> 30; | |
| 465 | 469 | SET_TILE_INFO(0, tileno + 0x2000, palette + 0x18, 0); |
| 466 | 470 | } |
| 467 | 471 | |
| r14896 | r14897 | |
| 514 | 518 | for (i = 0x0000 / 4; i < 0x4000 / 4; i += 4) |
| 515 | 519 | { |
| 516 | 520 | /* Upper bits are used by the tilemaps */ |
| 517 | int code = state->m_vram[i + 0] & 0xffff; | |
| 518 | int x = state->m_vram[i + 1] & 0xffff; | |
| 519 | int y = state->m_vram[i + 2] & 0xffff; | |
| 520 | int col = state->m_vram[i + 3] & 0x1f; | |
| 521 | int code = state->m_vram.target()[i + 0] & 0xffff; | |
| 522 | int x = state->m_vram.target()[i + 1] & 0xffff; | |
| 523 | int y = state->m_vram.target()[i + 2] & 0xffff; | |
| 524 | int col = state->m_vram.target()[i + 3] & 0x1f; | |
| 521 | 525 | |
| 522 | 526 | /* co-ordinates are signed */ |
| 523 | 527 | if (x & 0x8000) x -= 0x10000; |
| r14896 | r14897 | |
| 638 | 642 | m_maincpu->eat_cycles(50); |
| 639 | 643 | } |
| 640 | 644 | |
| 641 | return m_workram[0xd1ee0 / 4]; | |
| 645 | return m_workram.target()[0xd1ee0 / 4]; | |
| 642 | 646 | } |
| 643 | 647 | |
| 644 | 648 | static DRIVER_INIT( gstream ) |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | igs017_state(const machine_config &mconfig, device_type type, const char *tag) |
| 56 | 56 | : driver_device(mconfig, type, tag), |
| 57 | 57 | m_input_addr(-1), |
| 58 | m_maincpu(*this, "maincpu") | |
| 59 | { } | |
| 58 | m_maincpu(*this, "maincpu"), | |
| 59 | m_spriteram(*this, "spriteram"), | |
| 60 | m_fg_videoram(*this, "fg_videoram"), | |
| 61 | m_bg_videoram(*this, "bg_videoram"){ } | |
| 60 | 62 | |
| 63 | int m_input_addr; | |
| 64 | required_device<cpu_device> m_maincpu; | |
| 65 | required_shared_ptr<UINT8> m_spriteram; | |
| 66 | required_shared_ptr<UINT8> m_fg_videoram; | |
| 67 | required_shared_ptr<UINT8> m_bg_videoram; | |
| 68 | ||
| 61 | 69 | int m_toggle; |
| 62 | 70 | int m_debug_addr; |
| 63 | 71 | int m_debug_width; |
| 64 | 72 | UINT8 m_video_disable; |
| 65 | UINT8 *m_fg_videoram; | |
| 66 | UINT8 *m_bg_videoram; | |
| 67 | 73 | tilemap_t *m_fg_tilemap; |
| 68 | 74 | tilemap_t *m_bg_tilemap; |
| 69 | 75 | UINT8 *m_sprites_gfx; |
| r14896 | r14897 | |
| 71 | 77 | int m_nmi_enable; |
| 72 | 78 | int m_irq_enable; |
| 73 | 79 | UINT8 m_input_select; |
| 74 | int m_input_addr; | |
| 75 | 80 | UINT8 m_hopper; |
| 76 | 81 | UINT16 m_igs_magic[2]; |
| 77 | 82 | UINT8 m_scramble_data; |
| 78 | 83 | UINT8 m_prot[2]; |
| 79 | 84 | int m_irq1_enable; |
| 80 | 85 | int m_irq2_enable; |
| 81 | UINT8 *m_spriteram; | |
| 82 | ||
| 83 | required_device<cpu_device> m_maincpu; | |
| 84 | 86 | DECLARE_WRITE8_MEMBER(video_disable_w); |
| 85 | 87 | DECLARE_WRITE16_MEMBER(video_disable_lsb_w); |
| 86 | 88 | DECLARE_WRITE8_MEMBER(fg_w); |
| r14896 | r14897 | |
| 154 | 156 | static TILE_GET_INFO( get_fg_tile_info ) |
| 155 | 157 | { |
| 156 | 158 | igs017_state *state = machine.driver_data<igs017_state>(); |
| 157 | int code = state->m_fg_videoram[tile_index*4+0] + (state->m_fg_videoram[tile_index*4+1] << 8); | |
| 158 | int attr = state->m_fg_videoram[tile_index*4+2] + (state->m_fg_videoram[tile_index*4+3] << 8); | |
| 159 | int code = state->m_fg_videoram.target()[tile_index*4+0] + (state->m_fg_videoram.target()[tile_index*4+1] << 8); | |
| 160 | int attr = state->m_fg_videoram.target()[tile_index*4+2] + (state->m_fg_videoram.target()[tile_index*4+3] << 8); | |
| 159 | 161 | SET_TILE_INFO(0, code, COLOR(attr), TILE_FLIPXY( attr >> 5 )); |
| 160 | 162 | } |
| 161 | 163 | static TILE_GET_INFO( get_bg_tile_info ) |
| 162 | 164 | { |
| 163 | 165 | igs017_state *state = machine.driver_data<igs017_state>(); |
| 164 | int code = state->m_bg_videoram[tile_index*4+0] + (state->m_bg_videoram[tile_index*4+1] << 8); | |
| 165 | int attr = state->m_bg_videoram[tile_index*4+2] + (state->m_bg_videoram[tile_index*4+3] << 8); | |
| 166 | int code = state->m_bg_videoram.target()[tile_index*4+0] + (state->m_bg_videoram.target()[tile_index*4+1] << 8); | |
| 167 | int attr = state->m_bg_videoram.target()[tile_index*4+2] + (state->m_bg_videoram.target()[tile_index*4+3] << 8); | |
| 166 | 168 | SET_TILE_INFO(0, code, COLOR(attr)+8, TILE_FLIPXY( attr >> 5 )); |
| 167 | 169 | } |
| 168 | 170 | |
| 169 | 171 | WRITE8_MEMBER(igs017_state::fg_w) |
| 170 | 172 | { |
| 171 | m_fg_videoram[offset] = data; | |
| 173 | m_fg_videoram.target()[offset] = data; | |
| 172 | 174 | m_fg_tilemap->mark_tile_dirty(offset/4); |
| 173 | 175 | } |
| 174 | 176 | |
| 175 | 177 | WRITE8_MEMBER(igs017_state::bg_w) |
| 176 | 178 | { |
| 177 | m_bg_videoram[offset] = data; | |
| 179 | m_bg_videoram.target()[offset] = data; | |
| 178 | 180 | m_bg_tilemap->mark_tile_dirty(offset/4); |
| 179 | 181 | } |
| 180 | 182 | |
| r14896 | r14897 | |
| 182 | 184 | |
| 183 | 185 | READ16_MEMBER(igs017_state::fg_lsb_r) |
| 184 | 186 | { |
| 185 | return m_fg_videoram[offset]; | |
| 187 | return m_fg_videoram.target()[offset]; | |
| 186 | 188 | } |
| 187 | 189 | WRITE16_MEMBER(igs017_state::fg_lsb_w) |
| 188 | 190 | { |
| r14896 | r14897 | |
| 192 | 194 | |
| 193 | 195 | READ16_MEMBER(igs017_state::bg_lsb_r) |
| 194 | 196 | { |
| 195 | return m_bg_videoram[offset]; | |
| 197 | return m_bg_videoram.target()[offset]; | |
| 196 | 198 | } |
| 197 | 199 | WRITE16_MEMBER(igs017_state::bg_lsb_w) |
| 198 | 200 | { |
| r14896 | r14897 | |
| 202 | 204 | |
| 203 | 205 | READ16_MEMBER(igs017_state::spriteram_lsb_r) |
| 204 | 206 | { |
| 205 | return m_spriteram[offset]; | |
| 207 | return m_spriteram.target()[offset]; | |
| 206 | 208 | } |
| 207 | 209 | WRITE16_MEMBER(igs017_state::spriteram_lsb_w) |
| 208 | 210 | { |
| 209 | 211 | if (ACCESSING_BITS_0_7) |
| 210 | m_spriteram[offset] = data; | |
| 212 | m_spriteram.target()[offset] = data; | |
| 211 | 213 | } |
| 212 | 214 | |
| 213 | 215 | |
| r14896 | r14897 | |
| 304 | 306 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect) |
| 305 | 307 | { |
| 306 | 308 | igs017_state *state = machine.driver_data<igs017_state>(); |
| 307 | UINT8 *s = state->m_spriteram; | |
| 309 | UINT8 *s = state->m_spriteram.target(); | |
| 308 | 310 | UINT8 *end = state->m_spriteram + 0x800; |
| 309 | 311 | |
| 310 | 312 | for ( ; s < end; s += 8 ) |
| r14896 | r14897 | |
| 1294 | 1296 | static ADDRESS_MAP_START( iqblocka_io, AS_IO, 8, igs017_state ) |
| 1295 | 1297 | AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs |
| 1296 | 1298 | |
| 1297 | AM_RANGE( 0x1000, 0x17ff ) AM_RAM AM_BASE(m_spriteram) | |
| 1298 | AM_RANGE( 0x1800, 0x1bff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_SHARE("paletteram") | |
| 1299 | AM_RANGE( 0x1000, 0x17ff ) AM_RAM AM_SHARE("spriteram") | |
| 1300 | AM_RANGE( 0x1800, 0x1bff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w ) AM_SHARE("paletteram") | |
| 1299 | 1301 | AM_RANGE( 0x1c00, 0x1fff ) AM_RAM |
| 1300 | 1302 | |
| 1301 | 1303 | // AM_RANGE(0x200a, 0x200a) AM_WRITENOP |
| r14896 | r14897 | |
| 1420 | 1422 | AM_RANGE( 0x300000, 0x303fff ) AM_RAM |
| 1421 | 1423 | AM_RANGE( 0x49c000, 0x49c003 ) AM_WRITE(mgcs_magic_w ) |
| 1422 | 1424 | AM_RANGE( 0x49c002, 0x49c003 ) AM_READ(mgcs_magic_r ) |
| 1423 | AM_RANGE( 0xa02000, 0xa02fff ) AM_READWRITE(spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1425 | AM_RANGE( 0xa02000, 0xa02fff ) AM_READWRITE(spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1424 | 1426 | AM_RANGE( 0xa03000, 0xa037ff ) AM_RAM_WRITE(mgcs_paletteram_w ) AM_SHARE("paletteram") |
| 1425 | 1427 | AM_RANGE( 0xa04020, 0xa04027 ) AM_DEVREAD8_LEGACY("ppi8255", ppi8255_r, 0x00ff ) |
| 1426 | 1428 | AM_RANGE( 0xa04024, 0xa04025 ) AM_WRITE(video_disable_lsb_w ) |
| r14896 | r14897 | |
| 1517 | 1519 | static ADDRESS_MAP_START( sdmg2, AS_PROGRAM, 16, igs017_state ) |
| 1518 | 1520 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1519 | 1521 | AM_RANGE(0x1f0000, 0x1fffff) AM_RAM |
| 1520 | AM_RANGE(0x202000, 0x202fff) AM_READWRITE(spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1522 | AM_RANGE(0x202000, 0x202fff) AM_READWRITE(spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1521 | 1523 | AM_RANGE(0x203000, 0x2037ff) AM_RAM_WRITE(sdmg2_paletteram_w ) AM_SHARE("paletteram") |
| 1522 | 1524 | AM_RANGE(0x204020, 0x204027) AM_DEVREAD8_LEGACY("ppi8255", ppi8255_r, 0x00ff ) |
| 1523 | 1525 | AM_RANGE(0x204024, 0x204025) AM_WRITE(video_disable_lsb_w ) |
| r14896 | r14897 | |
| 1638 | 1640 | AM_RANGE(0x600000, 0x603fff) AM_RAM |
| 1639 | 1641 | AM_RANGE(0x876000, 0x876003) AM_WRITE(mgdha_magic_w ) |
| 1640 | 1642 | AM_RANGE(0x876002, 0x876003) AM_READ(mgdha_magic_r ) |
| 1641 | AM_RANGE(0xa02000, 0xa02fff) AM_READWRITE(spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1643 | AM_RANGE(0xa02000, 0xa02fff) AM_READWRITE(spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1642 | 1644 | AM_RANGE(0xa03000, 0xa037ff) AM_RAM_WRITE(sdmg2_paletteram_w ) AM_SHARE("paletteram") |
| 1643 | 1645 | // AM_RANGE(0xa04014, 0xa04015) // written with FF at boot |
| 1644 | 1646 | AM_RANGE(0xa04020, 0xa04027) AM_DEVREAD8_LEGACY("ppi8255", ppi8255_r, 0x00ff ) |
| r14896 | r14897 | |
| 1727 | 1729 | static ADDRESS_MAP_START( tjsb_io, AS_IO, 8, igs017_state ) |
| 1728 | 1730 | AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs |
| 1729 | 1731 | |
| 1730 | AM_RANGE( 0x1000, 0x17ff ) AM_RAM AM_ | |
| 1732 | AM_RANGE( 0x1000, 0x17ff ) AM_RAM AM_ | |
| 1731 | 1733 | AM_RANGE( 0x1800, 0x1bff ) AM_RAM_WRITE(tjsb_paletteram_w ) AM_SHARE("paletteram") |
| 1732 | 1734 | AM_RANGE( 0x1c00, 0x1fff ) AM_RAM |
| 1733 | 1735 | |
| r14896 | r14897 | |
| 1815 | 1817 | AM_RANGE(0x500000, 0x503fff) AM_RAM |
| 1816 | 1818 | AM_RANGE(0x910000, 0x910003) AM_WRITE( lhzb2_magic_w ) |
| 1817 | 1819 | AM_RANGE(0x910002, 0x910003) AM_READ( lhzb2_magic_r ) |
| 1818 | AM_RANGE(0xb02000, 0xb02fff) AM_READWRITE( spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1820 | AM_RANGE(0xb02000, 0xb02fff) AM_READWRITE( spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1819 | 1821 | AM_RANGE(0xb03000, 0xb037ff) AM_RAM_WRITE( lhzb2a_paletteram_w ) AM_SHARE("paletteram") |
| 1820 | 1822 | AM_RANGE(0xb04020, 0xb04027) AM_DEVREAD8_LEGACY( "ppi8255", ppi8255_r, 0x00ff ) |
| 1821 | 1823 | AM_RANGE(0xb04024, 0xb04025) AM_WRITE( video_disable_lsb_w ) |
| 1822 | 1824 | AM_RANGE(0xb04028, 0xb04029) AM_WRITE( irq2_enable_w ) |
| 1823 | 1825 | AM_RANGE(0xb0402a, 0xb0402b) AM_WRITE( irq1_enable_w ) |
| 1824 | AM_RANGE(0xb08000, 0xb0bfff) AM_READWRITE( fg_lsb_r, fg_lsb_w ) AM_BASE( m_fg_videoram ) | |
| 1825 | AM_RANGE(0xb0c000, 0xb0ffff) AM_READWRITE( bg_lsb_r, bg_lsb_w ) AM_BASE( m_bg_videoram ) | |
| 1826 | AM_RANGE(0xb08000, 0xb0bfff) AM_READWRITE( fg_lsb_r, fg_lsb_w ) AM_SHARE("fg_videoram") | |
| 1827 | AM_RANGE(0xb0c000, 0xb0ffff) AM_READWRITE( bg_lsb_r, bg_lsb_w ) AM_SHARE("bg_videoram") | |
| 1826 | 1828 | AM_RANGE(0xb10000, 0xb10001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff ) |
| 1827 | 1829 | ADDRESS_MAP_END |
| 1828 | 1830 | |
| r14896 | r14897 | |
| 1947 | 1949 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1948 | 1950 | AM_RANGE(0x500000, 0x503fff) AM_RAM |
| 1949 | 1951 | // AM_RANGE(0x910000, 0x910003) protection |
| 1950 | AM_RANGE(0xb02000, 0xb02fff) AM_READWRITE( spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1952 | AM_RANGE(0xb02000, 0xb02fff) AM_READWRITE( spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 1951 | 1953 | AM_RANGE(0xb03000, 0xb037ff) AM_RAM_WRITE( lhzb2a_paletteram_w ) AM_SHARE("paletteram") |
| 1952 | 1954 | AM_RANGE(0xb04024, 0xb04025) AM_WRITE( video_disable_lsb_w ) |
| 1953 | 1955 | AM_RANGE(0xb04028, 0xb04029) AM_WRITE( irq2_enable_w ) |
| 1954 | 1956 | AM_RANGE(0xb0402a, 0xb0402b) AM_WRITE( irq1_enable_w ) |
| 1955 | AM_RANGE(0xb08000, 0xb0bfff) AM_READWRITE( fg_lsb_r, fg_lsb_w ) AM_BASE( m_fg_videoram ) | |
| 1956 | AM_RANGE(0xb0c000, 0xb0ffff) AM_READWRITE( bg_lsb_r, bg_lsb_w ) AM_BASE( m_bg_videoram ) | |
| 1957 | AM_RANGE(0xb08000, 0xb0bfff) AM_READWRITE( fg_lsb_r, fg_lsb_w ) AM_SHARE("fg_videoram") | |
| 1958 | AM_RANGE(0xb0c000, 0xb0ffff) AM_READWRITE( bg_lsb_r, bg_lsb_w ) AM_SHARE("bg_videoram") | |
| 1957 | 1959 | AM_RANGE(0xb10000, 0xb10001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff ) |
| 1958 | 1960 | AM_RANGE(0xb12000, 0xb12001) AM_WRITE( lhzb2a_input_select_w ) |
| 1959 | 1961 | // Inputs dynamically mapped at xx8000, protection at xx4000 (xx = f0 initially). xx written to xxc000 |
| r14896 | r14897 | |
| 2028 | 2030 | AM_RANGE(0x100000, 0x103fff) AM_RAM |
| 2029 | 2031 | AM_RANGE(0x602000, 0x602003) AM_WRITE( slqz2_magic_w ) |
| 2030 | 2032 | AM_RANGE(0x602002, 0x602003) AM_READ( slqz2_magic_r ) |
| 2031 | AM_RANGE(0x902000, 0x902fff) AM_READWRITE( spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 2033 | AM_RANGE(0x902000, 0x902fff) AM_READWRITE( spriteram_lsb_r, spriteram_lsb_w ) AM_ | |
| 2032 | 2034 | AM_RANGE(0x903000, 0x9037ff) AM_RAM_WRITE( slqz2_paletteram_w ) AM_SHARE("paletteram") |
| 2033 | 2035 | AM_RANGE(0x904020, 0x904027) AM_DEVREAD8_LEGACY( "ppi8255", ppi8255_r, 0x00ff ) |
| 2034 | 2036 | AM_RANGE(0x904024, 0x904025) AM_WRITE( video_disable_lsb_w ) |
| 2035 | 2037 | AM_RANGE(0x904028, 0x904029) AM_WRITE( irq2_enable_w ) |
| 2036 | 2038 | AM_RANGE(0x90402a, 0x90402b) AM_WRITE( irq1_enable_w ) |
| 2037 | AM_RANGE(0x908000, 0x90bfff) AM_READWRITE( fg_lsb_r, fg_lsb_w ) AM_BASE( m_fg_videoram ) | |
| 2038 | AM_RANGE(0x90c000, 0x90ffff) AM_READWRITE( bg_lsb_r, bg_lsb_w ) AM_BASE( m_bg_videoram ) | |
| 2039 | AM_RANGE(0x908000, 0x90bfff) AM_READWRITE( fg_lsb_r, fg_lsb_w ) AM_SHARE("fg_videoram") | |
| 2040 | AM_RANGE(0x90c000, 0x90ffff) AM_READWRITE( bg_lsb_r, bg_lsb_w ) AM_SHARE("bg_videoram") | |
| 2039 | 2041 | AM_RANGE(0x910000, 0x910001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff ) |
| 2040 | 2042 | ADDRESS_MAP_END |
| 2041 | 2043 |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | { |
| 36 | 36 | if (ACCESSING_BITS_8_15) |
| 37 | 37 | { |
| 38 | flip_screen_set( | |
| 38 | flip_screen_set( | |
| 39 | 39 | coin_counter_w(machine(), 0, data & 0x4000); |
| 40 | 40 | coin_counter_w(machine(), 1, data & 0x8000); |
| 41 | 41 | } |
| r14896 | r14897 | |
| 44 | 44 | WRITE16_MEMBER(pushman_state::pushman_control_w) |
| 45 | 45 | { |
| 46 | 46 | if (ACCESSING_BITS_8_15) |
| 47 | soundlatch_w(space, 0, (data >> 8) & 0xff); | |
| 47 | soundlatch_byte_w(space, 0, (data >> 8) & 0xff); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | READ16_MEMBER(pushman_state::pushman_68705_r) |
| r14896 | r14897 | |
| 153 | 153 | AM_RANGE(0xfe8000, 0xfe8003) AM_WRITE(pushman_scroll_w) |
| 154 | 154 | AM_RANGE(0xfe800e, 0xfe800f) AM_WRITENOP /* ? */ |
| 155 | 155 | AM_RANGE(0xfec000, 0xfec7ff) AM_RAM_WRITE(pushman_videoram_w) AM_BASE(m_videoram) |
| 156 | AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE(paletteram | |
| 156 | AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE(paletteram | |
| 157 | 157 | AM_RANGE(0xffc000, 0xffffff) AM_RAM |
| 158 | 158 | ADDRESS_MAP_END |
| 159 | 159 | |
| r14896 | r14897 | |
| 166 | 166 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, pushman_state ) |
| 167 | 167 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 168 | 168 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 169 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 169 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 170 | 170 | ADDRESS_MAP_END |
| 171 | 171 | |
| 172 | 172 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, pushman_state ) |
| r14896 | r14897 | |
| 186 | 186 | AM_RANGE(0xe8000, 0xe8003) AM_WRITE(pushman_scroll_w) |
| 187 | 187 | AM_RANGE(0xe800e, 0xe800f) AM_WRITENOP /* ? */ |
| 188 | 188 | AM_RANGE(0xec000, 0xec7ff) AM_RAM_WRITE(pushman_videoram_w) AM_BASE(m_videoram) |
| 189 | AM_RANGE(0xf8000, 0xf87ff) AM_RAM_WRITE(paletteram | |
| 189 | AM_RANGE(0xf8000, 0xf87ff) AM_RAM_WRITE(paletteram | |
| 190 | 190 | AM_RANGE(0xfc000, 0xfffff) AM_RAM |
| 191 | 191 | ADDRESS_MAP_END |
| 192 | 192 |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | AM_RANGE(0x1481, 0x1481) AM_WRITE_LEGACY(konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 41 | 41 | AM_RANGE(0x1483, 0x1484) AM_WRITE(hyperspt_coin_counter_w) |
| 42 | 42 | AM_RANGE(0x1487, 0x1487) AM_WRITE(irq_mask_w) /* Interrupt enable */ |
| 43 | AM_RANGE(0x1500, 0x1500) AM_WRITE(soundlatch_w) | |
| 43 | AM_RANGE(0x1500, 0x1500) AM_WRITE(soundlatch_byte_w) | |
| 44 | 44 | AM_RANGE(0x1600, 0x1600) AM_READ_PORT("DSW2") |
| 45 | 45 | AM_RANGE(0x1680, 0x1680) AM_READ_PORT("SYSTEM") |
| 46 | 46 | AM_RANGE(0x1681, 0x1681) AM_READ_PORT("P1_P2") |
| r14896 | r14897 | |
| 61 | 61 | AM_RANGE(0x1481, 0x1481) AM_WRITE_LEGACY(konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 62 | 62 | AM_RANGE(0x1483, 0x1484) AM_WRITE(hyperspt_coin_counter_w) |
| 63 | 63 | AM_RANGE(0x1487, 0x1487) AM_WRITE(irq_mask_w) /* Interrupt enable */ |
| 64 | AM_RANGE(0x1500, 0x1500) AM_WRITE(soundlatch_w) | |
| 64 | AM_RANGE(0x1500, 0x1500) AM_WRITE(soundlatch_byte_w) | |
| 65 | 65 | AM_RANGE(0x1600, 0x1600) AM_READ_PORT("DSW2") |
| 66 | 66 | AM_RANGE(0x1680, 0x1680) AM_READ_PORT("SYSTEM") |
| 67 | 67 | AM_RANGE(0x1681, 0x1681) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 77 | 77 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, hyperspt_state ) |
| 78 | 78 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 79 | 79 | AM_RANGE(0x4000, 0x4fff) AM_RAM |
| 80 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 80 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 81 | 81 | AM_RANGE(0x8000, 0x8000) AM_READ_LEGACY(hyperspt_sh_timer_r) |
| 82 | 82 | AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) /* speech data */ |
| 83 | 83 | AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE_LEGACY("vlm", hyperspt_sound_w) /* speech and output control */ |
| r14896 | r14897 | |
| 89 | 89 | static ADDRESS_MAP_START( soundb_map, AS_PROGRAM, 8, hyperspt_state ) |
| 90 | 90 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 91 | 91 | AM_RANGE(0x4000, 0x4fff) AM_RAM |
| 92 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 92 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 93 | 93 | AM_RANGE(0x8000, 0x8000) AM_READ_LEGACY(hyperspt_sh_timer_r) |
| 94 | 94 | AM_RANGE(0xa000, 0xa000) AM_NOP |
| 95 | 95 | AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE_LEGACY("hyprolyb_adpcm", hyprolyb_adpcm_w) /* speech and output control */ |
| r14896 | r14897 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | static ADDRESS_MAP_START( shangha2_map, AS_PROGRAM, 16, shanghai_state ) |
| 144 | 144 | AM_RANGE(0x00000, 0x03fff) AM_RAM |
| 145 | AM_RANGE(0x04000, 0x041ff) AM_WRITE(paletteram | |
| 145 | AM_RANGE(0x04000, 0x041ff) AM_WRITE(paletteram | |
| 146 | 146 | AM_RANGE(0x80000, 0xfffff) AM_ROM |
| 147 | 147 | ADDRESS_MAP_END |
| 148 | 148 | |
| r14896 | r14897 | |
| 181 | 181 | AM_RANGE(0x09012, 0x09013) AM_READ_PORT("P2") |
| 182 | 182 | AM_RANGE(0x09014, 0x09015) AM_READ_PORT("SYSTEM") |
| 183 | 183 | AM_RANGE(0x09016, 0x0901f) AM_WRITENOP // 0x9016 is set to 0 at the boot |
| 184 | AM_RANGE(0x0a000, 0x0a1ff) AM_WRITE(paletteram | |
| 184 | AM_RANGE(0x0a000, 0x0a1ff) AM_WRITE(paletteram | |
| 185 | 185 | AM_RANGE(0x0b010, 0x0b01f) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w) |
| 186 | 186 | AM_RANGE(0x80000, 0xfffff) AM_ROM |
| 187 | 187 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 1067 | 1067 | int m_s12_setstate; |
| 1068 | 1068 | int m_s12_setnum; |
| 1069 | 1069 | int m_s12_settings[8]; |
| 1070 | DECLARE_WRITE32_MEMBER(sharedram_w); | |
| 1071 | DECLARE_READ32_MEMBER(sharedram_r); | |
| 1072 | DECLARE_WRITE16_MEMBER(sharedram_sub_w); | |
| 1073 | DECLARE_READ16_MEMBER(sharedram_sub_r); | |
| 1074 | DECLARE_WRITE32_MEMBER(bankoffset_w); | |
| 1075 | DECLARE_WRITE32_MEMBER(dmaoffset_w); | |
| 1076 | DECLARE_WRITE32_MEMBER(s12_dma_bias_w); | |
| 1077 | DECLARE_WRITE32_MEMBER(system11gun_w); | |
| 1078 | DECLARE_READ32_MEMBER(system11gun_r); | |
| 1079 | DECLARE_WRITE32_MEMBER(kcoff_w); | |
| 1080 | DECLARE_WRITE32_MEMBER(kcon_w); | |
| 1081 | DECLARE_WRITE32_MEMBER(tektagt_protection_1_w); | |
| 1082 | DECLARE_READ32_MEMBER(tektagt_protection_1_r); | |
| 1083 | DECLARE_WRITE32_MEMBER(tektagt_protection_2_w); | |
| 1084 | DECLARE_READ32_MEMBER(tektagt_protection_2_r); | |
| 1085 | DECLARE_READ32_MEMBER(tektagt_protection_3_r); | |
| 1086 | DECLARE_READ8_MEMBER(s12_mcu_p8_r); | |
| 1087 | DECLARE_READ8_MEMBER(s12_mcu_pa_r); | |
| 1088 | DECLARE_WRITE8_MEMBER(s12_mcu_pa_w); | |
| 1089 | DECLARE_READ8_MEMBER(s12_mcu_rtc_r); | |
| 1090 | DECLARE_READ8_MEMBER(s12_mcu_portB_r); | |
| 1091 | DECLARE_WRITE8_MEMBER(s12_mcu_portB_w); | |
| 1092 | DECLARE_WRITE8_MEMBER(s12_mcu_settings_w); | |
| 1093 | DECLARE_READ8_MEMBER(s12_mcu_gun_h_r); | |
| 1094 | DECLARE_READ8_MEMBER(s12_mcu_gun_v_r); | |
| 1070 | 1095 | }; |
| 1071 | 1096 | |
| 1072 | 1097 | INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) |
| r14896 | r14897 | |
| 1082 | 1107 | } |
| 1083 | 1108 | } |
| 1084 | 1109 | |
| 1085 | ||
| 1110 | ||
| 1086 | 1111 | { |
| 1087 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1088 | 1112 | |
| 1089 | verboselog( space->machine(), 1, "sharedram_w( %08x, %08x, %08x )\n", ( offset * 4 ), data, mem_mask ); | |
| 1090 | COMBINE_DATA( &state->m_sharedram[ offset ] ); | |
| 1113 | verboselog( machine(), 1, "sharedram_w( %08x, %08x, %08x )\n", ( offset * 4 ), data, mem_mask ); | |
| 1114 | COMBINE_DATA( &m_sharedram[ offset ] ); | |
| 1091 | 1115 | } |
| 1092 | 1116 | |
| 1093 | ||
| 1117 | ||
| 1094 | 1118 | { |
| 1095 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1096 | 1119 | |
| 1097 | verboselog( space->machine(), 1, "sharedram_r( %08x, %08x ) %08x\n", ( offset * 4 ), mem_mask, state->m_sharedram[ offset ] ); | |
| 1098 | return state->m_sharedram[ offset ]; | |
| 1120 | verboselog( machine(), 1, "sharedram_r( %08x, %08x ) %08x\n", ( offset * 4 ), mem_mask, m_sharedram[ offset ] ); | |
| 1121 | return m_sharedram[ offset ]; | |
| 1099 | 1122 | } |
| 1100 | 1123 | |
| 1101 | ||
| 1124 | ||
| 1102 | 1125 | { |
| 1103 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1104 | 1126 | |
| 1105 | UINT16 *shared16 = (UINT16 *) | |
| 1127 | UINT16 *shared16 = (UINT16 *) | |
| 1106 | 1128 | |
| 1107 | 1129 | COMBINE_DATA(&shared16[BYTE_XOR_LE(offset)]); |
| 1108 | 1130 | } |
| 1109 | 1131 | |
| 1110 | ||
| 1132 | ||
| 1111 | 1133 | { |
| 1112 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1113 | 1134 | |
| 1114 | UINT16 *shared16 = (UINT16 *) | |
| 1135 | UINT16 *shared16 = (UINT16 *) | |
| 1115 | 1136 | |
| 1116 | 1137 | return shared16[BYTE_XOR_LE(offset)]; |
| 1117 | 1138 | } |
| 1118 | 1139 | |
| 1119 | ||
| 1140 | ||
| 1120 | 1141 | { |
| 1121 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1122 | 1142 | |
| 1123 | 1143 | // Golgo 13 has different banking (maybe the keycus controls it?) |
| 1124 | if( strcmp( space->machine().system().name, "golgo13" ) == 0 || | |
| 1125 | strcmp( space->machine().system().name, "g13knd" ) == 0 ) | |
| 1144 | if( strcmp( machine().system().name, "golgo13" ) == 0 || | |
| 1145 | strcmp( machine().system().name, "g13knd" ) == 0 ) | |
| 1126 | 1146 | { |
| 1127 | 1147 | if( ( data & 8 ) != 0 ) |
| 1128 | 1148 | { |
| 1129 | | |
| 1149 | | |
| 1130 | 1150 | } |
| 1131 | 1151 | else |
| 1132 | 1152 | { |
| 1133 | | |
| 1153 | | |
| 1134 | 1154 | } |
| 1135 | 1155 | } |
| 1136 | 1156 | else |
| 1137 | 1157 | { |
| 1138 | | |
| 1158 | | |
| 1139 | 1159 | } |
| 1140 | 1160 | |
| 1141 | memory_set_bank( | |
| 1161 | memory_set_bank( | |
| 1142 | 1162 | |
| 1143 | verboselog( | |
| 1163 | verboselog( | |
| 1144 | 1164 | } |
| 1145 | 1165 | |
| 1146 | ||
| 1166 | ||
| 1147 | 1167 | { |
| 1148 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1149 | 1168 | |
| 1150 | 1169 | if( ACCESSING_BITS_0_15 ) |
| 1151 | 1170 | { |
| 1152 | | |
| 1171 | | |
| 1153 | 1172 | } |
| 1154 | 1173 | if( ACCESSING_BITS_16_31 ) |
| 1155 | 1174 | { |
| 1156 | | |
| 1175 | | |
| 1157 | 1176 | } |
| 1158 | verboselog( | |
| 1177 | verboselog( | |
| 1159 | 1178 | } |
| 1160 | 1179 | |
| 1161 | 1180 | static void namcos12_rom_read( namcos12_state *state, UINT32 n_address, INT32 n_size ) |
| r14896 | r14897 | |
| 1222 | 1241 | irq1_line_pulse( state->machine().device( "sub" ) ); |
| 1223 | 1242 | } |
| 1224 | 1243 | |
| 1225 | ||
| 1244 | ||
| 1226 | 1245 | { |
| 1227 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1228 | 1246 | |
| 1229 | | |
| 1247 | | |
| 1230 | 1248 | } |
| 1231 | 1249 | |
| 1232 | 1250 | static ADDRESS_MAP_START( namcos12_map, AS_PROGRAM, 32, namcos12_state ) |
| 1233 | 1251 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE("share1") /* ram */ |
| 1234 | AM_RANGE(0x1f000000, 0x1f000003) AM_READNOP AM_WRITE_LEGACY(bankoffset_w) /* banking */ | |
| 1235 | AM_RANGE(0x1f080000, 0x1f083fff) AM_READWRITE_LEGACY(sharedram_r, sharedram_w) AM_BASE(m_sharedram) /* shared ram?? */ | |
| 1252 | AM_RANGE(0x1f000000, 0x1f000003) AM_READNOP AM_WRITE(bankoffset_w) /* banking */ | |
| 1253 | AM_RANGE(0x1f080000, 0x1f083fff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(m_sharedram) /* shared ram?? */ | |
| 1236 | 1254 | AM_RANGE(0x1f140000, 0x1f140fff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */ |
| 1237 | 1255 | AM_RANGE(0x1f1bff08, 0x1f1bff0f) AM_WRITENOP /* ?? */ |
| 1238 | AM_RANGE(0x1f700000, 0x1f70ffff) AM_WRITE_LEGACY(dmaoffset_w) /* dma */ | |
| 1239 | AM_RANGE(0x1f801000, 0x1f801003) AM_WRITE_LEGACY(s12_dma_bias_w) | |
| 1256 | AM_RANGE(0x1f700000, 0x1f70ffff) AM_WRITE(dmaoffset_w) /* dma */ | |
| 1257 | AM_RANGE(0x1f801000, 0x1f801003) AM_WRITE(s12_dma_bias_w) | |
| 1240 | 1258 | AM_RANGE(0x1fa00000, 0x1fbfffff) AM_ROMBANK("bank1") /* banked roms */ |
| 1241 | 1259 | AM_RANGE(0x1fc00000, 0x1fffffff) AM_ROM AM_SHARE("share2") AM_REGION("user1", 0) /* bios */ |
| 1242 | 1260 | AM_RANGE(0x80000000, 0x803fffff) AM_RAM AM_SHARE("share1") /* ram mirror */ |
| r14896 | r14897 | |
| 1246 | 1264 | AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP |
| 1247 | 1265 | ADDRESS_MAP_END |
| 1248 | 1266 | |
| 1249 | ||
| 1267 | ||
| 1250 | 1268 | { |
| 1251 | 1269 | if( ACCESSING_BITS_0_15 ) |
| 1252 | 1270 | { |
| r14896 | r14897 | |
| 1263 | 1281 | output_set_value("P2_Start_lamp", (~data & 0x04)>>2); |
| 1264 | 1282 | |
| 1265 | 1283 | |
| 1266 | verboselog( | |
| 1284 | verboselog( | |
| 1267 | 1285 | } |
| 1268 | 1286 | if( ACCESSING_BITS_16_31 ) |
| 1269 | 1287 | { |
| 1270 | verboselog( | |
| 1288 | verboselog( | |
| 1271 | 1289 | } |
| 1272 | 1290 | } |
| 1273 | 1291 | |
| 1274 | ||
| 1292 | ||
| 1275 | 1293 | { |
| 1276 | 1294 | UINT32 data = 0; |
| 1277 | 1295 | switch( offset ) |
| 1278 | 1296 | { |
| 1279 | 1297 | case 0: |
| 1280 | data = input_port_read( | |
| 1298 | data = input_port_read( | |
| 1281 | 1299 | break; |
| 1282 | 1300 | case 1: |
| 1283 | data = ( input_port_read( | |
| 1301 | data = ( input_port_read( | |
| 1284 | 1302 | break; |
| 1285 | 1303 | case 2: |
| 1286 | data = input_port_read( | |
| 1304 | data = input_port_read( | |
| 1287 | 1305 | break; |
| 1288 | 1306 | case 3: |
| 1289 | data = ( input_port_read( | |
| 1307 | data = ( input_port_read( | |
| 1290 | 1308 | break; |
| 1291 | 1309 | } |
| 1292 | verboselog( | |
| 1310 | verboselog( | |
| 1293 | 1311 | return data; |
| 1294 | 1312 | } |
| 1295 | 1313 | |
| 1296 | 1314 | static void system11gun_install( running_machine &machine ) |
| 1297 | 1315 | { |
| 1298 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f788000, 0x1f788003, FUNC(system11gun_w) ); | |
| 1299 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1f780000, 0x1f78000f, FUNC(system11gun_r) ); | |
| 1316 | namcos12_state *state = machine.driver_data<namcos12_state>(); | |
| 1317 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1f788000, 0x1f788003, write32_delegate(FUNC(namcos12_state::system11gun_w),state)); | |
| 1318 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler (0x1f780000, 0x1f78000f, read32_delegate(FUNC(namcos12_state::system11gun_r),state)); | |
| 1300 | 1319 | } |
| 1301 | 1320 | |
| 1302 | ||
| 1321 | ||
| 1303 | 1322 | { |
| 1304 | memory_set_bankptr( | |
| 1323 | memory_set_bankptr( | |
| 1305 | 1324 | } |
| 1306 | 1325 | |
| 1307 | ||
| 1326 | ||
| 1308 | 1327 | { |
| 1309 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1310 | 1328 | |
| 1311 | memory_set_bankptr( | |
| 1329 | memory_set_bankptr( | |
| 1312 | 1330 | } |
| 1313 | 1331 | |
| 1314 | ||
| 1332 | ||
| 1315 | 1333 | { |
| 1316 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1317 | 1334 | |
| 1318 | 1335 | // Second dma offset or protection ref values write |
| 1319 | state->m_n_tektagdmaoffset = data; | |
| 1320 | if(state->m_ttt_cnt != 2) | |
| 1321 | state->m_ttt_val[state->m_ttt_cnt++] = data; | |
| 1336 | m_n_tektagdmaoffset = data; | |
| 1337 | if(m_ttt_cnt != 2) | |
| 1338 | m_ttt_val[m_ttt_cnt++] = data; | |
| 1322 | 1339 | } |
| 1323 | 1340 | |
| 1324 | ||
| 1341 | ||
| 1325 | 1342 | { |
| 1326 | 1343 | // Reads are either ignored or bit 15 is tested for a busy flag |
| 1327 | 1344 | return 0x8000; |
| 1328 | 1345 | } |
| 1329 | 1346 | |
| 1330 | ||
| 1347 | ||
| 1331 | 1348 | { |
| 1332 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1333 | 1349 | |
| 1334 | 1350 | // Writes are 0 or rand(), only used as a "start prot value write" trigger |
| 1335 | | |
| 1351 | | |
| 1336 | 1352 | } |
| 1337 | 1353 | |
| 1338 | ||
| 1354 | ||
| 1339 | 1355 | { |
| 1340 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1341 | UINT32 *ttt_val = state->m_ttt_val; | |
| 1356 | UINT32 *ttt_val = m_ttt_val; | |
| 1342 | 1357 | UINT32 data = 0; |
| 1343 | 1358 | |
| 1344 | 1359 | if(((ttt_val[0] >> 16) & 0xff) == 0x6d) |
| r14896 | r14897 | |
| 1359 | 1374 | return data; |
| 1360 | 1375 | } |
| 1361 | 1376 | |
| 1362 | ||
| 1377 | ||
| 1363 | 1378 | { |
| 1364 | 1379 | // Always ignored |
| 1365 | 1380 | return 0; |
| r14896 | r14897 | |
| 1369 | 1384 | { |
| 1370 | 1385 | namcos12_state *state = machine.driver_data<namcos12_state>(); |
| 1371 | 1386 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 1372 | bankoffset_w(space,0,0,0xffffffff); | |
| 1387 | state->bankoffset_w(*space,0,0,0xffffffff); | |
| 1373 | 1388 | state->m_has_tektagt_dma = 0; |
| 1374 | 1389 | |
| 1375 | 1390 | if( strcmp( machine.system().name, "tektagt" ) == 0 || |
| r14896 | r14897 | |
| 1380 | 1395 | strcmp( machine.system().name, "tektagtja" ) == 0 ) |
| 1381 | 1396 | { |
| 1382 | 1397 | state->m_has_tektagt_dma = 1; |
| 1383 | space->install_legacy_readwrite_handler(0x1fb00000, 0x1fb00003, FUNC(tektagt_protection_1_r), FUNC(tektagt_protection_1_w) ); | |
| 1384 | space->install_legacy_readwrite_handler(0x1fb80000, 0x1fb80003, FUNC(tektagt_protection_2_r), FUNC(tektagt_protection_2_w) ); | |
| 1385 | space->install_legacy_read_handler(0x1f700000, 0x1f700003, FUNC(tektagt_protection_3_r) ); | |
| 1398 | space->install_readwrite_handler(0x1fb00000, 0x1fb00003, read32_delegate(FUNC(namcos12_state::tektagt_protection_1_r),state), write32_delegate(FUNC(namcos12_state::tektagt_protection_1_w),state)); | |
| 1399 | space->install_readwrite_handler(0x1fb80000, 0x1fb80003, read32_delegate(FUNC(namcos12_state::tektagt_protection_2_r),state), write32_delegate(FUNC(namcos12_state::tektagt_protection_2_w),state)); | |
| 1400 | space->install_read_handler(0x1f700000, 0x1f700003, read32_delegate(FUNC(namcos12_state::tektagt_protection_3_r),state)); | |
| 1386 | 1401 | } |
| 1387 | 1402 | |
| 1388 | 1403 | if( strcmp( machine.system().name, "tektagt" ) == 0 || |
| r14896 | r14897 | |
| 1409 | 1424 | { |
| 1410 | 1425 | /* this is based on guesswork, it might not even be keycus. */ |
| 1411 | 1426 | space->install_read_bank (0x1fc20280, 0x1fc2028b, "bank2" ); |
| 1412 | space->install_legacy_write_handler(0x1f008000, 0x1f008003, FUNC(kcon_w) ); | |
| 1413 | space->install_legacy_write_handler(0x1f018000, 0x1f018003, FUNC(kcoff_w) ); | |
| 1427 | space->install_write_handler(0x1f008000, 0x1f008003, write32_delegate(FUNC(namcos12_state::kcon_w),state)); | |
| 1428 | space->install_write_handler(0x1f018000, 0x1f018003, write32_delegate(FUNC(namcos12_state::kcoff_w),state)); | |
| 1414 | 1429 | |
| 1415 | 1430 | memset( state->m_kcram, 0, sizeof( state->m_kcram ) ); |
| 1416 | 1431 | memory_set_bankptr( space->machine(), "bank2", state->m_kcram ); |
| r14896 | r14897 | |
| 1420 | 1435 | /* H8/3002 MCU stuff */ |
| 1421 | 1436 | static ADDRESS_MAP_START( s12h8rwmap, AS_PROGRAM, 16, namcos12_state ) |
| 1422 | 1437 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1423 | AM_RANGE(0x080000, 0x08ffff) AM_READWRITE | |
| 1438 | AM_RANGE(0x080000, 0x08ffff) AM_READWRITE | |
| 1424 | 1439 | AM_RANGE(0x280000, 0x287fff) AM_DEVREADWRITE("c352", c352_device, read, write) |
| 1425 | 1440 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") |
| 1426 | 1441 | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 1428 | 1443 | AM_RANGE(0x300030, 0x300031) AM_NOP // most S12 bioses write here simply to generate a wait state. there is no deeper meaning. |
| 1429 | 1444 | ADDRESS_MAP_END |
| 1430 | 1445 | |
| 1431 | ||
| 1446 | ||
| 1432 | 1447 | { |
| 1433 | 1448 | return 0x02; |
| 1434 | 1449 | } |
| r14896 | r14897 | |
| 1437 | 1452 | // in System 12, bit 0 of H8/3002 port A is connected to it's chip enable |
| 1438 | 1453 | // the actual I/O takes place through the H8/3002's serial port B. |
| 1439 | 1454 | |
| 1440 | ||
| 1455 | ||
| 1441 | 1456 | { |
| 1442 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1443 | 1457 | |
| 1444 | return | |
| 1458 | return | |
| 1445 | 1459 | } |
| 1446 | 1460 | |
| 1447 | ||
| 1461 | ||
| 1448 | 1462 | { |
| 1449 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1450 | 1463 | |
| 1451 | 1464 | // bit 0 = chip enable for the RTC |
| 1452 | 1465 | // reset the state on the rising edge of the bit |
| 1453 | if ((!( | |
| 1466 | if ((!( | |
| 1454 | 1467 | { |
| 1455 | | |
| 1468 | | |
| 1456 | 1469 | } |
| 1457 | 1470 | |
| 1458 | | |
| 1471 | | |
| 1459 | 1472 | } |
| 1460 | 1473 | |
| 1461 | 1474 | INLINE UINT8 make_bcd(UINT8 data) |
| r14896 | r14897 | |
| 1463 | 1476 | return ((data / 10) << 4) | (data % 10); |
| 1464 | 1477 | } |
| 1465 | 1478 | |
| 1466 | ||
| 1479 | ||
| 1467 | 1480 | { |
| 1468 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1469 | 1481 | UINT8 ret = 0; |
| 1470 | 1482 | system_time systime; |
| 1471 | 1483 | static const int weekday[7] = { 7, 1, 2, 3, 4, 5, 6 }; |
| 1472 | 1484 | |
| 1473 | | |
| 1485 | | |
| 1474 | 1486 | |
| 1475 | switch ( | |
| 1487 | switch ( | |
| 1476 | 1488 | { |
| 1477 | 1489 | case 0: |
| 1478 | 1490 | ret = make_bcd(systime.local_time.second); // seconds (BCD, 0-59) in bits 0-6, bit 7 = battery low |
| r14896 | r14897 | |
| 1500 | 1512 | break; |
| 1501 | 1513 | } |
| 1502 | 1514 | |
| 1503 | | |
| 1515 | | |
| 1504 | 1516 | |
| 1505 | 1517 | return ret; |
| 1506 | 1518 | } |
| 1507 | 1519 | |
| 1508 | ||
| 1520 | ||
| 1509 | 1521 | { |
| 1510 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1511 | 1522 | |
| 1512 | 1523 | // golgo13 won't boot if this doesn't toggle every read |
| 1513 | state->m_s12_lastpB ^= 0x80; | |
| 1514 | return state->m_s12_lastpB; | |
| 1524 | m_s12_lastpB ^= 0x80; | |
| 1525 | return m_s12_lastpB; | |
| 1515 | 1526 | } |
| 1516 | 1527 | |
| 1517 | ||
| 1528 | ||
| 1518 | 1529 | { |
| 1519 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1520 | 1530 | |
| 1521 | 1531 | // bit 7 = chip enable for the video settings controller |
| 1522 | 1532 | if (data & 0x80) |
| 1523 | 1533 | { |
| 1524 | | |
| 1534 | | |
| 1525 | 1535 | } |
| 1526 | 1536 | |
| 1527 | | |
| 1537 | | |
| 1528 | 1538 | } |
| 1529 | 1539 | |
| 1530 | ||
| 1540 | ||
| 1531 | 1541 | { |
| 1532 | namcos12_state *state = space->machine().driver_data<namcos12_state>(); | |
| 1533 | int *s12_settings = state->m_s12_settings; | |
| 1542 | int *s12_settings = m_s12_settings; | |
| 1534 | 1543 | |
| 1535 | if ( | |
| 1544 | if ( | |
| 1536 | 1545 | { |
| 1537 | 1546 | // data |
| 1538 | s12_settings[ | |
| 1547 | s12_settings[ | |
| 1539 | 1548 | |
| 1540 | if ( | |
| 1549 | if ( | |
| 1541 | 1550 | { |
| 1542 | 1551 | logerror("S12 video settings: Contrast: %02x R: %02x G: %02x B: %02x\n", |
| 1543 | 1552 | BITSWAP8(s12_settings[0], 0, 1, 2, 3, 4, 5, 6, 7), |
| r14896 | r14897 | |
| 1548 | 1557 | } |
| 1549 | 1558 | else |
| 1550 | 1559 | { // setting number |
| 1551 | | |
| 1560 | | |
| 1552 | 1561 | } |
| 1553 | 1562 | |
| 1554 | | |
| 1563 | | |
| 1555 | 1564 | } |
| 1556 | 1565 | |
| 1557 | 1566 | /* Golgo 13 lightgun inputs |
| r14896 | r14897 | |
| 1561 | 1570 | * within the 16-bit word. |
| 1562 | 1571 | */ |
| 1563 | 1572 | |
| 1564 | ||
| 1573 | ||
| 1565 | 1574 | { |
| 1566 | const input_port_config *port = | |
| 1575 | const input_port_config *port = | |
| 1567 | 1576 | if( port != NULL ) |
| 1568 | 1577 | { |
| 1569 | 1578 | int rv = input_port_read_direct( port ) << 6; |
| r14896 | r14897 | |
| 1580 | 1589 | return 0; |
| 1581 | 1590 | } |
| 1582 | 1591 | |
| 1583 | ||
| 1592 | ||
| 1584 | 1593 | { |
| 1585 | const input_port_config *port = | |
| 1594 | const input_port_config *port = | |
| 1586 | 1595 | if( port != NULL ) |
| 1587 | 1596 | { |
| 1588 | 1597 | int rv = input_port_read_direct( port ) << 6; |
| r14896 | r14897 | |
| 1601 | 1610 | |
| 1602 | 1611 | static ADDRESS_MAP_START( s12h8iomap, AS_IO, 8, namcos12_state ) |
| 1603 | 1612 | AM_RANGE(H8_PORT_7, H8_PORT_7) AM_READ_PORT("DSW") |
| 1604 | AM_RANGE(H8_PORT_8, H8_PORT_8) AM_READ_LEGACY(s12_mcu_p8_r ) AM_WRITENOP | |
| 1605 | AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READWRITE_LEGACY(s12_mcu_pa_r, s12_mcu_pa_w ) | |
| 1606 | AM_RANGE(H8_PORT_B, H8_PORT_B) AM_READWRITE_LEGACY(s12_mcu_portB_r, s12_mcu_portB_w ) | |
| 1607 | AM_RANGE(H8_SERIAL_1, H8_SERIAL_1) AM_READ_LEGACY(s12_mcu_rtc_r ) AM_WRITE_LEGACY(s12_mcu_settings_w ) | |
| 1613 | AM_RANGE(H8_PORT_8, H8_PORT_8) AM_READ(s12_mcu_p8_r ) AM_WRITENOP | |
| 1614 | AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READWRITE(s12_mcu_pa_r, s12_mcu_pa_w ) | |
| 1615 | AM_RANGE(H8_PORT_B, H8_PORT_B) AM_READWRITE(s12_mcu_portB_r, s12_mcu_portB_w ) | |
| 1616 | AM_RANGE(H8_SERIAL_1, H8_SERIAL_1) AM_READ(s12_mcu_rtc_r ) AM_WRITE(s12_mcu_settings_w ) | |
| 1608 | 1617 | AM_RANGE(H8_ADC_0_H, H8_ADC_0_L) AM_NOP |
| 1609 | AM_RANGE(H8_ADC_1_H, H8_ADC_1_L) AM_READ_LEGACY(s12_mcu_gun_h_r ) // golgo 13 gun X-axis | |
| 1610 | AM_RANGE(H8_ADC_2_H, H8_ADC_2_L) AM_READ_LEGACY(s12_mcu_gun_v_r ) // golgo 13 gun Y-axis | |
| 1618 | AM_RANGE(H8_ADC_1_H, H8_ADC_1_L) AM_READ(s12_mcu_gun_h_r ) // golgo 13 gun X-axis | |
| 1619 | AM_RANGE(H8_ADC_2_H, H8_ADC_2_L) AM_READ(s12_mcu_gun_v_r ) // golgo 13 gun Y-axis | |
| 1611 | 1620 | AM_RANGE(H8_ADC_3_H, H8_ADC_3_L) AM_NOP |
| 1612 | 1621 | ADDRESS_MAP_END |
| 1613 | 1622 |
| r14896 | r14897 | |
|---|---|---|
| 43 | 43 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 44 | 44 | AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) /* mirror address */ |
| 45 | 45 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 46 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 47 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 46 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 47 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 48 | 48 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 49 | 49 | AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w) |
| 50 | 50 | AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w) |
| r14896 | r14897 | |
| 65 | 65 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 66 | 66 | AM_RANGE(0x9400, 0x97ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) |
| 67 | 67 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 68 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 69 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 68 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 69 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 70 | 70 | AM_RANGE(0x9880, 0x98ff) AM_RAM |
| 71 | 71 | |
| 72 | 72 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 96 | 96 | AM_RANGE(0x7800, 0x7803) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 97 | 97 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 98 | 98 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 99 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 100 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 99 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 100 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 101 | 101 | AM_RANGE(0x9880, 0x98ff) AM_RAM |
| 102 | 102 | AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w) |
| 103 | 103 | AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w) |
| r14896 | r14897 | |
| 124 | 124 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 125 | 125 | AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r) |
| 126 | 126 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 127 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 128 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 127 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 128 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 129 | 129 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 130 | 130 | AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_1_w) |
| 131 | 131 | AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_stars_enable_w) |
| r14896 | r14897 | |
| 146 | 146 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 147 | 147 | AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r) |
| 148 | 148 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 149 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 150 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 149 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 150 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 151 | 151 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 152 | 152 | AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_1_w) |
| 153 | 153 | AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_stars_enable_w) |
| r14896 | r14897 | |
| 168 | 168 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 169 | 169 | AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) |
| 170 | 170 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 171 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 172 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 171 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 172 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 173 | 173 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 174 | 174 | AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_1_w) |
| 175 | 175 | AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w) |
| r14896 | r14897 | |
| 188 | 188 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 189 | 189 | AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r) |
| 190 | 190 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 191 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 192 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 191 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 192 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 193 | 193 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 194 | 194 | AM_RANGE(0x6000, 0x6000) AM_WRITE(galaxold_coin_counter_2_w) |
| 195 | 195 | AM_RANGE(0x6002, 0x6002) AM_WRITE(galaxold_coin_counter_1_w) |
| r14896 | r14897 | |
| 198 | 198 | AM_RANGE(0x6006, 0x6006) AM_WRITE(galaxold_gfxbank_w) |
| 199 | 199 | AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w) |
| 200 | 200 | AM_RANGE(0x7000, 0x7000) AM_WRITE(watchdog_reset_w) |
| 201 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w) | |
| 201 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0") AM_WRITE(soundlatch_byte_w) | |
| 202 | 202 | AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1") |
| 203 | 203 | AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2") |
| 204 | 204 | AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN3") |
| 205 | AM_RANGE(0x9000, 0x9000) AM_WRITE | |
| 205 | AM_RANGE(0x9000, 0x9000) AM_WRITE | |
| 206 | 206 | ADDRESS_MAP_END |
| 207 | 207 | |
| 208 | 208 | |
| r14896 | r14897 | |
| 210 | 210 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 211 | 211 | AM_RANGE(0x1210, 0x1213) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 212 | 212 | AM_RANGE(0x1400, 0x143f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 213 | AM_RANGE(0x1440, 0x145f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 214 | AM_RANGE(0x1460, 0x147f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 213 | AM_RANGE(0x1440, 0x145f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 214 | AM_RANGE(0x1460, 0x147f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 215 | 215 | AM_RANGE(0x1480, 0x14ff) AM_RAM |
| 216 | 216 | AM_RANGE(0x1500, 0x1503) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 217 | 217 | AM_RANGE(0x1606, 0x1606) AM_WRITE(galaxold_flip_screen_x_w) |
| r14896 | r14897 | |
| 235 | 235 | AM_RANGE(0x4400, 0x47ff) AM_RAM |
| 236 | 236 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 237 | 237 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 238 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 239 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 238 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 239 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 240 | 240 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 241 | 241 | AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w) |
| 242 | 242 | AM_RANGE(0x6800, 0x6802) AM_WRITE(galaxold_gfxbank_w) |
| r14896 | r14897 | |
| 254 | 254 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 255 | 255 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(m_videoram) |
| 256 | 256 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 257 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 258 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 257 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 258 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 259 | 259 | AM_RANGE(0x6004, 0x6004) AM_WRITE(hotshock_flip_screen_w) |
| 260 | 260 | AM_RANGE(0x6800, 0x6800) AM_WRITE(galaxold_coin_counter_2_w) |
| 261 | 261 | AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w) |
| r14896 | r14897 | |
| 264 | 264 | AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxold_coin_counter_1_w) |
| 265 | 265 | AM_RANGE(0x6806, 0x6806) AM_WRITE(scrambold_background_red_w) |
| 266 | 266 | AM_RANGE(0x6807, 0x6807) AM_WRITE(scrambold_background_green_w) |
| 267 | AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_w) | |
| 268 | AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(hotshock_sh_irqtrigger_w) | |
| 267 | AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_byte_w) | |
| 268 | AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w) | |
| 269 | 269 | AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r) |
| 270 | 270 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0") |
| 271 | 271 | AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 291 | 291 | AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("8910.2", ay8910_address_w) |
| 292 | 292 | ADDRESS_MAP_END |
| 293 | 293 | |
| 294 | ||
| 294 | ||
| 295 | 295 | { |
| 296 | if(cpu_get_pc(&space | |
| 296 | if(cpu_get_pc(&space. | |
| 297 | 297 | return 1; |
| 298 | 298 | else |
| 299 | 299 | return 0; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | static ADDRESS_MAP_START( hunchbks_readport, AS_IO, 8, scramble_state ) |
| 303 | AM_RANGE(0x00, 0x00) AM_READ | |
| 303 | AM_RANGE(0x00, 0x00) AM_READ | |
| 304 | 304 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE") |
| 305 | 305 | ADDRESS_MAP_END |
| 306 | 306 | |
| r14896 | r14897 | |
| 1152 | 1152 | { |
| 1153 | 1153 | AY8910_LEGACY_OUTPUT, |
| 1154 | 1154 | AY8910_DEFAULT_LOADS, |
| 1155 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 1155 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 1156 | 1156 | DEVCB_HANDLER(scramble_portB_r), |
| 1157 | 1157 | DEVCB_NULL, |
| 1158 | 1158 | DEVCB_NULL |
| r14896 | r14897 | |
| 1207 | 1207 | |
| 1208 | 1208 | |
| 1209 | 1209 | |
| 1210 | ||
| 1210 | ||
| 1211 | 1211 | { |
| 1212 | scramble_state *state = space->machine().driver_data<scramble_state>(); | |
| 1213 | return state->m_soundram[offset & 0x03ff]; | |
| 1212 | return m_soundram[offset & 0x03ff]; | |
| 1214 | 1213 | } |
| 1215 | 1214 | |
| 1216 | ||
| 1215 | ||
| 1217 | 1216 | { |
| 1218 | scramble_state *state = space->machine().driver_data<scramble_state>(); | |
| 1219 | state->m_soundram[offset & 0x03ff] = data; | |
| 1217 | m_soundram[offset & 0x03ff] = data; | |
| 1220 | 1218 | } |
| 1221 | 1219 | |
| 1222 | 1220 | static ADDRESS_MAP_START( scramble_sound_map, AS_PROGRAM, 8, scramble_state ) |
| 1223 | 1221 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 1224 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE | |
| 1222 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE | |
| 1225 | 1223 | AM_RANGE(0x8000, 0x83ff) AM_WRITENOP AM_BASE(m_soundram) /* only here to initialize pointer */ |
| 1226 | AM_RANGE(0x9000, 0x9fff) AM_WRITE | |
| 1224 | AM_RANGE(0x9000, 0x9fff) AM_WRITE | |
| 1227 | 1225 | ADDRESS_MAP_END |
| 1228 | 1226 | |
| 1229 | 1227 | static ADDRESS_MAP_START( scramble_sound_io_map, AS_IO, 8, scramble_state ) |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | /* bit 2 toggles during gameplay */ |
| 57 | 57 | |
| 58 | flip_screen_set( | |
| 58 | state->flip_screen_set( | |
| 59 | 59 | |
| 60 | 60 | // popmessage("%02x",data&0x0f); |
| 61 | 61 | } |
| r14896 | r14897 | |
|---|---|---|
| 422 | 422 | avt_state(const machine_config &mconfig, device_type type, const char *tag) |
| 423 | 423 | : driver_device(mconfig, type, tag), |
| 424 | 424 | m_maincpu(*this,"maincpu"), |
| 425 | m_crtc(*this, "crtc") | |
| 426 | { } | |
| 425 | m_crtc(*this, "crtc"), | |
| 426 | m_videoram(*this, "videoram"), | |
| 427 | m_colorram(*this, "colorram"){ } | |
| 427 | 428 | |
| 429 | required_device<cpu_device> m_maincpu; | |
| 430 | required_device<mc6845_device> m_crtc; | |
| 431 | required_shared_ptr<UINT8> m_videoram; | |
| 432 | required_shared_ptr<UINT8> m_colorram; | |
| 433 | ||
| 428 | 434 | DECLARE_WRITE8_MEMBER(avt_6845_address_w); |
| 429 | 435 | DECLARE_WRITE8_MEMBER(avt_6845_data_w); |
| 430 | 436 | DECLARE_READ8_MEMBER( avt_6845_data_r ); |
| 431 | 437 | DECLARE_WRITE8_MEMBER(avt_videoram_w); |
| 432 | 438 | DECLARE_WRITE8_MEMBER(avt_colorram_w); |
| 433 | 439 | |
| 434 | UINT8 *m_videoram; | |
| 435 | UINT8 *m_colorram; | |
| 436 | 440 | tilemap_t *m_bg_tilemap; |
| 437 | 441 | UINT8 m_crtc_vreg[0x100],m_crtc_index; |
| 438 | 442 | |
| 439 | required_device<cpu_device> m_maincpu; | |
| 440 | required_device<mc6845_device> m_crtc; | |
| 441 | 443 | DECLARE_WRITE8_MEMBER(debug_w); |
| 442 | 444 | }; |
| 443 | 445 | |
| r14896 | r14897 | |
| 466 | 468 | |
| 467 | 469 | WRITE8_MEMBER( avt_state::avt_videoram_w ) |
| 468 | 470 | { |
| 469 | m_videoram[offset] = data; | |
| 471 | m_videoram.target()[offset] = data; | |
| 470 | 472 | m_bg_tilemap->mark_tile_dirty(offset); |
| 471 | 473 | } |
| 472 | 474 | |
| 473 | 475 | |
| 474 | 476 | WRITE8_MEMBER( avt_state::avt_colorram_w ) |
| 475 | 477 | { |
| 476 | m_colorram[offset] = data; | |
| 478 | m_colorram.target()[offset] = data; | |
| 477 | 479 | m_bg_tilemap->mark_tile_dirty(offset); |
| 478 | 480 | } |
| 479 | 481 | |
| r14896 | r14897 | |
| 486 | 488 | xxxx ---- color code. |
| 487 | 489 | ---- xxxx seems unused. |
| 488 | 490 | */ |
| 489 | int attr = state->m_colorram[tile_index]; | |
| 490 | int code = state->m_videoram[tile_index] | ((attr & 1) << 8); | |
| 491 | int attr = state->m_colorram.target()[tile_index]; | |
| 492 | int code = state->m_videoram.target()[tile_index] | ((attr & 1) << 8); | |
| 491 | 493 | int color = (attr & 0xf0)>>4; |
| 492 | 494 | |
| 493 | 495 | SET_TILE_INFO( 0, code, color, 0); |
| r14896 | r14897 | |
| 514 | 516 | { |
| 515 | 517 | for(x=0;x<mc6845_h_display;x++) |
| 516 | 518 | { |
| 517 | UINT16 tile = state->m_videoram[count] | ((state->m_colorram[count] & 1) << 8); | |
| 518 | UINT8 color = (state->m_colorram[count] & 0xf0) >> 4; | |
| 519 | UINT16 tile = state->m_videoram.target()[count] | ((state->m_colorram.target()[count] & 1) << 8); | |
| 520 | UINT8 color = (state->m_colorram.target()[count] & 0xf0) >> 4; | |
| 519 | 521 | |
| 520 | 522 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,x*8,(y*8)); |
| 521 | 523 | |
| r14896 | r14897 | |
| 614 | 616 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 615 | 617 | AM_RANGE(0x6000, 0x7fff) AM_RAM |
| 616 | 618 | AM_RANGE(0x8000, 0x9fff) AM_RAM // AM_SHARE("nvram") |
| 617 | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(avt_videoram_w) AM_BASE(m_videoram) | |
| 618 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(avt_colorram_w) AM_BASE(m_colorram) | |
| 619 | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(avt_videoram_w) AM_SHARE("videoram") | |
| 620 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(avt_colorram_w) AM_SHARE("colorram") | |
| 619 | 621 | ADDRESS_MAP_END |
| 620 | 622 | |
| 621 | 623 | static ADDRESS_MAP_START( avt_portmap, AS_IO, 8, avt_state ) |
| r14896 | r14897 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | WRITE8_MEMBER(mole_state::mole_flipscreen_w) |
| 121 | 121 | { |
| 122 | flip_screen_set( | |
| 122 | flip_screen_set( | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | static SCREEN_UPDATE_IND16( mole ) |
| r14896 | r14897 | |
|---|---|---|
| 112 | 112 | x = sx + xc * 8; |
| 113 | 113 | y = (sy + yc * 8) & 0xff; |
| 114 | 114 | |
| 115 | if (flip_screen | |
| 115 | if (state->flip_screen | |
| 116 | 116 | { |
| 117 | 117 | x = 248 - x; |
| 118 | 118 | y = 248 - y; |
| r14896 | r14897 | |
| 164 | 164 | AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 165 | 165 | AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE(m_objectram, m_objectram_size) |
| 166 | 166 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("share1") |
| 167 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 167 | AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 168 | 168 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(bublbobl_sound_command_w) |
| 169 | 169 | AM_RANGE(0xfa03, 0xfa03) AM_WRITENOP // sound cpu reset |
| 170 | 170 | AM_RANGE(0xfa80, 0xfa80) AM_WRITENOP |
| r14896 | r14897 | |
| 201 | 201 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| 202 | 202 | AM_RANGE(0x9000, 0x9000) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 203 | 203 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym3526_r, ym3526_w) |
| 204 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_r) AM_WRITENOP // message for main cpu | |
| 204 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) AM_WRITENOP // message for main cpu | |
| 205 | 205 | AM_RANGE(0xb001, 0xb001) AM_READNOP AM_WRITE(bublbobl_sh_nmi_enable_w) // bit 0: message pending for main cpu, bit 1: message pending for sound cpu |
| 206 | 206 | AM_RANGE(0xb002, 0xb002) AM_WRITE(bublbobl_sh_nmi_disable_w) |
| 207 | 207 | AM_RANGE(0xe000, 0xefff) AM_ROM // space for diagnostic ROM? |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | WRITE8_MEMBER(pitnrun_state::pitnrun_hflip_w) |
| 85 | 85 | { |
| 86 | flip_screen_x_set( | |
| 86 | flip_screen_x_set( | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | WRITE8_MEMBER(pitnrun_state::pitnrun_vflip_w) |
| 90 | 90 | { |
| 91 | flip_screen_y_set( | |
| 91 | flip_screen_y_set( | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static ADDRESS_MAP_START( pitnrun_map, AS_PROGRAM, 8, pitnrun_state ) |
| r14896 | r14897 | |
| 105 | 105 | AM_RANGE(0xb005, 0xb005) AM_WRITE(pitnrun_char_bank_select) |
| 106 | 106 | AM_RANGE(0xb006, 0xb006) AM_WRITE(pitnrun_hflip_w) |
| 107 | 107 | AM_RANGE(0xb007, 0xb007) AM_WRITE(pitnrun_vflip_w) |
| 108 | AM_RANGE(0xb800, 0xb800) AM_READ_PORT("INPUTS") AM_WRITE(soundlatch_w) | |
| 108 | AM_RANGE(0xb800, 0xb800) AM_READ_PORT("INPUTS") AM_WRITE(soundlatch_byte_w) | |
| 109 | 109 | AM_RANGE(0xc800, 0xc801) AM_WRITE(pitnrun_scroll_w) |
| 110 | 110 | AM_RANGE(0xc802, 0xc802) AM_WRITENOP/* VP(VF?)MCV - not used ?*/ |
| 111 | 111 | AM_RANGE(0xc804, 0xc804) AM_WRITE(pitnrun_mcu_data_w) |
| r14896 | r14897 | |
| 124 | 124 | |
| 125 | 125 | static ADDRESS_MAP_START( pitnrun_sound_io_map, AS_IO, 8, pitnrun_state ) |
| 126 | 126 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 127 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_w) | |
| 127 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w) | |
| 128 | 128 | AM_RANGE(0x8c, 0x8d) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 129 | 129 | AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 130 | 130 | AM_RANGE(0x8f, 0x8f) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| r14896 | r14897 | |
| 216 | 216 | { |
| 217 | 217 | AY8910_LEGACY_OUTPUT, |
| 218 | 218 | AY8910_DEFAULT_LOADS, |
| 219 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 220 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 219 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 220 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 221 | 221 | DEVCB_NULL, |
| 222 | 222 | DEVCB_NULL |
| 223 | 223 | }; |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | WRITE8_MEMBER(tehkanwc_state::sound_command_w) |
| 142 | 142 | { |
| 143 | soundlatch_w(space, offset, data); | |
| 143 | soundlatch_byte_w(space, offset, data); | |
| 144 | 144 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 145 | 145 | } |
| 146 | 146 | |
| r14896 | r14897 | |
| 151 | 151 | |
| 152 | 152 | WRITE8_MEMBER(tehkanwc_state::sound_answer_w) |
| 153 | 153 | { |
| 154 | soundlatch2_w(space, 0, data); | |
| 154 | soundlatch2_byte_w(space, 0, data); | |
| 155 | 155 | |
| 156 | 156 | /* in Gridiron, the sound CPU goes in a tight loop after the self test, */ |
| 157 | 157 | /* probably waiting to be reset by a watchdog */ |
| r14896 | r14897 | |
| 219 | 219 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1") |
| 220 | 220 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("share2") AM_BASE(m_videoram) |
| 221 | 221 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("share3") AM_BASE(m_colorram) |
| 222 | AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_SHARE("share4") AM_SHARE("paletteram") | |
| 222 | AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("share4") AM_SHARE("paletteram") | |
| 223 | 223 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */ |
| 224 | 224 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("share6") AM_BASE(m_videoram2) |
| 225 | 225 | AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("share7") AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* sprites */ |
| r14896 | r14897 | |
| 232 | 232 | AM_RANGE(0xf810, 0xf811) AM_READWRITE(tehkanwc_track_1_r, tehkanwc_track_1_reset_w) /* track 1 x/y */ |
| 233 | 233 | AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w) |
| 234 | 234 | AM_RANGE(0xf813, 0xf813) AM_READ_PORT("P2BUT") |
| 235 | AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_r) AM_WRITE(sound_command_w) /* answer from the sound CPU */ | |
| 235 | AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_byte_r) AM_WRITE(sound_command_w) /* answer from the sound CPU */ | |
| 236 | 236 | AM_RANGE(0xf840, 0xf840) AM_READ_PORT("DSW1") AM_WRITE(sub_cpu_halt_w) |
| 237 | 237 | AM_RANGE(0xf850, 0xf850) AM_READ_PORT("DSW2") AM_WRITENOP /* ?? writes 0x00 or 0xff */ |
| 238 | 238 | AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r) AM_WRITE(tehkanwc_flipscreen_x_w) |
| r14896 | r14897 | |
| 245 | 245 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1") |
| 246 | 246 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("share2") |
| 247 | 247 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("share3") |
| 248 | AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_SHARE("share4") AM_SHARE("paletteram") | |
| 248 | AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("share4") AM_SHARE("paletteram") | |
| 249 | 249 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */ |
| 250 | 250 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("share6") |
| 251 | 251 | AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("share7") /* sprites */ |
| r14896 | r14897 | |
| 260 | 260 | AM_RANGE(0x8001, 0x8001) AM_DEVWRITE_LEGACY("msm", msm_reset_w)/* MSM51xx reset */ |
| 261 | 261 | AM_RANGE(0x8002, 0x8002) AM_WRITENOP /* ?? written in the IRQ handler */ |
| 262 | 262 | AM_RANGE(0x8003, 0x8003) AM_WRITENOP /* ?? written in the NMI handler */ |
| 263 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) AM_WRITE(sound_answer_w) | |
| 263 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) AM_WRITE(sound_answer_w) | |
| 264 | 264 | ADDRESS_MAP_END |
| 265 | 265 | |
| 266 | 266 | static ADDRESS_MAP_START( sound_port, AS_IO, 8, tehkanwc_state ) |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | #define MASTER_CLOCK 20000000 /* 20Mhz Main Clock Xtal */ |
| 141 | 141 | |
| 142 | 142 | |
| 143 | void liberatr_state::machine_start() | |
| 143 | void liberatr_state::machine_start_liberatr() | |
| 144 | 144 | { |
| 145 | 145 | atarigen_state::machine_start(); |
| 146 | 146 | |
| r14896 | r14897 | |
| 392 | 392 | MCFG_CPU_PERIODIC_INT(irq0_line_hold,4*60) |
| 393 | 393 | |
| 394 | 394 | MCFG_ER2055_ADD("earom") |
| 395 | ||
| 396 | MCFG_MACHINE_START_DRIVER(liberatr_state, machine_start_liberatr) | |
| 395 | 397 | |
| 396 | 398 | /* video hardware */ |
| 399 | MCFG_VIDEO_START_DRIVER(liberatr_state, video_start_liberatr) | |
| 397 | 400 | MCFG_SCREEN_ADD("screen", RASTER) |
| 398 | 401 | MCFG_SCREEN_REFRESH_RATE(60) |
| 399 | 402 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| r14896 | r14897 | |
|---|---|---|
| 102 | 102 | { |
| 103 | 103 | |
| 104 | 104 | COMBINE_DATA(&m_soundcommand); |
| 105 | soundlatch_w(space, 0, m_soundcommand & 0xff); | |
| 105 | soundlatch_byte_w(space, 0, m_soundcommand & 0xff); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | READ16_MEMBER(bionicc_state::hacked_soundcommand_r) |
| r14896 | r14897 | |
| 164 | 164 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bionicc_state ) |
| 165 | 165 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 166 | 166 | AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 167 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 167 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 168 | 168 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 169 | 169 | ADDRESS_MAP_END |
| 170 | 170 |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | READ8_MEMBER(citycon_state::citycon_in_r) |
| 18 | 18 | { |
| 19 | return input_port_read(machine(), flip_screen | |
| 19 | return input_port_read(machine(), flip_screen | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | READ8_MEMBER(citycon_state::citycon_irq_ack_r) |
| r14896 | r14897 | |
| 33 | 33 | AM_RANGE(0x2800, 0x28ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 34 | 34 | AM_RANGE(0x2800, 0x2fff) AM_NOP //0x2900-0x2fff cleared at post but unused |
| 35 | 35 | AM_RANGE(0x3000, 0x3000) AM_READ(citycon_in_r) AM_WRITE(citycon_background_w) /* player 1 & 2 inputs multiplexed */ |
| 36 | AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_w) | |
| 37 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_w) | |
| 36 | AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_byte_w) | |
| 37 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_byte_w) | |
| 38 | 38 | AM_RANGE(0x3004, 0x3005) AM_READNOP AM_WRITEONLY AM_BASE(m_scroll) |
| 39 | 39 | AM_RANGE(0x3007, 0x3007) AM_READ(citycon_irq_ack_r) |
| 40 | AM_RANGE(0x3800, 0x3cff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 40 | AM_RANGE(0x3800, 0x3cff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 41 | 41 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 42 | 42 | ADDRESS_MAP_END |
| 43 | 43 | |
| r14896 | r14897 | |
| 176 | 176 | { |
| 177 | 177 | AY8910_LEGACY_OUTPUT, |
| 178 | 178 | AY8910_DEFAULT_LOADS, |
| 179 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 180 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_r), | |
| 179 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 180 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r), | |
| 181 | 181 | DEVCB_NULL, |
| 182 | 182 | DEVCB_NULL |
| 183 | 183 | }, |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | public: |
| 44 | 44 | dynadice_state(const machine_config &mconfig, device_type type, const char *tag) |
| 45 | : driver_device(mconfig, type, tag) { } | |
| 45 | : driver_device(mconfig, type, tag) , | |
| 46 | m_videoram(*this, "videoram"){ } | |
| 46 | 47 | |
| 47 | 48 | /* memory pointers */ |
| 48 | UINT8 | |
| 49 | required_shared_ptr<UINT8> | |
| 49 | 50 | // UINT8 * m_nvram; // currently this uses generic nvram handling |
| 50 | 51 | // UINT8 * m_paletteram; // currently this uses generic palette handling |
| 51 | 52 | |
| r14896 | r14897 | |
| 62 | 63 | |
| 63 | 64 | WRITE8_MEMBER(dynadice_state::dynadice_videoram_w) |
| 64 | 65 | { |
| 65 | m_videoram[offset] = data; | |
| 66 | m_videoram.target()[offset] = data; | |
| 66 | 67 | m_bg_tilemap->mark_tile_dirty(offset); |
| 67 | 68 | m_top_tilemap->mark_all_dirty(); |
| 68 | 69 | } |
| r14896 | r14897 | |
| 94 | 95 | |
| 95 | 96 | static ADDRESS_MAP_START( dynadice_map, AS_PROGRAM, 8, dynadice_state ) |
| 96 | 97 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 97 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(dynadice_videoram_w) AM_ | |
| 98 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(dynadice_videoram_w) AM_ | |
| 98 | 99 | AM_RANGE(0x4000, 0x40ff) AM_RAM AM_SHARE("nvram") |
| 99 | 100 | ADDRESS_MAP_END |
| 100 | 101 | |
| r14896 | r14897 | |
| 103 | 104 | AM_RANGE(0x51, 0x51) AM_READ_PORT("IN1") |
| 104 | 105 | AM_RANGE(0x52, 0x52) AM_READ_PORT("DSW") |
| 105 | 106 | AM_RANGE(0x62, 0x62) AM_WRITENOP |
| 106 | AM_RANGE(0x63, 0x63) AM_WRITE(soundlatch_w) | |
| 107 | AM_RANGE(0x63, 0x63) AM_WRITE(soundlatch_byte_w) | |
| 107 | 108 | AM_RANGE(0x70, 0x77) AM_WRITENOP |
| 108 | 109 | ADDRESS_MAP_END |
| 109 | 110 | |
| r14896 | r14897 | |
| 114 | 115 | |
| 115 | 116 | static ADDRESS_MAP_START( dynadice_sound_io_map, AS_IO, 8, dynadice_state ) |
| 116 | 117 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 117 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 118 | AM_RANGE(0x01, 0x01) AM_WRITE(soundlatch_clear_w) | |
| 118 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 119 | AM_RANGE(0x01, 0x01) AM_WRITE(soundlatch_clear_byte_w) | |
| 119 | 120 | AM_RANGE(0x02, 0x02) AM_WRITE(sound_data_w) |
| 120 | 121 | AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("aysnd", sound_control_w) |
| 121 | 122 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 192 | 193 | static TILE_GET_INFO( get_tile_info ) |
| 193 | 194 | { |
| 194 | 195 | dynadice_state *state = machine.driver_data<dynadice_state>(); |
| 195 | int code = state->m_videoram[tile_index]; | |
| 196 | int code = state->m_videoram.target()[tile_index]; | |
| 196 | 197 | SET_TILE_INFO(1, code, 0, 0); |
| 197 | 198 | } |
| 198 | 199 |
| r14896 | r14897 | |
|---|---|---|
| 276 | 276 | AM_RANGE(0x71001a, 0x71001b) AM_READ_PORT("P4") |
| 277 | 277 | // AM_RANGE(0x71001c, 0x71001d) AM_READ_LEGACY(playmark_snd_status???) |
| 278 | 278 | // AM_RANGE(0x71001e, 0x71001f) AM_WRITENOP//playmark_snd_command_w }, |
| 279 | AM_RANGE(0x780000, 0x780fff) AM_WRITE(paletteram | |
| 279 | AM_RANGE(0x780000, 0x780fff) AM_WRITE(paletteram | |
| 280 | 280 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 281 | 281 | ADDRESS_MAP_END |
| 282 | 282 |
| r14896 | r14897 | |
|---|---|---|
| 301 | 301 | |
| 302 | 302 | WRITE8_MEMBER(jangou_state::sound_latch_w) |
| 303 | 303 | { |
| 304 | soundlatch_w(space, 0, data & 0xff); | |
| 304 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 305 | 305 | device_set_input_line(m_cpu_1, INPUT_LINE_NMI, ASSERT_LINE); |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | READ8_MEMBER(jangou_state::sound_latch_r) |
| 309 | 309 | { |
| 310 | 310 | device_set_input_line(m_cpu_1, INPUT_LINE_NMI, CLEAR_LINE); |
| 311 | return soundlatch_r(space, 0); | |
| 311 | return soundlatch_byte_r(space, 0); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /* Jangou HC-55516 CVSD */ |
| r14896 | r14897 | |
|---|---|---|
| 276 | 276 | { |
| 277 | 277 | if (PGMLOGERROR) |
| 278 | 278 | logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, cpu_get_pc(&space.device())); |
| 279 | soundlatch_w(space, 0, data); | |
| 279 | soundlatch_byte_w(space, 0, data); | |
| 280 | 280 | device_set_input_line(m_soundcpu, INPUT_LINE_NMI, PULSE_LINE ); |
| 281 | 281 | } |
| 282 | 282 | } |
| r14896 | r14897 | |
| 285 | 285 | { |
| 286 | 286 | if (PGMLOGERROR) |
| 287 | 287 | logerror("SL 3 z80.w %02x (%04x)\n", data, cpu_get_pc(&space.device())); |
| 288 | soundlatch3_w(space, 0, data); | |
| 288 | soundlatch3_byte_w(space, 0, data); | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | void pgm_sound_irq( device_t *device, int level ) |
| r14896 | r14897 | |
| 310 | 310 | |
| 311 | 311 | ADDRESS_MAP_START( pgm_z80_io, AS_IO, 8, pgm_state ) |
| 312 | 312 | AM_RANGE(0x8000, 0x8003) AM_DEVREADWRITE_LEGACY("ics", ics2115_device::read, ics2115_device::write) |
| 313 | AM_RANGE(0x8100, 0x81ff) AM_READ(soundlatch3_r) AM_WRITE(z80_l3_w) | |
| 314 | AM_RANGE(0x8200, 0x82ff) AM_READWRITE(soundlatch_r, soundlatch_w) | |
| 315 | AM_RANGE(0x8400, 0x84ff) AM_READWRITE(soundlatch2_r, soundlatch2_w) | |
| 313 | AM_RANGE(0x8100, 0x81ff) AM_READ(soundlatch3_byte_r) AM_WRITE(z80_l3_w) | |
| 314 | AM_RANGE(0x8200, 0x82ff) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) | |
| 315 | AM_RANGE(0x8400, 0x84ff) AM_READWRITE(soundlatch2_byte_r, soundlatch2_byte_w) | |
| 316 | 316 | ADDRESS_MAP_END |
| 317 | 317 | |
| 318 | 318 | /*** 68000 (main CPU) + variants for protection devices **********************/ |
| r14896 | r14897 | |
| 323 | 323 | AM_RANGE(0x800000, 0x81ffff) AM_RAM AM_MIRROR(0x0e0000) AM_BASE_LEGACY(&pgm_mainram) AM_SHARE("sram") /* Main Ram */ |
| 324 | 324 | |
| 325 | 325 | AM_RANGE(0x900000, 0x907fff) AM_MIRROR(0x0f8000) AM_READWRITE(pgm_videoram_r, pgm_videoram_w) AM_BASE(m_videoram) /* IGS023 VIDEO CHIP */ |
| 326 | AM_RANGE(0xa00000, 0xa011ff) AM_RAM_WRITE(paletteram | |
| 326 | AM_RANGE(0xa00000, 0xa011ff) AM_RAM_WRITE(paletteram | |
| 327 | 327 | AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(m_videoregs) /* Video Regs inc. Zoom Table */ |
| 328 | 328 | |
| 329 | 329 | AM_RANGE(0xc00002, 0xc00003) AM_READ(soundlatch_word_r) AM_WRITE(m68k_l1_w) |
| r14896 | r14897 | |
| 1508 | 1508 | ROM_LOAD( "m0600.rom", 0x400000, 0x400000, CRC(3ada4fd6) SHA1(4c87adb25d31cbd41f04fbffe31f7bc37173da76) ) |
| 1509 | 1509 | ROM_END |
| 1510 | 1510 | |
| 1511 | ||
| 1512 | /* kovsh bootlegs, these still have the ARM! */ | |
| 1513 | ROM_START( kovlsqh2 ) | |
| 1514 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 1515 | PGM_68K_BIOS | |
| 1516 | ROM_LOAD16_WORD_SWAP( "lsqh2_prg.rom",0x100000, 0x400000, CRC(d71e3d50) SHA1(bda78648bc176b0ded74118a8e340ee661bb930d) ) | |
| 1517 | ||
| 1518 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 1519 | ROM_LOAD( "qhsg_prot.c51", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) | |
| 1520 | ||
| 1521 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 1522 | PGM_VIDEO_BIOS | |
| 1523 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 1524 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 1525 | ||
| 1526 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 1527 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 1528 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 1529 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 1530 | ||
| 1531 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 1532 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 1533 | ||
| 1534 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 1535 | PGM_AUDIO_BIOS | |
| 1536 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 1537 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 1538 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 1539 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 1540 | ROM_END | |
| 1541 | ||
| 1542 | ROM_START( kovlsjb ) | |
| 1543 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 1544 | PGM_68K_BIOS | |
| 1545 | ROM_LOAD16_WORD_SWAP( "lsjb_prg.rom", 0x100000, 0x400000, CRC(adf06b37) SHA1(be3c0af64de374046d28492ac49c01da1ec78e40) ) | |
| 1546 | ||
| 1547 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 1548 | ROM_LOAD( "qhsg_prot.c51", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) | |
| 1549 | ||
| 1550 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 1551 | PGM_VIDEO_BIOS | |
| 1552 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 1553 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 1554 | ||
| 1555 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 1556 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 1557 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 1558 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 1559 | ||
| 1560 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 1561 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 1562 | ||
| 1563 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 1564 | PGM_AUDIO_BIOS | |
| 1565 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 1566 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 1567 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 1568 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 1569 | ROM_END | |
| 1570 | ||
| 1571 | ROM_START( kovlsjba ) | |
| 1572 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 1573 | PGM_68K_BIOS | |
| 1574 | ROM_LOAD16_WORD_SWAP( "lsjba_prg.rom",0x100000, 0x400000, CRC(8b42f456) SHA1(48796e48f6f1a5f68442cf15a6b195095d443a35) ) | |
| 1575 | ||
| 1576 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 1577 | ROM_LOAD( "qhsg_prot.c51", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) | |
| 1578 | ||
| 1579 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 1580 | PGM_VIDEO_BIOS | |
| 1581 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 1582 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 1583 | ||
| 1584 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 1585 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 1586 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 1587 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 1588 | ||
| 1589 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 1590 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 1591 | ||
| 1592 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 1593 | PGM_AUDIO_BIOS | |
| 1594 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 1595 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 1596 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 1597 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 1598 | ROM_END | |
| 1599 | ||
| 1600 | 1511 | ROM_START( kovqhsgs ) |
| 1601 | 1512 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1602 | 1513 | PGM_68K_BIOS |
| r14896 | r14897 | |
| 1627 | 1538 | ROM_END |
| 1628 | 1539 | |
| 1629 | 1540 | |
| 1630 | ROM_START( kovlsqh ) | |
| 1631 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 1632 | PGM_68K_BIOS | |
| 1633 | ROM_LOAD16_WORD_SWAP( "lsqh_v200cn.rom", 0x100000, 0x400000, CRC(9935a27a) SHA1(3075935293172466c4bd997dcb67f864ae26493e) ) | |
| 1634 | 1541 | |
| 1635 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 1636 | ROM_LOAD( "qhsg_prot.c51", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) | |
| 1637 | ||
| 1638 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 1639 | PGM_VIDEO_BIOS | |
| 1640 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 1641 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 1642 | ||
| 1643 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 1644 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 1645 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 1646 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 1647 | ||
| 1648 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 1649 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 1650 | ||
| 1651 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 1652 | PGM_AUDIO_BIOS | |
| 1653 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 1654 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 1655 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 1656 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 1657 | ROM_END | |
| 1658 | ||
| 1659 | 1542 | /* |
| 1660 | 1543 | |
| 1661 | 1544 | p0701_v105.u2 |
| r14896 | r14897 | |
| 3168 | 3051 | ROM_LOAD16_WORD_SWAP( "p0600h.rom", 0x100000, 0x400000, CRC(e251e8e4) SHA1(af5b7c81632a39e1450d932951bed634c76b84e8) ) |
| 3169 | 3052 | |
| 3170 | 3053 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ |
| 3171 | ROM_LOAD( "kovsh | |
| 3054 | ROM_LOAD( "kovsh | |
| 3172 | 3055 | |
| 3173 | 3056 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ |
| 3174 | 3057 | PGM_VIDEO_BIOS |
| r14896 | r14897 | |
| 3189 | 3072 | ROM_LOAD( "m0600.rom", 0x400000, 0x400000, CRC(3ada4fd6) SHA1(4c87adb25d31cbd41f04fbffe31f7bc37173da76) ) |
| 3190 | 3073 | ROM_END |
| 3191 | 3074 | |
| 3075 | ||
| 3076 | ROM_START( kovshxas ) | |
| 3077 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 3078 | PGM_68K_BIOS | |
| 3079 | ROM_LOAD16_WORD_SWAP( "de_p0609.322", 0x100000, 0x400000, CRC(3b7b627f) SHA1(b331148501f9349fbd5882fb3f184f6304e58646) ) | |
| 3080 | ||
| 3081 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 3082 | ROM_LOAD( "kovsh_v100_china.asic", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) // this is the kovsh ARM rom, we intercept and modify protection calls | |
| 3083 | ||
| 3084 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 3085 | PGM_VIDEO_BIOS | |
| 3086 | ROM_LOAD( "t0600.rom", 0x180000, 0x800000, CRC(4acc1ad6) SHA1(0668dbd5e856c2406910c6b7382548b37c631780) ) | |
| 3087 | ||
| 3088 | ROM_REGION( 0x2000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 3089 | ROM_LOAD( "a0600.rom", 0x0000000, 0x0800000, CRC(d8167834) SHA1(fa55a99629d03b2ea253392352f70d2c8639a991) ) // FIXED BITS (xxxxxxxx1xxxxxxx) | |
| 3090 | ROM_LOAD( "a0601.rom", 0x0800000, 0x0800000, CRC(ff7a4373) SHA1(7def9fca7513ad5a117da230bebd2e3c78679041) ) // FIXED BITS (xxxxxxxx1xxxxxxx) | |
| 3091 | ROM_LOAD( "a0602.rom", 0x1000000, 0x0800000, CRC(e7a32959) SHA1(3d0ed684dc5b269238890836b2ce7ef46aa5265b) ) // FIXED BITS (xxxxxxxx1xxxxxxx) | |
| 3092 | ROM_LOAD( "a0603xas.rom", 0x1800000, 0x0800000, CRC(7057b37e) SHA1(85a19f23303b4d581c4fa315b2c204af92fcb424) ) | |
| 3093 | ||
| 3094 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 3095 | ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) | |
| 3096 | ROM_LOAD( "b0601xas.rom", 0x0800000, 0x0800000, CRC(3784fb49) SHA1(7e85fe5b5fb8746f1321c03ad2350d2a58969d7a) ) | |
| 3097 | ||
| 3098 | ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 3099 | PGM_AUDIO_BIOS | |
| 3100 | ROM_LOAD( "m0600.rom", 0x400000, 0x400000, CRC(3ada4fd6) SHA1(4c87adb25d31cbd41f04fbffe31f7bc37173da76) ) | |
| 3101 | ROM_END | |
| 3102 | ||
| 3103 | ||
| 3104 | ROM_START( kovlsqh ) | |
| 3105 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 3106 | PGM_68K_BIOS | |
| 3107 | ROM_LOAD16_WORD_SWAP( "lsqh_v200cn.rom", 0x100000, 0x400000, CRC(9935a27a) SHA1(3075935293172466c4bd997dcb67f864ae26493e) ) | |
| 3108 | ||
| 3109 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 3110 | ROM_LOAD( "kovsh_v100_china.asic", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) // this is the kovsh ARM rom, we intercept and modify protection calls | |
| 3111 | ||
| 3112 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 3113 | PGM_VIDEO_BIOS | |
| 3114 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 3115 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 3116 | ||
| 3117 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 3118 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 3119 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 3120 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 3121 | ||
| 3122 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 3123 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 3124 | ||
| 3125 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 3126 | PGM_AUDIO_BIOS | |
| 3127 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 3128 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 3129 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 3130 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 3131 | ROM_END | |
| 3132 | ||
| 3133 | ROM_START( kovlsqh2 ) | |
| 3134 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 3135 | PGM_68K_BIOS | |
| 3136 | ROM_LOAD16_WORD_SWAP( "lsqh2_prg.rom",0x100000, 0x400000, CRC(d71e3d50) SHA1(bda78648bc176b0ded74118a8e340ee661bb930d) ) | |
| 3137 | ||
| 3138 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 3139 | ROM_LOAD( "kovsh_v100_china.asic", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) // this is the kovsh ARM rom, we intercept and modify protection calls | |
| 3140 | ||
| 3141 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 3142 | PGM_VIDEO_BIOS | |
| 3143 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 3144 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 3145 | ||
| 3146 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 3147 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 3148 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 3149 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 3150 | ||
| 3151 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 3152 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 3153 | ||
| 3154 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 3155 | PGM_AUDIO_BIOS | |
| 3156 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 3157 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 3158 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 3159 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 3160 | ROM_END | |
| 3161 | ||
| 3162 | ||
| 3163 | ROM_START( kovlsjb ) | |
| 3164 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 3165 | PGM_68K_BIOS | |
| 3166 | ROM_LOAD16_WORD_SWAP( "lsjb_prg.rom", 0x100000, 0x400000, CRC(adf06b37) SHA1(be3c0af64de374046d28492ac49c01da1ec78e40) ) | |
| 3167 | ||
| 3168 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 3169 | ROM_LOAD( "kovsh_v100_china.asic", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) // this is the kovsh ARM rom, we intercept and modify protection calls | |
| 3170 | ||
| 3171 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 3172 | PGM_VIDEO_BIOS | |
| 3173 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 3174 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 3175 | ||
| 3176 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 3177 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 3178 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 3179 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 3180 | ||
| 3181 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 3182 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 3183 | ||
| 3184 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 3185 | PGM_AUDIO_BIOS | |
| 3186 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 3187 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 3188 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 3189 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 3190 | ROM_END | |
| 3191 | ||
| 3192 | ROM_START( kovlsjba ) | |
| 3193 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 3194 | PGM_68K_BIOS | |
| 3195 | ROM_LOAD16_WORD_SWAP( "lsjba_prg.rom",0x100000, 0x400000, CRC(8b42f456) SHA1(48796e48f6f1a5f68442cf15a6b195095d443a35) ) | |
| 3196 | ||
| 3197 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 3198 | ROM_LOAD( "kovsh_v100_china.asic", 0x000000, 0x04000, BAD_DUMP CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) // this is the kovsh ARM rom, we intercept and modify protection calls | |
| 3199 | ||
| 3200 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 3201 | PGM_VIDEO_BIOS | |
| 3202 | ROM_LOAD( "lsqh2_t01.rom",0x180000, 0x800000, CRC(d498d97f) SHA1(97a7b6d2ed1170449e7c2899448af7cbbca4c94f) ) | |
| 3203 | ROM_IGNORE( 0x800000 ) // second half identical | |
| 3204 | ||
| 3205 | ROM_REGION( 0x3000000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 3206 | ROM_LOAD( "lsqh2_a01.rom", 0x0000000, 0x1000000, CRC(25ae3efd) SHA1(083d977602ddb5ad54fbdcba000cd4287de8d463) ) | |
| 3207 | ROM_LOAD( "lsqh2_a23.rom", 0x1000000, 0x1000000, CRC(7a779112) SHA1(0a7d36b3715063d8eac629b95a9bb3ecd8e54fca) ) | |
| 3208 | ROM_LOAD( "lsqh2_a45.rom", 0x2000000, 0x1000000, CRC(5d7de052) SHA1(7663b6cf09f65c4644661005a38f9aba84a32913) ) | |
| 3209 | ||
| 3210 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 3211 | ROM_LOAD( "lsqh2_b01.rom", 0x0000000, 0x1000000, CRC(df7ca696) SHA1(7af3d27957a39de7e4873867c9972c05af7e7964) ) | |
| 3212 | ||
| 3213 | ROM_REGION( 0xc00000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 3214 | PGM_AUDIO_BIOS | |
| 3215 | ROM_LOAD( "lsqh2_m01.rom",0x400000, 0x400000, CRC(01af1b65) SHA1(6cf523fa8f1e03f974771611bb9a4e08a4d4443f) ) | |
| 3216 | ROM_IGNORE( 0x400000 ) // 400000-7fffff empty | |
| 3217 | ROM_CONTINUE( 0x800000, 0x400000 ) | |
| 3218 | ROM_IGNORE( 0x400000 ) // c00000-ffffff empty | |
| 3219 | ROM_END | |
| 3220 | ||
| 3221 | ||
| 3192 | 3222 | ROM_START( killbldp ) |
| 3193 | 3223 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3194 | 3224 | PGM_68K_BIOS |
| r14896 | r14897 | |
| 3777 | 3807 | GAME( 2003, thegladpcb, theglad, pgm_arm_type3, pgm, theglad, ROT0, "IGS", "The Gladiator - Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 02/25/03 SHEN JIAN) (JAMMA PCB)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // ARM time: 16:32:21 |
| 3778 | 3808 | |
| 3779 | 3809 | |
| 3780 | ||
| 3810 | // simulation doesn't seem 100% | |
| 3781 | 3811 | GAME( 2004, oldsplus, pgm, pgm_arm_type1_sim, oldsplus, oldsplus, ROT0, "IGS", "Oriental Legend Special Plus / Xi You Shi E Zhuan Super Plus", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 3782 | 3812 | |
| 3813 | // we use the kovsh ARM rom for this, itercepting commands and changing them to match it, doesn't seem 100% correct tho so I'm leaving it as NOT WORKING | |
| 3814 | // if the internal ROM can't be extracted (likely case, execute only area and NO chance of custom code execution at all due to lack of external ROM) then a reference simulator should probably be written based on the actual | |
| 3815 | // kovsh code, tweaked based on tests done with this specific board to catch any different behaviors. These all seem to be for China only, they don't work as expected when set to other regions. | |
| 3783 | 3816 | GAME( 2004, kovshp, pgm, pgm_arm_type1, kovsh, kovshp, ROT0, "IGS", "Knights of Valour Super Heroes Plus / Sangoku Senki Super Heroes Plus (ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 3784 | // these bootlegs are clones of this instead | |
| 3817 | // this bootleg is very close to kovshp | |
| 3818 | GAME( 2004, kovshxas, kovshp, pgm_arm_type1, kovsh, kovshxas, ROT0, "bootleg", "Knights of Valour: Aoshi Sanguo / Sangoku Senki: Aoshi Sanguo (ver. 202CN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ | |
| 3819 | // these should be bootlegs of kovshp, but have further command changes in their ARMs and have a lot of code shuffled around, bootlegs of a different revision? | |
| 3785 | 3820 | GAME( 2004, kovlsqh, kovshp, pgm_arm_type1, kovsh, kovlsqh2, ROT0, "bootleg", "Knights of Valour: Luan Shi Quan Huang / Sangoku Senki: Luan Shi Quan Huang (ver. 200CN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 3786 | 3821 | GAME( 2004, kovlsqh2, kovshp, pgm_arm_type1, kovsh, kovlsqh2, ROT0, "bootleg", "Knights of Valour: Luan Shi Quan Huang 2 / Sangoku Senki: Luan Shi Quan Huang 2 (ver. 200CN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 3787 | 3822 | GAME( 2004, kovlsjb, kovshp, pgm_arm_type1, kovsh, kovlsqh2, ROT0, "bootleg", "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN, set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| r14896 | r14897 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | static const via6522_interface via_2_interface = |
| 169 | 169 | { |
| 170 | DEVCB_NULL, DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), /*inputs : A/B */ | |
| 170 | DEVCB_NULL, DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), /*inputs : A/B */ | |
| 171 | 171 | DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, /*inputs : CA/B1,CA/B2 */ |
| 172 | 172 | DEVCB_HANDLER(audio_cmd_w), DEVCB_NULL, /*outputs: A/B */ |
| 173 | 173 | DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(audio_trigger_w), DEVCB_HANDLER(audio_reset_w), /*outputs: CA/B1,CA/B2 */ |
| r14896 | r14897 | |
| 196 | 196 | { |
| 197 | 197 | gameplan_state *gameplan = device->machine().driver_data<gameplan_state>(); |
| 198 | 198 | address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 199 | gameplan->soundlatch_w(*space, 0, data); | |
| 199 | gameplan->soundlatch_byte_w(*space, 0, data); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 |
| r14896 | r14897 | |
|---|---|---|
| 183 | 183 | WRITE8_MEMBER(capbowl_state::capbowl_sndcmd_w) |
| 184 | 184 | { |
| 185 | 185 | device_set_input_line(m_audiocpu, M6809_IRQ_LINE, HOLD_LINE); |
| 186 | soundlatch_w(space, offset, data); | |
| 186 | soundlatch_byte_w(space, offset, data); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
| r14896 | r14897 | |
| 264 | 264 | AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 265 | 265 | AM_RANGE(0x2000, 0x2000) AM_WRITENOP /* Not hooked up according to the schematics */ |
| 266 | 266 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 267 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_r) | |
| 267 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) | |
| 268 | 268 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 269 | 269 | ADDRESS_MAP_END |
| 270 | 270 | |
| r14896 | r14897 | |
| 318 | 318 | { |
| 319 | 319 | AY8910_LEGACY_OUTPUT, |
| 320 | 320 | AY8910_DEFAULT_LOADS, |
| 321 | DEVCB_DEVICE_ | |
| 321 | DEVCB_DEVICE_M | |
| 322 | 322 | DEVCB_NULL, |
| 323 | 323 | DEVCB_NULL, |
| 324 | DEVCB_DEVICE_ | |
| 324 | DEVCB_DEVICE_M | |
| 325 | 325 | }, |
| 326 | 326 | firqhandler |
| 327 | 327 | }; |
| r14896 | r14897 | |
| 372 | 372 | MCFG_MACHINE_RESET(capbowl) |
| 373 | 373 | MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", capbowl_state, init_nvram) |
| 374 | 374 | |
| 375 | MCFG_TICKET_DISPENSER_ADD("ticket", 100, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 375 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 376 | 376 | |
| 377 | 377 | /* video hardware */ |
| 378 | 378 | MCFG_VIDEO_START(capbowl) |
| r14896 | r14897 | |
|---|---|---|
| 249 | 249 | AM_RANGE(0xd20000, 0xd20003) AM_DEVWRITE_LEGACY("pc080sn", pc080sn_yscroll_word_w) |
| 250 | 250 | AM_RANGE(0xd40000, 0xd40003) AM_DEVWRITE_LEGACY("pc080sn", pc080sn_xscroll_word_w) |
| 251 | 251 | AM_RANGE(0xd50000, 0xd50003) AM_DEVWRITE_LEGACY("pc080sn", pc080sn_ctrl_word_w) |
| 252 | AM_RANGE(0xd80000, 0xd80fff) AM_RAM_WRITE(paletteram | |
| 252 | AM_RANGE(0xd80000, 0xd80fff) AM_RAM_WRITE(paletteram | |
| 253 | 253 | AM_RANGE(0xe00100, 0xe00fff) AM_RAM AM_SHARE("share1") AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 254 | 254 | AM_RANGE(0xe01000, 0xe02fff) AM_RAM AM_SHARE("share2") |
| 255 | 255 | AM_RANGE(0xe08000, 0xe0ffff) AM_RAM_WRITE(darius_fg_layer_w) AM_SHARE("share3") AM_BASE(m_fg_ram) |
| r14896 | r14897 | |
| 260 | 260 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 261 | 261 | AM_RANGE(0x040000, 0x04ffff) AM_RAM /* local RAM */ |
| 262 | 262 | AM_RANGE(0xc00000, 0xc0007f) AM_WRITE(darius_ioc_w) /* only writes $c00050 (?) */ |
| 263 | AM_RANGE(0xd80000, 0xd80fff) AM_WRITE(paletteram | |
| 263 | AM_RANGE(0xd80000, 0xd80fff) AM_WRITE(paletteram | |
| 264 | 264 | AM_RANGE(0xe00100, 0xe00fff) AM_RAM AM_SHARE("share1") |
| 265 | 265 | AM_RANGE(0xe01000, 0xe02fff) AM_RAM AM_SHARE("share2") |
| 266 | 266 | AM_RANGE(0xe08000, 0xe0ffff) AM_RAM_WRITE(darius_fg_layer_w) AM_SHARE("share3") |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | { |
| 141 | 141 | public: |
| 142 | 142 | kinst_state(const machine_config &mconfig, device_type type, const char *tag) |
| 143 | : driver_device(mconfig, type, tag) { } | |
| 143 | : driver_device(mconfig, type, tag) , | |
| 144 | m_rambase(*this, "rambase"), | |
| 145 | m_rambase2(*this, "rambase2"), | |
| 146 | m_control(*this, "control"), | |
| 147 | m_rombase(*this, "rombase"){ } | |
| 144 | 148 | |
| 145 | UINT32 *m_rambase; | |
| 146 | UINT32 *m_rambase2; | |
| 147 | UINT32 *m_rombase; | |
| 149 | required_shared_ptr<UINT32> m_rambase; | |
| 150 | required_shared_ptr<UINT32> m_rambase2; | |
| 151 | required_shared_ptr<UINT32> m_control; | |
| 152 | required_shared_ptr<UINT32> m_rombase; | |
| 148 | 153 | UINT32 *m_video_base; |
| 149 | UINT32 *m_control; | |
| 150 | 154 | const UINT8 *m_control_map; |
| 151 | 155 | DECLARE_READ32_MEMBER(kinst_control_r); |
| 152 | 156 | DECLARE_WRITE32_MEMBER(kinst_control_w); |
| r14896 | r14897 | |
| 172 | 176 | mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS); |
| 173 | 177 | |
| 174 | 178 | /* configure fast RAM regions for DRC */ |
| 175 | mips3drc_add_fastram(machine.device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->m_rambase2); | |
| 176 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->m_rambase); | |
| 177 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase); | |
| 179 | mips3drc_add_fastram(machine.device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->m_rambase2.target()); | |
| 180 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->m_rambase.target()); | |
| 181 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase.target()); | |
| 178 | 182 | } |
| 179 | 183 | |
| 180 | 184 | |
| r14896 | r14897 | |
| 221 | 225 | } |
| 222 | 226 | |
| 223 | 227 | /* set a safe base location for video */ |
| 224 | state->m_video_base = &state->m_rambase[0x30000/4]; | |
| 228 | state->m_video_base = &state->m_rambase.target()[0x30000/4]; | |
| 225 | 229 | } |
| 226 | 230 | |
| 227 | 231 | |
| r14896 | r14897 | |
| 329 | 333 | |
| 330 | 334 | /* apply shuffling */ |
| 331 | 335 | offset = m_control_map[offset / 2]; |
| 332 | result = m_control[offset]; | |
| 336 | result = m_control.target()[offset]; | |
| 333 | 337 | |
| 334 | 338 | switch (offset) |
| 335 | 339 | { |
| r14896 | r14897 | |
| 363 | 367 | |
| 364 | 368 | /* apply shuffling */ |
| 365 | 369 | offset = m_control_map[offset / 2]; |
| 366 | olddata = m_control[offset]; | |
| 367 | COMBINE_DATA(&m_control[offset]); | |
| 370 | olddata = m_control.target()[offset]; | |
| 371 | COMBINE_DATA(&m_control.target()[offset]); | |
| 368 | 372 | |
| 369 | 373 | switch (offset) |
| 370 | 374 | { |
| 371 | 375 | case 0: /* $80 - VRAM buffer control */ |
| 372 | 376 | if (data & 4) |
| 373 | m_video_base = &m_rambase[0x58000/4]; | |
| 377 | m_video_base = &m_rambase.target()[0x58000/4]; | |
| 374 | 378 | else |
| 375 | m_video_base = &m_rambase[0x30000/4]; | |
| 379 | m_video_base = &m_rambase.target()[0x30000/4]; | |
| 376 | 380 | break; |
| 377 | 381 | |
| 378 | 382 | case 1: /* $88 - sound reset */ |
| r14896 | r14897 | |
| 380 | 384 | break; |
| 381 | 385 | |
| 382 | 386 | case 2: /* $90 - sound control */ |
| 383 | if (!(olddata & 0x02) && (m_control[offset] & 0x02)) | |
| 384 | dcs_data_w(machine(), m_control[3]); | |
| 387 | if (!(olddata & 0x02) && (m_control.target()[offset] & 0x02)) | |
| 388 | dcs_data_w(machine(), m_control.target()[3]); | |
| 385 | 389 | break; |
| 386 | 390 | |
| 387 | 391 | case 3: /* $98 - sound data */ |
| r14896 | r14897 | |
| 399 | 403 | |
| 400 | 404 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, kinst_state ) |
| 401 | 405 | ADDRESS_MAP_UNMAP_HIGH |
| 402 | AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_BASE(m_rambase) | |
| 403 | AM_RANGE(0x08000000, 0x087fffff) AM_RAM AM_BASE(m_rambase2) | |
| 404 | AM_RANGE(0x10000080, 0x100000ff) AM_READWRITE(kinst_control_r, kinst_control_w) AM_BASE(m_control) | |
| 406 | AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_SHARE("rambase") | |
| 407 | AM_RANGE(0x08000000, 0x087fffff) AM_RAM AM_SHARE("rambase2") | |
| 408 | AM_RANGE(0x10000080, 0x100000ff) AM_READWRITE(kinst_control_r, kinst_control_w) AM_SHARE("control") | |
| 405 | 409 | AM_RANGE(0x10000100, 0x1000013f) AM_DEVREADWRITE_LEGACY("ide", kinst_ide_r, kinst_ide_w) |
| 406 | 410 | AM_RANGE(0x10000170, 0x10000173) AM_DEVREADWRITE_LEGACY("ide", kinst_ide_extra_r, kinst_ide_extra_w) |
| 407 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_ | |
| 411 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_ | |
| 408 | 412 | ADDRESS_MAP_END |
| 409 | 413 | |
| 410 | 414 |
| r14896 | r14897 | |
|---|---|---|
| 116 | 116 | { |
| 117 | 117 | public: |
| 118 | 118 | sub_state(const machine_config &mconfig, device_type type, const char *tag) |
| 119 | : driver_device(mconfig, type, tag) { } | |
| 119 | : driver_device(mconfig, type, tag) , | |
| 120 | m_attr(*this, "attr"), | |
| 121 | m_vid(*this, "vid"), | |
| 122 | m_spriteram(*this, "spriteram"), | |
| 123 | m_spriteram2(*this, "spriteram2"), | |
| 124 | m_scrolly(*this, "scrolly"){ } | |
| 120 | 125 | |
| 121 | UINT8* m_vid; | |
| 122 | UINT8* m_attr; | |
| 123 | UINT8* m_scrolly; | |
| 124 | UINT8* m_spriteram; | |
| 125 | UINT8* m_spriteram2; | |
| 126 | required_shared_ptr<UINT8> m_attr; | |
| 127 | required_shared_ptr<UINT8> m_vid; | |
| 128 | required_shared_ptr<UINT8> m_spriteram; | |
| 129 | required_shared_ptr<UINT8> m_spriteram2; | |
| 130 | required_shared_ptr<UINT8> m_scrolly; | |
| 126 | 131 | UINT8 m_nmi_en; |
| 127 | 132 | DECLARE_WRITE8_MEMBER(subm_to_sound_w); |
| 128 | 133 | DECLARE_WRITE8_MEMBER(nmi_mask_w); |
| r14896 | r14897 | |
| 144 | 149 | { |
| 145 | 150 | for (x=0;x<32;x++) |
| 146 | 151 | { |
| 147 | UINT16 tile = state->m_vid[count]; | |
| 152 | UINT16 tile = state->m_vid.target()[count]; | |
| 148 | 153 | UINT8 col; |
| 149 | UINT8 y_offs = state->m_scrolly[x]; | |
| 154 | UINT8 y_offs = state->m_scrolly.target()[x]; | |
| 150 | 155 | |
| 151 | tile += (state->m_attr[count]&0xe0)<<3; | |
| 152 | col = (state->m_attr[count]&0x1f); | |
| 156 | tile += (state->m_attr.target()[count]&0xe0)<<3; | |
| 157 | col = (state->m_attr.target()[count]&0x1f); | |
| 153 | 158 | |
| 154 | 159 | drawgfx_opaque(bitmap,cliprect,gfx,tile,col+0x40,0,0,x*8,(y*8)-y_offs); |
| 155 | 160 | drawgfx_opaque(bitmap,cliprect,gfx,tile,col+0x40,0,0,x*8,(y*8)-y_offs+256); |
| r14896 | r14897 | |
| 170 | 175 | 1 --cc cccc color |
| 171 | 176 | */ |
| 172 | 177 | { |
| 173 | UINT8 *spriteram = state->m_spriteram; | |
| 174 | UINT8 *spriteram_2 = state->m_spriteram2; | |
| 178 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 179 | UINT8 *spriteram_2 = state->m_spriteram2.target(); | |
| 175 | 180 | UINT8 x,y,spr_offs,i,col,fx,fy; |
| 176 | 181 | |
| 177 | 182 | for(i=0;i<0x40;i+=2) |
| r14896 | r14897 | |
| 195 | 200 | { |
| 196 | 201 | for (x=0;x<32;x++) |
| 197 | 202 | { |
| 198 | UINT16 tile = state->m_vid[count]; | |
| 203 | UINT16 tile = state->m_vid.target()[count]; | |
| 199 | 204 | UINT8 col; |
| 200 | UINT8 y_offs = state->m_scrolly[x]; | |
| 205 | UINT8 y_offs = state->m_scrolly.target()[x]; | |
| 201 | 206 | |
| 202 | tile += (state->m_attr[count]&0xe0)<<3; | |
| 203 | col = (state->m_attr[count]&0x1f); | |
| 207 | tile += (state->m_attr.target()[count]&0xe0)<<3; | |
| 208 | col = (state->m_attr.target()[count]&0x1f); | |
| 204 | 209 | |
| 205 | 210 | if(x >= 28) |
| 206 | 211 | { |
| r14896 | r14897 | |
| 218 | 223 | static ADDRESS_MAP_START( subm_map, AS_PROGRAM, 8, sub_state ) |
| 219 | 224 | AM_RANGE(0x0000, 0xafff) AM_ROM |
| 220 | 225 | AM_RANGE(0xb000, 0xbfff) AM_RAM |
| 221 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_BASE(m_attr) | |
| 222 | AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_BASE(m_vid) | |
| 223 | AM_RANGE(0xd000, 0xd03f) AM_RAM AM_BASE(m_spriteram) | |
| 224 | AM_RANGE(0xd800, 0xd83f) AM_RAM AM_BASE(m_spriteram2) | |
| 225 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE(m_scrolly) | |
| 226 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("attr") | |
| 227 | AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_SHARE("vid") | |
| 228 | AM_RANGE(0xd000, 0xd03f) AM_RAM AM_SHARE("spriteram") | |
| 229 | AM_RANGE(0xd800, 0xd83f) AM_RAM AM_SHARE("spriteram2") | |
| 230 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_SHARE("scrolly") | |
| 226 | 231 | |
| 227 | 232 | AM_RANGE(0xe000, 0xe000) AM_NOP |
| 228 | 233 | AM_RANGE(0xe800, 0xe800) AM_NOP |
| r14896 | r14897 | |
| 239 | 244 | |
| 240 | 245 | WRITE8_MEMBER(sub_state::subm_to_sound_w) |
| 241 | 246 | { |
| 242 | soundlatch_w(space, 0, data & 0xff); | |
| 247 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 243 | 248 | cputag_set_input_line(machine(), "soundcpu", 0, HOLD_LINE); |
| 244 | 249 | } |
| 245 | 250 | |
| r14896 | r14897 | |
| 251 | 256 | |
| 252 | 257 | static ADDRESS_MAP_START( subm_io, AS_IO, 8, sub_state ) |
| 253 | 258 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 254 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r) AM_WRITE(subm_to_sound_w) // to/from sound CPU | |
| 259 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) AM_WRITE(subm_to_sound_w) // to/from sound CPU | |
| 255 | 260 | ADDRESS_MAP_END |
| 256 | 261 | |
| 257 | 262 | static ADDRESS_MAP_START( subm_sound_map, AS_PROGRAM, 8, sub_state ) |
| r14896 | r14897 | |
| 262 | 267 | |
| 263 | 268 | static ADDRESS_MAP_START( subm_sound_io, AS_IO, 8, sub_state ) |
| 264 | 269 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 265 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_r, soundlatch2_w) // to/from main CPU | |
| 270 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) // to/from main CPU | |
| 266 | 271 | AM_RANGE(0x40, 0x41) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_data_w) |
| 267 | 272 | AM_RANGE(0x80, 0x81) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_data_w) |
| 268 | 273 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | break; |
| 70 | 70 | case 1: |
| 71 | 71 | if (offset < 0x800) |
| 72 | paletteram_xxxxBBBBRRRRGGGG_le_w(space, offset, data); | |
| 72 | paletteram_xxxxBBBBRRRRGGGG_byte_le_w(space, offset, data); | |
| 73 | 73 | break; |
| 74 | 74 | default: |
| 75 | 75 | cbasebal_scrollram_w(space, offset, data); |
| r14896 | r14897 | |
|---|---|---|
| 178 | 178 | { |
| 179 | 179 | public: |
| 180 | 180 | mpoker_state(const machine_config &mconfig, device_type type, const char *tag) |
| 181 | : driver_device(mconfig, type, tag) { } | |
| 181 | : driver_device(mconfig, type, tag) , | |
| 182 | m_video(*this, "video"){ } | |
| 182 | 183 | |
| 183 | 184 | UINT8 m_output[8]; |
| 184 | UINT8 | |
| 185 | required_shared_ptr<UINT8> m_video; | |
| 185 | 186 | int m_mixdata; |
| 186 | 187 | DECLARE_READ8_MEMBER(mixport_r); |
| 187 | 188 | DECLARE_WRITE8_MEMBER(muxed_w); |
| r14896 | r14897 | |
| 214 | 215 | { |
| 215 | 216 | for (x=0;x<32;x++) |
| 216 | 217 | { |
| 217 | UINT16 dat = state->m_video[count]; | |
| 218 | UINT16 col = state->m_video[count+0x400] & 0x7f; | |
| 218 | UINT16 dat = state->m_video.target()[count]; | |
| 219 | UINT16 col = state->m_video.target()[count+0x400] & 0x7f; | |
| 219 | 220 | drawgfx_opaque(bitmap,cliprect,gfx,dat,col,0,0,x*16,y*16); |
| 220 | 221 | count++; |
| 221 | 222 | } |
| r14896 | r14897 | |
| 474 | 475 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 475 | 476 | // AM_RANGE(0x0158, 0x0158) AM_WRITE (muxed_w) |
| 476 | 477 | AM_RANGE(0x3800, 0x38ff) AM_RAM AM_SHARE("nvram") /* NVRAM = 2x SCM5101E */ |
| 477 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_ | |
| 478 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_ | |
| 478 | 479 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("SW1") |
| 479 | 480 | AM_RANGE(0x8001, 0x8001) AM_READ(mixport_r) /* DIP switch bank 2 + a sort of watchdog */ |
| 480 | 481 | AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | mux_port=data; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | WRITE8_ | |
| 71 | WRITE8_M | |
| 72 | 72 | { |
| 73 | memory_set_bankptr( | |
| 73 | memory_set_bankptr( | |
| 74 | 74 | st0016_rom_bank=data; |
| 75 | 75 | } |
| 76 | 76 | |
| r14896 | r14897 | |
| 82 | 82 | AM_RANGE(0xc2, 0xc2) AM_READ(mux_r) AM_WRITENOP |
| 83 | 83 | AM_RANGE(0xc3, 0xc3) AM_READ_PORT("P2") AM_WRITENOP |
| 84 | 84 | AM_RANGE(0xe0, 0xe0) AM_WRITENOP /* renju = $40, neratte = 0 */ |
| 85 | AM_RANGE(0xe1, 0xe1) AM_WRITE | |
| 85 | AM_RANGE(0xe1, 0xe1) AM_WRITE | |
| 86 | 86 | AM_RANGE(0xe2, 0xe2) AM_WRITE(st0016_sprite_bank_w) |
| 87 | 87 | AM_RANGE(0xe3, 0xe4) AM_WRITE(st0016_character_bank_w) |
| 88 | 88 | AM_RANGE(0xe5, 0xe5) AM_WRITE(st0016_palette_bank_w) |
| r14896 | r14897 | |
| 147 | 147 | AM_RANGE(0xd2, 0xd2) AM_READ(mux_r) AM_WRITENOP |
| 148 | 148 | AM_RANGE(0xd3, 0xd3) AM_READ_PORT("P2") AM_WRITENOP |
| 149 | 149 | AM_RANGE(0xe0, 0xe0) AM_WRITENOP |
| 150 | AM_RANGE(0xe1, 0xe1) AM_WRITE | |
| 150 | AM_RANGE(0xe1, 0xe1) AM_WRITE | |
| 151 | 151 | AM_RANGE(0xe2, 0xe2) AM_WRITE(st0016_sprite_bank_w) |
| 152 | 152 | AM_RANGE(0xe3, 0xe4) AM_WRITE(st0016_character_bank_w) |
| 153 | 153 | AM_RANGE(0xe5, 0xe5) AM_WRITE(st0016_palette_bank_w) |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | AM_RANGE(0x050000, 0x050001) AM_WRITE(cchasm_refresh_control_w) |
| 38 | 38 | AM_RANGE(0x060000, 0x060001) AM_READ_PORT("DSW") AM_WRITE(cchasm_led_w) |
| 39 | 39 | AM_RANGE(0x070000, 0x070001) AM_WRITE(watchdog_reset16_w) |
| 40 | AM_RANGE(0xf80000, 0xf800ff) AM_READWRITE | |
| 40 | AM_RANGE(0xf80000, 0xf800ff) AM_READWRITE | |
| 41 | 41 | AM_RANGE(0xffb000, 0xffffff) AM_RAM AM_BASE(m_ram) |
| 42 | 42 | ADDRESS_MAP_END |
| 43 | 43 | |
| r14896 | r14897 | |
| 52 | 52 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 53 | 53 | AM_RANGE(0x5000, 0x53ff) AM_RAM |
| 54 | 54 | AM_RANGE(0x6000, 0x6001) AM_MIRROR(0xf9e) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 55 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0xf9e) AM_READ | |
| 55 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0xf9e) AM_READ | |
| 56 | 56 | AM_RANGE(0x6001, 0x6001) AM_MIRROR(0xf9e) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 57 | 57 | AM_RANGE(0x6020, 0x6021) AM_MIRROR(0xf9e) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 58 | 58 | AM_RANGE(0x6021, 0x6021) AM_MIRROR(0xf9e) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| 59 | AM_RANGE(0x6040, 0x6040) AM_MIRROR(0xf9e) AM_READWRITE(soundlatch_r, soundlatch3_w) | |
| 60 | AM_RANGE(0x6041, 0x6041) AM_MIRROR(0xf9e) AM_READWRITE_LEGACY(cchasm_soundlatch2_r, cchasm_soundlatch4_w) | |
| 61 | AM_RANGE(0x6061, 0x6061) AM_MIRROR(0xf9e) AM_WRITE_LEGACY(cchasm_reset_coin_flag_w) | |
| 59 | AM_RANGE(0x6040, 0x6040) AM_MIRROR(0xf9e) AM_READWRITE(soundlatch_byte_r, soundlatch3_byte_w) | |
| 60 | AM_RANGE(0x6041, 0x6041) AM_MIRROR(0xf9e) AM_READWRITE(cchasm_soundlatch2_r, cchasm_soundlatch4_w) | |
| 61 | AM_RANGE(0x6061, 0x6061) AM_MIRROR(0xf9e) AM_WRITE(cchasm_reset_coin_flag_w) | |
| 62 | 62 | AM_RANGE(0x7041, 0x7041) AM_NOP // TODO |
| 63 | 63 | ADDRESS_MAP_END |
| 64 | 64 |
| r14896 | r14897 | |
|---|---|---|
| 79 | 79 | AM_RANGE(0x3c81, 0x3c81) AM_WRITE(irq_mask_w) |
| 80 | 80 | AM_RANGE(0x3c83, 0x3c84) AM_WRITE(sbasketb_coin_counter_w) |
| 81 | 81 | AM_RANGE(0x3c85, 0x3c85) AM_WRITEONLY AM_BASE(m_spriteram_select) |
| 82 | AM_RANGE(0x3d00, 0x3d00) AM_WRITE(soundlatch_w) | |
| 82 | AM_RANGE(0x3d00, 0x3d00) AM_WRITE(soundlatch_byte_w) | |
| 83 | 83 | AM_RANGE(0x3d80, 0x3d80) AM_WRITE(sbasketb_sh_irqtrigger_w) |
| 84 | 84 | AM_RANGE(0x3e00, 0x3e00) AM_READ_PORT("SYSTEM") |
| 85 | 85 | AM_RANGE(0x3e01, 0x3e01) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 94 | 94 | static ADDRESS_MAP_START( sbasketb_sound_map, AS_PROGRAM, 8, sbasketb_state ) |
| 95 | 95 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 96 | 96 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 97 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 97 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 98 | 98 | AM_RANGE(0x8000, 0x8000) AM_READ_LEGACY(hyperspt_sh_timer_r) |
| 99 | 99 | AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) /* speech data */ |
| 100 | 100 | AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE_LEGACY("vlm", hyperspt_sound_w) /* speech and output controll */ |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | public: |
| 35 | 35 | skyarmy_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | : driver_device(mconfig, type, tag) { } | |
| 36 | : driver_device(mconfig, type, tag) , | |
| 37 | m_videoram(*this, "videoram"), | |
| 38 | m_colorram(*this, "colorram"), | |
| 39 | m_spriteram(*this, "spriteram"), | |
| 40 | m_scrollram(*this, "scrollram"){ } | |
| 37 | 41 | |
| 38 | UINT8 *m_spriteram; | |
| 39 | UINT8 *m_videoram; | |
| 40 | UINT8 *m_colorram; | |
| 41 | UINT8 *m_scrollram; | |
| 42 | required_shared_ptr<UINT8> m_videoram; | |
| 43 | required_shared_ptr<UINT8> m_colorram; | |
| 44 | required_shared_ptr<UINT8> m_spriteram; | |
| 45 | required_shared_ptr<UINT8> m_scrollram; | |
| 42 | 46 | tilemap_t* m_tilemap; |
| 43 | 47 | int m_nmi; |
| 44 | 48 | DECLARE_WRITE8_MEMBER(skyarmy_flip_screen_x_w); |
| r14896 | r14897 | |
| 50 | 54 | |
| 51 | 55 | WRITE8_MEMBER(skyarmy_state::skyarmy_flip_screen_x_w) |
| 52 | 56 | { |
| 53 | flip_screen_x_set( | |
| 57 | flip_screen_x_set( | |
| 54 | 58 | } |
| 55 | 59 | |
| 56 | 60 | WRITE8_MEMBER(skyarmy_state::skyarmy_flip_screen_y_w) |
| 57 | 61 | { |
| 58 | flip_screen_y_set( | |
| 62 | flip_screen_y_set( | |
| 59 | 63 | } |
| 60 | 64 | |
| 61 | 65 | static TILE_GET_INFO( get_skyarmy_tile_info ) |
| 62 | 66 | { |
| 63 | 67 | skyarmy_state *state = machine.driver_data<skyarmy_state>(); |
| 64 | int code = state->m_videoram[tile_index]; | |
| 65 | int attr = BITSWAP8(state->m_colorram[tile_index], 7, 6, 5, 4, 3, 0, 1, 2) & 7; | |
| 68 | int code = state->m_videoram.target()[tile_index]; | |
| 69 | int attr = BITSWAP8(state->m_colorram.target()[tile_index], 7, 6, 5, 4, 3, 0, 1, 2) & 7; | |
| 66 | 70 | |
| 67 | 71 | SET_TILE_INFO( 0, code, attr, 0); |
| 68 | 72 | } |
| r14896 | r14897 | |
| 70 | 74 | WRITE8_MEMBER(skyarmy_state::skyarmy_videoram_w) |
| 71 | 75 | { |
| 72 | 76 | |
| 73 | m_videoram[offset] = data; | |
| 77 | m_videoram.target()[offset] = data; | |
| 74 | 78 | m_tilemap->mark_tile_dirty(offset); |
| 75 | 79 | } |
| 76 | 80 | |
| 77 | 81 | WRITE8_MEMBER(skyarmy_state::skyarmy_colorram_w) |
| 78 | 82 | { |
| 79 | 83 | |
| 80 | m_colorram[offset] = data; | |
| 84 | m_colorram.target()[offset] = data; | |
| 81 | 85 | m_tilemap->mark_tile_dirty(offset); |
| 82 | 86 | } |
| 83 | 87 | |
| r14896 | r14897 | |
| 121 | 125 | static SCREEN_UPDATE_IND16( skyarmy ) |
| 122 | 126 | { |
| 123 | 127 | skyarmy_state *state = screen.machine().driver_data<skyarmy_state>(); |
| 124 | UINT8 *spriteram = state->m_spriteram; | |
| 128 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 125 | 129 | int sx, sy, flipx, flipy, offs,pal; |
| 126 | 130 | int i; |
| 127 | 131 | |
| 128 | 132 | for(i=0;i<0x20;i++) |
| 129 | state->m_tilemap->set_scrolly(i,state->m_scrollram[i]); | |
| 133 | state->m_tilemap->set_scrolly(i,state->m_scrollram.target()[i]); | |
| 130 | 134 | |
| 131 | 135 | state->m_tilemap->draw(bitmap, cliprect, 0,0); |
| 132 | 136 | |
| r14896 | r14897 | |
| 167 | 171 | static ADDRESS_MAP_START( skyarmy_map, AS_PROGRAM, 8, skyarmy_state ) |
| 168 | 172 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 169 | 173 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 170 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(skyarmy_videoram_w) AM_BASE(m_videoram) /* Video RAM */ | |
| 171 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(skyarmy_colorram_w) AM_BASE(m_colorram) /* Color RAM */ | |
| 172 | AM_RANGE(0x9800, 0x983f) AM_RAM AM_BASE(m_spriteram) /* Sprites */ | |
| 173 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_scrollram) /* Scroll RAM */ | |
| 174 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(skyarmy_videoram_w) AM_SHARE("videoram") /* Video RAM */ | |
| 175 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(skyarmy_colorram_w) AM_SHARE("colorram") /* Color RAM */ | |
| 176 | AM_RANGE(0x9800, 0x983f) AM_RAM AM_SHARE("spriteram") /* Sprites */ | |
| 177 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("scrollram") /* Scroll RAM */ | |
| 174 | 178 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW") |
| 175 | 179 | AM_RANGE(0xa001, 0xa001) AM_READ_PORT("P1") |
| 176 | 180 | AM_RANGE(0xa002, 0xa002) AM_READ_PORT("P2") |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | { |
| 31 | 31 | public: |
| 32 | 32 | suprgolf_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | : driver_device(mconfig, type, tag) { } | |
| 33 | : driver_device(mconfig, type, tag) , | |
| 34 | m_videoram(*this, "videoram"){ } | |
| 34 | 35 | |
| 35 | 36 | tilemap_t *m_tilemap; |
| 36 | UINT8 | |
| 37 | required_shared_ptr<UINT8> | |
| 37 | 38 | UINT8 *m_paletteram; |
| 38 | 39 | UINT8 *m_bg_vram; |
| 39 | 40 | UINT16 *m_bg_fb; |
| r14896 | r14897 | |
| 59 | 60 | static TILE_GET_INFO( get_tile_info ) |
| 60 | 61 | { |
| 61 | 62 | suprgolf_state *state = machine.driver_data<suprgolf_state>(); |
| 62 | int code = state->m_videoram[tile_index*2]+256*(state->m_videoram[tile_index*2+1]); | |
| 63 | int color = state->m_videoram[tile_index*2+0x800] & 0x7f; | |
| 63 | int code = state->m_videoram.target()[tile_index*2]+256*(state->m_videoram.target()[tile_index*2+1]); | |
| 64 | int color = state->m_videoram.target()[tile_index*2+0x800] & 0x7f; | |
| 64 | 65 | |
| 65 | 66 | SET_TILE_INFO( |
| 66 | 67 | 0, |
| r14896 | r14897 | |
| 133 | 134 | if (m_palette_switch) |
| 134 | 135 | return m_paletteram[offset]; |
| 135 | 136 | else |
| 136 | return m_videoram[offset]; | |
| 137 | return m_videoram.target()[offset]; | |
| 137 | 138 | } |
| 138 | 139 | |
| 139 | 140 | WRITE8_MEMBER(suprgolf_state::suprgolf_videoram_w) |
| r14896 | r14897 | |
| 154 | 155 | } |
| 155 | 156 | else |
| 156 | 157 | { |
| 157 | m_videoram[offset] = data; | |
| 158 | m_videoram.target()[offset] = data; | |
| 158 | 159 | m_tilemap->mark_tile_dirty((offset & 0x7fe) >> 1); |
| 159 | 160 | } |
| 160 | 161 | } |
| r14896 | r14897 | |
| 266 | 267 | memory_set_bankptr(device->machine(), "bank2", region_base + (data&0x3f ) * 0x4000); |
| 267 | 268 | |
| 268 | 269 | state->m_msm_nmi_mask = data & 0x40; |
| 269 | flip_screen_set( | |
| 270 | state->flip_screen_set( | |
| 270 | 271 | } |
| 271 | 272 | |
| 272 | 273 | WRITE8_MEMBER(suprgolf_state::rom2_bank_select_w) |
| r14896 | r14897 | |
| 306 | 307 | AM_RANGE(0x4000, 0x4000) AM_WRITE(rom2_bank_select_w ) |
| 307 | 308 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") |
| 308 | 309 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(suprgolf_bg_vram_r, suprgolf_bg_vram_w ) // banked background vram |
| 309 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(suprgolf_videoram_r, suprgolf_videoram_w ) AM_ | |
| 310 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(suprgolf_videoram_r, suprgolf_videoram_w ) AM_ | |
| 310 | 311 | AM_RANGE(0xf000, 0xf000) AM_WRITE(suprgolf_pen_w ) |
| 311 | 312 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 312 | 313 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | WRITE8_MEMBER(ksayakyu_state::latch_w) |
| 88 | 88 | { |
| 89 | 89 | m_sound_status &= ~0x80; |
| 90 | soundlatch_w(space, 0, data | 0x80); | |
| 90 | soundlatch_byte_w(space, 0, data | 0x80); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | READ8_MEMBER(ksayakyu_state::sound_status_r) |
| r14896 | r14897 | |
| 98 | 98 | WRITE8_MEMBER(ksayakyu_state::tomaincpu_w) |
| 99 | 99 | { |
| 100 | 100 | m_sound_status |= 0x80; |
| 101 | soundlatch_w(space, 0, data); | |
| 101 | soundlatch_byte_w(space, 0, data); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | static ADDRESS_MAP_START( maincpu_map, AS_PROGRAM, 8, ksayakyu_state ) |
| r14896 | r14897 | |
| 188 | 188 | { |
| 189 | 189 | AY8910_LEGACY_OUTPUT, |
| 190 | 190 | AY8910_DEFAULT_LOADS, |
| 191 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 191 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 192 | 192 | DEVCB_NULL, |
| 193 | 193 | DEVCB_NULL, |
| 194 | 194 | DEVCB_HANDLER(dummy1_w) |
| r14896 | r14897 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | WRITE8_MEMBER(himesiki_state::himesiki_sound_w) |
| 101 | 101 | { |
| 102 | soundlatch_w(space, offset, data); | |
| 102 | soundlatch_byte_w(space, offset, data); | |
| 103 | 103 | device_set_input_line(m_subcpu, INPUT_LINE_NMI, PULSE_LINE); |
| 104 | 104 | } |
| 105 | 105 | |
| r14896 | r14897 | |
| 109 | 109 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 110 | 110 | AM_RANGE(0x8000, 0x9fff) AM_RAM |
| 111 | 111 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(m_spriteram) |
| 112 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 112 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 113 | 113 | AM_RANGE(0xb000, 0xbfff) AM_RAM_WRITE(himesiki_bg_ram_w) AM_BASE(m_bg_ram) |
| 114 | 114 | AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank1") |
| 115 | 115 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 137 | 137 | static ADDRESS_MAP_START( himesiki_iom1, AS_IO, 8, himesiki_state ) |
| 138 | 138 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 139 | 139 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ym2203", ym2203_r, ym2203_w) |
| 140 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) | |
| 140 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) | |
| 141 | 141 | ADDRESS_MAP_END |
| 142 | 142 | |
| 143 | 143 | /****************************************************************************/ |
| r14896 | r14897 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | Arcade games (hacks of console games) running on SNES harware. |
| 4 | 4 | |
| 5 | Driver (based on nss.c | |
| 5 | Driver (based on nss.c | |
| 6 | 6 | |
| 7 | 7 | Supported games: |
| 8 | 8 | - Killer Instinct |
| 9 | 9 | - Final Fight 2 |
| 10 | - Sonic Blast Man 2 | |
| 11 | 10 | - Iron (bootleg of Iron Commando) |
| 12 | 11 | - Ghost Chaser Densei |
| 12 | - Sonic Blast Man 2 | |
| 13 | 13 | - Gundam Wing: Endless Duel |
| 14 | 14 | |
| 15 | 15 | Not dumped: |
| r14896 | r14897 | |
| 17 | 17 | |
| 18 | 18 | TODO: |
| 19 | 19 | |
| 20 | - ffight2b - dipswitches ($7eadd7 ?) | |
| 21 | - sblast2b - dipswicthes | |
| 22 | - kiinstb - fix gfx glitches, missing texts | |
| 20 | - all games : (re)add PORT_DIPLOCATION | |
| 21 | - kiinstb : fix gfx glitches, missing texts | |
| 22 | - ffight2b : fix starting credits (RAM - mainly 0x7eadce where credits are stored - is filled with 0x55, so you are awarded 55 credits on a hard reset) | |
| 23 | - sblast2b : dipswicthes | |
| 24 | - denseib : fix gfx glitches, missing texts | |
| 23 | 25 | |
| 26 | *************************************************************************** | |
| 24 | 27 | |
| 28 | Killer Instinct PCB Info: | |
| 29 | -------------------------- | |
| 30 | ||
| 31 | PQFP 100(?)pin chip marked "SP-BE0" | |
| 32 | PQFP 100(?)pin chip marked "SP-BH0" | |
| 33 | PQFP 100(?)pin chip marked "SP-AF0" | |
| 34 | Lattice pLSI 1024-60LJ B604S03 | |
| 35 | 6116 SRAM x2 | |
| 36 | AS7C256 SRAM x8 | |
| 37 | jumper pack (12) | |
| 38 | dsw8 x2 | |
| 39 | Xtal 24.576 MHz | |
| 40 | Xtal 21.47727 MHz | |
| 41 | volume pot | |
| 42 | 27c801 x4 | |
| 43 | two empty eprom sockets | |
| 44 | ||
| 45 | It's SNES version of KI with few mods (removed copyright messages, | |
| 46 | extra code for coin input, etc). | |
| 47 | ||
| 48 | 256 bytes of RAM (mapped to reserved area) are shared with some | |
| 49 | device (probably Lattice PLD) used for handle coin inputs and dips | |
| 50 | ||
| 51 | Data lines of eproms are bitswapped. | |
| 52 | ||
| 53 | *************************************************************************** | |
| 54 | ||
| 25 | 55 | Final Fight 2 PCB layout: |
| 26 | 56 | ------------------------ |
| 27 | 57 | |
| r14896 | r14897 | |
| 55 | 85 | | |---| JAMMA |---| | |
| 56 | 86 | |---------------| |------------------------------------| |---------------| |
| 57 | 87 | |
| 58 | Killer Instinct PCB Info: | |
| 59 | -------------------------- | |
| 60 | ||
| 61 | PQFP 100(?)pin chip marked "SP-BE0" | |
| 62 | PQFP 100(?)pin chip marked "SP-BH0" | |
| 63 | PQFP 100(?)pin chip marked "SP-AF0" | |
| 64 | Lattice pLSI 1024-60LJ B604S03 | |
| 65 | 6116 SRAM x2 | |
| 66 | AS7C256 SRAM x8 | |
| 67 | jumper pack (12) | |
| 68 | dsw8 x2 | |
| 69 | Xtal 24.576 MHz | |
| 70 | Xtal 21.47727 MHz | |
| 71 | volume pot | |
| 72 | 27c801 x4 | |
| 73 | two empty eprom sockets | |
| 74 | ||
| 75 | It's SNES version of KI with few mods (removed copyright messages, | |
| 76 | extra code for coin input, etc). | |
| 77 | ||
| 78 | 256 bytes of RAM ( mapped to reserved area) are shared with some | |
| 79 | device (probably Lattice PLD) used for handle coin inputs and dips | |
| 80 | ||
| 81 | Data lines of eproms are bitswapped. | |
| 82 | ||
| 83 | 88 | *************************************************************************** |
| 84 | 89 | |
| 85 | 90 | Iron PCB (same as Final Fight 2?) |
| r14896 | r14897 | |
| 131 | 136 | | | || | | | | | | | | | | | | | | | | | | | | | | | | | |
| 132 | 137 | |_________________| |______________________________________________| |_________________| |
| 133 | 138 | |
| 134 | ||
| 135 | 139 | ***************************************************************************/ |
| 136 | 140 | |
| 137 | 141 | |
| r14896 | r14897 | |
| 151 | 155 | : snes_state(mconfig, type, tag) { } |
| 152 | 156 | |
| 153 | 157 | INT8 *m_shared_ram; |
| 154 | UINT8 m_ffight2b_coins; | |
| 155 | INT32 m_oldinput; | |
| 156 | INT32 m_oldcoin; | |
| 157 | 158 | UINT8 m_cnt; |
| 159 | DECLARE_READ8_MEMBER(sharedram_r); | |
| 160 | DECLARE_WRITE8_MEMBER(sharedram_w); | |
| 161 | DECLARE_READ8_MEMBER(sb2b_75bd37_r); | |
| 162 | DECLARE_READ8_MEMBER(sb2b_6a6xxx_r); | |
| 163 | DECLARE_READ8_MEMBER(sb2b_7xxx_r); | |
| 164 | DECLARE_READ8_MEMBER(snesb_dsw1_r); | |
| 165 | DECLARE_READ8_MEMBER(snesb_dsw2_r); | |
| 166 | DECLARE_READ8_MEMBER(snesb_coin_r); | |
| 158 | 167 | }; |
| 159 | 168 | |
| 160 | 169 | |
| 161 | ||
| 162 | static READ8_HANDLER(sharedram_r) | |
| 170 | /* Killer Instinct */ | |
| 171 | READ8_MEMBER(snesb_state::sharedram_r) | |
| 163 | 172 | { |
| 164 | snesb_state *state = space->machine().driver_data<snesb_state>(); | |
| 165 | INT32 coincnt; | |
| 166 | INT32 input = input_port_read(space->machine(), "COIN"); | |
| 167 | ||
| 168 | if(input&3) | |
| 169 | { | |
| 170 | if( ((input&1)==1)&&((state->m_oldinput&1)==0)) {state->m_shared_ram[0]++;} | |
| 171 | ||
| 172 | coincnt=state->m_shared_ram[0]; | |
| 173 | ||
| 174 | if(coincnt>99){coincnt=99;} | |
| 175 | ||
| 176 | state->m_shared_ram[0xb]=(coincnt/10)+'0'; | |
| 177 | state->m_shared_ram[0xa]=(coincnt%10)+'0'; | |
| 178 | } | |
| 179 | state->m_oldinput=input; | |
| 180 | return state->m_shared_ram[offset]; | |
| 173 | return m_shared_ram[offset]; | |
| 181 | 174 | } |
| 182 | 175 | |
| 183 | ||
| 176 | ||
| 184 | 177 | { |
| 185 | snesb_state *state = space->machine().driver_data<snesb_state>(); | |
| 186 | state->m_shared_ram[offset]=data; | |
| 178 | m_shared_ram[offset]=data; | |
| 187 | 179 | } |
| 188 | 180 | |
| 189 | static READ8_HANDLER(ffight2b_coin_r) | |
| 181 | /* Sonic Blast Man 2 Special Turbo */ | |
| 182 | READ8_MEMBER(snesb_state::sb2b_75bd37_r) | |
| 190 | 183 | { |
| 191 | snesb_state *state = space->machine().driver_data<snesb_state>(); | |
| 192 | INT32 input = input_port_read(space->machine(), "COIN"); | |
| 193 | ||
| 194 | if( ((input&1)==1)&&((state->m_oldcoin&1)==0)) | |
| 195 | { | |
| 196 | INT32 coin_cnt=(state->m_ffight2b_coins&0xf)+10*(state->m_ffight2b_coins>>4); | |
| 197 | if(++coin_cnt>99) coin_cnt=99; | |
| 198 | state->m_ffight2b_coins=(coin_cnt%10)|((coin_cnt/10)<<4); | |
| 199 | } | |
| 200 | state->m_oldcoin=input; | |
| 201 | return state->m_ffight2b_coins; | |
| 202 | } | |
| 203 | ||
| 204 | /* Sonic blast man 2 turbo */ | |
| 205 | ||
| 206 | static READ8_HANDLER(sb2b_75bd37_r) | |
| 207 | { | |
| 208 | snesb_state *state = space->machine().driver_data<snesb_state>(); | |
| 209 | 184 | /* protection check */ |
| 210 | return ++ | |
| 185 | return ++ | |
| 211 | 186 | } |
| 212 | 187 | |
| 213 | ||
| 188 | ||
| 214 | 189 | { |
| 215 | 190 | /* protection checks */ |
| 216 | 191 | switch(offset) |
| r14896 | r14897 | |
| 223 | 198 | case 0xfb7: return 0x47; |
| 224 | 199 | } |
| 225 | 200 | |
| 226 | logerror("Unknown protection read read %x @ %x\n",offset, cpu_get_pc(&space | |
| 201 | logerror("Unknown protection read read %x @ %x\n",offset, cpu_get_pc(&space. | |
| 227 | 202 | |
| 228 | 203 | return 0; |
| 229 | 204 | } |
| 230 | 205 | |
| 231 | ||
| 206 | ||
| 232 | 207 | { |
| 233 | return input_port_read(space->machine(), "DSW"); | |
| 234 | } | |
| 235 | ||
| 236 | static READ8_HANDLER(sb2b_770079_r) | |
| 237 | { | |
| 238 | return input_port_read(space->machine(), "COIN"); | |
| 239 | } | |
| 240 | ||
| 241 | static READ8_HANDLER(sb2b_7xxx_r) | |
| 242 | { | |
| 243 | 208 | return snes_ram[0xc07000 + offset]; |
| 244 | 209 | } |
| 245 | 210 | |
| 246 | /* Iron */ | |
| 247 | 211 | |
| 248 | static READ8_HANDLER(iron_770071_r) | |
| 212 | /* Generic read handlers for Dip Switches and coins inputs */ | |
| 213 | READ8_MEMBER(snesb_state::snesb_dsw1_r) | |
| 249 | 214 | { |
| 250 | return input_port_read( | |
| 215 | return input_port_read( | |
| 251 | 216 | } |
| 252 | 217 | |
| 253 | ||
| 218 | ||
| 254 | 219 | { |
| 255 | return input_port_read( | |
| 220 | return input_port_read( | |
| 256 | 221 | } |
| 257 | 222 | |
| 258 | ||
| 223 | ||
| 259 | 224 | { |
| 260 | return input_port_read( | |
| 225 | return input_port_read( | |
| 261 | 226 | } |
| 262 | 227 | |
| 263 | 228 | |
| 264 | /* Denseib */ | |
| 265 | ||
| 266 | static READ8_HANDLER(denseib_770071_r) | |
| 267 | { | |
| 268 | return input_port_read(space->machine(), "DSW1"); | |
| 269 | } | |
| 270 | ||
| 271 | static READ8_HANDLER(denseib_770079_r) | |
| 272 | { | |
| 273 | return input_port_read(space->machine(), "COIN"); | |
| 274 | } | |
| 275 | ||
| 276 | ||
| 277 | ||
| 278 | 229 | static ADDRESS_MAP_START( snesb_map, AS_PROGRAM, 8, snesb_state ) |
| 279 | 230 | AM_RANGE(0x000000, 0x2fffff) AM_READWRITE_LEGACY(snes_r_bank1, snes_w_bank1) /* I/O and ROM (repeats for each bank) */ |
| 280 | 231 | AM_RANGE(0x300000, 0x3fffff) AM_READWRITE_LEGACY(snes_r_bank2, snes_w_bank2) /* I/O and ROM (repeats for each bank) */ |
| r14896 | r14897 | |
| 400 | 351 | INPUT_PORTS_END |
| 401 | 352 | |
| 402 | 353 | |
| 354 | /* verified from 5A22 code */ | |
| 403 | 355 | static INPUT_PORTS_START( kinstb ) |
| 404 | 356 | PORT_INCLUDE(snes_common) |
| 405 | 357 | |
| 406 | PORT_START("DSW") | |
| 358 | PORT_START("DSW1") | |
| 359 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Difficulty ) ) | |
| 360 | PORT_DIPSETTING( 0x00, "0 (Easiest)" ) /* "EASY" (0 star) */ | |
| 361 | PORT_DIPSETTING( 0x01, "1" ) /* (1 star) */ | |
| 362 | PORT_DIPSETTING( 0x02, "2" ) /* (2 stars) */ | |
| 363 | PORT_DIPSETTING( 0x03, "3" ) /* (3 stars) */ | |
| 364 | PORT_DIPSETTING( 0x04, "4" ) /* (4 stars) */ | |
| 365 | PORT_DIPSETTING( 0x05, "5" ) /* "HARD" (5 stars) */ | |
| 366 | PORT_DIPSETTING( 0x06, "6" ) /* undefined */ | |
| 367 | PORT_DIPSETTING( 0x07, "7" ) /* undefined */ | |
| 368 | PORT_DIPSETTING( 0x08, "8" ) /* undefined */ | |
| 369 | PORT_DIPSETTING( 0x09, "9" ) /* undefined */ | |
| 370 | PORT_DIPSETTING( 0x0a, "10" ) /* undefined */ | |
| 371 | PORT_DIPSETTING( 0x0b, "11" ) /* undefined */ | |
| 372 | PORT_DIPSETTING( 0x0c, "12" ) /* undefined */ | |
| 373 | PORT_DIPSETTING( 0x0d, "13" ) /* undefined */ | |
| 374 | PORT_DIPSETTING( 0x0e, "14" ) /* undefined */ | |
| 375 | PORT_DIPSETTING( 0x0f, "15 (Hardest)" ) /* undefined */ | |
| 376 | PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW ) | |
| 377 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 378 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 379 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) | |
| 407 | 380 | |
| 381 | PORT_START("DSW2") | |
| 382 | PORT_DIPNAME( 0x0f, 0x01, DEF_STR( Coinage ) ) | |
| 383 | PORT_DIPSETTING( 0x0f, "15 Coins/1 Credit" ) | |
| 384 | PORT_DIPSETTING( 0x0e, "14 Coins/1 Credit" ) | |
| 385 | PORT_DIPSETTING( 0x0d, "13 Coins/1 Credit" ) | |
| 386 | PORT_DIPSETTING( 0x0c, "12 Coins/1 Credit" ) | |
| 387 | PORT_DIPSETTING( 0x0b, "11 Coins/1 Credit" ) | |
| 388 | PORT_DIPSETTING( 0x0a, "10 Coins/1 Credit" ) | |
| 389 | PORT_DIPSETTING( 0x09, DEF_STR( 9C_1C ) ) | |
| 390 | PORT_DIPSETTING( 0x08, DEF_STR( 8C_1C ) ) | |
| 391 | PORT_DIPSETTING( 0x07, DEF_STR( 7C_1C ) ) | |
| 392 | PORT_DIPSETTING( 0x06, DEF_STR( 6C_1C ) ) | |
| 393 | PORT_DIPSETTING( 0x05, DEF_STR( 5C_1C ) ) | |
| 394 | PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) | |
| 395 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) | |
| 396 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 397 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) | |
| 398 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) | |
| 399 | PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW ) | |
| 400 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 401 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 402 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) | |
| 403 | ||
| 408 | 404 | PORT_START("COIN") |
| 409 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 410 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 411 | ||
| 405 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 406 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 412 | 407 | INPUT_PORTS_END |
| 413 | 408 | |
| 414 | ||
| 409 | /* verified from 5A22 code */ | |
| 415 | 410 | static INPUT_PORTS_START( ffight2b ) |
| 416 | 411 | PORT_INCLUDE(snes_common) |
| 417 | 412 | |
| 418 | PORT_START("DSW") | |
| 419 | PORT_DIPNAME( 0x01, 0x01, "Player Bonus" ) PORT_DIPLOCATION("SW1:1") | |
| 420 | PORT_DIPSETTING( 0x01, DEF_STR( No ) ) | |
| 421 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) | |
| 422 | PORT_DIPNAME( 0x06, 0x04, "Game Level" ) PORT_DIPLOCATION("SW1:2,3") | |
| 423 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 413 | PORT_START("DSW1") | |
| 414 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) | |
| 415 | PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) | |
| 416 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 417 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 418 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) | |
| 419 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) /* duplicate setting */ | |
| 420 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) | |
| 421 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) | |
| 422 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) | |
| 423 | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Lives ) ) | |
| 424 | PORT_DIPSETTING( 0x18, "1" ) | |
| 425 | PORT_DIPSETTING( 0x10, "2" ) | |
| 426 | PORT_DIPSETTING( 0x08, "3" ) | |
| 427 | PORT_DIPSETTING( 0x00, "4" ) | |
| 428 | PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) /* "GAME LEVEL" */ | |
| 429 | PORT_DIPSETTING( 0x60, DEF_STR( Easy ) ) | |
| 430 | PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) | |
| 431 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) | |
| 432 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) /* "EXPERT" */ | |
| 433 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Bonus_Life ) ) | |
| 434 | PORT_DIPSETTING( 0x00, "100k 300k 200k+" ) | |
| 435 | PORT_DIPSETTING( 0x80, DEF_STR( None ) ) | |
| 436 | ||
| 437 | PORT_START("DSW2") | |
| 438 | PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW ) | |
| 439 | PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW ) | |
| 440 | PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW ) | |
| 441 | PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW ) | |
| 442 | PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW ) | |
| 443 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 444 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 445 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) | |
| 446 | ||
| 447 | PORT_START("COIN") | |
| 448 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 449 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 450 | INPUT_PORTS_END | |
| 451 | ||
| 452 | /* verified from 5A22 code */ | |
| 453 | static INPUT_PORTS_START( iron ) | |
| 454 | PORT_INCLUDE(snes_common) | |
| 455 | ||
| 456 | PORT_START("DSW1") | |
| 457 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) | |
| 458 | PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) | |
| 459 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 460 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 461 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) | |
| 462 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) /* duplicate setting */ | |
| 463 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) | |
| 464 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) | |
| 465 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) | |
| 466 | PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW ) | |
| 467 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 468 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 469 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) | |
| 470 | ||
| 471 | PORT_START("DSW2") | |
| 472 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) /* "LEVEL" */ | |
| 473 | PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) | |
| 474 | PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) /* "MEDIUM" */ | |
| 424 | 475 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) |
| 476 | PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) /* duplicate setting */ | |
| 477 | PORT_DIPNAME( 0x04, 0x04, "Suffered Damages" ) /* code at 0x(8)082d0 */ | |
| 425 | 478 | PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) |
| 426 | PORT_DIPSETTING( 0x06, DEF_STR( Easy ) ) | |
| 427 | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4,5") | |
| 428 | PORT_DIPSETTING( 0x00, "4" ) | |
| 429 | PORT_DIPSETTING( 0x08, "3" ) | |
| 430 | PORT_DIPSETTING( 0x10, "2" ) | |
| 431 | PORT_DIPSETTING( 0x18, "1" ) | |
| 432 | PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:6,7,8") | |
| 433 | PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) | |
| 434 | PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) | |
| 435 | PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) | |
| 436 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 437 | /* PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) */ | |
| 438 | PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) | |
| 439 | PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) | |
| 440 | PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) | |
| 479 | PORT_DIPSETTING( 0x00, "More" ) | |
| 480 | PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) /* table at 0x(8)3ffda (4 * 1 word) gives 02 03 04 05 (add 1) but extra LSRA before TAY at 0x(8)3ffcf */ | |
| 481 | PORT_DIPSETTING( 0x18, "3" ) | |
| 482 | PORT_DIPSETTING( 0x08, "4" ) | |
| 483 | PORT_DIPSETTING( 0x10, "769 (Bug)" ) | |
| 484 | PORT_DIPSETTING( 0x00, "1025 (Bug)" ) | |
| 485 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 486 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 487 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) | |
| 488 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 489 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
| 441 | 490 | |
| 442 | 491 | PORT_START("COIN") |
| 443 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) | |
| 444 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) | |
| 492 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 493 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 445 | 494 | INPUT_PORTS_END |
| 446 | 495 | |
| 447 | ||
| 448 | static INPUT_PORTS_START( sblast2b ) | |
| 496 | /* verified from 5A22 code */ | |
| 497 | static INPUT_PORTS_START( denseib ) | |
| 449 | 498 | PORT_INCLUDE(snes_common) |
| 450 | 499 | |
| 451 | PORT_START("DSW") | |
| 452 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" ) | |
| 453 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) | |
| 454 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" ) | |
| 455 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" ) | |
| 456 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) | |
| 457 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) | |
| 458 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) | |
| 459 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) | |
| 500 | PORT_START("DSW1") | |
| 501 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) | |
| 502 | PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) | |
| 503 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 504 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 505 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) | |
| 506 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) /* duplicate setting */ | |
| 507 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) | |
| 508 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) | |
| 509 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) | |
| 510 | PORT_DIPNAME( 0x18, 0x10, DEF_STR( Difficulty ) ) /* "RANK" */ | |
| 511 | PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) | |
| 512 | PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) | |
| 513 | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) | |
| 514 | // PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) /* duplicate setting */ | |
| 515 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 516 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 517 | PORT_DIPNAME( 0x80, 0x00, "Mode" ) | |
| 518 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) | |
| 519 | PORT_DIPSETTING( 0x80, "Battle" ) | |
| 460 | 520 | |
| 521 | PORT_START("DSW2") | |
| 522 | PORT_DIPNAME( 0x07, 0x07, "Suffered Damages" ) /* code at 0x(8)0f810 */ | |
| 523 | PORT_DIPSETTING( 0x07, DEF_STR( Normal ) ) | |
| 524 | PORT_DIPSETTING( 0x06, "x1.5" ) | |
| 525 | PORT_DIPSETTING( 0x05, "x2.5" ) | |
| 526 | PORT_DIPSETTING( 0x04, "x3.5" ) | |
| 527 | PORT_DIPSETTING( 0x03, "x4.5" ) | |
| 528 | PORT_DIPSETTING( 0x02, "x5.5" ) | |
| 529 | PORT_DIPSETTING( 0x01, "x6.5" ) | |
| 530 | PORT_DIPSETTING( 0x00, "x7.5" ) | |
| 531 | PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW ) | |
| 532 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 533 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 534 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) | |
| 535 | ||
| 461 | 536 | PORT_START("COIN") |
| 462 | 537 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 463 | 538 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 464 | ||
| 465 | 539 | INPUT_PORTS_END |
| 466 | 540 | |
| 467 | ||
| 468 | static INPUT_PORTS_START( iron ) | |
| 541 | /* verified from 5A22 code */ | |
| 542 | static INPUT_PORTS_START( sblast2b ) | |
| 469 | 543 | PORT_INCLUDE(snes_common) |
| 470 | 544 | |
| 471 | 545 | PORT_START("DSW1") |
| 472 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" ) | |
| 473 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) | |
| 474 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" ) | |
| 475 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" ) | |
| 476 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) | |
| 477 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) | |
| 478 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) | |
| 479 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) | |
| 546 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) | |
| 547 | PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) | |
| 548 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) | |
| 549 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) | |
| 550 | PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) | |
| 551 | // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) /* duplicate setting */ | |
| 552 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) | |
| 553 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) | |
| 554 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) | |
| 555 | PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) ) /* "LEVEL" */ | |
| 556 | PORT_DIPSETTING( 0x38, "0 (Easiest)" ) /* "NORMAL" */ | |
| 557 | PORT_DIPSETTING( 0x30, "1" ) /* "HARD" */ | |
| 558 | PORT_DIPSETTING( 0x28, "2" ) /* undefined */ | |
| 559 | PORT_DIPSETTING( 0x20, "3" ) /* undefined */ | |
| 560 | PORT_DIPSETTING( 0x18, "4" ) /* undefined */ | |
| 561 | PORT_DIPSETTING( 0x10, "5" ) /* undefined */ | |
| 562 | PORT_DIPSETTING( 0x08, "6" ) /* undefined */ | |
| 563 | PORT_DIPSETTING( 0x00, "7 (Hardest)" ) /* undefined */ | |
| 564 | PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) ) | |
| 565 | PORT_DIPSETTING( 0xc0, "1" ) | |
| 566 | PORT_DIPSETTING( 0x80, "2" ) | |
| 567 | PORT_DIPSETTING( 0x40, "3" ) | |
| 568 | PORT_DIPSETTING( 0x00, "4" ) | |
| 480 | 569 | |
| 481 | 570 | PORT_START("DSW2") |
| 482 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) | |
| 483 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) | |
| 484 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) | |
| 485 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) | |
| 486 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) | |
| 487 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) | |
| 488 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) | |
| 489 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) | |
| 571 | PORT_DIPNAME( 0x0f, 0x04, "Power" ) | |
| 572 | PORT_DIPSETTING( 0x07, "0" ) | |
| 573 | PORT_DIPSETTING( 0x06, "1" ) | |
| 574 | PORT_DIPSETTING( 0x05, "2" ) | |
| 575 | PORT_DIPSETTING( 0x04, "3" ) | |
| 576 | PORT_DIPSETTING( 0x03, "4" ) | |
| 577 | PORT_DIPSETTING( 0x02, "5" ) | |
| 578 | PORT_DIPSETTING( 0x01, "6" ) | |
| 579 | PORT_DIPSETTING( 0x00, "7" ) | |
| 580 | PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW ) | |
| 581 | PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW ) | |
| 582 | PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW ) | |
| 583 | PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) | |
| 490 | 584 | |
| 491 | 585 | PORT_START("COIN") |
| 492 | 586 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 493 | 587 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 494 | 588 | INPUT_PORTS_END |
| 495 | 589 | |
| 496 | static INPUT_PORTS_START( denseib ) | |
| 590 | ||
| 591 | static INPUT_PORTS_START( endless ) | |
| 497 | 592 | PORT_INCLUDE(snes_common) |
| 498 | 593 | |
| 499 | 594 | PORT_START("DSW1") |
| 500 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" ) | |
| 501 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) | |
| 502 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" ) | |
| 503 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" ) | |
| 504 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) | |
| 505 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) | |
| 506 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) | |
| 507 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) | |
| 595 | PORT_DIPUNKNOWN( 0x01, IP_ACTIVE_LOW ) | |
| 596 | PORT_DIPUNKNOWN( 0x02, IP_ACTIVE_LOW ) | |
| 597 | PORT_DIPUNKNOWN( 0x04, IP_ACTIVE_LOW ) | |
| 598 | PORT_DIPUNKNOWN( 0x08, IP_ACTIVE_LOW ) | |
| 599 | PORT_DIPUNKNOWN( 0x10, IP_ACTIVE_LOW ) | |
| 600 | PORT_DIPUNKNOWN( 0x20, IP_ACTIVE_LOW ) | |
| 601 | PORT_DIPUNKNOWN( 0x40, IP_ACTIVE_LOW ) | |
| 602 | PORT_DIPUNKNOWN( 0x80, IP_ACTIVE_LOW ) | |
| 508 | 603 | |
| 604 | PORT_START("DSW2") | |
| 605 | PORT_DIPUNKNOWN( 0x01, IP_ACTIVE_LOW ) | |
| 606 | PORT_DIPUNKNOWN( 0x02, IP_ACTIVE_LOW ) | |
| 607 | PORT_DIPUNKNOWN( 0x04, IP_ACTIVE_LOW ) | |
| 608 | PORT_DIPUNKNOWN( 0x08, IP_ACTIVE_LOW ) | |
| 609 | PORT_DIPUNKNOWN( 0x10, IP_ACTIVE_LOW ) | |
| 610 | PORT_DIPUNKNOWN( 0x20, IP_ACTIVE_LOW ) | |
| 611 | PORT_DIPUNKNOWN( 0x40, IP_ACTIVE_LOW ) | |
| 612 | PORT_DIPUNKNOWN( 0x80, IP_ACTIVE_LOW ) | |
| 613 | ||
| 509 | 614 | PORT_START("COIN") |
| 510 | 615 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 511 | 616 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| r14896 | r14897 | |
| 553 | 658 | } |
| 554 | 659 | |
| 555 | 660 | state->m_shared_ram = auto_alloc_array(machine, INT8, 0x100); |
| 556 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 661 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 557 | 662 | |
| 663 | /* extra inputs */ | |
| 664 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),state)); | |
| 665 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),state)); | |
| 666 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),state)); | |
| 667 | ||
| 558 | 668 | DRIVER_INIT_CALL(snes_hirom); |
| 559 | 669 | } |
| 560 | 670 | |
| 561 | 671 | static DRIVER_INIT( ffight2b ) |
| 562 | 672 | { |
| 563 | snesb_state *state = machine.driver_data<snesb_state>(); | |
| 564 | 673 | INT32 i; |
| 565 | 674 | UINT8 *rom = machine.region("user3")->base(); |
| 566 | 675 | |
| r14896 | r14897 | |
| 590 | 699 | } |
| 591 | 700 | } |
| 592 | 701 | |
| 593 | /* | |
| 702 | /* | |
| 594 | 703 | rom[0x7ffd] = 0x89; |
| 595 | 704 | rom[0x7ffc] = 0x54; |
| 596 | 705 | |
| 597 | state->m_ffight2b_coins = 0; | |
| 598 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7eadce, 0x7eadce, FUNC(ffight2b_coin_r)); | |
| 706 | /* extra inputs */ | |
| 707 | snesb_state *state = machine.driver_data<snesb_state>(); | |
| 708 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),state)); | |
| 709 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),state)); | |
| 710 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),state)); | |
| 599 | 711 | |
| 600 | 712 | DRIVER_INIT_CALL(snes); |
| 601 | 713 | } |
| 602 | 714 | |
| 715 | static DRIVER_INIT( iron ) | |
| 716 | { | |
| 717 | INT32 i; | |
| 718 | UINT8 *rom = machine.region("user3")->base(); | |
| 603 | 719 | |
| 720 | for (i = 0; i < 0x140000; i++) | |
| 721 | { | |
| 722 | if(i < 0x80000) | |
| 723 | { | |
| 724 | rom[i] = BITSWAP8(rom[i]^0xff,2,7,1,6,3,0,5,4); | |
| 725 | } | |
| 726 | else | |
| 727 | { | |
| 728 | rom[i] = BITSWAP8(rom[i],6,3,0,5,1,4,7,2); | |
| 729 | } | |
| 730 | } | |
| 731 | ||
| 732 | /* extra inputs */ | |
| 733 | snesb_state *state = machine.driver_data<snesb_state>(); | |
| 734 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),state)); | |
| 735 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),state)); | |
| 736 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),state)); | |
| 737 | ||
| 738 | DRIVER_INIT_CALL(snes); | |
| 739 | } | |
| 740 | ||
| 741 | static DRIVER_INIT( denseib ) | |
| 742 | { | |
| 743 | UINT8 *rom = machine.region("user3")->base(); | |
| 744 | INT32 i; | |
| 745 | ||
| 746 | for (i = 0; i < 0x200000; i++) | |
| 747 | { | |
| 748 | rom[i] = rom[i] ^ 0xff; | |
| 749 | switch (i >> 16) | |
| 750 | { | |
| 751 | case 0x00: rom[i] = BITSWAP8(rom[i],1,7,0,6,3,4,5,2); break; | |
| 752 | case 0x01: rom[i] = BITSWAP8(rom[i],3,4,7,2,0,6,5,1); break; | |
| 753 | case 0x02: rom[i] = BITSWAP8(rom[i],5,4,2,1,7,0,6,3); break; | |
| 754 | case 0x03: rom[i] = BITSWAP8(rom[i],0,1,3,7,2,6,5,4); break; | |
| 755 | ||
| 756 | default: rom[i] = BITSWAP8(rom[i],4,5,1,0,2,3,7,6); break; | |
| 757 | } | |
| 758 | } | |
| 759 | ||
| 760 | /* boot vector */ | |
| 761 | rom[0xfffc] = 0x40; | |
| 762 | rom[0xfffd] = 0xf7; | |
| 763 | ||
| 764 | /* extra inputs */ | |
| 765 | snesb_state *state = machine.driver_data<snesb_state>(); | |
| 766 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),state)); | |
| 767 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),state)); | |
| 768 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),state)); | |
| 769 | ||
| 770 | DRIVER_INIT_CALL(snes_hirom); | |
| 771 | } | |
| 772 | ||
| 604 | 773 | static const UINT8 data_substitution0[] = {0x88,0x02,0x2a,0x08,0x28,0xaa,0x8a,0x0a,0xa2,0x00,0x80,0xa0,0x22,0xa8,0x82,0x20,}; |
| 605 | 774 | static const UINT8 data_substitution1[] = {0x44,0x01,0x51,0x40,0x50,0x55,0x45,0x41,0x15,0x00,0x04,0x14,0x11,0x54,0x05,0x10,}; |
| 606 | 775 | static const UINT8 address_substitution_low[] = |
| r14896 | r14897 | |
| 654 | 823 | dst[0xfffd] = 0x7a; |
| 655 | 824 | |
| 656 | 825 | /* protection checks */ |
| 657 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x75bd37, 0x75bd37, FUNC(sb2b_75bd37_r)); | |
| 658 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6a6000, 0x6a6fff, FUNC(sb2b_6a6xxx_r)); | |
| 826 | snesb_state *state = machine.driver_data<snesb_state>(); | |
| 827 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x75bd37, 0x75bd37, read8_delegate(FUNC(snesb_state::sb2b_75bd37_r),state)); | |
| 828 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x6a6000, 0x6a6fff, read8_delegate(FUNC(snesb_state::sb2b_6a6xxx_r),state)); | |
| 659 | 829 | |
| 660 | /* extra inputs */ | |
| 661 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(sb2b_770071_r)); | |
| 662 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(sb2b_770079_r)); | |
| 663 | ||
| 664 | 830 | /* handler to read boot code */ |
| 665 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 831 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 666 | 832 | |
| 667 | DRIVER_INIT_CALL(snes_hirom); | |
| 668 | } | |
| 669 | ||
| 670 | static DRIVER_INIT( iron ) | |
| 671 | { | |
| 672 | INT32 i; | |
| 673 | UINT8 *rom = machine.region("user3")->base(); | |
| 674 | ||
| 675 | for (i = 0; i < 0x140000; i++) | |
| 676 | { | |
| 677 | if(i < 0x80000) | |
| 678 | { | |
| 679 | rom[i] = BITSWAP8(rom[i]^0xff,2,7,1,6,3,0,5,4); | |
| 680 | } | |
| 681 | else | |
| 682 | { | |
| 683 | rom[i] = BITSWAP8(rom[i],6,3,0,5,1,4,7,2); | |
| 684 | } | |
| 685 | } | |
| 686 | ||
| 687 | 833 | /* extra inputs */ |
| 688 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(iron_770071_r)); | |
| 689 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770073, 0x770073, FUNC(iron_770073_r)); | |
| 690 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(iron_770079_r)); | |
| 834 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770071, 0x770071, read8_delegate(FUNC(snesb_state::snesb_dsw1_r),state)); | |
| 835 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770073, 0x770073, read8_delegate(FUNC(snesb_state::snesb_dsw2_r),state)); | |
| 836 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x770079, 0x770079, read8_delegate(FUNC(snesb_state::snesb_coin_r),state)); | |
| 691 | 837 | |
| 692 | DRIVER_INIT_CALL(snes); | |
| 838 | DRIVER_INIT_CALL(snes_hirom); | |
| 693 | 839 | } |
| 694 | 840 | |
| 695 | 841 | static DRIVER_INIT( endless ) |
| r14896 | r14897 | |
| 706 | 852 | DRIVER_INIT_CALL(snes); |
| 707 | 853 | } |
| 708 | 854 | |
| 709 | static DRIVER_INIT( denseib ) | |
| 710 | { | |
| 711 | UINT8 *rom = machine.region("user3")->base(); | |
| 712 | INT32 i; | |
| 713 | 855 | |
| 714 | for (i = 0; i < 0x200000; i++) | |
| 715 | { | |
| 716 | rom[i] = rom[i] ^ 0xff; | |
| 717 | switch (i >> 16) | |
| 718 | { | |
| 719 | case 0x00: rom[i] = BITSWAP8(rom[i],1,7,0,6,3,4,5,2); break; | |
| 720 | case 0x01: rom[i] = BITSWAP8(rom[i],3,4,7,2,0,6,5,1); break; | |
| 721 | case 0x02: rom[i] = BITSWAP8(rom[i],5,4,2,1,7,0,6,3); break; | |
| 722 | case 0x03: rom[i] = BITSWAP8(rom[i],0,1,3,7,2,6,5,4); break; | |
| 723 | ||
| 724 | default: rom[i] = BITSWAP8(rom[i],4,5,1,0,2,3,7,6); break; | |
| 725 | } | |
| 726 | } | |
| 727 | ||
| 728 | /* boot vector */ | |
| 729 | rom[0xfffc] = 0x40; | |
| 730 | rom[0xfffd] = 0xf7; | |
| 731 | ||
| 732 | /* extra inputs */ | |
| 733 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(denseib_770071_r)); | |
| 734 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(denseib_770079_r)); | |
| 735 | ||
| 736 | DRIVER_INIT_CALL(snes_hirom); | |
| 737 | } | |
| 738 | ||
| 739 | ||
| 740 | 856 | ROM_START( kinstb ) |
| 741 | 857 | ROM_REGION( 0x400000, "user3", 0 ) |
| 742 | 858 | ROM_LOAD( "1.u14", 0x000000, 0x100000, CRC(70889919) SHA1(1451714cbdacb7f6ced2bc7afa478ad7264cf3b7) ) |
| r14896 | r14897 | |
| 750 | 866 | ROM_REGION(0x800, "user6", ROMREGION_ERASEFF) |
| 751 | 867 | ROM_END |
| 752 | 868 | |
| 753 | ROM_START( endless ) | |
| 754 | ROM_REGION( 0x400000, "user3", 0 ) | |
| 755 | ROM_LOAD( "endlessduel.unknownposition1", 0x000000, 0x80000, CRC(e49acd29) SHA1(ac137261fe7a7691738ac812bea9591256eb9038) ) | |
| 756 | ROM_LOAD( "endlessduel.unknownposition2", 0x080000, 0x80000, CRC(ad2052f9) SHA1(d61382e3d93eb0bff45fb534cec0ce5ae3626165) ) | |
| 757 | ROM_LOAD( "endlessduel.unknownposition3", 0x100000, 0x80000, CRC(30d06d7a) SHA1(17c617d94abb10c3bdf9d51013b116f4ef4debe8) ) | |
| 758 | ROM_LOAD( "endlessduel.unknownposition4", 0x180000, 0x80000, CRC(9a9493ad) SHA1(82ee4fce9cc2014cb8404fd43eebb7941cdb9ac1) ) | |
| 759 | ||
| 760 | ROM_REGION(0x100, "user5", 0) | |
| 761 | ROM_LOAD("spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) | |
| 762 | ||
| 763 | ROM_REGION(0x800, "user6", ROMREGION_ERASEFF) | |
| 764 | ROM_END | |
| 765 | ||
| 766 | 869 | ROM_START( ffight2b ) |
| 767 | 870 | ROM_REGION( 0x400000, "user3", 0 ) |
| 768 | 871 | ROM_LOAD( "ff2_3.u6", 0x000000, 0x008000, CRC(343bf582) SHA1(cc6b7219bb2fe61f0b377b606ad28b0e5a78be0b) ) |
| r14896 | r14897 | |
| 817 | 920 | ROM_REGION(0x800, "user6", ROMREGION_ERASEFF) |
| 818 | 921 | ROM_END |
| 819 | 922 | |
| 923 | ROM_START( denseib ) | |
| 924 | ROM_REGION( 0x200000, "user3", ROMREGION_ERASEFF ) | |
| 925 | ROM_LOAD( "dj.u14", 0x000000, 0x0080000, CRC(487ded13) SHA1(624edce30fe2f2d750bcb49c609ceb511b2279b1) ) | |
| 926 | ROM_LOAD( "dj.u15", 0x080000, 0x0080000, CRC(5932a440) SHA1(6048372268a097b08d9f56ad30f083267d798165) ) | |
| 927 | ROM_LOAD( "dj.u16", 0x100000, 0x0080000, CRC(7cb71fd7) SHA1(7673e9dcaabe804e2d637e67eabca1683dad4245) ) | |
| 928 | ROM_LOAD( "dj.u17", 0x180000, 0x0080000, CRC(de29dd89) SHA1(441aefbc7ee64515ee66431ef504e76dc8dc5ca3) ) | |
| 929 | ||
| 930 | ROM_REGION(0x100, "user5", 0) | |
| 931 | ROM_LOAD("spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) | |
| 932 | ||
| 933 | ROM_REGION(0x800, "user6", ROMREGION_ERASEFF) | |
| 934 | ROM_END | |
| 935 | ||
| 820 | 936 | ROM_START( sblast2b ) |
| 821 | 937 | ROM_REGION( 0x180000, "user3", ROMREGION_ERASEFF ) |
| 822 | 938 | |
| r14896 | r14897 | |
| 832 | 948 | |
| 833 | 949 | ROM_END |
| 834 | 950 | |
| 835 | ROM_START( denseib ) | |
| 836 | ROM_REGION( 0x200000, "user3", ROMREGION_ERASEFF ) | |
| 837 | ROM_LOAD( "dj.u14", 0x000000, 0x0080000, CRC(487ded13) SHA1(624edce30fe2f2d750bcb49c609ceb511b2279b1) ) | |
| 838 | ROM_LOAD( "dj.u15", 0x080000, 0x0080000, CRC(5932a440) SHA1(6048372268a097b08d9f56ad30f083267d798165) ) | |
| 839 | ROM_LOAD( "dj.u16", 0x100000, 0x0080000, CRC(7cb71fd7) SHA1(7673e9dcaabe804e2d637e67eabca1683dad4245) ) | |
| 840 | ROM_LOAD( "dj.u17", 0x180000, 0x0080000, CRC(de29dd89) SHA1(441aefbc7ee64515ee66431ef504e76dc8dc5ca3) ) | |
| 951 | ROM_START( endless ) | |
| 952 | ROM_REGION( 0x400000, "user3", 0 ) | |
| 953 | ROM_LOAD( "endlessduel.unknownposition1", 0x000000, 0x80000, CRC(e49acd29) SHA1(ac137261fe7a7691738ac812bea9591256eb9038) ) | |
| 954 | ROM_LOAD( "endlessduel.unknownposition2", 0x080000, 0x80000, CRC(ad2052f9) SHA1(d61382e3d93eb0bff45fb534cec0ce5ae3626165) ) | |
| 955 | ROM_LOAD( "endlessduel.unknownposition3", 0x100000, 0x80000, CRC(30d06d7a) SHA1(17c617d94abb10c3bdf9d51013b116f4ef4debe8) ) | |
| 956 | ROM_LOAD( "endlessduel.unknownposition4", 0x180000, 0x80000, CRC(9a9493ad) SHA1(82ee4fce9cc2014cb8404fd43eebb7941cdb9ac1) ) | |
| 841 | 957 | |
| 842 | 958 | ROM_REGION(0x100, "user5", 0) |
| 843 | 959 | ROM_LOAD("spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) |
| r14896 | r14897 | |
| 848 | 964 | |
| 849 | 965 | GAME( 199?, kinstb, 0, kinstb, kinstb, kinstb, ROT0, "bootleg", "Killer Instinct (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 850 | 966 | GAME( 1996, ffight2b, 0, kinstb, ffight2b, ffight2b, ROT0, "bootleg", "Final Fight 2 (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 851 | GAME( 1997, sblast2b, 0, kinstb, sblast2b, sblast2b, ROT0, "bootleg", "Sonic Blast Man 2 Special Turbo (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS) | |
| 852 | 967 | GAME( 1996, iron, 0, kinstb, iron, iron, ROT0, "bootleg", "Iron (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 853 | 968 | GAME( 1996, denseib, 0, kinstb, denseib, denseib, ROT0, "bootleg", "Ghost Chaser Densei (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 854 | GAME( 1996, endless, 0, kinstb, iron, endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 969 | GAME( 1997, sblast2b, 0, kinstb, sblast2b, sblast2b, ROT0, "bootleg", "Sonic Blast Man 2 Special Turbo (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS) | |
| 970 | GAME( 1996, endless, 0, kinstb, endless, endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| r14896 | r14897 | |
|---|---|---|
| 91 | 91 | device_t *m_pic8259_2; |
| 92 | 92 | device_t *m_dma8237_1; |
| 93 | 93 | device_t *m_dma8237_2; |
| 94 | DECLARE_READ8_MEMBER(disk_iobank_r); | |
| 95 | DECLARE_WRITE8_MEMBER(disk_iobank_w); | |
| 96 | DECLARE_READ8_MEMBER(fdc765_status_r); | |
| 97 | DECLARE_READ8_MEMBER(fdc765_data_r); | |
| 98 | DECLARE_WRITE8_MEMBER(fdc765_data_w); | |
| 99 | DECLARE_WRITE8_MEMBER(drive_selection_w); | |
| 100 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 101 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 102 | DECLARE_READ8_MEMBER(dma_page_select_r); | |
| 103 | DECLARE_WRITE8_MEMBER(dma_page_select_w); | |
| 104 | DECLARE_WRITE8_MEMBER(tetriskr_bg_bank_w); | |
| 94 | 105 | }; |
| 95 | 106 | |
| 96 | 107 | static SCREEN_UPDATE_RGB32( tetriskr ) |
| r14896 | r14897 | |
| 132 | 143 | } |
| 133 | 144 | |
| 134 | 145 | |
| 135 | ||
| 146 | ||
| 136 | 147 | { |
| 137 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 138 | //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,cpu_get_pc(&space->device())); | |
| 139 | //if(offset == 0) return input_port_read(space->machine(), "DSW"); | |
| 140 | if(offset == 1) return input_port_read(space->machine(), "IN1"); | |
| 148 | //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,cpu_get_pc(&space.device())); | |
| 149 | //if(offset == 0) return input_port_read(machine(), "DSW"); | |
| 150 | if(offset == 1) return input_port_read(machine(), "IN1"); | |
| 141 | 151 | |
| 142 | return | |
| 152 | return | |
| 143 | 153 | } |
| 144 | 154 | |
| 145 | ||
| 155 | ||
| 146 | 156 | { |
| 147 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 148 | 157 | /* |
| 149 | 158 | BIOS does a single out $0310,$F0 on reset |
| 150 | 159 | |
| r14896 | r14897 | |
| 175 | 184 | } |
| 176 | 185 | else |
| 177 | 186 | { |
| 178 | if(( | |
| 187 | if(( | |
| 179 | 188 | newbank = 0; |
| 180 | else if (( | |
| 189 | else if (( | |
| 181 | 190 | newbank = 1; |
| 182 | else if (( | |
| 191 | else if (( | |
| 183 | 192 | newbank = 2; |
| 184 | else if (( | |
| 193 | else if (( | |
| 185 | 194 | newbank = 3; |
| 186 | 195 | } |
| 187 | 196 | |
| 188 | 197 | // printf("newbank = %d\n", newbank); |
| 189 | 198 | |
| 190 | if (newbank != | |
| 199 | if (newbank != | |
| 191 | 200 | { |
| 192 | state->m_bank = newbank; | |
| 193 | memory_set_bankptr(space->machine(), "bank1",space->machine().region("game_prg")->base() + 0x10000 * state->m_bank ); | |
| 201 | m_bank = newbank; | |
| 202 | memory_set_bankptr(machine(), "bank1",machine().region("game_prg")->base() + 0x10000 * m_bank ); | |
| 194 | 203 | } |
| 195 | 204 | |
| 196 | | |
| 205 | | |
| 197 | 206 | |
| 198 | | |
| 207 | | |
| 199 | 208 | } |
| 200 | 209 | |
| 201 | 210 | /********************************* |
| r14896 | r14897 | |
| 359 | 368 | #define FDC_WRITE 0x40 |
| 360 | 369 | #define FDC_READ 0x00 /*~0x40*/ |
| 361 | 370 | |
| 362 | ||
| 371 | ||
| 363 | 372 | { |
| 364 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 365 | 373 | UINT8 tmp; |
| 366 | // popmessage("Read FDC status @ PC=%05x",cpu_get_pc(&space->device())); | |
| 367 | tmp = state->m_status | 0x80; | |
| 368 | state->m_clr_status++; | |
| 369 | if(state->m_clr_status == 0x10) | |
| 374 | // popmessage("Read FDC status @ PC=%05x",cpu_get_pc(&space.device())); | |
| 375 | tmp = m_status | 0x80; | |
| 376 | m_clr_status++; | |
| 377 | if(m_clr_status == 0x10) | |
| 370 | 378 | { |
| 371 | state->m_status = 0; | |
| 372 | state->m_clr_status = 0; | |
| 379 | m_status = 0; | |
| 380 | m_clr_status = 0; | |
| 373 | 381 | } |
| 374 | 382 | return tmp; |
| 375 | 383 | } |
| 376 | 384 | |
| 377 | ||
| 385 | ||
| 378 | 386 | { |
| 379 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 380 | state->m_status = (FDC_READ); | |
| 387 | m_status = (FDC_READ); | |
| 381 | 388 | return 0xc0; |
| 382 | 389 | } |
| 383 | 390 | |
| 384 | ||
| 391 | ||
| 385 | 392 | { |
| 386 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 387 | state->m_status = (FDC_WRITE); | |
| 393 | m_status = (FDC_WRITE); | |
| 388 | 394 | } |
| 389 | 395 | |
| 390 | 396 | |
| 391 | ||
| 397 | ||
| 392 | 398 | { |
| 393 | // pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 394 | 399 | |
| 395 | 400 | /* TODO: properly hook-up upd765 FDC there */ |
| 396 | pic8259_ir6_w( | |
| 401 | pic8259_ir6_w( | |
| 397 | 402 | } |
| 398 | 403 | |
| 399 | 404 | /****************** |
| r14896 | r14897 | |
| 410 | 415 | } |
| 411 | 416 | |
| 412 | 417 | |
| 413 | ||
| 418 | ||
| 414 | 419 | { |
| 415 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 416 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 420 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 417 | 421 | & 0xFF0000; |
| 418 | 422 | |
| 419 | return space | |
| 423 | return space. | |
| 420 | 424 | } |
| 421 | 425 | |
| 422 | 426 | |
| 423 | ||
| 427 | ||
| 424 | 428 | { |
| 425 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 426 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 429 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 427 | 430 | & 0xFF0000; |
| 428 | 431 | |
| 429 | space | |
| 432 | space. | |
| 430 | 433 | } |
| 431 | 434 | |
| 432 | ||
| 435 | ||
| 433 | 436 | { |
| 434 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 435 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 437 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 436 | 438 | |
| 437 | 439 | switch(offset % 8) { |
| 438 | 440 | case 1: |
| 439 | data = | |
| 441 | data = | |
| 440 | 442 | break; |
| 441 | 443 | case 2: |
| 442 | data = | |
| 444 | data = | |
| 443 | 445 | break; |
| 444 | 446 | case 3: |
| 445 | data = | |
| 447 | data = | |
| 446 | 448 | break; |
| 447 | 449 | case 7: |
| 448 | data = | |
| 450 | data = | |
| 449 | 451 | break; |
| 450 | 452 | } |
| 451 | 453 | return data; |
| 452 | 454 | } |
| 453 | 455 | |
| 454 | 456 | |
| 455 | ||
| 457 | ||
| 456 | 458 | { |
| 457 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 458 | state->m_at_pages[offset % 0x10] = data; | |
| 459 | m_at_pages[offset % 0x10] = data; | |
| 459 | 460 | |
| 460 | 461 | switch(offset % 8) { |
| 461 | 462 | case 1: |
| 462 | | |
| 463 | | |
| 463 | 464 | break; |
| 464 | 465 | case 2: |
| 465 | | |
| 466 | | |
| 466 | 467 | break; |
| 467 | 468 | case 3: |
| 468 | | |
| 469 | | |
| 469 | 470 | break; |
| 470 | 471 | case 7: |
| 471 | | |
| 472 | | |
| 472 | 473 | break; |
| 473 | 474 | } |
| 474 | 475 | } |
| r14896 | r14897 | |
| 488 | 489 | { |
| 489 | 490 | DEVCB_LINE(pc_dma_hrq_changed), |
| 490 | 491 | DEVCB_NULL, |
| 491 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 492 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 492 | DEVCB_DRIVER_MEMBER(pcxt_state, pc_dma_read_byte), | |
| 493 | DEVCB_DRIVER_MEMBER(pcxt_state, pc_dma_write_byte), | |
| 493 | 494 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 494 | 495 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 495 | 496 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 549 | 550 | AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) //PPI 8255 |
| 550 | 551 | AM_RANGE(0x0064, 0x0066) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) //PPI 8255 |
| 551 | 552 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE("rtc", mc146818_device, read, write) |
| 552 | AM_RANGE(0x0080, 0x0087) AM_READWRITE | |
| 553 | AM_RANGE(0x0080, 0x0087) AM_READWRITE | |
| 553 | 554 | AM_RANGE(0x00a0, 0x00af) AM_DEVREADWRITE_LEGACY("pic8259_2", pic8259_r, pic8259_w ) |
| 554 | 555 | AM_RANGE(0x0278, 0x027f) AM_RAM //printer (parallel) port latch |
| 555 | 556 | AM_RANGE(0x02f8, 0x02ff) AM_RAM //Modem port |
| 556 | 557 | AM_RANGE(0x0378, 0x037f) AM_RAM //printer (parallel) port |
| 557 | 558 | AM_RANGE(0x03bc, 0x03bf) AM_RAM //printer port |
| 558 | AM_RANGE(0x03f2, 0x03f2) AM_WRITE_LEGACY(drive_selection_w) | |
| 559 | AM_RANGE(0x03f4, 0x03f4) AM_READ_LEGACY(fdc765_status_r) //765 Floppy Disk Controller (FDC) Status | |
| 560 | AM_RANGE(0x03f5, 0x03f5) AM_READWRITE_LEGACY(fdc765_data_r,fdc765_data_w)//FDC Data | |
| 559 | AM_RANGE(0x03f2, 0x03f2) AM_WRITE(drive_selection_w) | |
| 560 | AM_RANGE(0x03f4, 0x03f4) AM_READ(fdc765_status_r) //765 Floppy Disk Controller (FDC) Status | |
| 561 | AM_RANGE(0x03f5, 0x03f5) AM_READWRITE(fdc765_data_r,fdc765_data_w)//FDC Data | |
| 561 | 562 | AM_RANGE(0x03f8, 0x03ff) AM_RAM //rs232c (serial) port |
| 562 | 563 | ADDRESS_MAP_END |
| 563 | 564 | |
| r14896 | r14897 | |
| 566 | 567 | AM_IMPORT_FROM( pcxt_io_common ) |
| 567 | 568 | // AM_RANGE(0x0200, 0x020f) AM_RAM //game port |
| 568 | 569 | AM_RANGE(0x0201, 0x0201) AM_READ_PORT("COIN") //game port |
| 569 | AM_RANGE(0x0310, 0x0311) AM_READWRITE | |
| 570 | AM_RANGE(0x0310, 0x0311) AM_READWRITE | |
| 570 | 571 | AM_RANGE(0x0312, 0x0312) AM_READ_PORT("IN0") //Prototyping card,read only |
| 571 | 572 | ADDRESS_MAP_END |
| 572 | 573 | |
| 573 | ||
| 574 | ||
| 574 | 575 | { |
| 575 | pcxt_state *state = space->machine().driver_data<pcxt_state>(); | |
| 576 | 576 | |
| 577 | | |
| 577 | | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | static ADDRESS_MAP_START( tetriskr_io, AS_IO, 8, pcxt_state ) |
| 581 | 581 | ADDRESS_MAP_GLOBAL_MASK(0x3ff) |
| 582 | 582 | AM_IMPORT_FROM( pcxt_io_common ) |
| 583 | 583 | AM_RANGE(0x0200, 0x020f) AM_RAM //game port |
| 584 | AM_RANGE(0x03c0, 0x03c0) AM_WRITE | |
| 584 | AM_RANGE(0x03c0, 0x03c0) AM_WRITE | |
| 585 | 585 | AM_RANGE(0x03c8, 0x03c8) AM_READ_PORT("IN0") |
| 586 | 586 | AM_RANGE(0x03c9, 0x03c9) AM_READ_PORT("IN1") |
| 587 | 587 | // AM_RANGE(0x03ce, 0x03ce) AM_READ_PORT("IN1") //read then discarded? |
| r14896 | r14897 | |
|---|---|---|
| 147 | 147 | WRITE16_MEMBER(mcatadv_state::mcat_soundlatch_w) |
| 148 | 148 | { |
| 149 | 149 | |
| 150 | soundlatch_w(space, 0, data); | |
| 150 | soundlatch_byte_w(space, 0, data); | |
| 151 | 151 | device_set_input_line(m_soundcpu, INPUT_LINE_NMI, PULSE_LINE); |
| 152 | 152 | } |
| 153 | 153 | |
| r14896 | r14897 | |
| 183 | 183 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(mcatadv_videoram1_w) AM_BASE(m_videoram1) // Tilemap 0 |
| 184 | 184 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(mcatadv_videoram2_w) AM_BASE(m_videoram2) // Tilemap 1 |
| 185 | 185 | |
| 186 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 186 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 187 | 187 | AM_RANGE(0x602000, 0x602fff) AM_RAM // Bigger than needs to be? |
| 188 | 188 | |
| 189 | 189 | AM_RANGE(0x700000, 0x707fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites, two halves for double buffering |
| r14896 | r14897 | |
| 220 | 220 | |
| 221 | 221 | static ADDRESS_MAP_START( mcatadv_sound_io_map, AS_IO, 8, mcatadv_state ) |
| 222 | 222 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 223 | AM_RANGE(0x80, 0x80) AM_READWRITE(soundlatch_r, soundlatch2_w) | |
| 223 | AM_RANGE(0x80, 0x80) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) | |
| 224 | 224 | ADDRESS_MAP_END |
| 225 | 225 | |
| 226 | 226 | |
| r14896 | r14897 | |
| 235 | 235 | AM_RANGE(0x00, 0x03) AM_DEVWRITE_LEGACY("ymsnd", ym2610_w) |
| 236 | 236 | AM_RANGE(0x04, 0x07) AM_DEVREAD_LEGACY("ymsnd", ym2610_r) |
| 237 | 237 | AM_RANGE(0x40, 0x40) AM_WRITE(mcatadv_sound_bw_w) |
| 238 | AM_RANGE(0x80, 0x80) AM_READWRITE(soundlatch_r, soundlatch2_w) | |
| 238 | AM_RANGE(0x80, 0x80) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) | |
| 239 | 239 | ADDRESS_MAP_END |
| 240 | 240 | |
| 241 | 241 | /*** Inputs ***/ |
| r14896 | r14897 | |
|---|---|---|
| 863 | 863 | if (ACCESSING_BITS_0_7) |
| 864 | 864 | { |
| 865 | 865 | |
| 866 | soundlatch_w(space, offset, data & 0xff); | |
| 866 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 867 | 867 | device_set_input_line(m_sub_cpu, 0, HOLD_LINE); |
| 868 | 868 | } |
| 869 | 869 | } |
| r14896 | r14897 | |
| 921 | 921 | if (ACCESSING_BITS_0_7) |
| 922 | 922 | { |
| 923 | 923 | |
| 924 | soundlatch_w(space, offset, data & 0xff); | |
| 924 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 925 | 925 | device_set_input_line(m_sub_cpu, INPUT_LINE_NMI, ASSERT_LINE); |
| 926 | 926 | } |
| 927 | 927 | } |
| r14896 | r14897 | |
| 932 | 932 | if (ACCESSING_BITS_0_7) |
| 933 | 933 | { |
| 934 | 934 | |
| 935 | soundlatch2_w(space, offset, data & 0xff); | |
| 935 | soundlatch2_byte_w(space, offset, data & 0xff); | |
| 936 | 936 | device_set_input_line(m_sub_cpu, INPUT_LINE_NMI, ASSERT_LINE); |
| 937 | 937 | } |
| 938 | 938 | } |
| r14896 | r14897 | |
| 1027 | 1027 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 1028 | 1028 | AM_RANGE(0x020000, 0x03ffff) AM_ROM // extra for Whoopee |
| 1029 | 1029 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1030 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1030 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1031 | 1031 | AM_RANGE(0x140000, 0x14000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1032 | 1032 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("DSWA") |
| 1033 | 1033 | AM_RANGE(0x180010, 0x180011) AM_READ_PORT("DSWB") |
| r14896 | r14897 | |
| 1044 | 1044 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1045 | 1045 | AM_RANGE(0x040000, 0x040001) AM_READ(ghox_p2_h_analog_r) |
| 1046 | 1046 | AM_RANGE(0x080000, 0x083fff) AM_RAM |
| 1047 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1047 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1048 | 1048 | AM_RANGE(0x100000, 0x100001) AM_READ(ghox_p1_h_analog_r) |
| 1049 | 1049 | AM_RANGE(0x140000, 0x14000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1050 | 1050 | AM_RANGE(0x180000, 0x180001) AM_READWRITE(ghox_mcu_r, ghox_mcu_w) // really part of shared RAM |
| r14896 | r14897 | |
| 1068 | 1068 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_v25_coin_word_w) // Coin count/lock + v25 reset line |
| 1069 | 1069 | AM_RANGE(0x210000, 0x21ffff) AM_READWRITE(shared_ram_r, shared_ram_w ) |
| 1070 | 1070 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1071 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1071 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1072 | 1072 | AM_RANGE(0x500000, 0x50000d) AM_DEVREADWRITE_LEGACY("gp9001vdp1", gp9001_vdp_r, gp9001_vdp_w) |
| 1073 | 1073 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) // test bit 8 |
| 1074 | 1074 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1083 | 1083 | AM_RANGE(0x208018, 0x208019) AM_READ_PORT("SYS") |
| 1084 | 1084 | AM_RANGE(0x20801c, 0x20801d) AM_WRITE(toaplan2_coin_word_w) |
| 1085 | 1085 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1086 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1086 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1087 | 1087 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) // test bit 8 |
| 1088 | 1088 | ADDRESS_MAP_END |
| 1089 | 1089 | |
| r14896 | r14897 | |
| 1105 | 1105 | AM_RANGE(0x200028, 0x200029) AM_DEVWRITE_LEGACY("oki1", oki_bankswitch_w) |
| 1106 | 1106 | AM_RANGE(0x20002c, 0x20002d) AM_READ(video_count_r) |
| 1107 | 1107 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1108 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1108 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1109 | 1109 | ADDRESS_MAP_END |
| 1110 | 1110 | |
| 1111 | 1111 | |
| r14896 | r14897 | |
| 1113 | 1113 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1114 | 1114 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 1115 | 1115 | AM_RANGE(0x200000, 0x20000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1116 | AM_RANGE(0x300000, 0x300fff) AM_RAM_WRITE(paletteram | |
| 1116 | AM_RANGE(0x300000, 0x300fff) AM_RAM_WRITE(paletteram | |
| 1117 | 1117 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1118 | 1118 | AM_RANGE(0x402000, 0x4021ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| 1119 | 1119 | AM_RANGE(0x402200, 0x402fff) AM_RAM |
| r14896 | r14897 | |
| 1136 | 1136 | static ADDRESS_MAP_START( pipibibs_68k_mem, AS_PROGRAM, 16, toaplan2_state ) |
| 1137 | 1137 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1138 | 1138 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1139 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1139 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1140 | 1140 | AM_RANGE(0x140000, 0x14000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1141 | 1141 | AM_RANGE(0x190000, 0x190fff) AM_READWRITE(shared_ram_r, shared_ram_w) |
| 1142 | 1142 | AM_RANGE(0x19c01c, 0x19c01d) AM_WRITE(toaplan2_coin_word_w) |
| r14896 | r14897 | |
| 1154 | 1154 | AM_RANGE(0x080000, 0x082fff) AM_RAM |
| 1155 | 1155 | AM_RANGE(0x083000, 0x0837ff) AM_DEVREADWRITE_LEGACY("gp9001vdp0", pipibibi_bootleg_spriteram16_r, pipibibi_bootleg_spriteram16_w) // SpriteRAM |
| 1156 | 1156 | AM_RANGE(0x083800, 0x087fff) AM_RAM // SpriteRAM (unused) |
| 1157 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1157 | AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM_WRITE(paletteram | |
| 1158 | 1158 | AM_RANGE(0x120000, 0x120fff) AM_RAM // Copy of SpriteRAM ? |
| 1159 | 1159 | // AM_RANGE(0x13f000, 0x13f001) AM_WRITENOP // ??? |
| 1160 | 1160 | AM_RANGE(0x180000, 0x182fff) AM_DEVREADWRITE_LEGACY("gp9001vdp0", pipibibi_bootleg_videoram16_r, pipibibi_bootleg_videoram16_w) // TileRAM |
| r14896 | r14897 | |
| 1181 | 1181 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_coin_word_w) |
| 1182 | 1182 | AM_RANGE(0x280000, 0x28ffff) AM_READWRITE(shared_ram_r, shared_ram_w ) |
| 1183 | 1183 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1184 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1184 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1185 | 1185 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1186 | 1186 | AM_RANGE(0x502000, 0x5021ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| 1187 | 1187 | AM_RANGE(0x503000, 0x5031ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size) |
| r14896 | r14897 | |
| 1203 | 1203 | AM_RANGE(0x200018, 0x200019) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 1204 | 1204 | AM_RANGE(0x20001c, 0x20001d) AM_READ_PORT("DSWA") |
| 1205 | 1205 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1206 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1206 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1207 | 1207 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1208 | 1208 | AM_RANGE(0x502000, 0x5021ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| 1209 | 1209 | AM_RANGE(0x503000, 0x5031ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size) |
| r14896 | r14897 | |
| 1222 | 1222 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_v25_coin_word_w) // Coin count/lock + v25 reset line |
| 1223 | 1223 | AM_RANGE(0x210000, 0x21ffff) AM_READWRITE(shared_ram_r, shared_ram_w ) |
| 1224 | 1224 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1225 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1225 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1226 | 1226 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) |
| 1227 | 1227 | ADDRESS_MAP_END |
| 1228 | 1228 | |
| r14896 | r14897 | |
| 1236 | 1236 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_v25_coin_word_w) // Coin count/lock + v25 reset line |
| 1237 | 1237 | AM_RANGE(0x210000, 0x21ffff) AM_READWRITE(shared_ram_r, shared_ram_w ) |
| 1238 | 1238 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1239 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1239 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1240 | 1240 | AM_RANGE(0x500000, 0x50000d) AM_DEVREADWRITE_LEGACY("gp9001vdp1", gp9001_vdp_r, gp9001_vdp_w) |
| 1241 | 1241 | AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) |
| 1242 | 1242 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1246 | 1246 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1247 | 1247 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 1248 | 1248 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1249 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1249 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1250 | 1250 | AM_RANGE(0x500000, 0x500003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 1251 | 1251 | AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 1252 | 1252 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("JMPR") |
| r14896 | r14897 | |
| 1275 | 1275 | AM_RANGE(0x21c034, 0x21c035) AM_READ_PORT("JMPR") |
| 1276 | 1276 | AM_RANGE(0x21c03c, 0x21c03d) AM_READ(video_count_r) |
| 1277 | 1277 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1278 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1278 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1279 | 1279 | AM_RANGE(0x401000, 0x4017ff) AM_RAM // Unused palette RAM |
| 1280 | 1280 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1281 | 1281 | AM_RANGE(0x502000, 0x5021ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| r14896 | r14897 | |
| 1299 | 1299 | AM_RANGE(0x21c034, 0x21c035) AM_READ_PORT("JMPR") |
| 1300 | 1300 | AM_RANGE(0x21c03c, 0x21c03d) AM_READ(video_count_r) |
| 1301 | 1301 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1302 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1302 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1303 | 1303 | AM_RANGE(0x401000, 0x4017ff) AM_RAM // Unused palette RAM |
| 1304 | 1304 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1305 | 1305 | AM_RANGE(0x502000, 0x5021ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| r14896 | r14897 | |
| 1322 | 1322 | AM_RANGE(0x21c034, 0x21c035) AM_READ_PORT("JMPR") |
| 1323 | 1323 | AM_RANGE(0x21c03c, 0x21c03d) AM_READ(video_count_r) |
| 1324 | 1324 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE_LEGACY("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1325 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1325 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 1326 | 1326 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1327 | 1327 | AM_RANGE(0x502000, 0x5021ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| 1328 | 1328 | AM_RANGE(0x502200, 0x502fff) AM_RAM |
| r14896 | r14897 | |
| 1336 | 1336 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 1337 | 1337 | // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA |
| 1338 | 1338 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1339 | AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram | |
| 1339 | AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram | |
| 1340 | 1340 | AM_RANGE(0x203000, 0x2031ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| 1341 | 1341 | AM_RANGE(0x203200, 0x2033ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size) |
| 1342 | 1342 | AM_RANGE(0x203400, 0x207fff) AM_RAM AM_BASE_SIZE(m_mainram16, m_mainram_overlap_size) |
| r14896 | r14897 | |
| 1366 | 1366 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 1367 | 1367 | // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA |
| 1368 | 1368 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size) |
| 1369 | AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram | |
| 1369 | AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram | |
| 1370 | 1370 | AM_RANGE(0x203000, 0x2031ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size) |
| 1371 | 1371 | AM_RANGE(0x203200, 0x2033ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size) |
| 1372 | 1372 | AM_RANGE(0x203400, 0x207fff) AM_RAM AM_BASE_SIZE(m_mainram16, m_mainram_overlap_size) |
| r14896 | r14897 | |
| 1418 | 1418 | AM_RANGE(0xe006, 0xe008) AM_WRITE(raizing_oki_bankswitch_w) |
| 1419 | 1419 | AM_RANGE(0xe00a, 0xe00a) AM_WRITE(raizing_z80_bankswitch_w) |
| 1420 | 1420 | AM_RANGE(0xe00c, 0xe00c) AM_WRITE(bgaregga_E00C_w) |
| 1421 | AM_RANGE(0xe01c, 0xe01c) AM_READ(soundlatch_r) | |
| 1421 | AM_RANGE(0xe01c, 0xe01c) AM_READ(soundlatch_byte_r) | |
| 1422 | 1422 | AM_RANGE(0xe01d, 0xe01d) AM_READ(bgaregga_E01D_r) |
| 1423 | 1423 | ADDRESS_MAP_END |
| 1424 | 1424 | |
| r14896 | r14897 | |
| 1432 | 1432 | |
| 1433 | 1433 | static ADDRESS_MAP_START( batrider_sound_z80_port, AS_IO, 8, toaplan2_state ) |
| 1434 | 1434 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1435 | AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch3_w) | |
| 1436 | AM_RANGE(0x42, 0x42) AM_WRITE(soundlatch4_w) | |
| 1435 | AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch3_byte_w) | |
| 1436 | AM_RANGE(0x42, 0x42) AM_WRITE(soundlatch4_byte_w) | |
| 1437 | 1437 | AM_RANGE(0x44, 0x44) AM_WRITE(batrider_sndirq_w) |
| 1438 | 1438 | AM_RANGE(0x46, 0x46) AM_WRITE(batrider_clear_nmi_w) |
| 1439 | AM_RANGE(0x48, 0x48) AM_READ(soundlatch_r) | |
| 1440 | AM_RANGE(0x4a, 0x4a) AM_READ(soundlatch2_r) | |
| 1439 | AM_RANGE(0x48, 0x48) AM_READ(soundlatch_byte_r) | |
| 1440 | AM_RANGE(0x4a, 0x4a) AM_READ(soundlatch2_byte_r) | |
| 1441 | 1441 | AM_RANGE(0x80, 0x81) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1442 | 1442 | AM_RANGE(0x82, 0x82) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 1443 | 1443 | AM_RANGE(0x84, 0x84) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| r14896 | r14897 | |
| 1454 | 1454 | |
| 1455 | 1455 | static ADDRESS_MAP_START( bbakraid_sound_z80_port, AS_IO, 8, toaplan2_state ) |
| 1456 | 1456 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1457 | AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch3_w) | |
| 1458 | AM_RANGE(0x42, 0x42) AM_WRITE(soundlatch4_w) | |
| 1457 | AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch3_byte_w) | |
| 1458 | AM_RANGE(0x42, 0x42) AM_WRITE(soundlatch4_byte_w) | |
| 1459 | 1459 | AM_RANGE(0x44, 0x44) AM_WRITE(batrider_sndirq_w) |
| 1460 | 1460 | AM_RANGE(0x46, 0x46) AM_WRITE(batrider_clear_nmi_w) |
| 1461 | AM_RANGE(0x48, 0x48) AM_READ(soundlatch_r) | |
| 1462 | AM_RANGE(0x4a, 0x4a) AM_READ(soundlatch2_r) | |
| 1461 | AM_RANGE(0x48, 0x48) AM_READ(soundlatch_byte_r) | |
| 1462 | AM_RANGE(0x4a, 0x4a) AM_READ(soundlatch2_byte_r) | |
| 1463 | 1463 | AM_RANGE(0x80, 0x81) AM_DEVREADWRITE_LEGACY("ymz", ymz280b_r, ymz280b_w) |
| 1464 | 1464 | ADDRESS_MAP_END |
| 1465 | 1465 |
| r14896 | r14897 | |
|---|---|---|
| 131 | 131 | WRITE8_MEMBER(cinemat_state::mux_select_w) |
| 132 | 132 | { |
| 133 | 133 | m_mux_select = data; |
| 134 | cinemat_sound_control_w( | |
| 134 | cinemat_sound_control_w( | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| r14896 | r14897 | |
| 323 | 323 | |
| 324 | 324 | AM_RANGE(0x05, 0x05) AM_WRITE(coin_reset_w) |
| 325 | 325 | AM_RANGE(0x06, 0x06) AM_WRITE(cinemat_vector_control_w) |
| 326 | AM_RANGE(0x00, 0x07) AM_WRITE | |
| 326 | AM_RANGE(0x00, 0x07) AM_WRITE | |
| 327 | 327 | ADDRESS_MAP_END |
| 328 | 328 | |
| 329 | 329 |
| r14896 | r14897 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | m_nmi_enable = data & 0x01; |
| 99 | 99 | m_irq_enable = data & 0x02; |
| 100 | flip_screen_set( | |
| 100 | flip_screen_set( | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static INTERRUPT_GEN( jb_interrupt ) |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | if (ACCESSING_BITS_0_7) |
| 38 | 38 | { |
| 39 | soundlatch_w(space, 0, data & 0xff); | |
| 39 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 40 | 40 | device_set_input_line(m_audiocpu, M6809_FIRQ_LINE, HOLD_LINE); |
| 41 | 41 | } |
| 42 | 42 | } |
| r14896 | r14897 | |
| 122 | 122 | AM_RANGE(0x102000, 0x103fff) AM_RAM /* Screen RAM */ |
| 123 | 123 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_BASE(m_vregs) /* Video Registers */ |
| 124 | 124 | // AM_RANGE(0x10800c, 0x10800d) AM_WRITE(watchdog_reset_w) /* INT 6 ACK/Watchdog timer */ |
| 125 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 125 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 126 | 126 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 127 | 127 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW1") |
| 128 | 128 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW2") |
| r14896 | r14897 | |
| 139 | 139 | AM_RANGE(0x0800, 0x0801) AM_DEVREADWRITE("oki", okim6295_device, read, write) /* OKI6295 */ |
| 140 | 140 | // AM_RANGE(0x0900, 0x0900) AM_WRITENOP /* enable sound output? */ |
| 141 | 141 | AM_RANGE(0x0a00, 0x0a01) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) /* YM3812 */ |
| 142 | AM_RANGE(0x0b00, 0x0b00) AM_READ(soundlatch_r) /* Sound latch */ | |
| 142 | AM_RANGE(0x0b00, 0x0b00) AM_READ(soundlatch_byte_r) /* Sound latch */ | |
| 143 | 143 | AM_RANGE(0x0c00, 0xffff) AM_ROM /* ROM */ |
| 144 | 144 | ADDRESS_MAP_END |
| 145 | 145 | |
| r14896 | r14897 | |
| 149 | 149 | AM_RANGE(0x102000, 0x103fff) AM_RAM /* Screen RAM */ |
| 150 | 150 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_BASE(m_vregs) /* Video Registers */ |
| 151 | 151 | // AM_RANGE(0x10800c, 0x10800d) AM_WRITE(watchdog_reset_w) /* INT 6 ACK/Watchdog timer */ |
| 152 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 152 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 153 | 153 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 154 | 154 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2") |
| 155 | 155 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 166 | 166 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(gaelco_encrypted_w) AM_BASE(m_screen) /* Screen RAM */ |
| 167 | 167 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_BASE(m_vregs) /* Video Registers */ |
| 168 | 168 | // AM_RANGE(0x10800c, 0x10800d) AM_WRITE(watchdog_reset_w) /* INT 6 ACK/Watchdog timer */ |
| 169 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 169 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 170 | 170 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 171 | 171 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2") |
| 172 | 172 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 183 | 183 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(thoop_encrypted_w) AM_BASE(m_screen) /* Screen RAM */ |
| 184 | 184 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_BASE(m_vregs) /* Video Registers */ |
| 185 | 185 | // AM_RANGE(0x10800c, 0x10800d) AM_WRITE(watchdog_reset_w) /* INT 6 ACK/Watchdog timer */ |
| 186 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 186 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 187 | 187 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 188 | 188 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2") |
| 189 | 189 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
|---|---|---|
| 556 | 556 | |
| 557 | 557 | static ADDRESS_MAP_START( wecleman_sub_map, AS_PROGRAM, 16, wecleman_state ) |
| 558 | 558 | AM_RANGE(0x000000, 0x00ffff) AM_ROM // ROM |
| 559 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE(m_roadram | |
| 559 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE_SIZE(m_roadram, | |
| 560 | 560 | AM_RANGE(0x070000, 0x073fff) AM_RAM AM_SHARE("share1") // RAM (Shared with main CPU) |
| 561 | 561 | ADDRESS_MAP_END |
| 562 | 562 | |
| r14896 | r14897 | |
| 567 | 567 | |
| 568 | 568 | static ADDRESS_MAP_START( hotchase_sub_map, AS_PROGRAM, 16, wecleman_state ) |
| 569 | 569 | AM_RANGE(0x000000, 0x01ffff) AM_ROM // ROM |
| 570 | AM_RANGE(0x020000, 0x020fff) AM_RAM AM_BASE(m_roadram | |
| 570 | AM_RANGE(0x020000, 0x020fff) AM_RAM AM_BASE_SIZE(m_roadram, | |
| 571 | 571 | AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("share1") // Shared with main CPU |
| 572 | 572 | AM_RANGE(0x060000, 0x060fff) AM_RAM // a table, presumably road related |
| 573 | 573 | AM_RANGE(0x061000, 0x06101f) AM_RAM // road vregs? |
| r14896 | r14897 | |
| 583 | 583 | { |
| 584 | 584 | if (ACCESSING_BITS_0_7) |
| 585 | 585 | { |
| 586 | soundlatch_w(space, 0, data & 0xFF); | |
| 586 | soundlatch_byte_w(space, 0, data & 0xFF); | |
| 587 | 587 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 588 | 588 | } |
| 589 | 589 | } |
| r14896 | r14897 | |
| 627 | 627 | AM_RANGE(0x9000, 0x9000) AM_READ(multiply_r) // Protection |
| 628 | 628 | AM_RANGE(0x9000, 0x9001) AM_WRITE(multiply_w) // Protection |
| 629 | 629 | AM_RANGE(0x9006, 0x9006) AM_WRITENOP // ? |
| 630 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) // From main CPU | |
| 630 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) // From main CPU | |
| 631 | 631 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("konami", k007232_r, k007232_w) // K007232 (Reading offset 5/b triggers the sample) |
| 632 | 632 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 633 | 633 | AM_RANGE(0xf000, 0xf000) AM_DEVWRITE_LEGACY("konami", wecleman_K00723216_bank_w) // Samples banking |
| r14896 | r14897 | |
| 643 | 643 | { |
| 644 | 644 | if (ACCESSING_BITS_0_7) |
| 645 | 645 | { |
| 646 | soundlatch_w(space, 0, data & 0xFF); | |
| 646 | soundlatch_byte_w(space, 0, data & 0xFF); | |
| 647 | 647 | cputag_set_input_line(machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE); |
| 648 | 648 | } |
| 649 | 649 | } |
| r14896 | r14897 | |
| 720 | 720 | AM_RANGE(0x3000, 0x300d) AM_DEVREADWRITE_LEGACY("konami3", hotchase_k007232_r, hotchase_k007232_w) |
| 721 | 721 | AM_RANGE(0x4000, 0x4007) AM_WRITE(hotchase_sound_control_w) // Sound volume, banking, etc. |
| 722 | 722 | AM_RANGE(0x5000, 0x5000) AM_WRITENOP // ? (written with 0 on IRQ, 1 on FIRQ) |
| 723 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) // From main CPU (Read on IRQ) | |
| 723 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) // From main CPU (Read on IRQ) | |
| 724 | 724 | AM_RANGE(0x7000, 0x7000) AM_WRITENOP // Command acknowledge ? |
| 725 | 725 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 726 | 726 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 377 | 377 | |
| 378 | 378 | else |
| 379 | 379 | { |
| 380 | soundlatch_w(space, 0, data); | |
| 380 | soundlatch_byte_w(space, 0, data); | |
| 381 | 381 | device_set_input_line(m_audiocpu, 0, ASSERT_LINE ); |
| 382 | 382 | } |
| 383 | 383 | } |
| r14896 | r14897 | |
| 576 | 576 | static ADDRESS_MAP_START( audio_io, AS_IO, 8, kas89_state ) |
| 577 | 577 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 578 | 578 | AM_RANGE(0x00, 0x00) AM_WRITE(int_ack_w) // comm out (1st Z80). seems to write here the value previously read through soundlatch (port 0x02). |
| 579 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r) | |
| 579 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) | |
| 580 | 580 | AM_RANGE(0x04, 0x04) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 581 | 581 | AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w) |
| 582 | 582 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | static void pc3092_update(running_machine &machine) |
| 54 | 54 | { |
| 55 | 55 | crbaloon_state *state = machine.driver_data<crbaloon_state>(); |
| 56 | flip_screen_set( | |
| 56 | state->flip_screen_set( | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | public: |
| 62 | 62 | dmndrby_state(const machine_config &mconfig, device_type type, const char *tag) |
| 63 | : driver_device(mconfig, type, tag) { } | |
| 63 | : driver_device(mconfig, type, tag) , | |
| 64 | m_scroll_ram(*this, "scroll_ram"), | |
| 65 | m_sprite_ram(*this, "sprite_ram"), | |
| 66 | m_dderby_vidchars(*this, "dderby_vidchars"), | |
| 67 | m_dderby_vidattribs(*this, "dderby_vidattribs"){ } | |
| 64 | 68 | |
| 65 | UINT8* m_dderby_vidchars; | |
| 66 | UINT8* m_scroll_ram; | |
| 67 | UINT8* m_dderby_vidattribs; | |
| 68 | UINT8* m_sprite_ram; | |
| 69 | required_shared_ptr<UINT8> m_scroll_ram; | |
| 70 | required_shared_ptr<UINT8> m_sprite_ram; | |
| 71 | required_shared_ptr<UINT8> m_dderby_vidchars; | |
| 72 | required_shared_ptr<UINT8> m_dderby_vidattribs; | |
| 69 | 73 | UINT8 *m_racetrack_tilemap_rom; |
| 70 | 74 | tilemap_t *m_racetrack_tilemap; |
| 71 | 75 | UINT8 m_io_port[8]; |
| r14896 | r14897 | |
| 78 | 82 | |
| 79 | 83 | WRITE8_MEMBER(dmndrby_state::dderby_sound_w) |
| 80 | 84 | { |
| 81 | soundlatch_w(space,0,data); | |
| 85 | soundlatch_byte_w(space,0,data); | |
| 82 | 86 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 83 | 87 | } |
| 84 | 88 | |
| r14896 | r14897 | |
| 128 | 132 | AM_RANGE(0xca01, 0xca01) AM_WRITENOP //watchdog |
| 129 | 133 | AM_RANGE(0xca02, 0xca02) AM_RAM_WRITE(dderby_sound_w) |
| 130 | 134 | AM_RANGE(0xca03, 0xca03) AM_WRITENOP//(timer_irq_w) //??? |
| 131 | AM_RANGE(0xcc00, 0xcc05) AM_RAM AM_BASE(m_scroll_ram) | |
| 132 | AM_RANGE(0xce08, 0xce1f) AM_RAM AM_BASE(m_sprite_ram) // horse sprites | |
| 133 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE(m_dderby_vidchars) // char ram | |
| 134 | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_BASE(m_dderby_vidattribs) // colours/ attrib ram | |
| 135 | AM_RANGE(0xcc00, 0xcc05) AM_RAM AM_SHARE("scroll_ram") | |
| 136 | AM_RANGE(0xce08, 0xce1f) AM_RAM AM_SHARE("sprite_ram") // horse sprites | |
| 137 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE("dderby_vidchars") // char ram | |
| 138 | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_SHARE("dderby_vidattribs") // colours/ attrib ram | |
| 135 | 139 | ADDRESS_MAP_END |
| 136 | 140 | |
| 137 | 141 | static ADDRESS_MAP_START( dderby_sound_map, AS_PROGRAM, 8, dmndrby_state ) |
| 138 | 142 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 139 | 143 | AM_RANGE(0x1000, 0x1000) AM_RAM //??? |
| 140 | 144 | AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 141 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r) | |
| 145 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r) | |
| 142 | 146 | AM_RANGE(0x4001, 0x4001) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 143 | 147 | AM_RANGE(0x6000, 0x67ff) AM_RAM |
| 144 | 148 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 358 | 362 | can we draw it with the tilemap? maybe not, the layout is a litle strange |
| 359 | 363 | |
| 360 | 364 | */ |
| 361 | // base = state->m_scroll_ram[0]; | |
| 365 | // base = state->m_scroll_ram.target()[0]; | |
| 362 | 366 | |
| 363 | off=0x1900-(state->m_bg*0x100)+(state->m_scroll_ram[1])*0x100; | |
| 364 | scrolly = 0xff-(state->m_scroll_ram[0]); | |
| 365 | if(state->m_scroll_ram[1]==0xff) off=0x1800; | |
| 367 | off=0x1900-(state->m_bg*0x100)+(state->m_scroll_ram.target()[1])*0x100; | |
| 368 | scrolly = 0xff-(state->m_scroll_ram.target()[0]); | |
| 369 | if(state->m_scroll_ram.target()[1]==0xff) off=0x1800; | |
| 366 | 370 | for(x=0;x<16;x++) { |
| 367 | 371 | for(y=0;y<16;y++) { |
| 368 | 372 | int chr = state->m_racetrack_tilemap_rom[off]; |
| r14896 | r14897 | |
| 394 | 398 | int a=0; |
| 395 | 399 | int b=0; |
| 396 | 400 | int base = count*4; |
| 397 | int sprx=state->m_sprite_ram[base+3]; | |
| 398 | int spry=state->m_sprite_ram[base+2]; | |
| 399 | //state->m_sprite_ram[base+1]; | |
| 400 | int col = (state->m_sprite_ram[base+1]&0x1f); | |
| 401 | int anim = (state->m_sprite_ram[base]&0x3)*0x40; // animation frame - probably wrong but seems right | |
| 402 | int horse = (state->m_sprite_ram[base+1]&0x7)*8+7; // horse label from 1 - 6 | |
| 401 | int sprx=state->m_sprite_ram.target()[base+3]; | |
| 402 | int spry=state->m_sprite_ram.target()[base+2]; | |
| 403 | //state->m_sprite_ram.target()[base+1]; | |
| 404 | int col = (state->m_sprite_ram.target()[base+1]&0x1f); | |
| 405 | int anim = (state->m_sprite_ram.target()[base]&0x3)*0x40; // animation frame - probably wrong but seems right | |
| 406 | int horse = (state->m_sprite_ram.target()[base+1]&0x7)*8+7; // horse label from 1 - 6 | |
| 403 | 407 | |
| 404 | 408 | for (a=0;a<8 ;a++) |
| 405 | 409 | { |
| r14896 | r14897 | |
| 422 | 426 | for(x=0;x<32;x++) |
| 423 | 427 | { |
| 424 | 428 | int tileno,bank,color; |
| 425 | tileno=state->m_dderby_vidchars[count]; | |
| 426 | bank=(state->m_dderby_vidattribs[count]&0x20)>>5; | |
| 429 | tileno=state->m_dderby_vidchars.target()[count]; | |
| 430 | bank=(state->m_dderby_vidattribs.target()[count]&0x20)>>5; | |
| 427 | 431 | tileno|=(bank<<8); |
| 428 | color=((state->m_dderby_vidattribs[count])&0x1f); | |
| 432 | color=((state->m_dderby_vidattribs.target()[count])&0x1f); | |
| 429 | 433 | |
| 430 | 434 | drawgfx_transpen(bitmap,cliprect,gfx,tileno,color,0,0,x*8,y*8,(tileno == 0x38) ? 0 : -1); |
| 431 | 435 |
| r14896 | r14897 | |
|---|---|---|
| 122 | 122 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(portrait_fgvideo_write) AM_BASE(m_fgvideoram) |
| 123 | 123 | AM_RANGE(0x9000, 0x91ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 124 | 124 | AM_RANGE(0x9200, 0x97ff) AM_RAM |
| 125 | AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_w) | |
| 125 | AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_byte_w) | |
| 126 | 126 | AM_RANGE(0xa010, 0xa010) AM_WRITENOP // ? |
| 127 | 127 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW1") |
| 128 | 128 | AM_RANGE(0xa004, 0xa004) AM_READ_PORT("DSW2") |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | WRITE8_MEMBER(munchmo_state::mnchmobl_soundlatch_w) |
| 62 | 62 | { |
| 63 | 63 | |
| 64 | soundlatch_w(space, 0, data); | |
| 64 | soundlatch_byte_w(space, 0, data); | |
| 65 | 65 | device_set_input_line(m_audiocpu, 0, HOLD_LINE ); |
| 66 | 66 | } |
| 67 | 67 | |
| r14896 | r14897 | |
| 110 | 110 | /* memory map provided thru schematics */ |
| 111 | 111 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, munchmo_state ) |
| 112 | 112 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 113 | AM_RANGE(0x2000, 0x3fff) AM_READ(soundlatch_r) | |
| 113 | AM_RANGE(0x2000, 0x3fff) AM_READ(soundlatch_byte_r) | |
| 114 | 114 | AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w) |
| 115 | 115 | AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 116 | 116 | AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| r14896 | r14897 | |
|---|---|---|
| 127 | 127 | WRITE16_MEMBER(lastduel_state::lastduel_sound_w) |
| 128 | 128 | { |
| 129 | 129 | if (ACCESSING_BITS_0_7) |
| 130 | soundlatch_w(space, 0, data & 0xff); | |
| 130 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /******************************************************************************/ |
| r14896 | r14897 | |
| 170 | 170 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 171 | 171 | AM_RANGE(0xe800, 0xe801) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w) |
| 172 | 172 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r,ym2203_w) |
| 173 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 173 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 174 | 174 | ADDRESS_MAP_END |
| 175 | 175 | |
| 176 | 176 | WRITE8_MEMBER(lastduel_state::mg_bankswitch_w) |
| r14896 | r14897 | |
| 185 | 185 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w) |
| 186 | 186 | AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r,ym2203_w) |
| 187 | 187 | AM_RANGE(0xf004, 0xf004) AM_DEVWRITE("oki", okim6295_device, write) |
| 188 | AM_RANGE(0xf006, 0xf006) AM_READ(soundlatch_r) | |
| 188 | AM_RANGE(0xf006, 0xf006) AM_READ(soundlatch_byte_r) | |
| 189 | 189 | AM_RANGE(0xf00a, 0xf00a) AM_WRITE(mg_bankswitch_w) |
| 190 | 190 | ADDRESS_MAP_END |
| 191 | 191 |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | public: |
| 51 | 51 | cmmb_state(const machine_config &mconfig, device_type type, const char *tag) |
| 52 | : driver_device(mconfig, type, tag) { } | |
| 52 | : driver_device(mconfig, type, tag) , | |
| 53 | m_videoram(*this, "videoram"){ } | |
| 53 | 54 | |
| 54 | UINT8 | |
| 55 | required_shared_ptr<UINT8> | |
| 55 | 56 | UINT8 m_irq_mask; |
| 56 | 57 | DECLARE_READ8_MEMBER(cmmb_charram_r); |
| 57 | 58 | DECLARE_WRITE8_MEMBER(cmmb_charram_w); |
| r14896 | r14897 | |
| 70 | 71 | static SCREEN_UPDATE_IND16( cmmb ) |
| 71 | 72 | { |
| 72 | 73 | cmmb_state *state = screen.machine().driver_data<cmmb_state>(); |
| 73 | UINT8 *videoram = state->m_videoram; | |
| 74 | UINT8 *videoram = state->m_videoram.target(); | |
| 74 | 75 | const gfx_element *gfx = screen.machine().gfx[0]; |
| 75 | 76 | int count = 0x00000; |
| 76 | 77 | |
| r14896 | r14897 | |
| 116 | 117 | WRITE8_MEMBER(cmmb_state::cmmb_paletteram_w) |
| 117 | 118 | { |
| 118 | 119 | /* RGB output is inverted */ |
| 119 | paletteram_RRRGGGBB_w(space,offset,~data); | |
| 120 | paletteram_RRRGGGBB_byte_w(space,offset,~data); | |
| 120 | 121 | } |
| 121 | 122 | |
| 122 | 123 | READ8_MEMBER(cmmb_state::cmmb_input_r) |
| r14896 | r14897 | |
| 176 | 177 | ADDRESS_MAP_GLOBAL_MASK(0xffff) |
| 177 | 178 | AM_RANGE(0x0000, 0x01ff) AM_RAM /* zero page address */ |
| 178 | 179 | // AM_RANGE(0x13c0, 0x13ff) AM_RAM //spriteram |
| 179 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_ | |
| 180 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_ | |
| 180 | 181 | AM_RANGE(0x2480, 0x249f) AM_RAM_WRITE(cmmb_paletteram_w) AM_SHARE("paletteram") |
| 181 | 182 | AM_RANGE(0x4000, 0x400f) AM_READWRITE(cmmb_input_r,cmmb_output_w) //i/o |
| 182 | 183 | AM_RANGE(0x4900, 0x4900) AM_READ(kludge_r) |
| r14896 | r14897 | |
|---|---|---|
| 199 | 199 | AM_RANGE(0x800180, 0x800181) AM_WRITE(drgnmst_snd_command_w) |
| 200 | 200 | AM_RANGE(0x800188, 0x800189) AM_WRITE(drgnmst_snd_flag_w) |
| 201 | 201 | AM_RANGE(0x8001e0, 0x8001e1) AM_WRITENOP |
| 202 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(paletteram | |
| 202 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(paletteram | |
| 203 | 203 | AM_RANGE(0x904000, 0x907fff) AM_RAM_WRITE(drgnmst_md_videoram_w) AM_BASE(m_md_videoram) |
| 204 | 204 | AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(drgnmst_bg_videoram_w) AM_BASE(m_bg_videoram) |
| 205 | 205 | AM_RANGE(0x90c000, 0x90ffff) AM_RAM_WRITE(drgnmst_fg_videoram_w) AM_BASE(m_fg_videoram) |
| r14896 | r14897 | |
|---|---|---|
| 24 | 24 | { |
| 25 | 25 | public: |
| 26 | 26 | boxer_state(const machine_config &mconfig, device_type type, const char *tag) |
| 27 | : driver_device(mconfig, type, tag) { } | |
| 27 | : driver_device(mconfig, type, tag) , | |
| 28 | m_tile_ram(*this, "tile_ram"), | |
| 29 | m_sprite_ram(*this, "sprite_ram"){ } | |
| 28 | 30 | |
| 29 | 31 | /* memory pointers */ |
| 30 | UINT8 * m_tile_ram; | |
| 31 | UINT8 * m_sprite_ram; | |
| 32 | required_shared_ptr<UINT8> m_tile_ram; | |
| 33 | required_shared_ptr<UINT8> m_sprite_ram; | |
| 32 | 34 | |
| 33 | 35 | /* misc */ |
| 34 | 36 | UINT8 m_pot_state; |
| r14896 | r14897 | |
| 128 | 130 | |
| 129 | 131 | int i, j; |
| 130 | 132 | |
| 131 | int x = 196 - state->m_sprite_ram[0 + 2 * n]; | |
| 132 | int y = 192 - state->m_sprite_ram[1 + 2 * n]; | |
| 133 | int x = 196 - state->m_sprite_ram.target()[0 + 2 * n]; | |
| 134 | int y = 192 - state->m_sprite_ram.target()[1 + 2 * n]; | |
| 133 | 135 | |
| 134 | int l = state->m_sprite_ram[4 + 2 * n] & 15; | |
| 135 | int r = state->m_sprite_ram[5 + 2 * n] & 15; | |
| 136 | int l = state->m_sprite_ram.target()[4 + 2 * n] & 15; | |
| 137 | int r = state->m_sprite_ram.target()[5 + 2 * n] & 15; | |
| 136 | 138 | |
| 137 | 139 | for (i = 0; i < 8; i++) |
| 138 | 140 | { |
| r14896 | r14897 | |
| 176 | 178 | { |
| 177 | 179 | for (j = 0; j < 32; j++) |
| 178 | 180 | { |
| 179 | UINT8 code = state->m_tile_ram[32 * i + j]; | |
| 181 | UINT8 code = state->m_tile_ram.target()[32 * i + j]; | |
| 180 | 182 | |
| 181 | 183 | drawgfx_transpen(bitmap, cliprect, |
| 182 | 184 | screen.machine().gfx[2], |
| r14896 | r14897 | |
| 297 | 299 | static ADDRESS_MAP_START( boxer_map, AS_PROGRAM, 8, boxer_state ) |
| 298 | 300 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 299 | 301 | AM_RANGE(0x0000, 0x01ff) AM_RAM |
| 300 | AM_RANGE(0x0200, 0x03ff) AM_RAM AM_ | |
| 302 | AM_RANGE(0x0200, 0x03ff) AM_RAM AM_ | |
| 301 | 303 | AM_RANGE(0x0800, 0x08ff) AM_READ(boxer_input_r) |
| 302 | 304 | AM_RANGE(0x1000, 0x17ff) AM_READ(boxer_misc_r) |
| 303 | 305 | AM_RANGE(0x1800, 0x1800) AM_WRITE(boxer_pot_w) |
| r14896 | r14897 | |
| 306 | 308 | AM_RANGE(0x1b00, 0x1bff) AM_WRITE(boxer_crowd_w) |
| 307 | 309 | AM_RANGE(0x1c00, 0x1cff) AM_WRITE(boxer_irq_reset_w) |
| 308 | 310 | AM_RANGE(0x1d00, 0x1dff) AM_WRITE(boxer_bell_w) |
| 309 | AM_RANGE(0x1e00, 0x1eff) AM_WRITEONLY AM_ | |
| 311 | AM_RANGE(0x1e00, 0x1eff) AM_WRITEONLY AM_ | |
| 310 | 312 | AM_RANGE(0x1f00, 0x1fff) AM_WRITE(watchdog_reset_w) |
| 311 | 313 | AM_RANGE(0x3000, 0x3fff) AM_ROM |
| 312 | 314 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 166 | 166 | |
| 167 | 167 | WRITE8_MEMBER(roul_state::sound_latch_w) |
| 168 | 168 | { |
| 169 | soundlatch_w(space, 0, data & 0xff); | |
| 169 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 170 | 170 | cputag_set_input_line(machine(), "soundcpu", 0, HOLD_LINE); |
| 171 | 171 | } |
| 172 | 172 | |
| r14896 | r14897 | |
| 202 | 202 | |
| 203 | 203 | static ADDRESS_MAP_START( sound_cpu_io_map, AS_IO, 8, roul_state ) |
| 204 | 204 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 205 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 205 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 206 | 206 | AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 207 | 207 | ADDRESS_MAP_END |
| 208 | 208 |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | { |
| 47 | 47 | /* flip Y/X could be the other way round... */ |
| 48 | 48 | if (offset) |
| 49 | flip_screen_y_set( | |
| 49 | flip_screen_y_set( | |
| 50 | 50 | else |
| 51 | flip_screen_x_set( | |
| 51 | flip_screen_x_set( | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | WRITE8_MEMBER(freekick_state::coin_w) |
| r14896 | r14897 | |
|---|---|---|
| 64 | 64 | * |
| 65 | 65 | *************************************/ |
| 66 | 66 | |
| 67 | ||
| 67 | ||
| 68 | 68 | { |
| 69 | xybots_state *state = space->machine().driver_data<xybots_state>(); | |
| 70 | int result = input_port_read(space->machine(), "FFE200"); | |
| 69 | int result = input_port_read(machine(), "FFE200"); | |
| 71 | 70 | |
| 72 | if (state->m_cpu_to_sound_ready) result ^= 0x0200; | |
| 73 | result ^= state->m_h256 ^= 0x0400; | |
| 71 | if (m_cpu_to_sound_ready) result ^= 0x0200; | |
| 72 | result ^= m_h256 ^= 0x0400; | |
| 74 | 73 | return result; |
| 75 | 74 | } |
| 76 | 75 | |
| r14896 | r14897 | |
| 92 | 91 | AM_RANGE(0xff9000, 0xffadff) AM_MIRROR(0x7f8000) AM_RAM |
| 93 | 92 | AM_RANGE(0xffae00, 0xffafff) AM_MIRROR(0x7f8000) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w) |
| 94 | 93 | AM_RANGE(0xffb000, 0xffbfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 95 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x7f8800) AM_RAM_WRITE(paletteram | |
| 94 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x7f8800) AM_RAM_WRITE(paletteram | |
| 96 | 95 | AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 97 | 96 | AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_READ_LEGACY(atarigen_sound_r) |
| 98 | 97 | AM_RANGE(0xffe100, 0xffe1ff) AM_MIRROR(0x7f8000) AM_READ_PORT("FFE100") |
| 99 | AM_RANGE(0xffe200, 0xffe2ff) AM_MIRROR(0x7f8000) AM_READ | |
| 98 | AM_RANGE(0xffe200, 0xffe2ff) AM_MIRROR(0x7f8000) AM_READ | |
| 100 | 99 | AM_RANGE(0xffe800, 0xffe8ff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 101 | 100 | AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_sound_w) |
| 102 | 101 | AM_RANGE(0xffea00, 0xffeaff) AM_MIRROR(0x7f8000) AM_WRITE(watchdog_reset16_w) |
| r14896 | r14897 | |
|---|---|---|
| 146 | 146 | static ADDRESS_MAP_START( st0016_io, AS_IO, 8, speglsht_state ) |
| 147 | 147 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 148 | 148 | AM_RANGE(0x00, 0xbf) AM_READ(st0016_vregs_r) AM_WRITE(st0016_vregs_w) |
| 149 | AM_RANGE(0xe1, 0xe1) AM_WRITE | |
| 149 | AM_RANGE(0xe1, 0xe1) AM_WRITE | |
| 150 | 150 | AM_RANGE(0xe2, 0xe2) AM_WRITE(st0016_sprite_bank_w) |
| 151 | 151 | AM_RANGE(0xe3, 0xe4) AM_WRITE(st0016_character_bank_w) |
| 152 | 152 | AM_RANGE(0xe5, 0xe5) AM_WRITE(st0016_palette_bank_w) |
| r14896 | r14897 | |
|---|---|---|
| 421 | 421 | { |
| 422 | 422 | public: |
| 423 | 423 | magicfly_state(const machine_config &mconfig, device_type type, const char *tag) |
| 424 | : driver_device(mconfig, type, tag) { } | |
| 424 | : driver_device(mconfig, type, tag) , | |
| 425 | m_videoram(*this, "videoram"), | |
| 426 | m_colorram(*this, "colorram"){ } | |
| 425 | 427 | |
| 426 | UINT8 *m_videoram; | |
| 427 | UINT8 *m_colorram; | |
| 428 | required_shared_ptr<UINT8> m_videoram; | |
| 429 | required_shared_ptr<UINT8> m_colorram; | |
| 428 | 430 | tilemap_t *m_bg_tilemap; |
| 429 | 431 | int m_input_selector; |
| 430 | 432 | DECLARE_WRITE8_MEMBER(magicfly_videoram_w); |
| r14896 | r14897 | |
| 441 | 443 | |
| 442 | 444 | WRITE8_MEMBER(magicfly_state::magicfly_videoram_w) |
| 443 | 445 | { |
| 444 | m_videoram[offset] = data; | |
| 446 | m_videoram.target()[offset] = data; | |
| 445 | 447 | m_bg_tilemap->mark_tile_dirty(offset); |
| 446 | 448 | } |
| 447 | 449 | |
| 448 | 450 | WRITE8_MEMBER(magicfly_state::magicfly_colorram_w) |
| 449 | 451 | { |
| 450 | m_colorram[offset] = data; | |
| 452 | m_colorram.target()[offset] = data; | |
| 451 | 453 | m_bg_tilemap->mark_tile_dirty(offset); |
| 452 | 454 | } |
| 453 | 455 | |
| r14896 | r14897 | |
| 463 | 465 | x--- ---- Mirrored from bit 3. The code check this one to boot the game. |
| 464 | 466 | |
| 465 | 467 | */ |
| 466 | int attr = state->m_colorram[tile_index]; | |
| 467 | int code = state->m_videoram[tile_index]; | |
| 468 | int attr = state->m_colorram.target()[tile_index]; | |
| 469 | int code = state->m_videoram.target()[tile_index]; | |
| 468 | 470 | int bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ |
| 469 | 471 | int color = attr & 0x07; /* bits 0-2 for color */ |
| 470 | 472 | |
| 471 | 473 | /* Seems that bit 7 is mirrored from bit 3 to have a normal boot */ |
| 472 | 474 | /* Boot only check the first color RAM offset */ |
| 473 | 475 | |
| 474 | state->m_colorram[0] = state->m_colorram[0] | ((state->m_colorram[0] & 0x08) << 4); /* only for 1st offset */ | |
| 475 | //state->m_colorram[tile_index] = attr | ((attr & 0x08) << 4); /* for the whole color RAM */ | |
| 476 | state->m_colorram.target()[0] = state->m_colorram.target()[0] | ((state->m_colorram.target()[0] & 0x08) << 4); /* only for 1st offset */ | |
| 477 | //state->m_colorram.target()[tile_index] = attr | ((attr & 0x08) << 4); /* for the whole color RAM */ | |
| 476 | 478 | |
| 477 | 479 | SET_TILE_INFO(bank, code, color, 0); |
| 478 | 480 | } |
| r14896 | r14897 | |
| 495 | 497 | x--- ---- Mirrored from bit 2. The code check this one to boot the game. |
| 496 | 498 | |
| 497 | 499 | */ |
| 498 | int attr = state->m_colorram[tile_index]; | |
| 499 | int code = state->m_videoram[tile_index]; | |
| 500 | int attr = state->m_colorram.target()[tile_index]; | |
| 501 | int code = state->m_videoram.target()[tile_index]; | |
| 500 | 502 | int bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ |
| 501 | 503 | int color = attr & 0x07; /* bits 0-2 for color */ |
| 502 | 504 | |
| 503 | 505 | /* Seems that bit 7 is mirrored from bit 2 to have a normal boot */ |
| 504 | 506 | /* Boot only check the first color RAM offset */ |
| 505 | 507 | |
| 506 | state->m_colorram[0] = state->m_colorram[0] | ((state->m_colorram[0] & 0x04) << 5); /* only for 1st offset */ | |
| 507 | //state->m_colorram[tile_index] = attr | ((attr & 0x04) << 5); /* for the whole color RAM */ | |
| 508 | state->m_colorram.target()[0] = state->m_colorram.target()[0] | ((state->m_colorram.target()[0] & 0x04) << 5); /* only for 1st offset */ | |
| 509 | //state->m_colorram.target()[tile_index] = attr | ((attr & 0x04) << 5); /* for the whole color RAM */ | |
| 508 | 510 | |
| 509 | 511 | SET_TILE_INFO(bank, code, color, 0); |
| 510 | 512 | } |
| r14896 | r14897 | |
| 597 | 599 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") /* MK48Z02B NVRAM */ |
| 598 | 600 | AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 599 | 601 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 600 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(magicfly_videoram_w) AM_BASE(m_videoram) /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ | |
| 601 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(magicfly_colorram_w) AM_BASE(m_colorram) /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ | |
| 602 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(magicfly_videoram_w) AM_SHARE("videoram") /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ | |
| 603 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(magicfly_colorram_w) AM_SHARE("colorram") /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ | |
| 602 | 604 | AM_RANGE(0x2800, 0x2800) AM_READ(mux_port_r) /* multiplexed input port */ |
| 603 | 605 | AM_RANGE(0x3000, 0x3000) AM_WRITE(mux_port_w) /* output port */ |
| 604 | 606 | AM_RANGE(0xc000, 0xffff) AM_ROM /* ROM space */ |
| r14896 | r14897 | |
|---|---|---|
| 656 | 656 | AM_RANGE(0x502000, 0x517fff) AM_READWRITE(wgp_pivram_word_r, wgp_pivram_word_w) AM_BASE(m_pivram) /* piv tilemaps */ |
| 657 | 657 | AM_RANGE(0x520000, 0x52001f) AM_READWRITE(wgp_piv_ctrl_word_r, wgp_piv_ctrl_word_w) AM_BASE(m_piv_ctrlram) |
| 658 | 658 | AM_RANGE(0x600000, 0x600003) AM_WRITE(rotate_port_w) /* rotation control ? */ |
| 659 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 659 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 660 | 660 | ADDRESS_MAP_END |
| 661 | 661 | |
| 662 | 662 | static ADDRESS_MAP_START( cpu2_map, AS_PROGRAM, 16 /* LAN areas not mapped... */, wgp_state ) |
| r14896 | r14897 | |
|---|---|---|
| 334 | 334 | { |
| 335 | 335 | |
| 336 | 336 | m_pending_command = 1; |
| 337 | soundlatch_w(space, 0, data & 0xff); | |
| 337 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 338 | 338 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 339 | 339 | } |
| 340 | 340 | } |
| r14896 | r14897 | |
| 358 | 358 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* work */ |
| 359 | 359 | AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE(welltris_spriteram_w) AM_BASE(m_spriteram) /* Sprite */ |
| 360 | 360 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(welltris_charvideoram_w) AM_BASE(m_charvideoram) /* Char */ |
| 361 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 361 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 362 | 362 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("P1") /* Bottom Controls */ |
| 363 | 363 | AM_RANGE(0xfff000, 0xfff001) AM_WRITE(welltris_palette_bank_w) |
| 364 | 364 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("P2") /* Top Controls */ |
| r14896 | r14897 | |
| 385 | 385 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 386 | 386 | AM_RANGE(0x00, 0x00) AM_WRITE(welltris_sh_bankswitch_w) |
| 387 | 387 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 388 | AM_RANGE(0x10, 0x10) AM_READ(soundlatch_r) | |
| 388 | AM_RANGE(0x10, 0x10) AM_READ(soundlatch_byte_r) | |
| 389 | 389 | AM_RANGE(0x18, 0x18) AM_WRITE(pending_command_clear_w) |
| 390 | 390 | ADDRESS_MAP_END |
| 391 | 391 |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | { |
| 63 | 63 | // popmessage("sound write %04x",data); |
| 64 | 64 | |
| 65 | soundlatch_w(space, 1, data & 0xff); | |
| 65 | soundlatch_byte_w(space, 1, data & 0xff); | |
| 66 | 66 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE ); |
| 67 | 67 | } |
| 68 | 68 | |
| r14896 | r14897 | |
| 109 | 109 | AM_RANGE(0xc01000, 0xc01fff) AM_RAM_WRITE(aquarium_bak_videoram_w) AM_BASE(m_bak_videoram) |
| 110 | 110 | AM_RANGE(0xc02000, 0xc03fff) AM_RAM_WRITE(aquarium_txt_videoram_w) AM_BASE(m_txt_videoram) |
| 111 | 111 | AM_RANGE(0xc80000, 0xc81fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 112 | AM_RANGE(0xd00000, 0xd00fff) AM_RAM_WRITE(paletteram | |
| 112 | AM_RANGE(0xd00000, 0xd00fff) AM_RAM_WRITE(paletteram | |
| 113 | 113 | AM_RANGE(0xd80014, 0xd8001f) AM_WRITEONLY AM_BASE(m_scroll) |
| 114 | 114 | AM_RANGE(0xd80068, 0xd80069) AM_WRITENOP /* probably not used */ |
| 115 | 115 | AM_RANGE(0xd80080, 0xd80081) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 131 | 131 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 132 | 132 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 133 | 133 | AM_RANGE(0x02, 0x02) AM_READWRITE(aquarium_oki_r, aquarium_oki_w) |
| 134 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) | |
| 134 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) | |
| 135 | 135 | AM_RANGE(0x06, 0x06) AM_WRITE(aquarium_snd_ack_w) |
| 136 | 136 | AM_RANGE(0x08, 0x08) AM_WRITE(aquarium_z80_bank_w) |
| 137 | 137 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 352 | 352 | switch (ioline) |
| 353 | 353 | { |
| 354 | 354 | case UPD7810_RXD: /* read the RxD line */ |
| 355 | data = driver_state->soundlatch_r(*space, 0); | |
| 355 | data = driver_state->soundlatch_byte_r(*space, 0); | |
| 356 | 356 | state = data & 1; |
| 357 | driver_state->soundlatch_w(*space, 0, data >> 1); | |
| 357 | driver_state->soundlatch_byte_w(*space, 0, data >> 1); | |
| 358 | 358 | break; |
| 359 | 359 | default: |
| 360 | 360 | logerror("upd7810 ioline %d not handled\n", ioline); |
| r14896 | r14897 | |
| 368 | 368 | |
| 369 | 369 | if (ACCESSING_BITS_0_7) |
| 370 | 370 | { |
| 371 | soundlatch_w(space, 0, data & 0xff); | |
| 371 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 372 | 372 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 373 | 373 | device_spin_until_interrupt(&space.device()); |
| 374 | 374 | m_busy_sndcpu = 1; |
| r14896 | r14897 | |
| 882 | 882 | AM_RANGE(0x620000, 0x63ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 883 | 883 | AM_RANGE(0x640000, 0x65ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 884 | 884 | AM_RANGE(0x660000, 0x66ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 885 | AM_RANGE(0x670000, 0x673fff) AM_RAM_WRITE(paletteram | |
| 885 | AM_RANGE(0x670000, 0x673fff) AM_RAM_WRITE(paletteram | |
| 886 | 886 | AM_RANGE(0x674000, 0x674fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 887 | 887 | AM_RANGE(0x678000, 0x6787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 888 | 888 | AM_RANGE(0x678840, 0x67884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 913 | 913 | AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 914 | 914 | AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 915 | 915 | AM_RANGE(0x160000, 0x16ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 916 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 916 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 917 | 917 | AM_RANGE(0x174000, 0x174fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 918 | 918 | AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 919 | 919 | AM_RANGE(0x178840, 0x17884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 952 | 952 | AM_RANGE(0xe20000, 0xe3ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 953 | 953 | AM_RANGE(0xe40000, 0xe5ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 954 | 954 | AM_RANGE(0xe60000, 0xe6ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 955 | AM_RANGE(0xe70000, 0xe73fff) AM_RAM_WRITE(paletteram | |
| 955 | AM_RANGE(0xe70000, 0xe73fff) AM_RAM_WRITE(paletteram | |
| 956 | 956 | AM_RANGE(0xe74000, 0xe74fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 957 | 957 | AM_RANGE(0xe78000, 0xe787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 958 | 958 | AM_RANGE(0xe78840, 0xe7884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 978 | 978 | AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 979 | 979 | AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 980 | 980 | AM_RANGE(0x160000, 0x16ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 981 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 981 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 982 | 982 | AM_RANGE(0x174000, 0x174fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 983 | 983 | AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 984 | 984 | AM_RANGE(0x178840, 0x17884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 1014 | 1014 | AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1015 | 1015 | AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1016 | 1016 | AM_RANGE(0x160000, 0x16ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1017 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 1017 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 1018 | 1018 | AM_RANGE(0x174000, 0x174fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1019 | 1019 | AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1020 | 1020 | AM_RANGE(0x178840, 0x17884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 1048 | 1048 | AM_RANGE(0x420000, 0x43ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1049 | 1049 | AM_RANGE(0x440000, 0x45ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1050 | 1050 | AM_RANGE(0x460000, 0x46ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1051 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1051 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1052 | 1052 | AM_RANGE(0x474000, 0x474fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1053 | 1053 | AM_RANGE(0x478000, 0x4787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1054 | 1054 | AM_RANGE(0x478840, 0x47884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 1081 | 1081 | AM_RANGE(0x820000, 0x83ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1082 | 1082 | AM_RANGE(0x840000, 0x85ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1083 | 1083 | AM_RANGE(0x860000, 0x86ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1084 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1084 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1085 | 1085 | AM_RANGE(0x874000, 0x874fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1086 | 1086 | AM_RANGE(0x878000, 0x8787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1087 | 1087 | AM_RANGE(0x878840, 0x87884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 1132 | 1132 | AM_RANGE(0x40000a, 0x40000b) AM_READ_PORT("DSW1") // |
| 1133 | 1133 | AM_RANGE(0x40000c, 0x40000d) AM_READ_PORT("IN2") // |
| 1134 | 1134 | AM_RANGE(0x860000, 0x86ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1135 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1135 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1136 | 1136 | AM_RANGE(0x874000, 0x874fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1137 | 1137 | AM_RANGE(0x875000, 0x875fff) AM_READWRITE(karatour_vram_0_r, karatour_vram_0_w) // Layer 0 (Part of) |
| 1138 | 1138 | AM_RANGE(0x876000, 0x876fff) AM_READWRITE(karatour_vram_1_r, karatour_vram_1_w) // Layer 1 (Part of) |
| r14896 | r14897 | |
| 1162 | 1162 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 1163 | 1163 | AM_RANGE(0x7fc000, 0x7fffff) AM_RAM // RAM |
| 1164 | 1164 | AM_RANGE(0x860000, 0x86ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1165 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1165 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1166 | 1166 | AM_RANGE(0x874000, 0x874fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1167 | 1167 | AM_RANGE(0x875000, 0x875fff) AM_READWRITE(karatour_vram_0_r, karatour_vram_0_w) // Layer 0 (Part of) |
| 1168 | 1168 | AM_RANGE(0x876000, 0x876fff) AM_READWRITE(karatour_vram_1_r, karatour_vram_1_w) // Layer 1 (Part of) |
| r14896 | r14897 | |
| 1197 | 1197 | AM_RANGE(0x820000, 0x83ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1198 | 1198 | AM_RANGE(0x840000, 0x85ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1199 | 1199 | AM_RANGE(0x860000, 0x86ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1200 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1200 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1201 | 1201 | AM_RANGE(0x874000, 0x874fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1202 | 1202 | AM_RANGE(0x878000, 0x8787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1203 | 1203 | AM_RANGE(0x878800, 0x878813) AM_WRITEONLY AM_BASE(m_videoregs) // Video Registers |
| r14896 | r14897 | |
| 1237 | 1237 | AM_RANGE(0x8a0000, 0x8bffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1238 | 1238 | AM_RANGE(0x8c0000, 0x8dffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1239 | 1239 | AM_RANGE(0x8e0000, 0x8effff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1240 | AM_RANGE(0x8f0000, 0x8f3fff) AM_RAM_WRITE(paletteram | |
| 1240 | AM_RANGE(0x8f0000, 0x8f3fff) AM_RAM_WRITE(paletteram | |
| 1241 | 1241 | AM_RANGE(0x8f4000, 0x8f4fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1242 | 1242 | AM_RANGE(0x8f8000, 0x8f87ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1243 | 1243 | AM_RANGE(0x8f8800, 0x8f8813) AM_WRITEONLY AM_BASE(m_videoregs) // Video Registers |
| r14896 | r14897 | |
| 1331 | 1331 | AM_RANGE(0x220000, 0x23ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1332 | 1332 | AM_RANGE(0x240000, 0x25ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1333 | 1333 | AM_RANGE(0x260000, 0x26ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1334 | AM_RANGE(0x270000, 0x273fff) AM_RAM_WRITE(paletteram | |
| 1334 | AM_RANGE(0x270000, 0x273fff) AM_RAM_WRITE(paletteram | |
| 1335 | 1335 | AM_RANGE(0x274000, 0x274fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1336 | 1336 | AM_RANGE(0x278000, 0x2787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1337 | 1337 | AM_RANGE(0x27880e, 0x27880f) AM_RAM AM_BASE(m_screenctrl) // Screen Control |
| r14896 | r14897 | |
| 1368 | 1368 | AM_RANGE(0x620000, 0x63ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1369 | 1369 | AM_RANGE(0x640000, 0x65ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1370 | 1370 | AM_RANGE(0x660000, 0x66ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1371 | AM_RANGE(0x670000, 0x673fff) AM_RAM_WRITE(paletteram | |
| 1371 | AM_RANGE(0x670000, 0x673fff) AM_RAM_WRITE(paletteram | |
| 1372 | 1372 | AM_RANGE(0x674000, 0x674fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1373 | 1373 | AM_RANGE(0x675000, 0x675fff) AM_RAM // Sprites? |
| 1374 | 1374 | AM_RANGE(0x678000, 0x6787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| r14896 | r14897 | |
| 1440 | 1440 | AM_RANGE(0x220000, 0x23ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1441 | 1441 | AM_RANGE(0x240000, 0x25ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1442 | 1442 | AM_RANGE(0x260000, 0x26ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1443 | AM_RANGE(0x270000, 0x273fff) AM_RAM_WRITE(paletteram | |
| 1443 | AM_RANGE(0x270000, 0x273fff) AM_RAM_WRITE(paletteram | |
| 1444 | 1444 | AM_RANGE(0x274000, 0x274fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1445 | 1445 | AM_RANGE(0x278000, 0x2787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1446 | 1446 | AM_RANGE(0x278810, 0x27881f) AM_WRITEONLY AM_BASE(m_irq_levels) // IRQ Levels |
| r14896 | r14897 | |
| 1478 | 1478 | AM_RANGE(0x440000, 0x45ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1479 | 1479 | AM_RANGE(0x460000, 0x46ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1480 | 1480 | AM_RANGE(0x460000, 0x46ffff) AM_WRITENOP // DSW Selection |
| 1481 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1481 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1482 | 1482 | AM_RANGE(0x474000, 0x474fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1483 | 1483 | AM_RANGE(0x478000, 0x4787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1484 | 1484 | AM_RANGE(0x47880e, 0x47880f) AM_WRITEONLY AM_BASE(m_screenctrl) // Screen Control |
| r14896 | r14897 | |
| 1517 | 1517 | AM_RANGE(0x420000, 0x43ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1518 | 1518 | AM_RANGE(0x440000, 0x45ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1519 | 1519 | AM_RANGE(0x460000, 0x46ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1520 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1520 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1521 | 1521 | AM_RANGE(0x474000, 0x474fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1522 | 1522 | AM_RANGE(0x478000, 0x4787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1523 | 1523 | AM_RANGE(0x478800, 0x478813) AM_RAM AM_BASE(m_videoregs) // Video Registers |
| r14896 | r14897 | |
| 1553 | 1553 | AM_RANGE(0xc20000, 0xc3ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1554 | 1554 | AM_RANGE(0xc40000, 0xc5ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1555 | 1555 | AM_RANGE(0xc60000, 0xc6ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1556 | AM_RANGE(0xc70000, 0xc73fff) AM_RAM_WRITE(paletteram | |
| 1556 | AM_RANGE(0xc70000, 0xc73fff) AM_RAM_WRITE(paletteram | |
| 1557 | 1557 | AM_RANGE(0xc74000, 0xc74fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1558 | 1558 | AM_RANGE(0xc78000, 0xc787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1559 | 1559 | AM_RANGE(0xc78800, 0xc78813) AM_WRITEONLY AM_BASE(m_videoregs) // Video Registers |
| r14896 | r14897 | |
| 1586 | 1586 | AM_RANGE(0x820000, 0x83ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1587 | 1587 | AM_RANGE(0x840000, 0x85ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1588 | 1588 | AM_RANGE(0x860000, 0x86ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1589 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1589 | AM_RANGE(0x870000, 0x873fff) AM_RAM_WRITE(paletteram | |
| 1590 | 1590 | AM_RANGE(0x874000, 0x874fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1591 | 1591 | AM_RANGE(0x878000, 0x8787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1592 | 1592 | AM_RANGE(0x878800, 0x878813) AM_WRITEONLY AM_BASE(m_videoregs) // Video Registers |
| r14896 | r14897 | |
| 1622 | 1622 | AM_RANGE(0xc20000, 0xc3ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1623 | 1623 | AM_RANGE(0xc40000, 0xc5ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1624 | 1624 | AM_RANGE(0xc60000, 0xc6ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1625 | AM_RANGE(0xc70000, 0xc73fff) AM_RAM_WRITE(paletteram | |
| 1625 | AM_RANGE(0xc70000, 0xc73fff) AM_RAM_WRITE(paletteram | |
| 1626 | 1626 | AM_RANGE(0xc74000, 0xc74fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1627 | 1627 | AM_RANGE(0xc78000, 0xc787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1628 | 1628 | AM_RANGE(0xc78840, 0xc7884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 1655 | 1655 | AM_RANGE(0xc20000, 0xc3ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1656 | 1656 | AM_RANGE(0xc40000, 0xc5ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1657 | 1657 | AM_RANGE(0xc60000, 0xc6ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1658 | AM_RANGE(0xc70000, 0xc73fff) AM_RAM_WRITE(paletteram | |
| 1658 | AM_RANGE(0xc70000, 0xc73fff) AM_RAM_WRITE(paletteram | |
| 1659 | 1659 | AM_RANGE(0xc74000, 0xc74fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1660 | 1660 | AM_RANGE(0xc78000, 0xc787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1661 | 1661 | AM_RANGE(0xc78840, 0xc7884d) AM_WRITE(metro_blitter_w) AM_BASE(m_blitter_regs) // Tiles Blitter |
| r14896 | r14897 | |
| 1686 | 1686 | WRITE16_MEMBER(metro_state::blzntrnd_sound_w) |
| 1687 | 1687 | { |
| 1688 | 1688 | |
| 1689 | soundlatch_w(space, offset, data >> 8); | |
| 1689 | soundlatch_byte_w(space, offset, data >> 8); | |
| 1690 | 1690 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 1691 | 1691 | } |
| 1692 | 1692 | |
| r14896 | r14897 | |
| 1719 | 1719 | static ADDRESS_MAP_START( blzntrnd_sound_io_map, AS_IO, 8, metro_state ) |
| 1720 | 1720 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1721 | 1721 | AM_RANGE(0x00, 0x00) AM_WRITE(blzntrnd_sh_bankswitch_w) |
| 1722 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_r) AM_WRITENOP | |
| 1722 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r) AM_WRITENOP | |
| 1723 | 1723 | AM_RANGE(0x80, 0x83) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w) |
| 1724 | 1724 | ADDRESS_MAP_END |
| 1725 | 1725 | |
| r14896 | r14897 | |
| 1732 | 1732 | AM_RANGE(0x240000, 0x25ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1733 | 1733 | AM_RANGE(0x260000, 0x26ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1734 | 1734 | AM_RANGE(0x260000, 0x26ffff) AM_WRITENOP // ?????? |
| 1735 | AM_RANGE(0x270000, 0x273fff) AM_RAM_WRITE(paletteram | |
| 1735 | AM_RANGE(0x270000, 0x273fff) AM_RAM_WRITE(paletteram | |
| 1736 | 1736 | AM_RANGE(0x274000, 0x274fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1737 | 1737 | AM_RANGE(0x278000, 0x2787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1738 | 1738 | AM_RANGE(0x278860, 0x27886b) AM_WRITE(metro_window_w) AM_BASE(m_window) // Tilemap Window |
| r14896 | r14897 | |
| 1774 | 1774 | AM_RANGE(0x400000, 0x41ffff) AM_RAM_WRITE(metro_vram_0_w) AM_BASE(m_vram_0) // Layer 0 |
| 1775 | 1775 | AM_RANGE(0x420000, 0x43ffff) AM_RAM_WRITE(metro_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 1776 | 1776 | AM_RANGE(0x440000, 0x45ffff) AM_RAM_WRITE(metro_vram_2_w) AM_BASE(m_vram_2) // Layer 2 |
| 1777 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1777 | AM_RANGE(0x470000, 0x473fff) AM_RAM_WRITE(paletteram | |
| 1778 | 1778 | AM_RANGE(0x474000, 0x474fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 1779 | 1779 | AM_RANGE(0x478000, 0x4787ff) AM_RAM AM_BASE_SIZE(m_tiletable, m_tiletable_size) // Tiles Set |
| 1780 | 1780 | AM_RANGE(0x47880e, 0x47880f) AM_WRITEONLY AM_BASE(m_screenctrl) // Screen Control |
| r14896 | r14897 | |
| 1861 | 1861 | AM_RANGE(0x760000, 0x76ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1862 | 1862 | |
| 1863 | 1863 | // AM_RANGE(0x772000, 0x773fff) AM_RAM |
| 1864 | AM_RANGE(0x770000, 0x773fff) AM_RAM_WRITE(paletteram | |
| 1864 | AM_RANGE(0x770000, 0x773fff) AM_RAM_WRITE(paletteram | |
| 1865 | 1865 | |
| 1866 | 1866 | AM_RANGE(0x775000, 0x775fff) AM_RAM_WRITE(vram_0_clr_w) |
| 1867 | 1867 | AM_RANGE(0x776000, 0x776fff) AM_RAM_WRITE(vram_1_clr_w) |
| r14896 | r14897 | |
|---|---|---|
| 137 | 137 | { |
| 138 | 138 | public: |
| 139 | 139 | gal3_state(const machine_config &mconfig, device_type type, const char *tag) |
| 140 | : driver_device(mconfig, type, tag) { } | |
| 140 | : driver_device(mconfig, type, tag) , | |
| 141 | m_nvmem(*this, "nvmem"), | |
| 142 | m_rsoSharedRAM(*this, "rsoSharedRAM"){ } | |
| 141 | 143 | |
| 142 | 144 | UINT32 *m_mpSharedRAM0; |
| 143 | 145 | //UINT32 *m_mpSharedRAM1; |
| 144 | UINT32 *m_nvmem; | |
| 145 | size_t m_nvmem_size; | |
| 146 | required_shared_ptr<UINT32> m_nvmem; | |
| 146 | 147 | UINT16 m_namcos21_video_enable; |
| 147 | UINT16 | |
| 148 | required_shared_ptr<UINT16> | |
| 148 | 149 | UINT32 m_led_mst; |
| 149 | 150 | UINT32 m_led_slv; |
| 150 | 151 | DECLARE_READ32_MEMBER(led_mst_r); |
| r14896 | r14897 | |
| 253 | 254 | UINT8 data[4]; |
| 254 | 255 | if( read_or_write ) |
| 255 | 256 | { |
| 256 | for( i=0; i<state->m_nvmem | |
| 257 | for( i=0; i<state->m_nvmem.bytes()/4; i++ ) | |
| 257 | 258 | { |
| 258 | UINT32 dword = state->m_nvmem[i]; | |
| 259 | UINT32 dword = state->m_nvmem.target()[i]; | |
| 259 | 260 | data[0] = dword>>24; |
| 260 | 261 | data[1] = (dword&0x00ff0000)>>16; |
| 261 | 262 | data[2] = (dword&0x0000ff00)>>8; |
| r14896 | r14897 | |
| 267 | 268 | { |
| 268 | 269 | if( file ) |
| 269 | 270 | { |
| 270 | for( i=0; i<state->m_nvmem | |
| 271 | for( i=0; i<state->m_nvmem.bytes()/4; i++ ) | |
| 271 | 272 | { |
| 272 | 273 | file->read( data, 4 ); |
| 273 | state->m_nvmem[i] = (data[0]<<24)|(data[1]<<16)|(data[2]<<8)|data[3]; | |
| 274 | state->m_nvmem.target()[i] = (data[0]<<24)|(data[1]<<16)|(data[2]<<8)|data[3]; | |
| 274 | 275 | } |
| 275 | 276 | } |
| 276 | 277 | else |
| 277 | 278 | { |
| 278 | 279 | /* fill in the default values */ |
| 279 | memset( state->m_nvmem, 0x00, state->m_nvmem | |
| 280 | memset( state->m_nvmem, 0x00, state->m_nvmem.bytes() ); | |
| 280 | 281 | } |
| 281 | 282 | } |
| 282 | 283 | } |
| r14896 | r14897 | |
| 342 | 343 | Check @$009a==1 to start DEMO |
| 343 | 344 | HACK*/ |
| 344 | 345 | offset *= 2; |
| 345 | return (m_rsoSharedRAM[offset]<<16)|m_rsoSharedRAM[offset+1]; | |
| 346 | return (m_rsoSharedRAM.target()[offset]<<16)|m_rsoSharedRAM.target()[offset+1]; | |
| 346 | 347 | } |
| 347 | 348 | |
| 348 | 349 | WRITE32_MEMBER(gal3_state::rso_w) |
| 349 | 350 | { |
| 350 | 351 | UINT32 v; |
| 351 | 352 | offset *= 2; |
| 352 | v = (m_rsoSharedRAM[offset]<<16)|m_rsoSharedRAM[offset+1]; | |
| 353 | v = (m_rsoSharedRAM.target()[offset]<<16)|m_rsoSharedRAM.target()[offset+1]; | |
| 353 | 354 | COMBINE_DATA( &v ); |
| 354 | m_rsoSharedRAM[offset+0] = v>>16; | |
| 355 | m_rsoSharedRAM[offset+1] = v&0xffff; | |
| 355 | m_rsoSharedRAM.target()[offset+0] = v>>16; | |
| 356 | m_rsoSharedRAM.target()[offset+1] = v&0xffff; | |
| 356 | 357 | } |
| 357 | 358 | |
| 358 | 359 | |
| 359 | 360 | static ADDRESS_MAP_START( cpu_mst_map, AS_PROGRAM, 32, gal3_state ) |
| 360 | 361 | AM_RANGE(0x00000000, 0x001fffff) AM_ROM |
| 361 | AM_RANGE(0x20000000, 0x20001fff) AM_RAM AM_ | |
| 362 | AM_RANGE(0x20000000, 0x20001fff) AM_RAM AM_ | |
| 362 | 363 | /// AM_RANGE(0x40000000, 0x4000ffff) AM_WRITE_LEGACY() // |
| 363 | 364 | AM_RANGE(0x44000000, 0x44000003) AM_READ_PORT("DSW_CPU_mst" ) |
| 364 | 365 | AM_RANGE(0x44800000, 0x44800003) AM_READ(led_mst_r) AM_WRITE(led_mst_w) //LEDs |
| r14896 | r14897 | |
| 435 | 436 | AM_RANGE(0x2c3800, 0x2c3801) AM_RAM //? |
| 436 | 437 | AM_RANGE(0x2c4000, 0x2c4001) AM_RAM //? |
| 437 | 438 | |
| 438 | AM_RANGE(0x300000, 0x300fff) AM_RAM AM_ | |
| 439 | AM_RANGE(0x300000, 0x300fff) AM_RAM AM_ | |
| 439 | 440 | |
| 440 | 441 | AM_RANGE(0x400000, 0x400017) AM_RAM //MC68681? |
| 441 | 442 | AM_RANGE(0x480000, 0x480017) AM_RAM //? |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | public: |
| 33 | 33 | nightgal_state(const machine_config &mconfig, device_type type, const char *tag) |
| 34 | : driver_device(mconfig, type, tag) { } | |
| 34 | : driver_device(mconfig, type, tag) , | |
| 35 | m_comms_ram(*this, "comms_ram"){ } | |
| 35 | 36 | |
| 36 | 37 | /* video-related */ |
| 37 | 38 | UINT8 m_blit_raw_data[3]; |
| r14896 | r14897 | |
| 44 | 45 | UINT8 m_z80_latch; |
| 45 | 46 | UINT8 m_mux_data; |
| 46 | 47 | |
| 47 | UINT8 | |
| 48 | required_shared_ptr<UINT8> | |
| 48 | 49 | |
| 49 | 50 | /* devices */ |
| 50 | 51 | device_t *m_maincpu; |
| r14896 | r14897 | |
| 378 | 379 | READ8_MEMBER(nightgal_state::royalqn_comm_r) |
| 379 | 380 | { |
| 380 | 381 | |
| 381 | return (m_comms_ram[offset] & 0x80) | (0x7f); //bits 6-0 are undefined, presumably open bus | |
| 382 | return (m_comms_ram.target()[offset] & 0x80) | (0x7f); //bits 6-0 are undefined, presumably open bus | |
| 382 | 383 | } |
| 383 | 384 | |
| 384 | 385 | WRITE8_MEMBER(nightgal_state::royalqn_comm_w) |
| 385 | 386 | { |
| 386 | 387 | |
| 387 | m_comms_ram[offset] = data & 0x80; | |
| 388 | m_comms_ram.target()[offset] = data & 0x80; | |
| 388 | 389 | } |
| 389 | 390 | |
| 390 | 391 | #ifdef UNUSED_CODE |
| r14896 | r14897 | |
| 509 | 510 | static ADDRESS_MAP_START( sexygal_map, AS_PROGRAM, 8, nightgal_state ) |
| 510 | 511 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 511 | 512 | AM_RANGE(0x8000, 0xbfff) AM_RAM //??? |
| 512 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(royalqn_comm_r, royalqn_comm_w) AM_ | |
| 513 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(royalqn_comm_r, royalqn_comm_w) AM_ | |
| 513 | 514 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 514 | 515 | ADDRESS_MAP_END |
| 515 | 516 | |
| r14896 | r14897 | |
| 533 | 534 | AM_RANGE(0x00a0, 0x00af) AM_WRITE(blit_true_vregs_w) |
| 534 | 535 | AM_RANGE(0x00b0, 0x00b0) AM_WRITENOP // bltflip register |
| 535 | 536 | |
| 536 | AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2c00) AM_READWRITE(royalqn_comm_r, royalqn_comm_w) AM_ | |
| 537 | AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2c00) AM_READWRITE(royalqn_comm_r, royalqn_comm_w) AM_ | |
| 537 | 538 | AM_RANGE(0xc000, 0xffff) AM_ROM AM_WRITENOP |
| 538 | 539 | ADDRESS_MAP_END |
| 539 | 540 | |
| r14896 | r14897 | |
| 544 | 545 | static ADDRESS_MAP_START( royalqn_map, AS_PROGRAM, 8, nightgal_state ) |
| 545 | 546 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 546 | 547 | AM_RANGE(0x8000, 0xbfff) AM_NOP |
| 547 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(royalqn_comm_r, royalqn_comm_w) AM_ | |
| 548 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(royalqn_comm_r, royalqn_comm_w) AM_ | |
| 548 | 549 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 549 | 550 | ADDRESS_MAP_END |
| 550 | 551 |
| r14896 | r14897 | |
|---|---|---|
| 23 | 23 | { |
| 24 | 24 | public: |
| 25 | 25 | rgum_state(const machine_config &mconfig, device_type type, const char *tag) |
| 26 | : driver_device(mconfig, type, tag) { } | |
| 26 | : driver_device(mconfig, type, tag) , | |
| 27 | m_vram(*this, "vram"), | |
| 28 | m_cram(*this, "cram"){ } | |
| 27 | 29 | |
| 28 | UINT8 *m_vram; | |
| 29 | UINT8 *m_cram; | |
| 30 | required_shared_ptr<UINT8> m_vram; | |
| 31 | required_shared_ptr<UINT8> m_cram; | |
| 30 | 32 | UINT8 m_hbeat; |
| 31 | 33 | DECLARE_CUSTOM_INPUT_MEMBER(rgum_heartbeat_r); |
| 32 | 34 | }; |
| r14896 | r14897 | |
| 48 | 50 | { |
| 49 | 51 | for(x=0;x<66;x++) |
| 50 | 52 | { |
| 51 | int tile = state->m_vram[count] | ((state->m_cram[count] & 0xf) <<8); | |
| 53 | int tile = state->m_vram.target()[count] | ((state->m_cram.target()[count] & 0xf) <<8); | |
| 52 | 54 | |
| 53 | 55 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8); |
| 54 | 56 | |
| r14896 | r14897 | |
| 73 | 75 | |
| 74 | 76 | AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 75 | 77 | |
| 76 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(m_vram) | |
| 77 | AM_RANGE(0x5000, 0x57ff) AM_RAM AM_BASE(m_cram) | |
| 78 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vram") | |
| 79 | AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE("cram") | |
| 78 | 80 | |
| 79 | 81 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 80 | 82 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 47 | 47 | if (m_videobank & 0x02) |
| 48 | 48 | { |
| 49 | 49 | if (m_videobank & 0x04) |
| 50 | paletteram_xBBBBBGGGGGRRRRR_be_w(space,offset + 0x0800,data); | |
| 50 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space,offset + 0x0800,data); | |
| 51 | 51 | else |
| 52 | paletteram_xBBBBBGGGGGRRRRR_be_w(space,offset,data); | |
| 52 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space,offset,data); | |
| 53 | 53 | } |
| 54 | 54 | else if (m_videobank & 0x01) |
| 55 | 55 | k053245_w(m_k053244, offset, data); |
| r14896 | r14897 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | WRITE8_MEMBER(zaccaria_state::sound_command_w) |
| 186 | 186 | { |
| 187 | soundlatch_w(space, 0, data); | |
| 187 | soundlatch_byte_w(space, 0, data); | |
| 188 | 188 | cputag_set_input_line(machine(), "audio2", 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); |
| 189 | 189 | } |
| 190 | 190 | |
| r14896 | r14897 | |
| 192 | 192 | { |
| 193 | 193 | pia6821_device *pia0 = machine().device<pia6821_device>("pia0"); |
| 194 | 194 | pia0->ca1_w(data & 0x80); |
| 195 | soundlatch2_w(space, 0, data); | |
| 195 | soundlatch2_byte_w(space, 0, data); | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | static WRITE8_DEVICE_HANDLER( mc1408_data_w ) |
| r14896 | r14897 | |
| 330 | 330 | AM_RANGE(0x0090, 0x0093) AM_DEVREADWRITE("pia1", pia6821_device, read, write) AM_MIRROR(0x8F6C) |
| 331 | 331 | AM_RANGE(0x1000, 0x1000) AM_DEVWRITE_LEGACY("dac2", mc1408_data_w) AM_MIRROR(0x83FF) /* MC1408 */ |
| 332 | 332 | AM_RANGE(0x1400, 0x1400) AM_WRITE(sound1_command_w) AM_MIRROR(0xC3FF) |
| 333 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_r) AM_MIRROR(0xC3FF) | |
| 333 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r) AM_MIRROR(0xC3FF) | |
| 334 | 334 | AM_RANGE(0x2000, 0x2fff) AM_ROM AM_MIRROR(0x8000) // rom 8 with A12 low |
| 335 | 335 | AM_RANGE(0x3000, 0x3fff) AM_ROM AM_MIRROR(0x8000) // rom 7 with A12 low |
| 336 | 336 | AM_RANGE(0x6000, 0x6fff) AM_ROM AM_MIRROR(0x8000) // rom 8 with A12 high |
| r14896 | r14897 | |
| 531 | 531 | AY8910_LEGACY_OUTPUT, |
| 532 | 532 | AY8910_DEFAULT_LOADS, |
| 533 | 533 | DEVCB_NULL, |
| 534 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_r), | |
| 534 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r), | |
| 535 | 535 | DEVCB_HANDLER(ay8910_port0a_w), |
| 536 | 536 | DEVCB_NULL |
| 537 | 537 | }; |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | coin_counter_w(machine(), 0, data & 0x80); |
| 62 | 62 | coin_counter_w(machine(), 1, data & 0x40); |
| 63 | flip_screen_set( | |
| 63 | flip_screen_set( | |
| 64 | 64 | /* unknown: (data & 0x10) and (data & 4) */ |
| 65 | 65 | } |
| 66 | 66 | |
| r14896 | r14897 | |
| 69 | 69 | AM_RANGE(0xdc00, 0xdfff) AM_RAM AM_SHARE("share1") // shared with SOUND |
| 70 | 70 | AM_RANGE(0xe000, 0xe1ff) AM_RAM_WRITE(speedbal_background_videoram_w) AM_BASE(m_background_videoram) |
| 71 | 71 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(speedbal_foreground_videoram_w) AM_BASE(m_foreground_videoram) |
| 72 | AM_RANGE(0xf000, 0xf5ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 72 | AM_RANGE(0xf000, 0xf5ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 73 | 73 | AM_RANGE(0xf600, 0xfeff) AM_RAM AM_SHARE("nvram") |
| 74 | 74 | AM_RANGE(0xff00, 0xffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 75 | 75 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | attckufo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | 53 | : driver_device(mconfig, type, tag), |
| 54 | 54 | m_maincpu(*this, "maincpu"), |
| 55 | m_mos6560(*this, "mos6560") { } | |
| 55 | m_mos6560(*this, "mos6560") , | |
| 56 | m_mainram(*this, "mainram"), | |
| 57 | m_tileram(*this, "tileram"){ } | |
| 56 | 58 | |
| 57 | /* memory pointers */ | |
| 58 | UINT8 * m_mainram; | |
| 59 | UINT8 * m_tileram; | |
| 60 | ||
| 61 | 59 | /* devices */ |
| 62 | 60 | required_device<cpu_device> m_maincpu; |
| 63 | 61 | required_device<mos6560_device> m_mos6560; |
| 62 | ||
| 63 | /* memory pointers */ | |
| 64 | required_shared_ptr<UINT8> m_mainram; | |
| 65 | required_shared_ptr<UINT8> m_tileram; | |
| 66 | ||
| 64 | 67 | DECLARE_READ8_MEMBER(attckufo_io_r); |
| 65 | 68 | DECLARE_WRITE8_MEMBER(attckufo_io_w); |
| 66 | 69 | }; |
| r14896 | r14897 | |
| 121 | 124 | |
| 122 | 125 | static ADDRESS_MAP_START( cpu_map, AS_PROGRAM, 8, attckufo_state ) |
| 123 | 126 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 124 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_ | |
| 127 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_ | |
| 125 | 128 | AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE_LEGACY("mos6560", mos6560_port_r, mos6560_port_w) |
| 126 | 129 | AM_RANGE(0x1400, 0x1403) AM_READWRITE(attckufo_io_r, attckufo_io_w) |
| 127 | AM_RANGE(0x1c00, 0x1fff) AM_RAM AM_ | |
| 130 | AM_RANGE(0x1c00, 0x1fff) AM_RAM AM_ | |
| 128 | 131 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 129 | 132 | ADDRESS_MAP_END |
| 130 | 133 |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | public: |
| 38 | 38 | jongkyo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 39 | : driver_device(mconfig, type, tag) { } | |
| 39 | : driver_device(mconfig, type, tag) , | |
| 40 | m_videoram(*this, "videoram"){ } | |
| 40 | 41 | |
| 41 | 42 | /* misc */ |
| 42 | 43 | UINT8 m_rom_bank; |
| 43 | 44 | UINT8 m_mux_data; |
| 44 | 45 | |
| 45 | 46 | /* memory pointers */ |
| 46 | UINT8 | |
| 47 | required_shared_ptr<UINT8> | |
| 47 | 48 | UINT8 m_videoram2[0x4000]; |
| 48 | 49 | DECLARE_WRITE8_MEMBER(bank_select_w); |
| 49 | 50 | DECLARE_WRITE8_MEMBER(mux_w); |
| r14896 | r14897 | |
| 89 | 90 | |
| 90 | 91 | |
| 91 | 92 | |
| 92 | data1 = state->m_videoram[0x4000 + x / 4 + y * 64]; | |
| 93 | data2 = state->m_videoram[x / 4 + y * 64]; | |
| 93 | data1 = state->m_videoram.target()[0x4000 + x / 4 + y * 64]; | |
| 94 | data2 = state->m_videoram.target()[x / 4 + y * 64]; | |
| 94 | 95 | |
| 95 | 96 | for (b = 0; b < 4; ++b) |
| 96 | 97 | { |
| r14896 | r14897 | |
| 224 | 225 | AM_RANGE(0x4000, 0x6bff) AM_ROM // fixed rom |
| 225 | 226 | AM_RANGE(0x6c00, 0x6fff) AM_ROMBANK("bank1") // banked (8 banks) |
| 226 | 227 | AM_RANGE(0x7000, 0x77ff) AM_RAM |
| 227 | AM_RANGE(0x8000, 0xffff) AM_RAM AM_ | |
| 228 | AM_RANGE(0x8000, 0xffff) AM_RAM AM_ | |
| 228 | 229 | ADDRESS_MAP_END |
| 229 | 230 | |
| 230 | 231 |
| r14896 | r14897 | |
|---|---|---|
| 77 | 77 | : driver_device(mconfig, type, tag), |
| 78 | 78 | m_maincpu(*this, "maincpu"), |
| 79 | 79 | m_dacl(*this, "dacl"), |
| 80 | m_dacr(*this, "dacr") | |
| 81 | { } | |
| 80 | m_dacr(*this, "dacr"), | |
| 81 | m_region4(*this, "region4"){ } | |
| 82 | 82 | |
| 83 | required_device<cpu_device> m_maincpu; | |
| 84 | required_device<dac_device> m_dacl; | |
| 85 | required_device<dac_device> m_dacr; | |
| 86 | required_shared_ptr<UINT16> m_region4; | |
| 83 | 87 | UINT16 m_vdp_address_low; |
| 84 | 88 | UINT16 m_vdp_address_high; |
| 85 | 89 | UINT16 m_vdp_writemode; |
| r14896 | r14897 | |
| 88 | 92 | UINT32 m_write_address_laststart; |
| 89 | 93 | UINT32 m_write_address_lastend; |
| 90 | 94 | |
| 91 | UINT16* m_region4; | |
| 92 | 95 | UINT8 m_paldac[3][0x100]; |
| 93 | 96 | int m_paldac_select; |
| 94 | 97 | int m_paldac_offset; |
| r14896 | r14897 | |
| 97 | 100 | UINT8 m_sound_index_l,m_sound_index_r; |
| 98 | 101 | UINT16 m_sound_pointer_l,m_sound_pointer_r; |
| 99 | 102 | |
| 100 | required_device<cpu_device> m_maincpu; | |
| 101 | required_device<dac_device> m_dacl; | |
| 102 | required_device<dac_device> m_dacr; | |
| 103 | 103 | DECLARE_WRITE16_MEMBER(region4_w); |
| 104 | 104 | DECLARE_READ16_MEMBER(buffer_status_r); |
| 105 | 105 | DECLARE_READ16_MEMBER(littlerb_vdp_r); |
| r14896 | r14897 | |
| 112 | 112 | |
| 113 | 113 | WRITE16_MEMBER(littlerb_state::region4_w) |
| 114 | 114 | { |
| 115 | COMBINE_DATA(&m_region4[offset]); | |
| 115 | COMBINE_DATA(&m_region4.target()[offset]); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | READ16_MEMBER(littlerb_state::buffer_status_r) |
| r14896 | r14897 | |
| 133 | 133 | |
| 134 | 134 | AM_RANGE(0x1ff80804, 0x1ff80805) AM_DEVREAD("^", littlerb_state, buffer_status_r) |
| 135 | 135 | // most gfx end up here including the sprite list |
| 136 | AM_RANGE(0x1ff80000, 0x1fffffff) AM_RAM AM_DEVWRITE("^", littlerb_state, region4_w) AM_ | |
| 136 | AM_RANGE(0x1ff80000, 0x1fffffff) AM_RAM AM_DEVWRITE("^", littlerb_state, region4_w) AM_ | |
| 137 | 137 | ADDRESS_MAP_END |
| 138 | 138 | |
| 139 | 139 | static ADDRESS_MAP_START( ramdac_map, AS_0, 8, littlerb_state ) |
| r14896 | r14897 | |
| 472 | 472 | littlerb_state *state = screen.machine().driver_data<littlerb_state>(); |
| 473 | 473 | int x,y,offs; |
| 474 | 474 | int xsize,ysize; |
| 475 | UINT16* spriteregion = &state->m_region4[0x400]; | |
| 475 | UINT16* spriteregion = &state->m_region4.target()[0x400]; | |
| 476 | 476 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 477 | 477 | //printf("frame\n"); |
| 478 | 478 | /* the spriteram format is something like this .. */ |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | WRITE8_MEMBER(tagteam_state::sound_command_w) |
| 34 | 34 | { |
| 35 | soundlatch_w(space, offset, data); | |
| 35 | soundlatch_byte_w(space, offset, data); | |
| 36 | 36 | cputag_set_input_line(machine(), "audiocpu", M6502_IRQ_LINE, HOLD_LINE); |
| 37 | 37 | } |
| 38 | 38 | |
| r14896 | r14897 | |
| 68 | 68 | AM_RANGE(0x2002, 0x2003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w) |
| 69 | 69 | AM_RANGE(0x2004, 0x2004) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 70 | 70 | AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w) |
| 71 | AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_r) | |
| 71 | AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r) | |
| 72 | 72 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 73 | 73 | ADDRESS_MAP_END |
| 74 | 74 |
| r14896 | r14897 | |
|---|---|---|
| 1319 | 1319 | { |
| 1320 | 1320 | public: |
| 1321 | 1321 | namcos23_state(const machine_config &mconfig, device_type type, const char *tag) |
| 1322 | : driver_device(mconfig, type, tag) { } | |
| 1322 | : driver_device(mconfig, type, tag) , | |
| 1323 | m_shared_ram(*this, "shared_ram"), | |
| 1324 | m_charram(*this, "charram"), | |
| 1325 | m_textram(*this, "textram"), | |
| 1326 | m_gmen_sh2_shared(*this, "gmen_sh2_shared"){ } | |
| 1323 | 1327 | |
| 1324 | 1328 | c361_t m_c361; |
| 1325 | 1329 | c417_t m_c417; |
| r14896 | r14897 | |
| 1329 | 1333 | render_t m_render; |
| 1330 | 1334 | |
| 1331 | 1335 | tilemap_t *m_bgtilemap; |
| 1332 | UINT32 *m_textram; | |
| 1333 | UINT32 *m_shared_ram; | |
| 1334 | UINT32 *m_gmen_sh2_shared; | |
| 1335 | UINT32 *m_charram; | |
| 1336 | required_shared_ptr<UINT32> m_shared_ram; | |
| 1337 | required_shared_ptr<UINT32> m_charram; | |
| 1338 | required_shared_ptr<UINT32> m_textram; | |
| 1339 | required_shared_ptr<UINT32> m_gmen_sh2_shared; | |
| 1336 | 1340 | UINT8 m_jvssense; |
| 1337 | 1341 | INT32 m_has_jvsio; |
| 1338 | 1342 | bool m_ctl_vbl_active; |
| r14896 | r14897 | |
| 1450 | 1454 | |
| 1451 | 1455 | WRITE32_MEMBER(namcos23_state::namcos23_textram_w) |
| 1452 | 1456 | { |
| 1453 | COMBINE_DATA( &m_textram[offset] ); | |
| 1457 | COMBINE_DATA( &m_textram.target()[offset] ); | |
| 1454 | 1458 | m_bgtilemap->mark_tile_dirty(offset*2); |
| 1455 | 1459 | m_bgtilemap->mark_tile_dirty((offset*2)+1); |
| 1456 | 1460 | } |
| 1457 | 1461 | |
| 1458 | 1462 | WRITE32_MEMBER(namcos23_state::s23_txtchar_w) |
| 1459 | 1463 | { |
| 1460 | COMBINE_DATA(&m_charram[offset]); | |
| 1464 | COMBINE_DATA(&m_charram.target()[offset]); | |
| 1461 | 1465 | gfx_element_mark_dirty(machine().gfx[0], offset/32); |
| 1462 | 1466 | } |
| 1463 | 1467 | |
| r14896 | r14897 | |
| 1858 | 1862 | |
| 1859 | 1863 | READ32_MEMBER(namcos23_state::gorgon_sharedram_r) |
| 1860 | 1864 | { |
| 1861 | return m_shared_ram[offset]; | |
| 1865 | return m_shared_ram.target()[offset]; | |
| 1862 | 1866 | } |
| 1863 | 1867 | |
| 1864 | 1868 | WRITE32_MEMBER(namcos23_state::gorgon_sharedram_w) |
| 1865 | 1869 | { |
| 1866 | COMBINE_DATA(&m_shared_ram[offset]); | |
| 1870 | COMBINE_DATA(&m_shared_ram.target()[offset]); | |
| 1867 | 1871 | |
| 1868 | 1872 | // hack for final furlong |
| 1869 | 1873 | if ((offset == 0x6000/4) && (data == 0) && (mem_mask == 0xff000000)) |
| r14896 | r14897 | |
| 2393 | 2397 | static VIDEO_START( ss23 ) |
| 2394 | 2398 | { |
| 2395 | 2399 | namcos23_state *state = machine.driver_data<namcos23_state>(); |
| 2396 | gfx_element_set_source(machine.gfx[0], (UINT8 *)state->m_charram); | |
| 2400 | gfx_element_set_source(machine.gfx[0], (UINT8 *)state->m_charram.target()); | |
| 2397 | 2401 | state->m_bgtilemap = tilemap_create(machine, TextTilemapGetInfo, tilemap_scan_rows, 16, 16, 64, 64); |
| 2398 | 2402 | state->m_bgtilemap->set_transparent_pen(0xf); |
| 2399 | 2403 | |
| r14896 | r14897 | |
| 2452 | 2456 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM |
| 2453 | 2457 | AM_RANGE(0x01000000, 0x010000ff) AM_READWRITE(p3d_r, p3d_w ) |
| 2454 | 2458 | AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE16(s23_c417_r, s23_c417_w, 0xffffffff ) |
| 2455 | AM_RANGE(0x04400000, 0x0440ffff) AM_READWRITE(gorgon_sharedram_r, gorgon_sharedram_w ) AM_ | |
| 2459 | AM_RANGE(0x04400000, 0x0440ffff) AM_READWRITE(gorgon_sharedram_r, gorgon_sharedram_w ) AM_ | |
| 2456 | 2460 | |
| 2457 | 2461 | AM_RANGE(0x04c3ff08, 0x04c3ff0b) AM_WRITE(s23_mcuen_w ) |
| 2458 | 2462 | AM_RANGE(0x04c3ff0c, 0x04c3ff0f) AM_RAM |
| r14896 | r14897 | |
| 2461 | 2465 | |
| 2462 | 2466 | AM_RANGE(0x06108000, 0x061087ff) AM_RAM // GAMMA (C404-3S) |
| 2463 | 2467 | AM_RANGE(0x06110000, 0x0613ffff) AM_RAM_WRITE(namcos23_paletteram_w ) AM_SHARE("paletteram") |
| 2464 | AM_RANGE(0x06400000, 0x06403fff) AM_RAM_WRITE(s23_txtchar_w ) AM_ | |
| 2468 | AM_RANGE(0x06400000, 0x06403fff) AM_RAM_WRITE(s23_txtchar_w ) AM_ | |
| 2465 | 2469 | AM_RANGE(0x06404000, 0x0641dfff) AM_RAM |
| 2466 | AM_RANGE(0x0641e000, 0x0641ffff) AM_RAM_WRITE(namcos23_textram_w ) AM_ | |
| 2470 | AM_RANGE(0x0641e000, 0x0641ffff) AM_RAM_WRITE(namcos23_textram_w ) AM_ | |
| 2467 | 2471 | |
| 2468 | 2472 | AM_RANGE(0x08000000, 0x087fffff) AM_ROM AM_REGION("data", 0) // data ROMs |
| 2469 | 2473 | |
| r14896 | r14897 | |
| 2483 | 2487 | AM_RANGE(0x00000000, 0x00ffffff) AM_RAM |
| 2484 | 2488 | AM_RANGE(0x01000000, 0x010000ff) AM_READWRITE(p3d_r, p3d_w ) |
| 2485 | 2489 | AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE16(s23_c417_r, s23_c417_w, 0xffffffff ) |
| 2486 | AM_RANGE(0x04400000, 0x0440ffff) AM_RAM AM_ | |
| 2490 | AM_RANGE(0x04400000, 0x0440ffff) AM_RAM AM_ | |
| 2487 | 2491 | AM_RANGE(0x04c3ff08, 0x04c3ff0b) AM_WRITE(s23_mcuen_w ) |
| 2488 | 2492 | AM_RANGE(0x04c3ff0c, 0x04c3ff0f) AM_RAM |
| 2489 | 2493 | AM_RANGE(0x06000000, 0x0600ffff) AM_RAM AM_SHARE("nvram") // Backup |
| 2490 | 2494 | AM_RANGE(0x06200000, 0x06203fff) AM_RAM // C422 |
| 2491 | 2495 | AM_RANGE(0x06400000, 0x0640000f) AM_READWRITE16(s23_c422_r, s23_c422_w, 0xffffffff ) // C422 registers |
| 2492 | AM_RANGE(0x06800000, 0x06807fff) AM_RAM_WRITE(s23_txtchar_w ) AM_ | |
| 2496 | AM_RANGE(0x06800000, 0x06807fff) AM_RAM_WRITE(s23_txtchar_w ) AM_ | |
| 2493 | 2497 | AM_RANGE(0x06804000, 0x0681dfff) AM_RAM |
| 2494 | AM_RANGE(0x0681e000, 0x0681ffff) AM_RAM_WRITE(namcos23_textram_w ) AM_ | |
| 2498 | AM_RANGE(0x0681e000, 0x0681ffff) AM_RAM_WRITE(namcos23_textram_w ) AM_ | |
| 2495 | 2499 | AM_RANGE(0x06820000, 0x0682000f) AM_READWRITE16(s23_c361_r, s23_c361_w, 0xffffffff ) // C361 |
| 2496 | 2500 | AM_RANGE(0x06a08000, 0x06a087ff) AM_RAM // Blending control & GAMMA (C404) |
| 2497 | 2501 | AM_RANGE(0x06a10000, 0x06a3ffff) AM_RAM_WRITE(namcos23_paletteram_w ) AM_SHARE("paletteram") |
| r14896 | r14897 | |
| 2514 | 2518 | |
| 2515 | 2519 | READ32_MEMBER(namcos23_state::sh2_shared_r) |
| 2516 | 2520 | { |
| 2517 | return m_gmen_sh2_shared[offset]; | |
| 2521 | return m_gmen_sh2_shared.target()[offset]; | |
| 2518 | 2522 | } |
| 2519 | 2523 | |
| 2520 | 2524 | WRITE32_MEMBER(namcos23_state::sh2_shared_w) |
| 2521 | 2525 | { |
| 2522 | COMBINE_DATA(&m_gmen_sh2_shared[offset]); | |
| 2526 | COMBINE_DATA(&m_gmen_sh2_shared.target()[offset]); | |
| 2523 | 2527 | } |
| 2524 | 2528 | |
| 2525 | 2529 | static ADDRESS_MAP_START( gmen_mips_map, AS_PROGRAM, 32, namcos23_state ) |
| r14896 | r14897 | |
| 2530 | 2534 | |
| 2531 | 2535 | |
| 2532 | 2536 | static ADDRESS_MAP_START( gmen_sh2_map, AS_PROGRAM, 32, namcos23_state ) |
| 2533 | AM_RANGE( 0x00000000, 0x00007fff ) AM_RAM AM_ | |
| 2537 | AM_RANGE( 0x00000000, 0x00007fff ) AM_RAM AM_ | |
| 2534 | 2538 | AM_RANGE( 0x04000000, 0x043fffff ) AM_RAM // SH-2 main work RAM |
| 2535 | 2539 | ADDRESS_MAP_END |
| 2536 | 2540 | |
| r14896 | r14897 | |
| 2542 | 2546 | |
| 2543 | 2547 | WRITE16_MEMBER(namcos23_state::sharedram_sub_w) |
| 2544 | 2548 | { |
| 2545 | UINT16 *shared16 = (UINT16 *)m_shared_ram; | |
| 2549 | UINT16 *shared16 = (UINT16 *)m_shared_ram.target(); | |
| 2546 | 2550 | |
| 2547 | 2551 | // fake that an I/O board is connected for games w/o a dump or that aren't properly communicating with it yet |
| 2548 | 2552 | if (!m_has_jvsio) |
| r14896 | r14897 | |
| 2558 | 2562 | |
| 2559 | 2563 | READ16_MEMBER(namcos23_state::sharedram_sub_r) |
| 2560 | 2564 | { |
| 2561 | UINT16 *shared16 = (UINT16 *)m_shared_ram; | |
| 2565 | UINT16 *shared16 = (UINT16 *)m_shared_ram.target(); | |
| 2562 | 2566 | |
| 2563 | 2567 | return shared16[BYTE_XOR_BE(offset)]; |
| 2564 | 2568 | } |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") |
| 58 | 58 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") |
| 59 | 59 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") |
| 60 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) | |
| 60 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) | |
| 61 | 61 | AM_RANGE(0xc804, 0xc804) AM_WRITE(commando_c804_w) |
| 62 | 62 | AM_RANGE(0xc808, 0xc809) AM_WRITE(commando_scrollx_w) |
| 63 | 63 | AM_RANGE(0xc80a, 0xc80b) AM_WRITE(commando_scrolly_w) |
| r14896 | r14897 | |
| 73 | 73 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, commando_state ) |
| 74 | 74 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 75 | 75 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 76 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 76 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 77 | 77 | AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 78 | 78 | AM_RANGE(0x8002, 0x8003) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 79 | 79 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | |
| 275 | ||
| 275 | ||
| 276 | 276 | { |
| 277 | 277 | /* reset sound IRQ */ |
| 278 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 279 | state->m_p2portrd_state = 0; | |
| 280 | atarigen_update_interrupts(space->machine()); | |
| 278 | m_p2portrd_state = 0; | |
| 279 | atarigen_update_interrupts(machine()); | |
| 281 | 280 | } |
| 282 | 281 | |
| 283 | 282 | |
| 284 | ||
| 283 | ||
| 285 | 284 | { |
| 286 | 285 | /* reset sound CPU */ |
| 287 | 286 | if (ACCESSING_BITS_0_7) |
| 288 | cputag_set_input_line( | |
| 287 | cputag_set_input_line( | |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | 290 | |
| r14896 | r14897 | |
| 296 | 295 | } |
| 297 | 296 | |
| 298 | 297 | |
| 299 | ||
| 298 | ||
| 300 | 299 | { |
| 301 | 300 | if (offset == 0 && ACCESSING_BITS_0_7) |
| 302 | | |
| 301 | | |
| 303 | 302 | } |
| 304 | 303 | |
| 305 | 304 | |
| r14896 | r14897 | |
| 310 | 309 | * |
| 311 | 310 | *************************************/ |
| 312 | 311 | |
| 313 | ||
| 312 | ||
| 314 | 313 | { |
| 315 | 314 | static const int bankoffset[64] = |
| 316 | 315 | { |
| r14896 | r14897 | |
| 332 | 331 | 0x8e000, 0x86000, 0x7e000, 0x76000 |
| 333 | 332 | }; |
| 334 | 333 | |
| 335 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 336 | int newword = state->m_bankselect[offset]; | |
| 334 | int newword = m_bankselect[offset]; | |
| 337 | 335 | UINT8 *base; |
| 338 | 336 | |
| 339 | 337 | COMBINE_DATA(&newword); |
| 340 | | |
| 338 | | |
| 341 | 339 | |
| 342 | base = &space->machine().region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]]; | |
| 343 | memcpy(offset ? state->m_rombank2 : state->m_rombank1, base, 0x2000); | |
| 340 | base = &machine().region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]]; | |
| 341 | memcpy(offset ? m_rombank2 : m_rombank1, base, 0x2000); | |
| 344 | 342 | } |
| 345 | 343 | |
| 346 | 344 | |
| r14896 | r14897 | |
| 349 | 347 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 350 | 348 | atarisy2_state *state = machine.driver_data<atarisy2_state>(); |
| 351 | 349 | |
| 352 | bankselect_w(space, 0, state->m_bankselect[0], 0xffff); | |
| 353 | bankselect_w(space, 1, state->m_bankselect[1], 0xffff); | |
| 350 | state->bankselect_w(*space, 0, state->m_bankselect[0], 0xffff); | |
| 351 | state->bankselect_w(*space, 1, state->m_bankselect[1], 0xffff); | |
| 354 | 352 | } |
| 355 | 353 | |
| 356 | 354 | |
| r14896 | r14897 | |
| 361 | 359 | * |
| 362 | 360 | *************************************/ |
| 363 | 361 | |
| 364 | ||
| 362 | ||
| 365 | 363 | { |
| 366 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 367 | int result = input_port_read(space->machine(), "1800") | (input_port_read(space->machine(), "1801") << 8); | |
| 364 | int result = input_port_read(machine(), "1800") | (input_port_read(machine(), "1801") << 8); | |
| 368 | 365 | |
| 369 | if (state->m_cpu_to_sound_ready) result ^= 0x20; | |
| 370 | if (state->m_sound_to_cpu_ready) result ^= 0x10; | |
| 366 | if (m_cpu_to_sound_ready) result ^= 0x20; | |
| 367 | if (m_sound_to_cpu_ready) result ^= 0x10; | |
| 371 | 368 | |
| 372 | 369 | return result; |
| 373 | 370 | } |
| 374 | 371 | |
| 375 | 372 | |
| 376 | ||
| 373 | ||
| 377 | 374 | { |
| 378 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 379 | int result = input_port_read(space->machine(), "1840"); | |
| 375 | int result = input_port_read(machine(), "1840"); | |
| 380 | 376 | |
| 381 | if (state->m_cpu_to_sound_ready) result |= 0x01; | |
| 382 | if (state->m_sound_to_cpu_ready) result |= 0x02; | |
| 383 | if ((state->m_has_tms5220) && (tms5220_readyq_r(space->machine().device("tms")) == 0)) | |
| 377 | if (m_cpu_to_sound_ready) result |= 0x01; | |
| 378 | if (m_sound_to_cpu_ready) result |= 0x02; | |
| 379 | if ((m_has_tms5220) && (tms5220_readyq_r(machine().device("tms")) == 0)) | |
| 384 | 380 | result &= ~0x04; |
| 385 | if (!(input_port_read( | |
| 381 | if (!(input_port_read( | |
| 386 | 382 | |
| 387 | 383 | return result; |
| 388 | 384 | } |
| 389 | 385 | |
| 390 | 386 | |
| 391 | ||
| 387 | ||
| 392 | 388 | { |
| 393 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 394 | 389 | |
| 395 | if ( | |
| 390 | if ( | |
| 396 | 391 | { |
| 397 | 392 | data = 12 | ((data >> 5) & 1); |
| 398 | tms5220_set_frequency( | |
| 393 | tms5220_set_frequency( | |
| 399 | 394 | } |
| 400 | 395 | } |
| 401 | 396 | |
| r14896 | r14897 | |
| 407 | 402 | * |
| 408 | 403 | *************************************/ |
| 409 | 404 | |
| 410 | ||
| 405 | ||
| 411 | 406 | { |
| 412 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 413 | state->m_which_adc = offset & 3; | |
| 407 | m_which_adc = offset & 3; | |
| 414 | 408 | } |
| 415 | 409 | |
| 416 | 410 | |
| 417 | ||
| 411 | ||
| 418 | 412 | { |
| 419 | 413 | static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" }; |
| 420 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 421 | 414 | |
| 422 | if (state->m_which_adc < state->m_pedal_count) | |
| 423 | return ~input_port_read(space->machine(), adcnames[state->m_which_adc]); | |
| 415 | if (m_which_adc < m_pedal_count) | |
| 416 | return ~input_port_read(machine(), adcnames[m_which_adc]); | |
| 424 | 417 | |
| 425 | return input_port_read( | |
| 418 | return input_port_read( | |
| 426 | 419 | } |
| 427 | 420 | |
| 428 | 421 | |
| 429 | ||
| 422 | ||
| 430 | 423 | { |
| 431 | 424 | static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" }; |
| 432 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 433 | 425 | |
| 434 | if (offset <= 1 && | |
| 426 | if (offset <= 1 && | |
| 435 | 427 | { |
| 436 | switch (input_port_read( | |
| 428 | switch (input_port_read( | |
| 437 | 429 | { |
| 438 | 430 | case 0: /* Real */ |
| 439 | 431 | break; |
| r14896 | r14897 | |
| 441 | 433 | case 1: /* Fake Joystick */ |
| 442 | 434 | /* special thanks to MAME Analog+ for the mapping code */ |
| 443 | 435 | { |
| 444 | int analogx = input_port_read(space->machine(), "FAKE_JOY_X") - 128; | |
| 445 | int analogy = input_port_read(space->machine(), "FAKE_JOY_Y") - 128; | |
| 436 | int analogx = input_port_read(machine(), "FAKE_JOY_X") - 128; | |
| 437 | int analogy = input_port_read(machine(), "FAKE_JOY_Y") - 128; | |
| 446 | 438 | double angle; |
| 447 | 439 | |
| 448 | 440 | /* if the joystick is centered, leave the rest of this alone */ |
| 449 | angle = | |
| 441 | angle = | |
| 450 | 442 | if (analogx < -32 || analogx > 32 || analogy < -32 || analogy > 32) |
| 451 | 443 | angle = atan2((double)analogx, (double)analogy) * 360 / (2 * M_PI); |
| 452 | 444 | |
| 453 | 445 | /* detect when we pass the 0 point in either direction */ |
| 454 | if (state->m_joy_last_angle < -90 && angle > 90) | |
| 455 | state->m_joy_rotations--; | |
| 456 | else if (state->m_joy_last_angle > 90 && angle < -90) | |
| 457 | state->m_joy_rotations++; | |
| 458 | state->m_joy_last_angle = angle; | |
| 446 | if (m_joy_last_angle < -90 && angle > 90) | |
| 447 | m_joy_rotations--; | |
| 448 | else if (m_joy_last_angle > 90 && angle < -90) | |
| 449 | m_joy_rotations++; | |
| 450 | m_joy_last_angle = angle; | |
| 459 | 451 | |
| 460 | 452 | /* make offset 0 return 0xff when the controller blocks one of two gaps */ |
| 461 | 453 | /* this is not accurate, as a counter should count up/down 2 counts as it passes through each gap */ |
| r14896 | r14897 | |
| 473 | 465 | else |
| 474 | 466 | { |
| 475 | 467 | /* take the rotations * 144 plus the current angle */ |
| 476 | return ( | |
| 468 | return ( | |
| 477 | 469 | } |
| 478 | 470 | } |
| 479 | 471 | |
| r14896 | r14897 | |
| 481 | 473 | { |
| 482 | 474 | INT32 diff; |
| 483 | 475 | UINT32 temp; |
| 484 | UINT32 rotate_count = input_port_read( | |
| 476 | UINT32 rotate_count = input_port_read( | |
| 485 | 477 | /* rotate_count behaves the same as the real LEAT1 Rotate encoder |
| 486 | 478 | * we use it to generate the LETA0 Center encoder count |
| 487 | 479 | */ |
| 488 | 480 | |
| 489 | if (rotate_count != | |
| 481 | if (rotate_count != | |
| 490 | 482 | { |
| 491 | 483 | /* see if count rolled between 0xffff and 0x0000 */ |
| 492 | if (( | |
| 484 | if (( | |
| 493 | 485 | { |
| 494 | temp = 0xffff - | |
| 486 | temp = 0xffff - | |
| 495 | 487 | diff = rotate_count + temp + 1; |
| 496 | 488 | } |
| 497 | else if ((rotate_count > 0xc000) && ( | |
| 489 | else if ((rotate_count > 0xc000) && ( | |
| 498 | 490 | { |
| 499 | 491 | temp = 0xffff - rotate_count; |
| 500 | diff = | |
| 492 | diff = | |
| 501 | 493 | } |
| 502 | 494 | else |
| 503 | 495 | { |
| 504 | temp = rotate_count - | |
| 496 | temp = rotate_count - | |
| 505 | 497 | diff = temp; |
| 506 | 498 | } |
| 507 | 499 | |
| 508 | | |
| 500 | | |
| 509 | 501 | |
| 510 | 502 | /* you may not like this, but it is the easiest way to accurately fake the center count */ |
| 511 | 503 | /* diff is never a big number anyways */ |
| r14896 | r14897 | |
| 513 | 505 | { |
| 514 | 506 | for (int i = 0; i > diff; i--) |
| 515 | 507 | { |
| 516 | state->m_spin_pos--; | |
| 517 | if (state->m_spin_pos < 0) | |
| 518 | state->m_spin_pos = 143; | |
| 508 | m_spin_pos--; | |
| 509 | if (m_spin_pos < 0) | |
| 510 | m_spin_pos = 143; | |
| 519 | 511 | else |
| 520 | switch ( | |
| 512 | switch ( | |
| 521 | 513 | { |
| 522 | 514 | case 2: |
| 523 | 515 | case 3: |
| 524 | 516 | case 141: |
| 525 | 517 | case 142: |
| 526 | | |
| 518 | | |
| 527 | 519 | } |
| 528 | 520 | } |
| 529 | 521 | } |
| r14896 | r14897 | |
| 531 | 523 | { |
| 532 | 524 | for (int i = 0; i < diff; i++) |
| 533 | 525 | { |
| 534 | state->m_spin_pos++; | |
| 535 | if (state->m_spin_pos > 143) | |
| 536 | state->m_spin_pos = 0; | |
| 526 | m_spin_pos++; | |
| 527 | if (m_spin_pos > 143) | |
| 528 | m_spin_pos = 0; | |
| 537 | 529 | else |
| 538 | switch ( | |
| 530 | switch ( | |
| 539 | 531 | { |
| 540 | 532 | case 2: |
| 541 | 533 | case 3: |
| 542 | 534 | case 141: |
| 543 | 535 | case 142: |
| 544 | | |
| 536 | | |
| 545 | 537 | } |
| 546 | 538 | } |
| 547 | 539 | } |
| 548 | 540 | } |
| 549 | 541 | |
| 550 | 542 | if (offset == 0) |
| 551 | return | |
| 543 | return | |
| 552 | 544 | else |
| 553 | 545 | /* offset == 1 */ |
| 554 | 546 | return rotate_count & 0xff; |
| r14896 | r14897 | |
| 559 | 551 | return 0xff; |
| 560 | 552 | } |
| 561 | 553 | } |
| 562 | return input_port_read( | |
| 554 | return input_port_read( | |
| 563 | 555 | } |
| 564 | 556 | |
| 565 | 557 | |
| r14896 | r14897 | |
| 656 | 648 | important. So it would be nice to add it in properly. |
| 657 | 649 | */ |
| 658 | 650 | |
| 659 | ||
| 651 | ||
| 660 | 652 | { |
| 661 | 653 | double rbott, rtop, gain; |
| 662 | 654 | |
| r14896 | r14897 | |
| 669 | 661 | if (!(data & 0x02)) rbott += 1.0/47; |
| 670 | 662 | if (!(data & 0x04)) rbott += 1.0/22; |
| 671 | 663 | gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott))); |
| 672 | atarigen_set_ym2151_vol( | |
| 664 | atarigen_set_ym2151_vol( | |
| 673 | 665 | |
| 674 | 666 | /* bits 3-4 control the volume of the POKEYs, using 47k and 100k resistors */ |
| 675 | 667 | rtop = 1.0/(1.0/100 + 1.0/100); |
| r14896 | r14897 | |
| 677 | 669 | if (!(data & 0x08)) rbott += 1.0/47; |
| 678 | 670 | if (!(data & 0x10)) rbott += 1.0/22; |
| 679 | 671 | gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott))); |
| 680 | atarigen_set_pokey_vol( | |
| 672 | atarigen_set_pokey_vol( | |
| 681 | 673 | |
| 682 | 674 | /* bits 5-7 control the volume of the TMS5220, using 22k, 47k, and 100k resistors */ |
| 683 | 675 | rtop = 1.0/(1.0/100 + 1.0/100); |
| r14896 | r14897 | |
| 686 | 678 | if (!(data & 0x40)) rbott += 1.0/47; |
| 687 | 679 | if (!(data & 0x80)) rbott += 1.0/22; |
| 688 | 680 | gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott))); |
| 689 | atarigen_set_tms5220_vol( | |
| 681 | atarigen_set_tms5220_vol( | |
| 690 | 682 | } |
| 691 | 683 | |
| 692 | 684 | |
| 693 | ||
| 685 | ||
| 694 | 686 | { |
| 695 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 696 | 687 | |
| 697 | 688 | /* if no change, do nothing */ |
| 698 | if ((data & 1) == | |
| 689 | if ((data & 1) == | |
| 699 | 690 | return; |
| 700 | | |
| 691 | | |
| 701 | 692 | |
| 702 | 693 | /* only track the 0 -> 1 transition */ |
| 703 | if ( | |
| 694 | if ( | |
| 704 | 695 | return; |
| 705 | 696 | |
| 706 | 697 | /* a large number of signals are reset when this happens */ |
| 707 | atarigen_sound_io_reset(space->machine().device("soundcpu")); | |
| 708 | devtag_reset(space->machine(), "ymsnd"); | |
| 709 | if (state->m_has_tms5220) | |
| 698 | atarigen_sound_io_reset(machine().device("soundcpu")); | |
| 699 | devtag_reset(machine(), "ymsnd"); | |
| 700 | if (m_has_tms5220) | |
| 710 | 701 | { |
| 711 | devtag_reset( | |
| 702 | devtag_reset( | |
| 712 | 703 | } |
| 713 | 704 | mixer_w(space, 0, 0); |
| 714 | 705 | } |
| 715 | 706 | |
| 716 | 707 | |
| 717 | ||
| 708 | ||
| 718 | 709 | { |
| 719 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 720 | 710 | |
| 721 | 711 | /* clear the p2portwr state on a p1portrd */ |
| 722 | state->m_p2portwr_state = 0; | |
| 723 | atarigen_update_interrupts(space->machine()); | |
| 712 | m_p2portwr_state = 0; | |
| 713 | atarigen_update_interrupts(machine()); | |
| 724 | 714 | |
| 725 | 715 | /* handle it normally otherwise */ |
| 726 | return atarigen_sound_r(space,offset,0xffff); | |
| 716 | return atarigen_sound_r(&space,offset,0xffff); | |
| 727 | 717 | } |
| 728 | 718 | |
| 729 | 719 | |
| 730 | ||
| 720 | ||
| 731 | 721 | { |
| 732 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 733 | 722 | |
| 734 | 723 | /* clock the state through */ |
| 735 | state->m_p2portwr_state = (state->m_interrupt_enable & 2) != 0; | |
| 736 | atarigen_update_interrupts(space->machine()); | |
| 724 | m_p2portwr_state = (m_interrupt_enable & 2) != 0; | |
| 725 | atarigen_update_interrupts(machine()); | |
| 737 | 726 | |
| 738 | 727 | /* handle it normally otherwise */ |
| 739 | atarigen_6502_sound_w(space, offset, data); | |
| 728 | atarigen_6502_sound_w(&space, offset, data); | |
| 740 | 729 | } |
| 741 | 730 | |
| 742 | 731 | |
| 743 | ||
| 732 | ||
| 744 | 733 | { |
| 745 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 746 | 734 | |
| 747 | 735 | /* clock the state through */ |
| 748 | state->m_p2portrd_state = (state->m_interrupt_enable & 1) != 0; | |
| 749 | atarigen_update_interrupts(space->machine()); | |
| 736 | m_p2portrd_state = (m_interrupt_enable & 1) != 0; | |
| 737 | atarigen_update_interrupts(machine()); | |
| 750 | 738 | |
| 751 | 739 | /* handle it normally otherwise */ |
| 752 | return atarigen_6502_sound_r(space, offset); | |
| 740 | return atarigen_6502_sound_r(&space, offset); | |
| 753 | 741 | } |
| 754 | 742 | |
| 755 | 743 | |
| r14896 | r14897 | |
| 760 | 748 | * |
| 761 | 749 | *************************************/ |
| 762 | 750 | |
| 763 | ||
| 751 | ||
| 764 | 752 | { |
| 765 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 766 | if (state->m_has_tms5220) | |
| 753 | if (m_has_tms5220) | |
| 767 | 754 | { |
| 768 | tms5220_data_w( | |
| 755 | tms5220_data_w( | |
| 769 | 756 | } |
| 770 | 757 | } |
| 771 | 758 | |
| 772 | ||
| 759 | ||
| 773 | 760 | { |
| 774 | atarisy2_state *state = space->machine().driver_data<atarisy2_state>(); | |
| 775 | if (state->m_has_tms5220) | |
| 761 | if (m_has_tms5220) | |
| 776 | 762 | { |
| 777 | tms5220_wsq_w( | |
| 763 | tms5220_wsq_w( | |
| 778 | 764 | } |
| 779 | 765 | } |
| 780 | 766 | |
| r14896 | r14897 | |
| 784 | 770 | * |
| 785 | 771 | *************************************/ |
| 786 | 772 | |
| 787 | ||
| 773 | ||
| 788 | 774 | { |
| 789 | coin_counter_w(space->machine(), 0, (data >> 0) & 1); | |
| 790 | coin_counter_w(space->machine(), 1, (data >> 1) & 1); | |
| 775 | coin_counter_w(machine(), 0, (data >> 0) & 1); | |
| 776 | coin_counter_w(machine(), 1, (data >> 1) & 1); | |
| 791 | 777 | } |
| 792 | 778 | |
| 793 | 779 | |
| r14896 | r14897 | |
| 802 | 788 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy2_state ) |
| 803 | 789 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 804 | 790 | AM_RANGE(0x1000, 0x11ff) AM_MIRROR(0x0200) AM_RAM_WRITE_LEGACY(atarisy2_paletteram_w) AM_SHARE("paletteram") |
| 805 | AM_RANGE(0x1400, 0x1403) AM_MIRROR(0x007c) AM_READWRITE_LEGACY(adc_r, bankselect_w) AM_BASE(m_bankselect) | |
| 806 | AM_RANGE(0x1480, 0x1487) AM_MIRROR(0x0078) AM_WRITE_LEGACY(adc_strobe_w) | |
| 807 | AM_RANGE(0x1580, 0x1581) AM_MIRROR(0x001e) AM_WRITE_LEGACY(int0_ack_w) | |
| 808 | AM_RANGE(0x15a0, 0x15a1) AM_MIRROR(0x001e) AM_WRITE_LEGACY(int1_ack_w) | |
| 791 | AM_RANGE(0x1400, 0x1403) AM_MIRROR(0x007c) AM_READWRITE(adc_r, bankselect_w) AM_BASE(m_bankselect) | |
| 792 | AM_RANGE(0x1480, 0x1487) AM_MIRROR(0x0078) AM_WRITE(adc_strobe_w) | |
| 793 | AM_RANGE(0x1580, 0x1581) AM_MIRROR(0x001e) AM_WRITE(int0_ack_w) | |
| 794 | AM_RANGE(0x15a0, 0x15a1) AM_MIRROR(0x001e) AM_WRITE(int1_ack_w) | |
| 809 | 795 | AM_RANGE(0x15c0, 0x15c1) AM_MIRROR(0x001e) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w) |
| 810 | 796 | AM_RANGE(0x15e0, 0x15e1) AM_MIRROR(0x001e) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 811 | AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x007e) AM_WRITE | |
| 797 | AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x007e) AM_WRITE | |
| 812 | 798 | AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarigen_sound_w) |
| 813 | 799 | AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_xscroll_w) AM_BASE(m_xscroll) |
| 814 | 800 | AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_yscroll_w) AM_BASE(m_yscroll) |
| 815 | AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ_LEGACY(switch_r) AM_WRITE(watchdog_reset16_w) | |
| 816 | AM_RANGE(0x1c00, 0x1c01) AM_MIRROR(0x03fe) AM_READ_LEGACY(sound_r) | |
| 801 | AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_WRITE(watchdog_reset16_w) | |
| 802 | AM_RANGE(0x1c00, 0x1c01) AM_MIRROR(0x03fe) AM_READ(sound_r) | |
| 817 | 803 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE_LEGACY(atarisy2_videoram_r, atarisy2_videoram_w) |
| 818 | 804 | AM_RANGE(0x4000, 0x5fff) AM_ROM AM_BASE(m_rombank1) |
| 819 | 805 | AM_RANGE(0x6000, 0x7fff) AM_ROM AM_BASE(m_rombank2) |
| r14896 | r14897 | |
| 834 | 820 | AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM |
| 835 | 821 | AM_RANGE(0x1000, 0x17ff) AM_MIRROR(0x2000) AM_RAM AM_SHARE("eeprom") |
| 836 | 822 | AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x2780) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) |
| 837 | AM_RANGE(0x1810, 0x1813) AM_MIRROR(0x278c) AM_READ | |
| 823 | AM_RANGE(0x1810, 0x1813) AM_MIRROR(0x278c) AM_READ | |
| 838 | 824 | AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x2780) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) |
| 839 | AM_RANGE(0x1840, 0x1840) AM_MIRROR(0x278f) AM_READ | |
| 825 | AM_RANGE(0x1840, 0x1840) AM_MIRROR(0x278f) AM_READ | |
| 840 | 826 | AM_RANGE(0x1850, 0x1851) AM_MIRROR(0x278e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 841 | AM_RANGE(0x1860, 0x1860) AM_MIRROR(0x278f) AM_READ_LEGACY(sound_6502_r) | |
| 842 | AM_RANGE(0x1870, 0x1870) AM_MIRROR(0x2781) AM_WRITE_LEGACY(tms5220_w) | |
| 843 | AM_RANGE(0x1872, 0x1873) AM_MIRROR(0x2780) AM_WRITE_LEGACY(tms5220_strobe_w) | |
| 844 | AM_RANGE(0x1874, 0x1874) AM_MIRROR(0x2781) AM_WRITE_LEGACY(sound_6502_w) | |
| 845 | AM_RANGE(0x1876, 0x1876) AM_MIRROR(0x2781) AM_WRITE_LEGACY(coincount_w) | |
| 827 | AM_RANGE(0x1860, 0x1860) AM_MIRROR(0x278f) AM_READ(sound_6502_r) | |
| 828 | AM_RANGE(0x1870, 0x1870) AM_MIRROR(0x2781) AM_WRITE(tms5220_w) | |
| 829 | AM_RANGE(0x1872, 0x1873) AM_MIRROR(0x2780) AM_WRITE(tms5220_strobe_w) | |
| 830 | AM_RANGE(0x1874, 0x1874) AM_MIRROR(0x2781) AM_WRITE(sound_6502_w) | |
| 831 | AM_RANGE(0x1876, 0x1876) AM_MIRROR(0x2781) AM_WRITE(coincount_w) | |
| 846 | 832 | AM_RANGE(0x1878, 0x1878) AM_MIRROR(0x2781) AM_WRITE_LEGACY(atarigen_6502_irq_ack_w) |
| 847 | AM_RANGE(0x187a, 0x187a) AM_MIRROR(0x2781) AM_WRITE_LEGACY(mixer_w) | |
| 848 | AM_RANGE(0x187c, 0x187c) AM_MIRROR(0x2781) AM_WRITE_LEGACY(switch_6502_w) | |
| 849 | AM_RANGE(0x187e, 0x187e) AM_MIRROR(0x2781) AM_WRITE_LEGACY(sound_reset_w) | |
| 833 | AM_RANGE(0x187a, 0x187a) AM_MIRROR(0x2781) AM_WRITE(mixer_w) | |
| 834 | AM_RANGE(0x187c, 0x187c) AM_MIRROR(0x2781) AM_WRITE(switch_6502_w) | |
| 835 | AM_RANGE(0x187e, 0x187e) AM_MIRROR(0x2781) AM_WRITE(sound_reset_w) | |
| 850 | 836 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 851 | 837 | ADDRESS_MAP_END |
| 852 | 838 |
| r14896 | r14897 | |
|---|---|---|
| 217 | 217 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 218 | 218 | |
| 219 | 219 | // bit 7 flips screen |
| 220 | flip_screen_set( | |
| 220 | flip_screen_set( | |
| 221 | 221 | |
| 222 | 222 | // other bits unused |
| 223 | 223 | } |
| r14896 | r14897 | |
| 397 | 397 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("PAD2") |
| 398 | 398 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DIPSW1") |
| 399 | 399 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DIPSW2") |
| 400 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w) | |
| 400 | AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w) | |
| 401 | 401 | AM_RANGE(0xc201, 0xc201) AM_WRITE(ninjakd2_soundreset_w) // sound reset + flip screen |
| 402 | 402 | AM_RANGE(0xc202, 0xc202) AM_WRITE(ninjakd2_bankselect_w) |
| 403 | 403 | AM_RANGE(0xc203, 0xc203) AM_WRITE(ninjakd2_sprite_overdraw_w) |
| 404 | 404 | AM_RANGE(0xc208, 0xc20c) AM_WRITE(ninjakd2_bg_ctrl_w) // scroll + enable |
| 405 | AM_RANGE(0xc800, 0xcdff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 405 | AM_RANGE(0xc800, 0xcdff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 406 | 406 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(m_fg_videoram) |
| 407 | 407 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(m_bg_videoram) |
| 408 | 408 | AM_RANGE(0xe000, 0xf9ff) AM_RAM |
| r14896 | r14897 | |
| 417 | 417 | AM_RANGE(0xda00, 0xdfff) AM_RAM AM_BASE(m_spriteram) |
| 418 | 418 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(ninjakd2_bgvideoram_w) AM_BASE(m_bg_videoram) |
| 419 | 419 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(m_fg_videoram) |
| 420 | AM_RANGE(0xf000, 0xf5ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 420 | AM_RANGE(0xf000, 0xf5ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 421 | 421 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("KEYCOIN") |
| 422 | 422 | AM_RANGE(0xf801, 0xf801) AM_READ_PORT("PAD1") |
| 423 | 423 | AM_RANGE(0xf802, 0xf802) AM_READ_PORT("PAD2") |
| 424 | 424 | AM_RANGE(0xf803, 0xf803) AM_READ_PORT("DIPSW1") |
| 425 | 425 | AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DIPSW2") |
| 426 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(soundlatch_w) | |
| 426 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(soundlatch_byte_w) | |
| 427 | 427 | AM_RANGE(0xfa01, 0xfa01) AM_WRITE(ninjakd2_soundreset_w) |
| 428 | 428 | AM_RANGE(0xfa02, 0xfa02) AM_WRITE(ninjakd2_bankselect_w) |
| 429 | 429 | AM_RANGE(0xfa03, 0xfa03) AM_WRITE(ninjakd2_sprite_overdraw_w) |
| r14896 | r14897 | |
| 434 | 434 | static ADDRESS_MAP_START( robokid_main_cpu, AS_PROGRAM, 8, ninjakd2_state ) |
| 435 | 435 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 436 | 436 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 437 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 437 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 438 | 438 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(m_fg_videoram) |
| 439 | 439 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(robokid_bg2_videoram_r, robokid_bg2_videoram_w) // banked |
| 440 | 440 | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(robokid_bg1_videoram_r, robokid_bg1_videoram_w) // banked |
| r14896 | r14897 | |
| 444 | 444 | AM_RANGE(0xdc02, 0xdc02) AM_READ_PORT("PAD2") |
| 445 | 445 | AM_RANGE(0xdc03, 0xdc03) AM_READ_PORT("DIPSW1") |
| 446 | 446 | AM_RANGE(0xdc04, 0xdc04) AM_READ_PORT("DIPSW2") |
| 447 | AM_RANGE(0xdc00, 0xdc00) AM_WRITE(soundlatch_w) | |
| 447 | AM_RANGE(0xdc00, 0xdc00) AM_WRITE(soundlatch_byte_w) | |
| 448 | 448 | AM_RANGE(0xdc01, 0xdc01) AM_WRITE(ninjakd2_soundreset_w) // sound reset + flip screen |
| 449 | 449 | AM_RANGE(0xdc02, 0xdc02) AM_WRITE(robokid_bankselect_w) |
| 450 | 450 | AM_RANGE(0xdc03, 0xdc03) AM_WRITE(ninjakd2_sprite_overdraw_w) |
| r14896 | r14897 | |
| 464 | 464 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 465 | 465 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("KEYCOIN") |
| 466 | 466 | AM_RANGE(0xc001, 0xc003) AM_READ(omegaf_io_protection_r) |
| 467 | AM_RANGE(0xc000, 0xc000) AM_WRITE(soundlatch_w) | |
| 467 | AM_RANGE(0xc000, 0xc000) AM_WRITE(soundlatch_byte_w) | |
| 468 | 468 | AM_RANGE(0xc001, 0xc001) AM_WRITE(ninjakd2_soundreset_w) // sound reset + flip screen |
| 469 | 469 | AM_RANGE(0xc002, 0xc002) AM_WRITE(robokid_bankselect_w) |
| 470 | 470 | AM_RANGE(0xc003, 0xc003) AM_WRITE(ninjakd2_sprite_overdraw_w) |
| r14896 | r14897 | |
| 480 | 480 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(robokid_bg1_videoram_r, robokid_bg1_videoram_w) // banked |
| 481 | 481 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(robokid_bg2_videoram_r, robokid_bg2_videoram_w) // banked |
| 482 | 482 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ninjakd2_fgvideoram_w) AM_BASE(m_fg_videoram) |
| 483 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 483 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 484 | 484 | AM_RANGE(0xe000, 0xf9ff) AM_RAM |
| 485 | 485 | AM_RANGE(0xfa00, 0xffff) AM_RAM AM_BASE(m_spriteram) |
| 486 | 486 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 490 | 490 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 491 | 491 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 492 | 492 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 493 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 493 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 494 | 494 | AM_RANGE(0xf000, 0xf000) AM_WRITE(ninjakd2_pcm_play_w) |
| 495 | 495 | ADDRESS_MAP_END |
| 496 | 496 |
| r14896 | r14897 | |
|---|---|---|
| 77 | 77 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 78 | 78 | AM_RANGE(0x00, 0x00) AM_READ_PORT("SYSTEM") AM_WRITE(yunsung8_videobank_w) // video RAM bank |
| 79 | 79 | AM_RANGE(0x01, 0x01) AM_READ_PORT("P1") AM_WRITE(yunsung8_bankswitch_w) // ROM Bank + Layers Enable |
| 80 | AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_WRITE(soundlatch_w) // To Sound CPU | |
| 80 | AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") AM_WRITE(soundlatch_byte_w) // To Sound CPU | |
| 81 | 81 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") |
| 82 | 82 | AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2") |
| 83 | 83 | AM_RANGE(0x06, 0x06) AM_WRITE(yunsung8_flipscreen_w) // Flip Screen |
| r14896 | r14897 | |
| 120 | 120 | AM_RANGE(0xe400, 0xe400) AM_WRITE(yunsung8_adpcm_w) |
| 121 | 121 | AM_RANGE(0xec00, 0xec01) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 122 | 122 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 123 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) // From Main CPU | |
| 123 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 124 | 124 | ADDRESS_MAP_END |
| 125 | 125 | |
| 126 | 126 |
| r14896 | r14897 | |
|---|---|---|
| 184 | 184 | spacefb_state *state = machine.driver_data<spacefb_state>(); |
| 185 | 185 | /* the 3 output ports are cleared on reset */ |
| 186 | 186 | state->spacefb_port_0_w(*space, 0, 0); |
| 187 | spacefb_port_1_w(space, 0, 0); | |
| 187 | state->spacefb_port_1_w(*space, 0, 0); | |
| 188 | 188 | state->spacefb_port_2_w(*space, 0, 0); |
| 189 | 189 | |
| 190 | 190 | start_interrupt_timer(machine); |
| r14896 | r14897 | |
| 201 | 201 | static ADDRESS_MAP_START( spacefb_main_map, AS_PROGRAM, 8, spacefb_state ) |
| 202 | 202 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 203 | 203 | AM_RANGE(0x4000, 0x7fff) AM_NOP |
| 204 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x3c00) AM_RAM AM_BASE(m_videoram | |
| 204 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x3c00) AM_RAM AM_BASE_SIZE(m_videoram, | |
| 205 | 205 | AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x3000) AM_RAM |
| 206 | 206 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_NOP |
| 207 | 207 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 229 | 229 | AM_RANGE(0x04, 0x07) AM_READNOP /* yes, this is correct (1-of-8 decoder) */ |
| 230 | 230 | |
| 231 | 231 | AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_WRITE(spacefb_port_0_w) |
| 232 | AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_WRITE | |
| 232 | AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_WRITE | |
| 233 | 233 | AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_WRITE(spacefb_port_2_w) |
| 234 | 234 | AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_WRITENOP |
| 235 | 235 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 237 | 237 | |
| 238 | 238 | static ADDRESS_MAP_START( spacefb_audio_io_map, AS_IO, 8, spacefb_state ) |
| 239 | 239 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 240 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ_LEGACY(spacefb_audio_p2_r) | |
| 241 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ_LEGACY(spacefb_audio_t0_r) | |
| 242 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_LEGACY(spacefb_audio_t1_r) | |
| 240 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(spacefb_audio_p2_r) | |
| 241 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(spacefb_audio_t0_r) | |
| 242 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(spacefb_audio_t1_r) | |
| 243 | 243 | ADDRESS_MAP_END |
| 244 | 244 | |
| 245 | 245 |
| r14896 | r14897 | |
|---|---|---|
| 158 | 158 | res = input_port_read_safe(machine(), portnames[offset], 0); |
| 159 | 159 | if (offset == 3) |
| 160 | 160 | { |
| 161 | res = input_port_read(machine(), (flip_screen | |
| 161 | res = input_port_read(machine(), (flip_screen | |
| 162 | 162 | if (m_handle_joystick) |
| 163 | 163 | { |
| 164 | 164 | /* map digital two-way joystick to two fixed VOLIN values */ |
| r14896 | r14897 | |
| 220 | 220 | cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE); |
| 221 | 221 | break; |
| 222 | 222 | case 7: |
| 223 | flip_screen_set( | |
| 223 | flip_screen_set( | |
| 224 | 224 | break; |
| 225 | 225 | } |
| 226 | 226 | } |
| r14896 | r14897 | |
| 246 | 246 | warpwarp_state *state = device->machine().driver_data<warpwarp_state>(); |
| 247 | 247 | int res; |
| 248 | 248 | |
| 249 | res = input_port_read(device->machine(), (flip_screen | |
| 249 | res = input_port_read(device->machine(), (state->flip_screen | |
| 250 | 250 | if (state->m_handle_joystick) |
| 251 | 251 | { |
| 252 | 252 | if (res & 1) return 0x0f; |
| r14896 | r14897 | |
| 305 | 305 | cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE); |
| 306 | 306 | break; |
| 307 | 307 | case 7: |
| 308 | flip_screen_set( | |
| 308 | flip_screen_set( | |
| 309 | 309 | break; |
| 310 | 310 | } |
| 311 | 311 | } |
| r14896 | r14897 | |
|---|---|---|
| 358 | 358 | public: |
| 359 | 359 | cojag_state(const machine_config &mconfig, device_type type, const char *tag) |
| 360 | 360 | : driver_device(mconfig, type, tag), |
| 361 | m_nvram(*this, "nvram") { } | |
| 361 | m_nvram(*this, "nvram") , | |
| 362 | m_rom_base(*this, "robase"){ } | |
| 362 | 363 | |
| 363 | 364 | required_shared_ptr<UINT32> m_nvram; |
| 364 | 365 | cpu_device *m_main_cpu; |
| 365 | 366 | UINT32 m_misc_control_data; |
| 366 | 367 | UINT8 m_eeprom_enable; |
| 367 | UINT32 | |
| 368 | required_shared_ptr<UINT32> | |
| 368 | 369 | UINT32 *m_gpu_jump_address; |
| 369 | 370 | UINT8 m_gpu_command_pending; |
| 370 | 371 | UINT32 m_gpu_spin_pc; |
| r14896 | r14897 | |
| 373 | 374 | UINT64 m_main_speedup_last_cycles; |
| 374 | 375 | UINT64 m_main_speedup_max_cycles; |
| 375 | 376 | UINT32 *m_main_gpu_wait; |
| 377 | DECLARE_WRITE32_MEMBER(jaguar_eeprom_w); | |
| 378 | DECLARE_READ32_MEMBER(jaguar_eeprom_clk); | |
| 379 | DECLARE_READ32_MEMBER(jaguar_eeprom_cs); | |
| 380 | DECLARE_READ32_MEMBER(misc_control_r); | |
| 381 | DECLARE_WRITE32_MEMBER(misc_control_w); | |
| 382 | DECLARE_READ32_MEMBER(gpuctrl_r); | |
| 383 | DECLARE_WRITE32_MEMBER(gpuctrl_w); | |
| 384 | DECLARE_READ32_MEMBER(dspctrl_r); | |
| 385 | DECLARE_WRITE32_MEMBER(dspctrl_w); | |
| 386 | DECLARE_READ32_MEMBER(jaguar_wave_rom_r); | |
| 387 | DECLARE_READ32_MEMBER(joystick_r); | |
| 388 | DECLARE_WRITE32_MEMBER(joystick_w); | |
| 389 | DECLARE_WRITE32_MEMBER(latch_w); | |
| 390 | DECLARE_READ32_MEMBER(eeprom_data_r); | |
| 391 | DECLARE_WRITE32_MEMBER(eeprom_enable_w); | |
| 392 | DECLARE_WRITE32_MEMBER(eeprom_data_w); | |
| 393 | DECLARE_WRITE32_MEMBER(gpu_jump_w); | |
| 394 | DECLARE_READ32_MEMBER(gpu_jump_r); | |
| 395 | DECLARE_READ32_MEMBER(cojagr3k_main_speedup_r); | |
| 396 | DECLARE_READ32_MEMBER(main_gpu_wait_r); | |
| 397 | DECLARE_WRITE32_MEMBER(area51_main_speedup_w); | |
| 398 | DECLARE_WRITE32_MEMBER(area51mx_main_speedup_w); | |
| 399 | DECLARE_READ16_MEMBER(gpuctrl_r16); | |
| 400 | DECLARE_WRITE16_MEMBER(gpuctrl_w16); | |
| 401 | DECLARE_READ16_MEMBER(jaguar_blitter_r16); | |
| 402 | DECLARE_WRITE16_MEMBER(jaguar_blitter_w16); | |
| 403 | DECLARE_READ16_MEMBER(jaguar_serial_r16); | |
| 404 | DECLARE_WRITE16_MEMBER(jaguar_serial_w16); | |
| 405 | DECLARE_READ16_MEMBER(dspctrl_r16); | |
| 406 | DECLARE_WRITE16_MEMBER(dspctrl_w16); | |
| 407 | DECLARE_READ16_MEMBER(jaguar_eeprom_cs16); | |
| 408 | DECLARE_READ16_MEMBER(jaguar_eeprom_clk16); | |
| 409 | DECLARE_WRITE16_MEMBER(jaguar_eeprom_w16); | |
| 410 | DECLARE_READ16_MEMBER(joystick_r16); | |
| 411 | DECLARE_WRITE16_MEMBER(joystick_w16); | |
| 412 | DECLARE_READ32_MEMBER(jaguar_shared_ram_r); | |
| 413 | DECLARE_WRITE32_MEMBER(jaguar_shared_ram_w); | |
| 414 | DECLARE_READ32_MEMBER(jaguar_rom_base_r); | |
| 415 | DECLARE_WRITE32_MEMBER(jaguar_rom_base_w); | |
| 416 | DECLARE_READ32_MEMBER(jaguar_cart_base_r); | |
| 417 | DECLARE_WRITE32_MEMBER(jaguar_cart_base_w); | |
| 418 | DECLARE_READ32_MEMBER(high_rom_base_r); | |
| 419 | DECLARE_WRITE32_MEMBER(high_rom_base_w); | |
| 420 | DECLARE_READ32_MEMBER(jaguar_dsp_ram_r); | |
| 421 | DECLARE_WRITE32_MEMBER(jaguar_dsp_ram_w); | |
| 422 | DECLARE_READ32_MEMBER(jaguar_gpu_clut_r); | |
| 423 | DECLARE_WRITE32_MEMBER(jaguar_gpu_clut_w); | |
| 424 | DECLARE_READ32_MEMBER(jaguar_gpu_ram_r); | |
| 425 | DECLARE_WRITE32_MEMBER(jaguar_gpu_ram_w); | |
| 426 | DECLARE_READ16_MEMBER(jaguar_shared_ram_r16); | |
| 427 | DECLARE_WRITE16_MEMBER(jaguar_shared_ram_w16); | |
| 428 | DECLARE_READ16_MEMBER(jaguar_rom_base_r16); | |
| 429 | DECLARE_WRITE16_MEMBER(jaguar_rom_base_w16); | |
| 430 | DECLARE_READ16_MEMBER(jaguar_cart_base_r16); | |
| 431 | DECLARE_WRITE16_MEMBER(jaguar_cart_base_w16); | |
| 432 | DECLARE_READ16_MEMBER(high_rom_base_r16); | |
| 433 | DECLARE_WRITE16_MEMBER(high_rom_base_w16); | |
| 434 | DECLARE_READ16_MEMBER(jaguar_dsp_ram_r16); | |
| 435 | DECLARE_WRITE16_MEMBER(jaguar_dsp_ram_w16); | |
| 436 | DECLARE_READ16_MEMBER(jaguar_gpu_clut_r16); | |
| 437 | DECLARE_WRITE16_MEMBER(jaguar_gpu_clut_w16); | |
| 438 | DECLARE_READ16_MEMBER(jaguar_gpu_ram_r16); | |
| 439 | DECLARE_WRITE16_MEMBER(jaguar_gpu_ram_w16); | |
| 376 | 440 | }; |
| 377 | 441 | |
| 378 | 442 | |
| r14896 | r14897 | |
| 581 | 645 | } |
| 582 | 646 | } |
| 583 | 647 | */ |
| 584 | ||
| 648 | ||
| 585 | 649 | { |
| 586 | eeprom_device *eeprom = | |
| 650 | eeprom_device *eeprom = | |
| 587 | 651 | eeprom_bit_count++; |
| 588 | 652 | if (eeprom_bit_count != 9) /* kill extra bit at end of address */ |
| 589 | 653 | { |
| r14896 | r14897 | |
| 592 | 656 | } |
| 593 | 657 | } |
| 594 | 658 | |
| 595 | ||
| 659 | ||
| 596 | 660 | { |
| 597 | eeprom_device *eeprom = | |
| 661 | eeprom_device *eeprom = | |
| 598 | 662 | eeprom->set_clock_line(PULSE_LINE); /* get next bit when reading */ |
| 599 | 663 | return 0; |
| 600 | 664 | } |
| 601 | 665 | |
| 602 | ||
| 666 | ||
| 603 | 667 | { |
| 604 | eeprom_device *eeprom = | |
| 668 | eeprom_device *eeprom = | |
| 605 | 669 | eeprom->set_cs_line(ASSERT_LINE); /* must do at end of an operation */ |
| 606 | 670 | eeprom->set_cs_line(CLEAR_LINE); /* enable chip for next operation */ |
| 607 | 671 | eeprom->write_bit(1); /* write a start bit */ |
| r14896 | r14897 | |
| 618 | 682 | * |
| 619 | 683 | *************************************/ |
| 620 | 684 | |
| 621 | ||
| 685 | ||
| 622 | 686 | { |
| 623 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 624 | 687 | /* D7 = board reset (low) |
| 625 | 688 | D6 = audio must & reset (high) |
| 626 | 689 | D5 = volume control data (invert on write) |
| r14896 | r14897 | |
| 628 | 691 | D3-D1 = audio bank 2-0 |
| 629 | 692 | D0 = shared memory select (0=XBUS) */ |
| 630 | 693 | |
| 631 | return | |
| 694 | return | |
| 632 | 695 | } |
| 633 | 696 | |
| 634 | 697 | |
| 635 | ||
| 698 | ||
| 636 | 699 | { |
| 637 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 638 | logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(&space->device()), data); | |
| 700 | logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(&space.device()), data); | |
| 639 | 701 | |
| 640 | 702 | /* D7 = board reset (low) |
| 641 | 703 | D6 = audio must & reset (high) |
| r14896 | r14897 | |
| 648 | 710 | if (!(data & 0x80)) |
| 649 | 711 | { |
| 650 | 712 | /* clear any spinuntil stuff */ |
| 651 | jaguar_gpu_resume(space->machine()); | |
| 652 | jaguar_dsp_resume(space->machine()); | |
| 713 | jaguar_gpu_resume(machine()); | |
| 714 | jaguar_dsp_resume(machine()); | |
| 653 | 715 | |
| 654 | 716 | /* halt the CPUs */ |
| 655 | jaguargpu_ctrl_w(space->machine().device("gpu"), G_CTRL, 0, 0xffffffff); | |
| 656 | jaguardsp_ctrl_w(space->machine().device("audiocpu"), D_CTRL, 0, 0xffffffff); | |
| 717 | jaguargpu_ctrl_w(machine().device("gpu"), G_CTRL, 0, 0xffffffff); | |
| 718 | jaguardsp_ctrl_w(machine().device("audiocpu"), D_CTRL, 0, 0xffffffff); | |
| 657 | 719 | } |
| 658 | 720 | |
| 659 | 721 | /* adjust banking */ |
| 660 | if ( | |
| 722 | if ( | |
| 661 | 723 | { |
| 662 | memory_set_bank(space->machine(), "bank2", (data >> 1) & 7); | |
| 663 | memory_set_bank(space->machine(), "bank9", (data >> 1) & 7); | |
| 724 | memory_set_bank(machine(), "bank2", (data >> 1) & 7); | |
| 725 | memory_set_bank(machine(), "bank9", (data >> 1) & 7); | |
| 664 | 726 | } |
| 665 | 727 | |
| 666 | COMBINE_DATA(& | |
| 728 | COMBINE_DATA(& | |
| 667 | 729 | } |
| 668 | 730 | |
| 669 | 731 | |
| r14896 | r14897 | |
| 674 | 736 | *************************************/ |
| 675 | 737 | |
| 676 | 738 | // shouldn't the DSPs be doing this calc, why is this needed for Jaguar? |
| 677 | ||
| 739 | ||
| 678 | 740 | { |
| 679 | UINT32 result = jaguargpu_ctrl_r( | |
| 741 | UINT32 result = jaguargpu_ctrl_r( | |
| 680 | 742 | |
| 681 | 743 | if (is_jaguar) |
| 682 | 744 | { |
| r14896 | r14897 | |
| 691 | 753 | } |
| 692 | 754 | |
| 693 | 755 | |
| 694 | ||
| 756 | ||
| 695 | 757 | { |
| 696 | 758 | if (is_jaguar) |
| 697 | 759 | if ((!protection_check) && (offset == 5) && (data == 1)) protection_check++; |
| 698 | 760 | |
| 699 | jaguargpu_ctrl_w( | |
| 761 | jaguargpu_ctrl_w( | |
| 700 | 762 | } |
| 701 | 763 | |
| 702 | 764 | |
| r14896 | r14897 | |
| 707 | 769 | * |
| 708 | 770 | *************************************/ |
| 709 | 771 | |
| 710 | ||
| 772 | ||
| 711 | 773 | { |
| 712 | return jaguardsp_ctrl_r( | |
| 774 | return jaguardsp_ctrl_r( | |
| 713 | 775 | } |
| 714 | 776 | |
| 715 | 777 | |
| 716 | ||
| 778 | ||
| 717 | 779 | { |
| 718 | jaguardsp_ctrl_w( | |
| 780 | jaguardsp_ctrl_w( | |
| 719 | 781 | } |
| 720 | 782 | |
| 721 | 783 | |
| 722 | ||
| 784 | ||
| 723 | 785 | { |
| 724 | 786 | return jaguar_wave_rom[offset]; |
| 725 | 787 | } |
| r14896 | r14897 | |
| 734 | 796 | * |
| 735 | 797 | *************************************/ |
| 736 | 798 | |
| 737 | ||
| 799 | ||
| 738 | 800 | { |
| 739 | 801 | UINT16 joystick_result = 0xfffe; |
| 740 | 802 | UINT16 joybuts_result = 0xffef; |
| r14896 | r14897 | |
| 763 | 825 | { |
| 764 | 826 | if ((joystick_data & (0x10000 << i)) == 0) |
| 765 | 827 | { |
| 766 | joystick_result &= input_port_read(space->machine(), keynames[0][i]); | |
| 767 | joybuts_result &= input_port_read(space->machine(), keynames[1][i]); | |
| 828 | joystick_result &= input_port_read(machine(), keynames[0][i]); | |
| 829 | joybuts_result &= input_port_read(machine(), keynames[1][i]); | |
| 768 | 830 | } |
| 769 | 831 | } |
| 770 | 832 | |
| 771 | joystick_result |= space->machine().device<eeprom_device>("eeprom")->read_bit(); | |
| 772 | joybuts_result |= (input_port_read(space->machine(), "CONFIG") & 0x10); | |
| 833 | joystick_result |= machine().device<eeprom_device>("eeprom")->read_bit(); | |
| 834 | joybuts_result |= (input_port_read(machine(), "CONFIG") & 0x10); | |
| 773 | 835 | |
| 774 | 836 | return (joystick_result << 16) | joybuts_result; |
| 775 | 837 | } |
| 776 | 838 | |
| 777 | ||
| 839 | ||
| 778 | 840 | { |
| 779 | 841 | /* |
| 780 | 842 | * 16 12 8 4 0 |
| r14896 | r14897 | |
| 832 | 894 | * |
| 833 | 895 | *************************************/ |
| 834 | 896 | |
| 835 | ||
| 897 | ||
| 836 | 898 | { |
| 837 | logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(&space | |
| 899 | logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(&space. | |
| 838 | 900 | |
| 839 | 901 | /* adjust banking */ |
| 840 | if ( | |
| 902 | if ( | |
| 841 | 903 | { |
| 842 | 904 | if (cojag_is_r3000) |
| 843 | memory_set_bank(space->machine(), "bank1", data & 1); | |
| 844 | memory_set_bank(space->machine(), "bank8", data & 1); | |
| 905 | memory_set_bank(machine(), "bank1", data & 1); | |
| 906 | memory_set_bank(machine(), "bank8", data & 1); | |
| 845 | 907 | } |
| 846 | 908 | } |
| 847 | 909 | |
| r14896 | r14897 | |
| 853 | 915 | * |
| 854 | 916 | *************************************/ |
| 855 | 917 | |
| 856 | ||
| 918 | ||
| 857 | 919 | { |
| 858 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 859 | 920 | if (cojag_is_r3000) |
| 860 | return | |
| 921 | return | |
| 861 | 922 | else |
| 862 | return | |
| 923 | return | |
| 863 | 924 | } |
| 864 | 925 | |
| 865 | 926 | |
| 866 | ||
| 927 | ||
| 867 | 928 | { |
| 868 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 869 | state->m_eeprom_enable = 1; | |
| 929 | m_eeprom_enable = 1; | |
| 870 | 930 | } |
| 871 | 931 | |
| 872 | 932 | |
| 873 | ||
| 933 | ||
| 874 | 934 | { |
| 875 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 876 | // if (state->m_eeprom_enable) | |
| 935 | // if (m_eeprom_enable) | |
| 877 | 936 | { |
| 878 | 937 | if (cojag_is_r3000) |
| 879 | | |
| 938 | | |
| 880 | 939 | else |
| 881 | | |
| 940 | | |
| 882 | 941 | } |
| 883 | 942 | // else |
| 884 | // logerror("%08X:error writing to disabled EEPROM\n", cpu_get_previouspc(&space->device())); | |
| 885 | state->m_eeprom_enable = 0; | |
| 943 | // logerror("%08X:error writing to disabled EEPROM\n", cpu_get_previouspc(&space.device())); | |
| 944 | m_eeprom_enable = 0; | |
| 886 | 945 | } |
| 887 | 946 | |
| 888 | 947 | |
| r14896 | r14897 | |
| 924 | 983 | } |
| 925 | 984 | |
| 926 | 985 | |
| 927 | ||
| 986 | ||
| 928 | 987 | { |
| 929 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 930 | 988 | /* update the data in memory */ |
| 931 | COMBINE_DATA(state->m_gpu_jump_address); | |
| 932 | logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(&space->device()), *state->m_gpu_jump_address); | |
| 989 | COMBINE_DATA(m_gpu_jump_address); | |
| 990 | logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(&space.device()), *m_gpu_jump_address); | |
| 933 | 991 | |
| 934 | 992 | /* if the GPU is suspended, release it now */ |
| 935 | jaguar_gpu_resume( | |
| 993 | jaguar_gpu_resume( | |
| 936 | 994 | |
| 937 | 995 | /* start the sync timer going, and note that there is a command pending */ |
| 938 | space->machine().scheduler().synchronize(FUNC(gpu_sync_timer)); | |
| 939 | state->m_gpu_command_pending = 1; | |
| 996 | machine().scheduler().synchronize(FUNC(gpu_sync_timer)); | |
| 997 | m_gpu_command_pending = 1; | |
| 940 | 998 | } |
| 941 | 999 | |
| 942 | 1000 | |
| 943 | ||
| 1001 | ||
| 944 | 1002 | { |
| 945 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 946 | 1003 | /* if the current GPU command is just pointing back to the spin loop, and */ |
| 947 | 1004 | /* we're reading it from the spin loop, we can optimize */ |
| 948 | if (* | |
| 1005 | if (* | |
| 949 | 1006 | { |
| 950 | 1007 | #if ENABLE_SPEEDUP_HACKS |
| 951 | 1008 | /* spin if we're allowed */ |
| 952 | if (jaguar_hacks_enabled) jaguar_gpu_suspend( | |
| 1009 | if (jaguar_hacks_enabled) jaguar_gpu_suspend( | |
| 953 | 1010 | #endif |
| 954 | 1011 | |
| 955 | 1012 | /* no command is pending */ |
| 956 | | |
| 1013 | | |
| 957 | 1014 | } |
| 958 | 1015 | |
| 959 | 1016 | /* return the current value */ |
| 960 | return * | |
| 1017 | return * | |
| 961 | 1018 | } |
| 962 | 1019 | |
| 963 | 1020 | |
| r14896 | r14897 | |
| 982 | 1039 | #if ENABLE_SPEEDUP_HACKS |
| 983 | 1040 | |
| 984 | 1041 | |
| 985 | ||
| 1042 | ||
| 986 | 1043 | { |
| 987 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 988 | UINT64 curcycles = state->m_main_cpu->total_cycles(); | |
| 1044 | UINT64 curcycles = m_main_cpu->total_cycles(); | |
| 989 | 1045 | |
| 990 | 1046 | /* if it's been less than main_speedup_max_cycles cycles since the last time */ |
| 991 | if (curcycles - | |
| 1047 | if (curcycles - | |
| 992 | 1048 | { |
| 993 | 1049 | /* increment the count; if we hit 5, we can spin until an interrupt comes */ |
| 994 | if ( | |
| 1050 | if ( | |
| 995 | 1051 | { |
| 996 | device_spin_until_interrupt(&space->device()); | |
| 997 | state->m_main_speedup_hits = 0; | |
| 1052 | device_spin_until_interrupt(&space.device()); | |
| 1053 | m_main_speedup_hits = 0; | |
| 998 | 1054 | } |
| 999 | 1055 | } |
| 1000 | 1056 | |
| 1001 | 1057 | /* if it's been more than main_speedup_max_cycles cycles, reset our count */ |
| 1002 | 1058 | else |
| 1003 | | |
| 1059 | | |
| 1004 | 1060 | |
| 1005 | 1061 | /* remember the last cycle count */ |
| 1006 | | |
| 1062 | | |
| 1007 | 1063 | |
| 1008 | 1064 | /* return the real value */ |
| 1009 | return * | |
| 1065 | return * | |
| 1010 | 1066 | } |
| 1011 | 1067 | |
| 1012 | 1068 | #endif |
| r14896 | r14897 | |
| 1031 | 1087 | #if ENABLE_SPEEDUP_HACKS |
| 1032 | 1088 | |
| 1033 | 1089 | |
| 1034 | ||
| 1090 | ||
| 1035 | 1091 | { |
| 1036 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 1037 | if (state->m_gpu_command_pending) | |
| 1038 | device_spin_until_interrupt(&space->device()); | |
| 1039 | return *state->m_main_gpu_wait; | |
| 1092 | if (m_gpu_command_pending) | |
| 1093 | device_spin_until_interrupt(&space.device()); | |
| 1094 | return *m_main_gpu_wait; | |
| 1040 | 1095 | } |
| 1041 | 1096 | |
| 1042 | 1097 | #endif |
| r14896 | r14897 | |
| 1058 | 1113 | |
| 1059 | 1114 | #if ENABLE_SPEEDUP_HACKS |
| 1060 | 1115 | |
| 1061 | ||
| 1116 | ||
| 1062 | 1117 | { |
| 1063 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 1064 | UINT64 curcycles = state->m_main_cpu->total_cycles(); | |
| 1118 | UINT64 curcycles = m_main_cpu->total_cycles(); | |
| 1065 | 1119 | |
| 1066 | 1120 | /* store the data */ |
| 1067 | COMBINE_DATA( | |
| 1121 | COMBINE_DATA( | |
| 1068 | 1122 | |
| 1069 | 1123 | /* if it's been less than 400 cycles since the last time */ |
| 1070 | if (* | |
| 1124 | if (* | |
| 1071 | 1125 | { |
| 1072 | 1126 | /* increment the count; if we hit 5, we can spin until an interrupt comes */ |
| 1073 | if ( | |
| 1127 | if ( | |
| 1074 | 1128 | { |
| 1075 | device_spin_until_interrupt(&space->device()); | |
| 1076 | state->m_main_speedup_hits = 0; | |
| 1129 | device_spin_until_interrupt(&space.device()); | |
| 1130 | m_main_speedup_hits = 0; | |
| 1077 | 1131 | } |
| 1078 | 1132 | } |
| 1079 | 1133 | |
| 1080 | 1134 | /* if it's been more than 400 cycles, reset our count */ |
| 1081 | 1135 | else |
| 1082 | | |
| 1136 | | |
| 1083 | 1137 | |
| 1084 | 1138 | /* remember the last cycle count */ |
| 1085 | | |
| 1139 | | |
| 1086 | 1140 | } |
| 1087 | 1141 | |
| 1088 | 1142 | |
| r14896 | r14897 | |
| 1093 | 1147 | against 0 must handle that explicitly. |
| 1094 | 1148 | */ |
| 1095 | 1149 | |
| 1096 | ||
| 1150 | ||
| 1097 | 1151 | { |
| 1098 | cojag_state *state = space->machine().driver_data<cojag_state>(); | |
| 1099 | UINT64 curcycles = state->m_main_cpu->total_cycles(); | |
| 1152 | UINT64 curcycles = m_main_cpu->total_cycles(); | |
| 1100 | 1153 | |
| 1101 | 1154 | /* store the data */ |
| 1102 | COMBINE_DATA(& | |
| 1155 | COMBINE_DATA(& | |
| 1103 | 1156 | |
| 1104 | 1157 | /* if it's been less than 450 cycles since the last time */ |
| 1105 | if ((( | |
| 1158 | if ((( | |
| 1106 | 1159 | { |
| 1107 | 1160 | /* increment the count; if we hit 5, we can spin until an interrupt comes */ |
| 1108 | if ( | |
| 1161 | if ( | |
| 1109 | 1162 | { |
| 1110 | device_spin_until_interrupt(&space->device()); | |
| 1111 | state->m_main_speedup_hits = 0; | |
| 1163 | device_spin_until_interrupt(&space.device()); | |
| 1164 | m_main_speedup_hits = 0; | |
| 1112 | 1165 | } |
| 1113 | 1166 | } |
| 1114 | 1167 | |
| 1115 | 1168 | /* if it's been more than 450 cycles, reset our count */ |
| 1116 | 1169 | else |
| 1117 | | |
| 1170 | | |
| 1118 | 1171 | |
| 1119 | 1172 | /* remember the last cycle count */ |
| 1120 | | |
| 1173 | | |
| 1121 | 1174 | } |
| 1122 | 1175 | |
| 1123 | 1176 | #endif |
| r14896 | r14897 | |
| 1136 | 1189 | // surely these should be 16-bit natively if the standard Jaguar is driven by a plain 68k? |
| 1137 | 1190 | // all these trampolines are not good for performance ;-) |
| 1138 | 1191 | |
| 1139 | static READ16_HANDLER( gpuctrl_r16 ) { if (!(offset&1)) { return gpuctrl_r(space, offset>>1, mem_mask<<16) >> 16; } else { return gpuctrl_r(space, offset>>1, mem_mask); } } | |
| 1140 | static WRITE16_HANDLER( gpuctrl_w16 ) { if (!(offset&1)) { gpuctrl_w(space, offset>>1, data << 16, mem_mask << 16); } else { gpuctrl_w(space, offset>>1, data, mem_mask); } } | |
| 1141 | static READ16_HANDLER( jaguar_blitter_r16 ) { if (!(offset&1)) { return jaguar_blitter_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_blitter_r(space, offset>>1, mem_mask); } } | |
| 1142 | static WRITE16_HANDLER( jaguar_blitter_w16 ) { if (!(offset&1)) { jaguar_blitter_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_blitter_w(space, offset>>1, data, mem_mask); } } | |
| 1143 | static READ16_HANDLER( jaguar_serial_r16 ) { if (!(offset&1)) { return jaguar_serial_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_serial_r(space, offset>>1, mem_mask); } } | |
| 1144 | static WRITE16_HANDLER( jaguar_serial_w16 ) { if (!(offset&1)) { jaguar_serial_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_serial_w(space, offset>>1, data, mem_mask); } } | |
| 1145 | static READ16_HANDLER( dspctrl_r16 ) { if (!(offset&1)) { return dspctrl_r(space, offset>>1, mem_mask<<16) >> 16; } else { return dspctrl_r(space, offset>>1, mem_mask); } } | |
| 1146 | static WRITE16_HANDLER( dspctrl_w16 ) { if (!(offset&1)) { dspctrl_w(space, offset>>1, data << 16, mem_mask << 16); } else { dspctrl_w(space, offset>>1, data, mem_mask); } } | |
| 1147 | static READ16_HANDLER( jaguar_eeprom_cs16 ) { if (!(offset&1)) { return jaguar_eeprom_cs(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_eeprom_cs(space, offset>>1, mem_mask); } } | |
| 1148 | static READ16_HANDLER( jaguar_eeprom_clk16 ) { if (!(offset&1)) { return jaguar_eeprom_clk(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_eeprom_clk(space, offset>>1, mem_mask); } } | |
| 1149 | static WRITE16_HANDLER( jaguar_eeprom_w16 ) { if (!(offset&1)) { jaguar_eeprom_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_eeprom_w(space, offset>>1, data, mem_mask); } } | |
| 1150 | static READ16_HANDLER( joystick_r16 ) { if (!(offset&1)) { return joystick_r(space, offset>>1, mem_mask<<16) >> 16; } else { return joystick_r(space, offset>>1, mem_mask); } } | |
| 1151 | static WRITE16_HANDLER( joystick_w16 ) { if (!(offset&1)) { joystick_w(space, offset>>1, data << 16, mem_mask << 16); } else { joystick_w(space, offset>>1, data, mem_mask); } } | |
| 1192 | READ16_MEMBER(cojag_state::gpuctrl_r16){ if (!(offset&1)) { return gpuctrl_r(space, offset>>1, mem_mask<<16) >> 16; } else { return gpuctrl_r(space, offset>>1, mem_mask); } } | |
| 1193 | WRITE16_MEMBER(cojag_state::gpuctrl_w16){ if (!(offset&1)) { gpuctrl_w(space, offset>>1, data << 16, mem_mask << 16); } else { gpuctrl_w(space, offset>>1, data, mem_mask); } } | |
| 1194 | READ16_MEMBER(cojag_state::jaguar_blitter_r16){ if (!(offset&1)) { return jaguar_blitter_r(&space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_blitter_r(&space, offset>>1, mem_mask); } } | |
| 1195 | WRITE16_MEMBER(cojag_state::jaguar_blitter_w16){ if (!(offset&1)) { jaguar_blitter_w(&space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_blitter_w(&space, offset>>1, data, mem_mask); } } | |
| 1196 | READ16_MEMBER(cojag_state::jaguar_serial_r16){ if (!(offset&1)) { return jaguar_serial_r(&space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_serial_r(&space, offset>>1, mem_mask); } } | |
| 1197 | WRITE16_MEMBER(cojag_state::jaguar_serial_w16){ if (!(offset&1)) { jaguar_serial_w(&space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_serial_w(&space, offset>>1, data, mem_mask); } } | |
| 1198 | READ16_MEMBER(cojag_state::dspctrl_r16){ if (!(offset&1)) { return dspctrl_r(space, offset>>1, mem_mask<<16) >> 16; } else { return dspctrl_r(space, offset>>1, mem_mask); } } | |
| 1199 | WRITE16_MEMBER(cojag_state::dspctrl_w16){ if (!(offset&1)) { dspctrl_w(space, offset>>1, data << 16, mem_mask << 16); } else { dspctrl_w(space, offset>>1, data, mem_mask); } } | |
| 1200 | READ16_MEMBER(cojag_state::jaguar_eeprom_cs16){ if (!(offset&1)) { return jaguar_eeprom_cs(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_eeprom_cs(space, offset>>1, mem_mask); } } | |
| 1201 | READ16_MEMBER(cojag_state::jaguar_eeprom_clk16){ if (!(offset&1)) { return jaguar_eeprom_clk(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_eeprom_clk(space, offset>>1, mem_mask); } } | |
| 1202 | WRITE16_MEMBER(cojag_state::jaguar_eeprom_w16){ if (!(offset&1)) { jaguar_eeprom_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_eeprom_w(space, offset>>1, data, mem_mask); } } | |
| 1203 | READ16_MEMBER(cojag_state::joystick_r16){ if (!(offset&1)) { return joystick_r(space, offset>>1, mem_mask<<16) >> 16; } else { return joystick_r(space, offset>>1, mem_mask); } } | |
| 1204 | WRITE16_MEMBER(cojag_state::joystick_w16){ if (!(offset&1)) { joystick_w(space, offset>>1, data << 16, mem_mask << 16); } else { joystick_w(space, offset>>1, data, mem_mask); } } | |
| 1152 | 1205 | |
| 1153 | static READ32_HANDLER( jaguar_shared_ram_r ) { return jaguar_shared_ram[offset]; } | |
| 1154 | static WRITE32_HANDLER( jaguar_shared_ram_w ) { COMBINE_DATA(&jaguar_shared_ram[offset]); } | |
| 1155 | static READ32_HANDLER( jaguar_rom_base_r ) { return rom_base[offset]; } | |
| 1156 | static WRITE32_HANDLER( jaguar_rom_base_w ) { /*ROM!*/ } | |
| 1157 | static READ32_HANDLER( jaguar_cart_base_r ) { return cart_base[offset]; } | |
| 1158 | static WRITE32_HANDLER( jaguar_cart_base_w ) { /*ROM!*/ } | |
| 1159 | static READ32_HANDLER( high_rom_base_r ) { return high_rom_base[offset]; } | |
| 1160 | static WRITE32_HANDLER( high_rom_base_w ) { /*ROM!*/ } | |
| 1161 | static READ32_HANDLER( jaguar_dsp_ram_r ) { return jaguar_dsp_ram[offset]; } | |
| 1162 | static WRITE32_HANDLER( jaguar_dsp_ram_w ) { COMBINE_DATA(&jaguar_dsp_ram[offset]); } | |
| 1163 | static READ32_HANDLER( jaguar_gpu_clut_r ) { return jaguar_gpu_clut[offset]; } | |
| 1164 | static WRITE32_HANDLER( jaguar_gpu_clut_w ) { COMBINE_DATA(&jaguar_gpu_clut[offset]); } | |
| 1165 | static READ32_HANDLER( jaguar_gpu_ram_r ) { return jaguar_gpu_ram[offset]; } | |
| 1166 | static WRITE32_HANDLER( jaguar_gpu_ram_w ) { COMBINE_DATA(&jaguar_gpu_ram[offset]); } | |
| 1206 | READ32_MEMBER(cojag_state::jaguar_shared_ram_r){ return jaguar_shared_ram[offset]; } | |
| 1207 | WRITE32_MEMBER(cojag_state::jaguar_shared_ram_w){ COMBINE_DATA(&jaguar_shared_ram[offset]); } | |
| 1208 | READ32_MEMBER(cojag_state::jaguar_rom_base_r){ return rom_base[offset]; } | |
| 1209 | WRITE32_MEMBER(cojag_state::jaguar_rom_base_w){ /*ROM!*/ } | |
| 1210 | READ32_MEMBER(cojag_state::jaguar_cart_base_r){ return cart_base[offset]; } | |
| 1211 | WRITE32_MEMBER(cojag_state::jaguar_cart_base_w){ /*ROM!*/ } | |
| 1212 | READ32_MEMBER(cojag_state::high_rom_base_r){ return high_rom_base[offset]; } | |
| 1213 | WRITE32_MEMBER(cojag_state::high_rom_base_w){ /*ROM!*/ } | |
| 1214 | READ32_MEMBER(cojag_state::jaguar_dsp_ram_r){ return jaguar_dsp_ram[offset]; } | |
| 1215 | WRITE32_MEMBER(cojag_state::jaguar_dsp_ram_w){ COMBINE_DATA(&jaguar_dsp_ram[offset]); } | |
| 1216 | READ32_MEMBER(cojag_state::jaguar_gpu_clut_r){ return jaguar_gpu_clut[offset]; } | |
| 1217 | WRITE32_MEMBER(cojag_state::jaguar_gpu_clut_w){ COMBINE_DATA(&jaguar_gpu_clut[offset]); } | |
| 1218 | READ32_MEMBER(cojag_state::jaguar_gpu_ram_r){ return jaguar_gpu_ram[offset]; } | |
| 1219 | WRITE32_MEMBER(cojag_state::jaguar_gpu_ram_w){ COMBINE_DATA(&jaguar_gpu_ram[offset]); } | |
| 1167 | 1220 | |
| 1168 | static READ16_HANDLER( jaguar_shared_ram_r16 ) { if (!(offset&1)) { return jaguar_shared_ram_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_shared_ram_r(space, offset>>1, mem_mask); } } | |
| 1169 | static WRITE16_HANDLER( jaguar_shared_ram_w16 ) { if (!(offset&1)) { jaguar_shared_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_shared_ram_w(space, offset>>1, data, mem_mask); } } | |
| 1170 | static READ16_HANDLER( jaguar_rom_base_r16 ) { if (!(offset&1)) { return jaguar_rom_base_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_rom_base_r(space, offset>>1, mem_mask); } } | |
| 1171 | static WRITE16_HANDLER( jaguar_rom_base_w16 ) { if (!(offset&1)) { jaguar_rom_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_rom_base_w(space, offset>>1, data, mem_mask); } } | |
| 1172 | static READ16_HANDLER( jaguar_cart_base_r16 ) { if (!(offset&1)) { return jaguar_cart_base_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_cart_base_r(space, offset>>1, mem_mask); } } | |
| 1173 | static WRITE16_HANDLER( jaguar_cart_base_w16 ) { if (!(offset&1)) { jaguar_cart_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_cart_base_w(space, offset>>1, data, mem_mask); } } | |
| 1174 | static READ16_HANDLER( high_rom_base_r16 ) { if (!(offset&1)) { return high_rom_base_r(space, offset>>1, mem_mask<<16) >> 16; } else { return high_rom_base_r(space, offset>>1, mem_mask); } } | |
| 1175 | static WRITE16_HANDLER( high_rom_base_w16 ) { if (!(offset&1)) { high_rom_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { high_rom_base_w(space, offset>>1, data, mem_mask); } } | |
| 1221 | READ16_MEMBER(cojag_state::jaguar_shared_ram_r16){ if (!(offset&1)) { return jaguar_shared_ram_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_shared_ram_r(space, offset>>1, mem_mask); } } | |
| 1222 | WRITE16_MEMBER(cojag_state::jaguar_shared_ram_w16){ if (!(offset&1)) { jaguar_shared_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_shared_ram_w(space, offset>>1, data, mem_mask); } } | |
| 1223 | READ16_MEMBER(cojag_state::jaguar_rom_base_r16){ if (!(offset&1)) { return jaguar_rom_base_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_rom_base_r(space, offset>>1, mem_mask); } } | |
| 1224 | WRITE16_MEMBER(cojag_state::jaguar_rom_base_w16){ if (!(offset&1)) { jaguar_rom_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_rom_base_w(space, offset>>1, data, mem_mask); } } | |
| 1225 | READ16_MEMBER(cojag_state::jaguar_cart_base_r16){ if (!(offset&1)) { return jaguar_cart_base_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_cart_base_r(space, offset>>1, mem_mask); } } | |
| 1226 | WRITE16_MEMBER(cojag_state::jaguar_cart_base_w16){ if (!(offset&1)) { jaguar_cart_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_cart_base_w(space, offset>>1, data, mem_mask); } } | |
| 1227 | READ16_MEMBER(cojag_state::high_rom_base_r16){ if (!(offset&1)) { return high_rom_base_r(space, offset>>1, mem_mask<<16) >> 16; } else { return high_rom_base_r(space, offset>>1, mem_mask); } } | |
| 1228 | WRITE16_MEMBER(cojag_state::high_rom_base_w16){ if (!(offset&1)) { high_rom_base_w(space, offset>>1, data << 16, mem_mask << 16); } else { high_rom_base_w(space, offset>>1, data, mem_mask); } } | |
| 1176 | 1229 | |
| 1177 | static READ16_HANDLER( jaguar_dsp_ram_r16 ) { if (!(offset&1)) { return jaguar_dsp_ram_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_dsp_ram_r(space, offset>>1, mem_mask); } } | |
| 1178 | static WRITE16_HANDLER( jaguar_dsp_ram_w16 ) { if (!(offset&1)) { jaguar_dsp_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_dsp_ram_w(space, offset>>1, data, mem_mask); } } | |
| 1179 | static READ16_HANDLER( jaguar_gpu_clut_r16 ) { if (!(offset&1)) { return jaguar_gpu_clut_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_gpu_clut_r(space, offset>>1, mem_mask); } } | |
| 1180 | static WRITE16_HANDLER( jaguar_gpu_clut_w16 ) { if (!(offset&1)) { jaguar_gpu_clut_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_gpu_clut_w(space, offset>>1, data, mem_mask); } } | |
| 1181 | static READ16_HANDLER( jaguar_gpu_ram_r16 ) { if (!(offset&1)) { return jaguar_gpu_ram_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_gpu_ram_r(space, offset>>1, mem_mask); } } | |
| 1182 | static WRITE16_HANDLER( jaguar_gpu_ram_w16 ) { if (!(offset&1)) { jaguar_gpu_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_gpu_ram_w(space, offset>>1, data, mem_mask); } } | |
| 1230 | READ16_MEMBER(cojag_state::jaguar_dsp_ram_r16){ if (!(offset&1)) { return jaguar_dsp_ram_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_dsp_ram_r(space, offset>>1, mem_mask); } } | |
| 1231 | WRITE16_MEMBER(cojag_state::jaguar_dsp_ram_w16){ if (!(offset&1)) { jaguar_dsp_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_dsp_ram_w(space, offset>>1, data, mem_mask); } } | |
| 1232 | READ16_MEMBER(cojag_state::jaguar_gpu_clut_r16){ if (!(offset&1)) { return jaguar_gpu_clut_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_gpu_clut_r(space, offset>>1, mem_mask); } } | |
| 1233 | WRITE16_MEMBER(cojag_state::jaguar_gpu_clut_w16){ if (!(offset&1)) { jaguar_gpu_clut_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_gpu_clut_w(space, offset>>1, data, mem_mask); } } | |
| 1234 | READ16_MEMBER(cojag_state::jaguar_gpu_ram_r16){ if (!(offset&1)) { return jaguar_gpu_ram_r(space, offset>>1, mem_mask<<16) >> 16; } else { return jaguar_gpu_ram_r(space, offset>>1, mem_mask); } } | |
| 1235 | WRITE16_MEMBER(cojag_state::jaguar_gpu_ram_w16){ if (!(offset&1)) { jaguar_gpu_ram_w(space, offset>>1, data << 16, mem_mask << 16); } else { jaguar_gpu_ram_w(space, offset>>1, data, mem_mask); } } | |
| 1183 | 1236 | |
| 1184 | 1237 | static ADDRESS_MAP_START( jaguar_map, AS_PROGRAM, 16, cojag_state ) |
| 1185 | 1238 | ADDRESS_MAP_GLOBAL_MASK(0xffffff) |
| 1186 | AM_RANGE(0x000000, 0x1fffff) AM_MIRROR(0x200000) AM_READWRITE_LEGACY(jaguar_shared_ram_r16, jaguar_shared_ram_w16 ); | |
| 1187 | AM_RANGE(0x800000, 0xdfffff) AM_READWRITE_LEGACY(jaguar_cart_base_r16, jaguar_cart_base_w16 ) | |
| 1188 | AM_RANGE(0xe00000, 0xe1ffff) AM_READWRITE_LEGACY(jaguar_rom_base_r16, jaguar_rom_base_w16 ) | |
| 1239 | AM_RANGE(0x000000, 0x1fffff) AM_MIRROR(0x200000) AM_READWRITE(jaguar_shared_ram_r16, jaguar_shared_ram_w16 ); | |
| 1240 | AM_RANGE(0x800000, 0xdfffff) AM_READWRITE(jaguar_cart_base_r16, jaguar_cart_base_w16 ) | |
| 1241 | AM_RANGE(0xe00000, 0xe1ffff) AM_READWRITE(jaguar_rom_base_r16, jaguar_rom_base_w16 ) | |
| 1189 | 1242 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE_LEGACY(jaguar_tom_regs_r, jaguar_tom_regs_w) // might be reversed endian of the others.. |
| 1190 | AM_RANGE(0xf00400, 0xf005ff) AM_MIRROR(0x000200) AM_READWRITE_LEGACY(jaguar_gpu_clut_r16, jaguar_gpu_clut_w16 ) | |
| 1191 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE_LEGACY(gpuctrl_r16, gpuctrl_w16) | |
| 1192 | AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE_LEGACY(jaguar_blitter_r16, jaguar_blitter_w16) | |
| 1193 | AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_READWRITE_LEGACY(jaguar_gpu_ram_r16, jaguar_gpu_ram_w16 ) | |
| 1243 | AM_RANGE(0xf00400, 0xf005ff) AM_MIRROR(0x000200) AM_READWRITE(jaguar_gpu_clut_r16, jaguar_gpu_clut_w16 ) | |
| 1244 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE(gpuctrl_r16, gpuctrl_w16) | |
| 1245 | AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_blitter_r16, jaguar_blitter_w16) | |
| 1246 | AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_READWRITE(jaguar_gpu_ram_r16, jaguar_gpu_ram_w16 ) | |
| 1194 | 1247 | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE_LEGACY(jaguar_jerry_regs_r, jaguar_jerry_regs_w) // might be reversed endian of the others.. |
| 1195 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE_LEGACY(joystick_r16, joystick_w16) | |
| 1196 | AM_RANGE(0xf14800, 0xf14803) AM_READWRITE_LEGACY(jaguar_eeprom_clk16,jaguar_eeprom_w16) // GPI00 | |
| 1197 | AM_RANGE(0xf15000, 0xf15003) AM_READ_LEGACY(jaguar_eeprom_cs16) // GPI01 | |
| 1198 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE_LEGACY(dspctrl_r16, dspctrl_w16) | |
| 1199 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE_LEGACY(jaguar_serial_r16, jaguar_serial_w16) | |
| 1200 | AM_RANGE(0xf1b000, 0xf1cfff) AM_READWRITE_LEGACY(jaguar_dsp_ram_r16, jaguar_dsp_ram_w16) | |
| 1201 | AM_RANGE(0xf1d000, 0xf1dfff) AM_READWRITE_LEGACY(high_rom_base_r16, high_rom_base_w16 ) | |
| 1248 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r16, joystick_w16) | |
| 1249 | AM_RANGE(0xf14800, 0xf14803) AM_READWRITE(jaguar_eeprom_clk16,jaguar_eeprom_w16) // GPI00 | |
| 1250 | AM_RANGE(0xf15000, 0xf15003) AM_READ(jaguar_eeprom_cs16) // GPI01 | |
| 1251 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r16, dspctrl_w16) | |
| 1252 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE(jaguar_serial_r16, jaguar_serial_w16) | |
| 1253 | AM_RANGE(0xf1b000, 0xf1cfff) AM_READWRITE(jaguar_dsp_ram_r16, jaguar_dsp_ram_w16) | |
| 1254 | AM_RANGE(0xf1d000, 0xf1dfff) AM_READWRITE(high_rom_base_r16, high_rom_base_w16 ) | |
| 1202 | 1255 | ADDRESS_MAP_END |
| 1203 | 1256 | |
| 1204 | 1257 | |
| r14896 | r14897 | |
| 1216 | 1269 | AM_RANGE(0x04e00000, 0x04e003ff) AM_DEVREADWRITE_LEGACY("ide", ide_controller32_r, ide_controller32_w) |
| 1217 | 1270 | AM_RANGE(0x04f00000, 0x04f003ff) AM_READWRITE_LEGACY(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 1218 | 1271 | AM_RANGE(0x04f00400, 0x04f007ff) AM_RAM AM_BASE_LEGACY(&jaguar_gpu_clut) AM_SHARE("share2") |
| 1219 | AM_RANGE(0x04f02100, 0x04f021ff) AM_READWRITE | |
| 1272 | AM_RANGE(0x04f02100, 0x04f021ff) AM_READWRITE | |
| 1220 | 1273 | AM_RANGE(0x04f02200, 0x04f022ff) AM_READWRITE_LEGACY(jaguar_blitter_r, jaguar_blitter_w) |
| 1221 | 1274 | AM_RANGE(0x04f03000, 0x04f03fff) AM_MIRROR(0x00008000) AM_RAM AM_BASE_LEGACY(&jaguar_gpu_ram) AM_SHARE("share3") |
| 1222 | 1275 | AM_RANGE(0x04f10000, 0x04f103ff) AM_READWRITE_LEGACY(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| 1223 | 1276 | AM_RANGE(0x04f16000, 0x04f1600b) AM_READ_LEGACY(cojag_gun_input_r) // GPI02 |
| 1224 | 1277 | AM_RANGE(0x04f17000, 0x04f17003) AM_READ_PORT("SYSTEM") // GPI03 |
| 1225 | AM_RANGE(0x04f17800, 0x04f17803) AM_WRITE | |
| 1278 | AM_RANGE(0x04f17800, 0x04f17803) AM_WRITE | |
| 1226 | 1279 | AM_RANGE(0x04f17c00, 0x04f17c03) AM_READ_PORT("P1_P2") // GPI05 |
| 1227 | AM_RANGE(0x04f1a100, 0x04f1a13f) AM_READWRITE | |
| 1280 | AM_RANGE(0x04f1a100, 0x04f1a13f) AM_READWRITE | |
| 1228 | 1281 | AM_RANGE(0x04f1a140, 0x04f1a17f) AM_READWRITE_LEGACY(jaguar_serial_r, jaguar_serial_w) |
| 1229 | 1282 | AM_RANGE(0x04f1b000, 0x04f1cfff) AM_RAM AM_BASE_LEGACY(&jaguar_dsp_ram) AM_SHARE("share4") |
| 1230 | 1283 | |
| 1231 | AM_RANGE(0x06000000, 0x06000003) AM_READWRITE | |
| 1284 | AM_RANGE(0x06000000, 0x06000003) AM_READWRITE | |
| 1232 | 1285 | AM_RANGE(0x10000000, 0x1007ffff) AM_RAM |
| 1233 | 1286 | AM_RANGE(0x12000000, 0x120fffff) AM_RAM // tested in self-test only? |
| 1234 | 1287 | AM_RANGE(0x14000004, 0x14000007) AM_WRITE(watchdog_reset32_w) |
| 1235 | AM_RANGE(0x16000000, 0x16000003) AM_WRITE_LEGACY(eeprom_enable_w) | |
| 1236 | AM_RANGE(0x18000000, 0x18001fff) AM_READWRITE_LEGACY(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram") | |
| 1237 | AM_RANGE(0x1fc00000, 0x1fdfffff) AM_ROM AM_REGION("user1", 0) AM_BASE(m_rom_base) | |
| 1288 | AM_RANGE(0x16000000, 0x16000003) AM_WRITE(eeprom_enable_w) | |
| 1289 | AM_RANGE(0x18000000, 0x18001fff) AM_READWRITE(eeprom_data_r, eeprom_data_w) AM_SHARE("nvram") | |
| 1290 | AM_RANGE(0x1fc00000, 0x1fdfffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("robase") | |
| 1238 | 1291 | ADDRESS_MAP_END |
| 1239 | 1292 | |
| 1240 | 1293 | |
| 1241 | 1294 | static ADDRESS_MAP_START( m68020_map, AS_PROGRAM, 32, cojag_state ) |
| 1242 | 1295 | AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_BASE_LEGACY(&jaguar_shared_ram) AM_SHARE("share1") |
| 1243 | AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION("user1", 0) AM_ | |
| 1296 | AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION("user1", 0) AM_ | |
| 1244 | 1297 | AM_RANGE(0xa00000, 0xa1ffff) AM_RAM |
| 1245 | AM_RANGE(0xa20000, 0xa21fff) AM_READWRITE | |
| 1298 | AM_RANGE(0xa20000, 0xa21fff) AM_READWRITE | |
| 1246 | 1299 | AM_RANGE(0xa30000, 0xa30003) AM_WRITE(watchdog_reset32_w) |
| 1247 | AM_RANGE(0xa40000, 0xa40003) AM_WRITE_LEGACY(eeprom_enable_w) | |
| 1248 | AM_RANGE(0xb70000, 0xb70003) AM_READWRITE_LEGACY(misc_control_r, misc_control_w) | |
| 1300 | AM_RANGE(0xa40000, 0xa40003) AM_WRITE(eeprom_enable_w) | |
| 1301 | AM_RANGE(0xb70000, 0xb70003) AM_READWRITE(misc_control_r, misc_control_w) | |
| 1249 | 1302 | AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank2") |
| 1250 | 1303 | AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE_LEGACY("ide", ide_controller32_r, ide_controller32_w) |
| 1251 | 1304 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE_LEGACY(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 1252 | 1305 | AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE_LEGACY(&jaguar_gpu_clut) AM_SHARE("share2") |
| 1253 | AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE | |
| 1306 | AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE | |
| 1254 | 1307 | AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE_LEGACY(jaguar_blitter_r, jaguar_blitter_w) |
| 1255 | 1308 | AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_BASE_LEGACY(&jaguar_gpu_ram) AM_SHARE("share3") |
| 1256 | 1309 | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE_LEGACY(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| 1257 | 1310 | AM_RANGE(0xf16000, 0xf1600b) AM_READ_LEGACY(cojag_gun_input_r) // GPI02 |
| 1258 | 1311 | AM_RANGE(0xf17000, 0xf17003) AM_READ_PORT("SYSTEM") // GPI03 |
| 1259 | // AM_RANGE(0xf17800, 0xf17803) AM_WRITE | |
| 1312 | // AM_RANGE(0xf17800, 0xf17803) AM_WRITE | |
| 1260 | 1313 | AM_RANGE(0xf17c00, 0xf17c03) AM_READ_PORT("P1_P2") // GPI05 |
| 1261 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE | |
| 1314 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE | |
| 1262 | 1315 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE_LEGACY(jaguar_serial_r, jaguar_serial_w) |
| 1263 | 1316 | AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_BASE_LEGACY(&jaguar_dsp_ram) AM_SHARE("share4") |
| 1264 | 1317 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1278 | 1331 | AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE_LEGACY("ide", ide_controller32_r, ide_controller32_w) |
| 1279 | 1332 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE_LEGACY(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 1280 | 1333 | AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_SHARE("share2") |
| 1281 | AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE | |
| 1334 | AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE | |
| 1282 | 1335 | AM_RANGE(0xf02200, 0xf022ff) AM_READWRITE_LEGACY(jaguar_blitter_r, jaguar_blitter_w) |
| 1283 | 1336 | AM_RANGE(0xf03000, 0xf03fff) AM_RAM AM_SHARE("share3") |
| 1284 | 1337 | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE_LEGACY(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| r14896 | r14897 | |
| 1297 | 1350 | AM_RANGE(0x800000, 0xbfffff) AM_ROMBANK("bank8") |
| 1298 | 1351 | AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK("bank9") |
| 1299 | 1352 | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE_LEGACY(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| 1300 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE | |
| 1353 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE | |
| 1301 | 1354 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE_LEGACY(jaguar_serial_r, jaguar_serial_w) |
| 1302 | 1355 | AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_SHARE("share4") |
| 1303 | AM_RANGE(0xf1d000, 0xf1dfff) AM_READ | |
| 1356 | AM_RANGE(0xf1d000, 0xf1dfff) AM_READ | |
| 1304 | 1357 | ADDRESS_MAP_END |
| 1305 | 1358 | |
| 1306 | 1359 | /* ToDo, these maps SHOULD be merged with the ones above */ |
| r14896 | r14897 | |
| 1312 | 1365 | AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_BASE_LEGACY(&rom_base) AM_SIZE_LEGACY(&rom_size) AM_SHARE("share16") AM_REGION("maincpu", 0xe00000) |
| 1313 | 1366 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE_LEGACY(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 1314 | 1367 | AM_RANGE(0xf00400, 0xf005ff) AM_BASE_LEGACY(&jaguar_gpu_clut) AM_MIRROR(0x000200) AM_RAM AM_SHARE("share2") |
| 1315 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE | |
| 1368 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE | |
| 1316 | 1369 | AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE_LEGACY(jaguar_blitter_r, jaguar_blitter_w) |
| 1317 | 1370 | AM_RANGE(0xf03000, 0xf03fff) AM_BASE_LEGACY(&jaguar_gpu_ram) AM_MIRROR(0x008000) AM_RAM AM_SHARE("share3") |
| 1318 | 1371 | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE_LEGACY(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| 1319 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE_LEGACY(joystick_r, joystick_w) | |
| 1320 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE_LEGACY(dspctrl_r, dspctrl_w) | |
| 1372 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w) | |
| 1373 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w) | |
| 1321 | 1374 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE_LEGACY(jaguar_serial_r, jaguar_serial_w) |
| 1322 | 1375 | AM_RANGE(0xf1b000, 0xf1cfff) AM_BASE_LEGACY(&jaguar_dsp_ram) AM_RAM AM_SHARE("share4") |
| 1323 | 1376 | AM_RANGE(0xf1d000, 0xf1dfff) AM_ROM AM_BASE_LEGACY(&high_rom_base) AM_REGION("maincpu", 0xf1d000) |
| r14896 | r14897 | |
| 1330 | 1383 | AM_RANGE(0xe00000, 0xe1ffff) AM_ROM AM_SHARE("share16") AM_REGION("maincpu", 0xe00000) |
| 1331 | 1384 | AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE_LEGACY(jaguar_tom_regs32_r, jaguar_tom_regs32_w) |
| 1332 | 1385 | AM_RANGE(0xf00400, 0xf005ff) AM_MIRROR(0x000200) AM_RAM AM_SHARE("share2") |
| 1333 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE | |
| 1386 | AM_RANGE(0xf02100, 0xf021ff) AM_MIRROR(0x008000) AM_READWRITE | |
| 1334 | 1387 | AM_RANGE(0xf02200, 0xf022ff) AM_MIRROR(0x008000) AM_READWRITE_LEGACY(jaguar_blitter_r, jaguar_blitter_w) |
| 1335 | 1388 | AM_RANGE(0xf03000, 0xf03fff) AM_MIRROR(0x008000) AM_RAM AM_SHARE("share3") |
| 1336 | 1389 | AM_RANGE(0xf10000, 0xf103ff) AM_READWRITE_LEGACY(jaguar_jerry_regs32_r, jaguar_jerry_regs32_w) |
| 1337 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE_LEGACY(joystick_r, joystick_w) | |
| 1338 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE_LEGACY(dspctrl_r, dspctrl_w) | |
| 1390 | AM_RANGE(0xf14000, 0xf14003) AM_READWRITE(joystick_r, joystick_w) | |
| 1391 | AM_RANGE(0xf1a100, 0xf1a13f) AM_READWRITE(dspctrl_r, dspctrl_w) | |
| 1339 | 1392 | AM_RANGE(0xf1a140, 0xf1a17f) AM_READWRITE_LEGACY(jaguar_serial_r, jaguar_serial_w) |
| 1340 | 1393 | AM_RANGE(0xf1b000, 0xf1cfff) AM_RAM AM_SHARE("share4") |
| 1341 | 1394 | AM_RANGE(0xf1d000, 0xf1dfff) AM_ROM AM_REGION("maincpu", 0xf1d000) |
| r14896 | r14897 | |
| 2301 | 2354 | |
| 2302 | 2355 | /* install synchronization hooks for GPU */ |
| 2303 | 2356 | if (cojag_is_r3000) |
| 2304 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2357 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2305 | 2358 | else |
| 2306 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, FUNC(gpu_jump_w)); | |
| 2307 | machine.device("gpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, FUNC(gpu_jump_r)); | |
| 2359 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, write32_delegate(FUNC(cojag_state::gpu_jump_w),state)); | |
| 2360 | machine.device("gpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, read32_delegate(FUNC(cojag_state::gpu_jump_r),state)); | |
| 2308 | 2361 | state->m_gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4]; |
| 2309 | 2362 | state->m_gpu_spin_pc = 0xf03000 + spin_pc; |
| 2310 | 2363 | |
| r14896 | r14897 | |
| 2323 | 2376 | cojag_state *state = machine.driver_data<cojag_state>(); |
| 2324 | 2377 | |
| 2325 | 2378 | /* install speedup for main CPU */ |
| 2326 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2379 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2327 | 2380 | } |
| 2328 | 2381 | #endif |
| 2329 | 2382 | } |
| r14896 | r14897 | |
| 2340 | 2393 | |
| 2341 | 2394 | /* install speedup for main CPU */ |
| 2342 | 2395 | state->m_main_speedup_max_cycles = 120; |
| 2343 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2396 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2344 | 2397 | } |
| 2345 | 2398 | #endif |
| 2346 | 2399 | } |
| r14896 | r14897 | |
| 2352 | 2405 | cojag_common_init(machine, 0x0c0, 0x09e); |
| 2353 | 2406 | |
| 2354 | 2407 | /* patch the protection */ |
| 2355 | state->m_rom_base[0x220/4] = 0x03e00008; | |
| 2408 | state->m_rom_base.target()[0x220/4] = 0x03e00008; | |
| 2356 | 2409 | |
| 2357 | 2410 | #if ENABLE_SPEEDUP_HACKS |
| 2358 | 2411 | /* install speedup for main CPU */ |
| 2359 | 2412 | state->m_main_speedup_max_cycles = 120; |
| 2360 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2413 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2361 | 2414 | #endif |
| 2362 | 2415 | } |
| 2363 | 2416 | |
| r14896 | r14897 | |
| 2369 | 2422 | cojag_common_init(machine, 0x0c0, 0x09e); |
| 2370 | 2423 | |
| 2371 | 2424 | /* patch the protection */ |
| 2372 | state->m_rom_base[0x418/4] = 0x4e754e75; | |
| 2425 | state->m_rom_base.target()[0x418/4] = 0x4e754e75; | |
| 2373 | 2426 | |
| 2374 | 2427 | #if ENABLE_SPEEDUP_HACKS |
| 2375 | 2428 | /* install speedup for main CPU */ |
| 2376 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2429 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2377 | 2430 | #endif |
| 2378 | 2431 | } |
| 2379 | 2432 | |
| r14896 | r14897 | |
| 2385 | 2438 | cojag_common_init(machine, 0x0c0, 0x09e); |
| 2386 | 2439 | |
| 2387 | 2440 | /* patch the protection */ |
| 2388 | state->m_rom_base[0x220/4] = 0x03e00008; | |
| 2441 | state->m_rom_base.target()[0x220/4] = 0x03e00008; | |
| 2389 | 2442 | |
| 2390 | 2443 | #if ENABLE_SPEEDUP_HACKS |
| 2391 | 2444 | /* install speedup for main CPU */ |
| 2392 | 2445 | state->m_main_speedup_max_cycles = 120; |
| 2393 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2446 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2394 | 2447 | #endif |
| 2395 | 2448 | } |
| 2396 | 2449 | |
| r14896 | r14897 | |
| 2406 | 2459 | |
| 2407 | 2460 | /* install speedup for main CPU */ |
| 2408 | 2461 | state->m_main_speedup_max_cycles = 200; |
| 2409 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2462 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2410 | 2463 | } |
| 2411 | 2464 | #endif |
| 2412 | 2465 | } |
| r14896 | r14897 | |
| 2423 | 2476 | /* install speedup for main CPU */ |
| 2424 | 2477 | state->m_main_speedup_max_cycles = 200; |
| 2425 | 2478 | if (main_speedup_addr != 0) |
| 2426 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(main_speedup_addr, main_speedup_addr + 3, FUNC(cojagr3k_main_speedup_r)); | |
| 2427 | state->m_main_gpu_wait = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0400d900, 0x0400d900 + 3, FUNC(main_gpu_wait_r)); | |
| 2479 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(main_speedup_addr, main_speedup_addr + 3, read32_delegate(FUNC(cojag_state::cojagr3k_main_speedup_r),state)); | |
| 2480 | state->m_main_gpu_wait = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0400d900, 0x0400d900 + 3, read32_delegate(FUNC(cojag_state::main_gpu_wait_r),state)); | |
| 2428 | 2481 | } |
| 2429 | 2482 | #endif |
| 2430 | 2483 | } |
| r14896 | r14897 | |
| 2448 | 2501 | |
| 2449 | 2502 | /* install speedup for main CPU */ |
| 2450 | 2503 | state->m_main_speedup_max_cycles = 50; |
| 2451 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2504 | state->m_main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2452 | 2505 | } |
| 2453 | 2506 | #endif |
| 2454 | 2507 | } |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | { |
| 51 | 51 | public: |
| 52 | 52 | onetwo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | : driver_device(mconfig, type, tag) { } | |
| 53 | : driver_device(mconfig, type, tag) , | |
| 54 | m_paletteram(*this, "paletteram"), | |
| 55 | m_paletteram2(*this, "paletteram2"), | |
| 56 | m_fgram(*this, "fgram"){ } | |
| 54 | 57 | |
| 55 | 58 | /* memory pointers */ |
| 56 | UINT8 * m_fgram; | |
| 57 | UINT8 * m_paletteram; | |
| 58 | UINT8 * m_paletteram2; | |
| 59 | required_shared_ptr<UINT8> m_paletteram; | |
| 60 | required_shared_ptr<UINT8> m_paletteram2; | |
| 61 | required_shared_ptr<UINT8> m_fgram; | |
| 59 | 62 | |
| 60 | 63 | /* video-related */ |
| 61 | 64 | tilemap_t *m_fg_tilemap; |
| r14896 | r14897 | |
| 82 | 85 | static TILE_GET_INFO( get_fg_tile_info ) |
| 83 | 86 | { |
| 84 | 87 | onetwo_state *state = machine.driver_data<onetwo_state>(); |
| 85 | int code = (state->m_fgram[tile_index * 2 + 1] << 8) | state->m_fgram[tile_index * 2]; | |
| 86 | int color = (state->m_fgram[tile_index * 2 + 1] & 0x80) >> 7; | |
| 88 | int code = (state->m_fgram.target()[tile_index * 2 + 1] << 8) | state->m_fgram.target()[tile_index * 2]; | |
| 89 | int color = (state->m_fgram.target()[tile_index * 2 + 1] & 0x80) >> 7; | |
| 87 | 90 | |
| 88 | 91 | code &= 0x7fff; |
| 89 | 92 | |
| r14896 | r14897 | |
| 111 | 114 | |
| 112 | 115 | WRITE8_MEMBER(onetwo_state::onetwo_fgram_w) |
| 113 | 116 | { |
| 114 | m_fgram[offset] = data; | |
| 117 | m_fgram.target()[offset] = data; | |
| 115 | 118 | m_fg_tilemap->mark_tile_dirty(offset / 2); |
| 116 | 119 | } |
| 117 | 120 | |
| r14896 | r14897 | |
| 129 | 132 | |
| 130 | 133 | WRITE8_MEMBER(onetwo_state::onetwo_soundlatch_w) |
| 131 | 134 | { |
| 132 | soundlatch_w(space, 0, data); | |
| 135 | soundlatch_byte_w(space, 0, data); | |
| 133 | 136 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 134 | 137 | } |
| 135 | 138 | |
| r14896 | r14897 | |
| 138 | 141 | onetwo_state *state = machine.driver_data<onetwo_state>(); |
| 139 | 142 | int r, g, b; |
| 140 | 143 | |
| 141 | r = state->m_paletteram[offset] & 0x1f; | |
| 142 | g = state->m_paletteram2[offset] & 0x1f; | |
| 143 | b = ((state->m_paletteram[offset] & 0x60) >> 2) | ((state->m_paletteram2[offset] & 0xe0) >> 5); | |
| 144 | r = state->m_paletteram.target()[offset] & 0x1f; | |
| 145 | g = state->m_paletteram2.target()[offset] & 0x1f; | |
| 146 | b = ((state->m_paletteram.target()[offset] & 0x60) >> 2) | ((state->m_paletteram2.target()[offset] & 0xe0) >> 5); | |
| 144 | 147 | palette_set_color_rgb(machine, offset, pal5bit(r), pal5bit(g), pal5bit(b)); |
| 145 | 148 | } |
| 146 | 149 | |
| 147 | 150 | WRITE8_MEMBER(onetwo_state::palette1_w) |
| 148 | 151 | { |
| 149 | m_paletteram[offset] = data; | |
| 152 | m_paletteram.target()[offset] = data; | |
| 150 | 153 | set_color(machine(), offset); |
| 151 | 154 | } |
| 152 | 155 | |
| 153 | 156 | WRITE8_MEMBER(onetwo_state::palette2_w) |
| 154 | 157 | { |
| 155 | m_paletteram2[offset] = data; | |
| 158 | m_paletteram2.target()[offset] = data; | |
| 156 | 159 | set_color(machine(), offset); |
| 157 | 160 | } |
| 158 | 161 | |
| r14896 | r14897 | |
| 165 | 168 | static ADDRESS_MAP_START( main_cpu, AS_PROGRAM, 8, onetwo_state ) |
| 166 | 169 | AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION("maincpu", 0x10000) |
| 167 | 170 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 168 | AM_RANGE(0xc800, 0xc87f) AM_RAM_WRITE(palette1_w) AM_BASE(m_paletteram) | |
| 169 | AM_RANGE(0xc900, 0xc97f) AM_RAM_WRITE(palette2_w) AM_BASE(m_paletteram2) | |
| 170 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(onetwo_fgram_w) AM_BASE(m_fgram) | |
| 171 | AM_RANGE(0xc800, 0xc87f) AM_RAM_WRITE(palette1_w) AM_SHARE("paletteram") | |
| 172 | AM_RANGE(0xc900, 0xc97f) AM_RAM_WRITE(palette2_w) AM_SHARE("paletteram2") | |
| 173 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(onetwo_fgram_w) AM_SHARE("fgram") | |
| 171 | 174 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 172 | 175 | ADDRESS_MAP_END |
| 173 | 176 | |
| r14896 | r14897 | |
| 183 | 186 | static ADDRESS_MAP_START( sound_cpu, AS_PROGRAM, 8, onetwo_state ) |
| 184 | 187 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 185 | 188 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 186 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 189 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 187 | 190 | ADDRESS_MAP_END |
| 188 | 191 | |
| 189 | 192 | static ADDRESS_MAP_START( sound_cpu_io, AS_IO, 8, onetwo_state ) |
| r14896 | r14897 | |
| 191 | 194 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_status_port_r, ym3812_control_port_w) |
| 192 | 195 | AM_RANGE(0x20, 0x20) AM_DEVWRITE_LEGACY("ymsnd", ym3812_write_port_w) |
| 193 | 196 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 194 | AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_clear_w) | |
| 197 | AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_clear_byte_w) | |
| 195 | 198 | ADDRESS_MAP_END |
| 196 | 199 | |
| 197 | 200 | /************************************* |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P2") |
| 51 | 51 | AM_RANGE(0x3003, 0x3003) AM_READ_PORT("DSW1") |
| 52 | 52 | AM_RANGE(0x3004, 0x3004) AM_READ_PORT("DSW2") |
| 53 | AM_RANGE(0x3800, 0x38ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split2_w) AM_SHARE("paletteram2") | |
| 54 | AM_RANGE(0x3900, 0x39ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_split1_w) AM_SHARE("paletteram") | |
| 55 | AM_RANGE(0x3a00, 0x3a00) AM_WRITE(soundlatch_w) | |
| 53 | AM_RANGE(0x3800, 0x38ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 54 | AM_RANGE(0x3900, 0x39ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_split_lo_w) AM_SHARE("paletteram") | |
| 55 | AM_RANGE(0x3a00, 0x3a00) AM_WRITE(soundlatch_byte_w) | |
| 56 | 56 | AM_RANGE(0x3b08, 0x3b09) AM_WRITE(gng_bgscrollx_w) |
| 57 | 57 | AM_RANGE(0x3b0a, 0x3b0b) AM_WRITE(gng_bgscrolly_w) |
| 58 | 58 | AM_RANGE(0x3c00, 0x3c00) AM_NOP /* watchdog? */ |
| r14896 | r14897 | |
| 69 | 69 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gng_state ) |
| 70 | 70 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 71 | 71 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 72 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) | |
| 72 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) | |
| 73 | 73 | AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 74 | 74 | AM_RANGE(0xe002, 0xe003) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 75 | 75 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 516 | 516 | ROM_END |
| 517 | 517 | |
| 518 | 518 | /*------------------------------------------------------------------- |
| 519 | / Street Fighter | |
| 519 | / Street Fighter II | |
| 520 | 520 | /-------------------------------------------------------------------*/ |
| 521 | 521 | ROM_START(sfight2) |
| 522 | 522 | ROM_REGION(0x10000, "maincpu", 0) |
| r14896 | r14897 | |
| 941 | 941 | GAME(1995, stargatp2, stargatp, gts3, gts3, gts3, ROT0, "Gottlieb", "Stargate (rev.2)", GAME_IS_SKELETON_MECHANICAL) |
| 942 | 942 | GAME(1995, stargatp3, stargatp, gts3, gts3, gts3, ROT0, "Gottlieb", "Stargate (rev.3)", GAME_IS_SKELETON_MECHANICAL) |
| 943 | 943 | GAME(1995, stargatp4, stargatp, gts3, gts3, gts3, ROT0, "Gottlieb", "Stargate (rev.4)", GAME_IS_SKELETON_MECHANICAL) |
| 944 | GAME(1993, sfight2, 0, gts3, gts3, gts3, ROT0, "Gottlieb", "Street Fighter 2", GAME_IS_SKELETON_MECHANICAL) | |
| 945 | GAME(1993, sfight2a, sfight2, gts3, gts3, gts3, ROT0, "Gottlieb", "Street Fighter 2 (rev.1)", GAME_IS_SKELETON_MECHANICAL) | |
| 946 | GAME(1993, sfight2b, sfight2, gts3, gts3, gts3, ROT0, "Gottlieb", "Street Fighter 2 (rev.2)", GAME_IS_SKELETON_MECHANICAL) | |
| 944 | GAME(1993, sfight2, 0, gts3, gts3, gts3, ROT0, "Gottlieb", "Street Fighter II", GAME_IS_SKELETON_MECHANICAL) | |
| 945 | GAME(1993, sfight2a, sfight2, gts3, gts3, gts3, ROT0, "Gottlieb", "Street Fighter II (rev.1)", GAME_IS_SKELETON_MECHANICAL) | |
| 946 | GAME(1993, sfight2b, sfight2, gts3, gts3, gts3, ROT0, "Gottlieb", "Street Fighter II (rev.2)", GAME_IS_SKELETON_MECHANICAL) | |
| 947 | 947 | GAME(1992, smb, 0, gts3, gts3, gts3, ROT0, "Gottlieb", "Super Mario Brothers", GAME_IS_SKELETON_MECHANICAL) |
| 948 | 948 | GAME(1992, smb1, smb, gts3, gts3, gts3, ROT0, "Gottlieb", "Super Mario Brothers (rev.1)", GAME_IS_SKELETON_MECHANICAL) |
| 949 | 949 | GAME(1992, smb2, smb, gts3, gts3, gts3, ROT0, "Gottlieb", "Super Mario Brothers (rev.2)", GAME_IS_SKELETON_MECHANICAL) |
| r14896 | r14897 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | WRITE8_MEMBER(wc90b_state::wc90b_sound_command_w) |
| 118 | 118 | { |
| 119 | soundlatch_w(space, offset, data); | |
| 119 | soundlatch_byte_w(space, offset, data); | |
| 120 | 120 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 121 | 121 | } |
| 122 | 122 | |
| r14896 | r14897 | |
| 164 | 164 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 165 | 165 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 166 | 166 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 167 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_SHARE("paletteram") | |
| 167 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("paletteram") | |
| 168 | 168 | AM_RANGE(0xe800, 0xefff) AM_ROM |
| 169 | 169 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("bank2") |
| 170 | 170 | AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE("share1") |
| r14896 | r14897 | |
| 178 | 178 | AM_RANGE(0xe400, 0xe400) AM_WRITE(adpcm_data_w) |
| 179 | 179 | AM_RANGE(0xe800, 0xe801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 180 | 180 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 181 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 181 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 182 | 182 | ADDRESS_MAP_END |
| 183 | 183 | |
| 184 | 184 |
| r14896 | r14897 | |
|---|---|---|
| 314 | 314 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 315 | 315 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 316 | 316 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| 317 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 317 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 318 | 318 | AM_RANGE(0xc000, 0xc000) AM_WRITENOP //irq ack |
| 319 | 319 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 320 | 320 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 326 | 326 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 327 | 327 | AM_RANGE(0x7000, 0x7000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 328 | 328 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| 329 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_r) | |
| 329 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) | |
| 330 | 330 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 331 | 331 | ADDRESS_MAP_END |
| 332 | 332 |
| r14896 | r14897 | |
|---|---|---|
| 106 | 106 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") |
| 107 | 107 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") |
| 108 | 108 | AM_RANGE(0xc4c9, 0xc4cb) AM_READ(gunsmoke_protection_r) |
| 109 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) | |
| 109 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) | |
| 110 | 110 | AM_RANGE(0xc804, 0xc804) AM_WRITE(gunsmoke_c804_w) // ROM bank switch, screen flip |
| 111 | 111 | AM_RANGE(0xc806, 0xc806) AM_WRITE(watchdog_reset_w) |
| 112 | 112 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(gunsmoke_videoram_w) AM_BASE(m_videoram) |
| r14896 | r14897 | |
| 121 | 121 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gunsmoke_state ) |
| 122 | 122 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 123 | 123 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 124 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) | |
| 124 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) | |
| 125 | 125 | AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 126 | 126 | AM_RANGE(0xe002, 0xe003) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 127 | 127 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 1379 | 1379 | /*------------------------------ |
| 1380 | 1380 | timer write handler |
| 1381 | 1381 | ------------------------------*/ |
| 1382 | ||
| 1382 | ||
| 1383 | 1383 | { |
| 1384 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1385 | uPD71054_state *uPD71054 = &state->m_uPD71054; | |
| 1384 | uPD71054_state *uPD71054 = &m_uPD71054; | |
| 1386 | 1385 | |
| 1387 | 1386 | data &= 0xff; |
| 1388 | 1387 | |
| r14896 | r14897 | |
| 1401 | 1400 | uPD71054->max[offset] = (uPD71054->max[offset]&0x00ff)+(data<<8); |
| 1402 | 1401 | } |
| 1403 | 1402 | if( uPD71054->max[offset] != 0 ) { |
| 1404 | uPD71054_update_timer( | |
| 1403 | uPD71054_update_timer( | |
| 1405 | 1404 | } |
| 1406 | 1405 | break; |
| 1407 | 1406 | case 0x0003: |
| r14896 | r14897 | |
| 1463 | 1462 | |
| 1464 | 1463 | */ |
| 1465 | 1464 | |
| 1466 | ||
| 1465 | ||
| 1467 | 1466 | { |
| 1468 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1469 | 1467 | |
| 1470 | return ((UINT16) | |
| 1468 | return ((UINT16) | |
| 1471 | 1469 | } |
| 1472 | 1470 | |
| 1473 | ||
| 1471 | ||
| 1474 | 1472 | { |
| 1475 | 1473 | if (ACCESSING_BITS_0_7) |
| 1476 | 1474 | { |
| 1477 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1478 | state->m_sharedram[offset] = data & 0xff; | |
| 1475 | m_sharedram[offset] = data & 0xff; | |
| 1479 | 1476 | } |
| 1480 | 1477 | } |
| 1481 | 1478 | |
| r14896 | r14897 | |
| 1488 | 1485 | |
| 1489 | 1486 | */ |
| 1490 | 1487 | |
| 1491 | ||
| 1488 | ||
| 1492 | 1489 | { |
| 1493 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1494 | 1490 | switch(offset) |
| 1495 | 1491 | { |
| 1496 | 1492 | case 0/2: // bit 0: reset sub cpu? |
| 1497 | 1493 | if (ACCESSING_BITS_0_7) |
| 1498 | 1494 | { |
| 1499 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1500 | 1495 | |
| 1501 | if ( !(state->m_sub_ctrl_data & 1) && (data & 1) ) | |
| 1502 | cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, PULSE_LINE); | |
| 1503 | state->m_sub_ctrl_data = data; | |
| 1496 | if ( !(m_sub_ctrl_data & 1) && (data & 1) ) | |
| 1497 | cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, PULSE_LINE); | |
| 1498 | m_sub_ctrl_data = data; | |
| 1504 | 1499 | } |
| 1505 | 1500 | break; |
| 1506 | 1501 | |
| r14896 | r14897 | |
| 1508 | 1503 | break; |
| 1509 | 1504 | |
| 1510 | 1505 | case 4/2: // not sure |
| 1511 | if (ACCESSING_BITS_0_7) s | |
| 1506 | if (ACCESSING_BITS_0_7) s | |
| 1512 | 1507 | break; |
| 1513 | 1508 | |
| 1514 | 1509 | case 6/2: // not sure |
| 1515 | if (ACCESSING_BITS_0_7) s | |
| 1510 | if (ACCESSING_BITS_0_7) s | |
| 1516 | 1511 | break; |
| 1517 | 1512 | } |
| 1518 | 1513 | |
| r14896 | r14897 | |
| 1520 | 1515 | |
| 1521 | 1516 | |
| 1522 | 1517 | /* DSW reading for 16 bit CPUs */ |
| 1523 | ||
| 1518 | ||
| 1524 | 1519 | { |
| 1525 | UINT16 dsw = input_port_read( | |
| 1520 | UINT16 dsw = input_port_read( | |
| 1526 | 1521 | if (offset == 0) return (dsw >> 8) & 0xff; |
| 1527 | 1522 | else return (dsw >> 0) & 0xff; |
| 1528 | 1523 | } |
| r14896 | r14897 | |
| 1593 | 1588 | /**/AM_RANGE(0x600000, 0x6005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 1594 | 1589 | AM_RANGE(0x600600, 0x600607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 1595 | 1590 | |
| 1596 | AM_RANGE(0x800000, 0x800007) AM_WRITE_LEGACY(sub_ctrl_w) // Sub CPU Control? | |
| 1597 | AM_RANGE(0xa00000, 0xa00fff) AM_READWRITE_LEGACY(sharedram_68000_r,sharedram_68000_w) // Shared RAM | |
| 1591 | AM_RANGE(0x800000, 0x800007) AM_WRITE(sub_ctrl_w) // Sub CPU Control? | |
| 1592 | AM_RANGE(0xa00000, 0xa00fff) AM_READWRITE(sharedram_68000_r,sharedram_68000_w) // Shared RAM | |
| 1598 | 1593 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 1599 | 1594 | AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_SHARE("share1") // RAM (Mirrored?) |
| 1600 | 1595 | AM_RANGE(0xffc000, 0xffffff) AM_RAM AM_SHARE("share1") // RAM (Mirrored?) |
| r14896 | r14897 | |
| 1613 | 1608 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP // IRQ enable/acknowledge? |
| 1614 | 1609 | AM_RANGE(0x400000, 0x400007) AM_WRITE(twineagl_tilebank_w) // special tile banking to animate water in twineagl |
| 1615 | 1610 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP // ? |
| 1616 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1611 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1617 | 1612 | AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1618 | 1613 | AM_RANGE(0x800000, 0x800005) AM_WRITEONLY AM_BASE(m_vctrl_0)// VRAM Ctrl |
| 1619 | 1614 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(seta_vram_0_w) AM_BASE(m_vram_0) // VRAM |
| 1620 | AM_RANGE(0xa00000, 0xa00007) AM_WRITE_LEGACY(sub_ctrl_w) // Sub CPU Control? | |
| 1621 | AM_RANGE(0xb00000, 0xb00fff) AM_READWRITE_LEGACY(sharedram_68000_r,sharedram_68000_w) // Shared RAM | |
| 1615 | AM_RANGE(0xa00000, 0xa00007) AM_WRITE(sub_ctrl_w) // Sub CPU Control? | |
| 1616 | AM_RANGE(0xb00000, 0xb00fff) AM_READWRITE(sharedram_68000_r,sharedram_68000_w) // Shared RAM | |
| 1622 | 1617 | AM_RANGE(0xc00000, 0xc00001) AM_WRITENOP // ? $4000 |
| 1623 | 1618 | AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 1624 | 1619 | AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| r14896 | r14897 | |
| 1631 | 1626 | Caliber 50 |
| 1632 | 1627 | ***************************************************************************/ |
| 1633 | 1628 | |
| 1634 | ||
| 1629 | ||
| 1635 | 1630 | { |
| 1636 | int dir1 = input_port_read(space->machine(), "ROT1"); // analog port | |
| 1637 | int dir2 = input_port_read(space->machine(), "ROT2"); // analog port | |
| 1631 | int dir1 = input_port_read(machine(), "ROT1"); // analog port | |
| 1632 | int dir2 = input_port_read(machine(), "ROT2"); // analog port | |
| 1638 | 1633 | |
| 1639 | 1634 | switch (offset) |
| 1640 | 1635 | { |
| 1641 | case 0x00/2: return input_port_read(space->machine(), "P1"); // p1 | |
| 1642 | case 0x02/2: return input_port_read(space->machine(), "P2"); // p2 | |
| 1636 | case 0x00/2: return input_port_read(machine(), "P1"); // p1 | |
| 1637 | case 0x02/2: return input_port_read(machine(), "P2"); // p2 | |
| 1643 | 1638 | |
| 1644 | case 0x08/2: return input_port_read( | |
| 1639 | case 0x08/2: return input_port_read( | |
| 1645 | 1640 | |
| 1646 | 1641 | case 0x10/2: return (dir1 & 0xff); // lower 8 bits of p1 rotation |
| 1647 | 1642 | case 0x12/2: return (dir1 >> 8); // upper 4 bits of p1 rotation |
| r14896 | r14897 | |
| 1649 | 1644 | case 0x16/2: return (dir2 >> 8); // upper 4 bits of p2 rotation |
| 1650 | 1645 | case 0x18/2: return 0xffff; // ? (value's read but not used) |
| 1651 | 1646 | default: |
| 1652 | logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space | |
| 1647 | logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space. | |
| 1653 | 1648 | return 0; |
| 1654 | 1649 | } |
| 1655 | 1650 | } |
| 1656 | 1651 | |
| 1657 | ||
| 1652 | ||
| 1658 | 1653 | { |
| 1659 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1660 | 1654 | if (ACCESSING_BITS_0_7) |
| 1661 | 1655 | { |
| 1662 | state->soundlatch_word_w(*space, 0, data, mem_mask); | |
| 1663 | cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE); | |
| 1664 | device_spin_until_time(&space->device(), attotime::from_usec(50)); // Allow the other cpu to reply | |
| 1656 | soundlatch_word_w(*&space, 0, data, mem_mask); | |
| 1657 | cputag_set_input_line(machine(), "sub", INPUT_LINE_NMI, PULSE_LINE); | |
| 1658 | device_spin_until_time(&space.device(), attotime::from_usec(50)); // Allow the other cpu to reply | |
| 1665 | 1659 | } |
| 1666 | 1660 | } |
| 1667 | 1661 | |
| r14896 | r14897 | |
| 1674 | 1668 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP // ? (random value) |
| 1675 | 1669 | AM_RANGE(0x400000, 0x400001) AM_READ(watchdog_reset16_r) // Watchdog |
| 1676 | 1670 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP // ? |
| 1677 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1671 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1678 | 1672 | AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1679 | 1673 | AM_RANGE(0x800000, 0x800005) AM_WRITEONLY AM_BASE(m_vctrl_0)// VRAM Ctrl |
| 1680 | 1674 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(seta_vram_0_w) AM_BASE(m_vram_0) // VRAM |
| 1681 | 1675 | |
| 1682 | 1676 | AM_RANGE(0x904000, 0x904fff) AM_RAM // |
| 1683 | AM_RANGE(0xa00000, 0xa00019) AM_READ | |
| 1677 | AM_RANGE(0xa00000, 0xa00019) AM_READ | |
| 1684 | 1678 | /**/AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 1685 | 1679 | AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 1686 | 1680 | AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 1687 | AM_RANGE(0xb00000, 0xb00001) AM_READ(soundlatch2_word_r) AM_WRITE | |
| 1681 | AM_RANGE(0xb00000, 0xb00001) AM_READ(soundlatch2_word_r) AM_WRITE | |
| 1688 | 1682 | /**/AM_RANGE(0xc00000, 0xc00001) AM_RAM // ? $4000 |
| 1689 | 1683 | ADDRESS_MAP_END |
| 1690 | 1684 | |
| r14896 | r14897 | |
| 1693 | 1687 | U.S. Classic |
| 1694 | 1688 | ***************************************************************************/ |
| 1695 | 1689 | |
| 1696 | ||
| 1690 | ||
| 1697 | 1691 | { |
| 1698 | 1692 | switch (offset) |
| 1699 | 1693 | { |
| 1700 | case 0/2: return (input_port_read(space->machine(), "DSW") >> 8) & 0xf; | |
| 1701 | case 2/2: return (input_port_read(space->machine(), "DSW") >> 12) & 0xf; | |
| 1702 | case 4/2: return (input_port_read(space->machine(), "DSW") >> 0) & 0xf; | |
| 1703 | case 6/2: return (input_port_read(space->machine(), "DSW") >> 4) & 0xf; | |
| 1694 | case 0/2: return (input_port_read(machine(), "DSW") >> 8) & 0xf; | |
| 1695 | case 2/2: return (input_port_read(machine(), "DSW") >> 12) & 0xf; | |
| 1696 | case 4/2: return (input_port_read(machine(), "DSW") >> 0) & 0xf; | |
| 1697 | case 6/2: return (input_port_read(machine(), "DSW") >> 4) & 0xf; | |
| 1704 | 1698 | } |
| 1705 | 1699 | return 0; |
| 1706 | 1700 | } |
| 1707 | 1701 | |
| 1708 | ||
| 1702 | ||
| 1709 | 1703 | { |
| 1710 | 1704 | static const char *const portx_name[2] = { "P1X", "P2X" }; |
| 1711 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1712 | 1705 | |
| 1713 | 1706 | switch (offset) |
| 1714 | 1707 | { |
| 1715 | case 0/2: return (input_port_read(space->machine(), portx_name[state->m_usclssic_port_select]) >> 0) & 0xff; | |
| 1716 | case 2/2: return (input_port_read(space->machine(), portx_name[state->m_usclssic_port_select]) >> 8) & 0xff; | |
| 1708 | case 0/2: return (input_port_read(machine(), portx_name[m_usclssic_port_select]) >> 0) & 0xff; | |
| 1709 | case 2/2: return (input_port_read(machine(), portx_name[m_usclssic_port_select]) >> 8) & 0xff; | |
| 1717 | 1710 | } |
| 1718 | 1711 | return 0; |
| 1719 | 1712 | } |
| 1720 | 1713 | |
| 1721 | ||
| 1714 | ||
| 1722 | 1715 | { |
| 1723 | 1716 | static const char *const porty_name[2] = { "P1Y", "P2Y" }; |
| 1724 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1725 | 1717 | |
| 1726 | 1718 | switch (offset) |
| 1727 | 1719 | { |
| 1728 | case 0/2: return (input_port_read(space->machine(), porty_name[state->m_usclssic_port_select]) >> 0) & 0xff; | |
| 1729 | case 2/2: return (input_port_read(space->machine(), porty_name[state->m_usclssic_port_select]) >> 8) & 0xff; | |
| 1720 | case 0/2: return (input_port_read(machine(), porty_name[m_usclssic_port_select]) >> 0) & 0xff; | |
| 1721 | case 2/2: return (input_port_read(machine(), porty_name[m_usclssic_port_select]) >> 8) & 0xff; | |
| 1730 | 1722 | } |
| 1731 | 1723 | return 0; |
| 1732 | 1724 | } |
| 1733 | 1725 | |
| 1734 | 1726 | |
| 1735 | ||
| 1727 | ||
| 1736 | 1728 | { |
| 1737 | 1729 | if (ACCESSING_BITS_0_7) |
| 1738 | 1730 | { |
| 1739 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1740 | 1731 | int tiles_offset = (data & 0x10) ? 0x4000: 0; |
| 1741 | 1732 | |
| 1742 | | |
| 1733 | | |
| 1743 | 1734 | |
| 1744 | if (tiles_offset != state->m_tiles_offset) | |
| 1745 | space->machine().tilemap().mark_all_dirty(); | |
| 1746 | state->m_tiles_offset = tiles_offset; | |
| 1735 | if (tiles_offset != m_tiles_offset) | |
| 1736 | machine().tilemap().mark_all_dirty(); | |
| 1737 | m_tiles_offset = tiles_offset; | |
| 1747 | 1738 | |
| 1748 | seta_coin_lockout_w( | |
| 1739 | seta_coin_lockout_w( | |
| 1749 | 1740 | } |
| 1750 | 1741 | } |
| 1751 | 1742 | |
| r14896 | r14897 | |
| 1758 | 1749 | /**/AM_RANGE(0x900000, 0x900001) AM_RAM // ? $4000 |
| 1759 | 1750 | AM_RANGE(0xa00000, 0xa00005) AM_RAM AM_BASE(m_vctrl_0) // VRAM Ctrl |
| 1760 | 1751 | /**/AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1761 | AM_RANGE(0xb40000, 0xb40003) AM_READ_LEGACY(usclssic_trackball_x_r) // TrackBall X | |
| 1762 | AM_RANGE(0xb40000, 0xb40001) AM_WRITE_LEGACY(usclssic_lockout_w) // Coin Lockout + Tiles Banking | |
| 1763 | AM_RANGE(0xb40004, 0xb40007) AM_READ_LEGACY(usclssic_trackball_y_r) // TrackBall Y + Buttons | |
| 1752 | AM_RANGE(0xb40000, 0xb40003) AM_READ(usclssic_trackball_x_r) // TrackBall X | |
| 1753 | AM_RANGE(0xb40000, 0xb40001) AM_WRITE(usclssic_lockout_w) // Coin Lockout + Tiles Banking | |
| 1754 | AM_RANGE(0xb40004, 0xb40007) AM_READ(usclssic_trackball_y_r) // TrackBall Y + Buttons | |
| 1764 | 1755 | AM_RANGE(0xb4000a, 0xb4000b) AM_WRITENOP // ? (value's not important. In lev2&6) |
| 1765 | 1756 | AM_RANGE(0xb40010, 0xb40011) AM_READ_PORT("COINS") // Coins |
| 1766 | AM_RANGE(0xb40010, 0xb40011) AM_WRITE_LEGACY(calibr50_soundlatch_w) // To Sub CPU | |
| 1767 | AM_RANGE(0xb40018, 0xb4001f) AM_READ_LEGACY(usclssic_dsw_r) // 2 DSWs | |
| 1757 | AM_RANGE(0xb40010, 0xb40011) AM_WRITE(calibr50_soundlatch_w) // To Sub CPU | |
| 1758 | AM_RANGE(0xb40018, 0xb4001f) AM_READ(usclssic_dsw_r) // 2 DSWs | |
| 1768 | 1759 | AM_RANGE(0xb40018, 0xb40019) AM_WRITE(watchdog_reset16_w) // Watchdog |
| 1769 | 1760 | AM_RANGE(0xb80000, 0xb80001) AM_READNOP // Watchdog (value is discarded)? |
| 1770 | 1761 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| r14896 | r14897 | |
| 1785 | 1776 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP // ? watchdog ? |
| 1786 | 1777 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP // ? 0 (irq ack lev 2?) |
| 1787 | 1778 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP // ? (end of lev 1: bit 4 goes 1,0,1) |
| 1788 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1779 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1789 | 1780 | AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1790 | 1781 | AM_RANGE(0xa00000, 0xa005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 1791 | 1782 | AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| r14896 | r14897 | |
| 1810 | 1801 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 |
| 1811 | 1802 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 1812 | 1803 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // (gundhara) Coin Lockout + Video Registers |
| 1813 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1804 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1814 | 1805 | AM_RANGE(0x700000, 0x7003ff) AM_RAM // (rezon,jjsquawk) |
| 1815 | 1806 | AM_RANGE(0x700400, 0x700fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1816 | 1807 | AM_RANGE(0x703c00, 0x7047ff) AM_RAM AM_BASE_SIZE(m_paletteram2, m_paletteram2_size) // 2nd Palette for the palette offset effect |
| r14896 | r14897 | |
| 1845 | 1836 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 |
| 1846 | 1837 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 1847 | 1838 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // (gundhara) Coin Lockout + Video Registers |
| 1848 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1839 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1849 | 1840 | AM_RANGE(0x700000, 0x7003ff) AM_RAM // (rezon,jjsquawk) |
| 1850 | 1841 | AM_RANGE(0x700400, 0x700fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1851 | 1842 | AM_RANGE(0x703c00, 0x7047ff) AM_RAM AM_BASE_SIZE(m_paletteram2, m_paletteram2_size) // 2nd Palette for the palette offset effect |
| r14896 | r14897 | |
| 1871 | 1862 | and Zombie Raid (with slight variations) |
| 1872 | 1863 | ***************************************************************************/ |
| 1873 | 1864 | |
| 1874 | ||
| 1865 | ||
| 1875 | 1866 | { |
| 1876 | 1867 | static const char *const portnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" }; |
| 1877 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1878 | 1868 | |
| 1879 | int data = input_port_read(space->machine(), portnames[state->m_gun_input_src]); // Input Ports 5-8 | |
| 1880 | return (data >> state->m_gun_input_bit) & 1; | |
| 1869 | int data = input_port_read(machine(), portnames[m_gun_input_src]); // Input Ports 5-8 | |
| 1870 | return (data >> m_gun_input_bit) & 1; | |
| 1881 | 1871 | } |
| 1882 | 1872 | |
| 1883 | 1873 | // Bit 0 is clock, 1 is data, 2 is reset |
| 1884 | ||
| 1874 | ||
| 1885 | 1875 | { |
| 1886 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 1887 | 1876 | |
| 1888 | if(data&4) { | |
| 1877 | if(data&4) { | |
| 1889 | 1878 | |
| 1890 | if((data&1) == | |
| 1879 | if((data&1) == | |
| 1891 | 1880 | |
| 1892 | if( | |
| 1881 | if( | |
| 1893 | 1882 | { |
| 1894 | switch ( | |
| 1883 | switch ( | |
| 1895 | 1884 | { |
| 1896 | 1885 | case 0: |
| 1897 | 1886 | case 1: // Starting sequence 2,3,2,3. Other inputs? |
| 1898 | 1887 | break; |
| 1899 | 1888 | case 2: // First bit of source |
| 1900 | | |
| 1889 | | |
| 1901 | 1890 | break; |
| 1902 | 1891 | case 3: // Second bit of source |
| 1903 | | |
| 1892 | | |
| 1904 | 1893 | break; |
| 1905 | 1894 | default: |
| 1906 | 1895 | /* Gun Recoils */ |
| r14896 | r14897 | |
| 1908 | 1897 | output_set_value("Player1_Gun_Recoil", (data & 0x10)>>4 ); |
| 1909 | 1898 | output_set_value("Player2_Gun_Recoil", (data & 0x8)>>3 ); |
| 1910 | 1899 | |
| 1911 | state->m_gun_input_bit = state->m_gun_bit_count - 4; | |
| 1912 | state->m_gun_input_bit = 8 - state->m_gun_input_bit; // Reverse order | |
| 1900 | m_gun_input_bit = m_gun_bit_count - 4; | |
| 1901 | m_gun_input_bit = 8 - m_gun_input_bit; // Reverse order | |
| 1913 | 1902 | break; |
| 1914 | 1903 | } |
| 1915 | | |
| 1904 | | |
| 1916 | 1905 | } |
| 1917 | 1906 | |
| 1918 | | |
| 1907 | | |
| 1919 | 1908 | } |
| 1920 | 1909 | |
| 1921 | 1910 | static ADDRESS_MAP_START( wrofaero_map, AS_PROGRAM, 16, seta_state ) |
| r14896 | r14897 | |
| 1928 | 1917 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 1929 | 1918 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // (gundhara) Coin Lockout + Video Registers |
| 1930 | 1919 | |
| 1931 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1920 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1932 | 1921 | AM_RANGE(0x700000, 0x7003ff) AM_RAM // (rezon,jjsquawk) |
| 1933 | 1922 | AM_RANGE(0x700400, 0x700fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1934 | 1923 | AM_RANGE(0x701000, 0x70ffff) AM_RAM // |
| r14896 | r14897 | |
| 1944 | 1933 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 1945 | 1934 | AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 1946 | 1935 | #if __uPD71054_TIMER |
| 1947 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 1936 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 1948 | 1937 | #else |
| 1949 | 1938 | AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP // ? |
| 1950 | 1939 | #endif |
| r14896 | r14897 | |
| 1952 | 1941 | AM_RANGE(0xf00000, 0xf00001) AM_WRITENOP // ? Sound IRQ Ack |
| 1953 | 1942 | ADDRESS_MAP_END |
| 1954 | 1943 | |
| 1955 | ||
| 1944 | ||
| 1956 | 1945 | { |
| 1957 | 1946 | return 0x0000; |
| 1958 | 1947 | } |
| r14896 | r14897 | |
| 1964 | 1953 | AM_RANGE(0x300000, 0x30ffff) AM_RAM // RAM (wrofaero only?) |
| 1965 | 1954 | // AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P1") // P1 |
| 1966 | 1955 | // AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 |
| 1967 | AM_RANGE(0x400002, 0x400003) AM_READ | |
| 1956 | AM_RANGE(0x400002, 0x400003) AM_READ | |
| 1968 | 1957 | // AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 1969 | 1958 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // (gundhara) Coin Lockout + Video Registers |
| 1970 | 1959 | |
| 1971 | //AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1960 | //AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1972 | 1961 | AM_RANGE(0x700000, 0x7003ff) AM_RAM // (rezon,jjsquawk) |
| 1973 | 1962 | AM_RANGE(0x700400, 0x700fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 1974 | 1963 | AM_RANGE(0x701000, 0x70ffff) AM_RAM // |
| r14896 | r14897 | |
| 1978 | 1967 | AM_RANGE(0x884000, 0x88ffff) AM_RAM // (jjsquawk) |
| 1979 | 1968 | /**/AM_RANGE(0x900000, 0x900005) AM_RAM AM_BASE(m_vctrl_0) // VRAM 0&1 Ctrl |
| 1980 | 1969 | |
| 1981 | AM_RANGE(0x902010, 0x902013) AM_READ | |
| 1970 | AM_RANGE(0x902010, 0x902013) AM_READ | |
| 1982 | 1971 | |
| 1983 | 1972 | /**/AM_RANGE(0x980000, 0x980005) AM_RAM AM_BASE(m_vctrl_2) // VRAM 2&3 Ctrl |
| 1984 | 1973 | /**/AM_RANGE(0xa00000, 0xa005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| r14896 | r14897 | |
| 1987 | 1976 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 1988 | 1977 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM // soundram on original |
| 1989 | 1978 | #if __uPD71054_TIMER |
| 1990 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 1979 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 1991 | 1980 | #else |
| 1992 | 1981 | AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP // ? |
| 1993 | 1982 | #endif |
| r14896 | r14897 | |
| 2005 | 1994 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 2006 | 1995 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // (gundhara) Coin Lockout + Video Registers |
| 2007 | 1996 | |
| 2008 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 1997 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2009 | 1998 | AM_RANGE(0x700000, 0x70b3ff) AM_RAM // RZ: (rezon,jjsquawk) |
| 2010 | 1999 | AM_RANGE(0x70b400, 0x70bfff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2011 | 2000 | AM_RANGE(0x70c000, 0x70ffff) AM_RAM // |
| r14896 | r14897 | |
| 2020 | 2009 | AM_RANGE(0xb0c000, 0xb0ffff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // RZ: Sprites Code + X + Attr |
| 2021 | 2010 | AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 2022 | 2011 | #if __uPD71054_TIMER |
| 2023 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 2012 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 2024 | 2013 | #else |
| 2025 | 2014 | AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP // ? |
| 2026 | 2015 | #endif |
| r14896 | r14897 | |
| 2037 | 2026 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM // RAM |
| 2038 | 2027 | AM_RANGE(0x100000, 0x100001) AM_READNOP // ? |
| 2039 | 2028 | AM_RANGE(0x200000, 0x200001) AM_READNOP // ? |
| 2040 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2029 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2041 | 2030 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // ? |
| 2042 | 2031 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 2043 | 2032 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| 2044 | 2033 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins |
| 2045 | //AM_RANGE(0x600000, 0x60000f) AM_READ | |
| 2034 | //AM_RANGE(0x600000, 0x60000f) AM_READ | |
| 2046 | 2035 | AM_RANGE(0x8000f0, 0x8000f1) AM_RAM // NVRAM |
| 2047 | 2036 | AM_RANGE(0x800100, 0x8001ff) AM_RAM // NVRAM |
| 2048 | 2037 | AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| r14896 | r14897 | |
| 2067 | 2056 | }; |
| 2068 | 2057 | |
| 2069 | 2058 | |
| 2070 | ||
| 2059 | ||
| 2071 | 2060 | { |
| 2072 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2073 | UINT16 result = keroppi_protection_word[state->m_keroppi_protection_count]; | |
| 2061 | UINT16 result = keroppi_protection_word[m_keroppi_protection_count]; | |
| 2074 | 2062 | |
| 2075 | state->m_keroppi_protection_count++; | |
| 2076 | if (state->m_keroppi_protection_count > 15) | |
| 2077 | state->m_keroppi_protection_count = 15; | |
| 2063 | m_keroppi_protection_count++; | |
| 2064 | if (m_keroppi_protection_count > 15) | |
| 2065 | m_keroppi_protection_count = 15; | |
| 2078 | 2066 | |
| 2079 | 2067 | return result; |
| 2080 | 2068 | } |
| 2081 | 2069 | |
| 2082 | ||
| 2070 | ||
| 2083 | 2071 | { |
| 2084 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2085 | state->m_keroppi_protection_count = 0; | |
| 2072 | m_keroppi_protection_count = 0; | |
| 2086 | 2073 | |
| 2087 | 2074 | return 0x00; |
| 2088 | 2075 | } |
| 2089 | 2076 | |
| 2090 | ||
| 2077 | ||
| 2091 | 2078 | { |
| 2092 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2093 | UINT16 result = input_port_read(space->machine(), "COINS"); | |
| 2079 | UINT16 result = input_port_read(machine(), "COINS"); | |
| 2094 | 2080 | |
| 2095 | if ( | |
| 2081 | if ( | |
| 2096 | 2082 | { |
| 2097 | 2083 | result &= ~0x0002; /* prize hopper */ |
| 2098 | | |
| 2084 | | |
| 2099 | 2085 | } |
| 2100 | 2086 | |
| 2101 | 2087 | return result; |
| r14896 | r14897 | |
| 2107 | 2093 | state->m_keroppi_prize_hop = 2; |
| 2108 | 2094 | } |
| 2109 | 2095 | |
| 2110 | ||
| 2096 | ||
| 2111 | 2097 | { |
| 2112 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2113 | if ((data & 0x0010) && !state->m_keroppi_prize_hop) | |
| 2098 | if ((data & 0x0010) && !m_keroppi_prize_hop) | |
| 2114 | 2099 | { |
| 2115 | state->m_keroppi_prize_hop = 1; | |
| 2116 | space->machine().scheduler().timer_set(attotime::from_seconds(3), FUNC(keroppi_prize_hop_callback), 0x20); /* 3 seconds */ | |
| 2100 | m_keroppi_prize_hop = 1; | |
| 2101 | machine().scheduler().timer_set(attotime::from_seconds(3), FUNC(keroppi_prize_hop_callback), 0x20); /* 3 seconds */ | |
| 2117 | 2102 | } |
| 2118 | 2103 | } |
| 2119 | 2104 | |
| 2120 | 2105 | static ADDRESS_MAP_START( keroppi_map, AS_PROGRAM, 16, seta_state ) |
| 2121 | 2106 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 2122 | 2107 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM // RAM |
| 2123 | AM_RANGE(0x100000, 0x100001) AM_READ_LEGACY(keroppi_protection_r) // | |
| 2124 | AM_RANGE(0x200000, 0x200001) AM_READ_LEGACY(keroppi_protection_init_r) // | |
| 2125 | AM_RANGE(0x300000, 0x300003) AM_READ_LEGACY(seta_dsw_r) // DSW | |
| 2108 | AM_RANGE(0x100000, 0x100001) AM_READ(keroppi_protection_r) // | |
| 2109 | AM_RANGE(0x200000, 0x200001) AM_READ(keroppi_protection_init_r) // | |
| 2110 | AM_RANGE(0x300000, 0x300003) AM_READ(seta_dsw_r) // DSW | |
| 2126 | 2111 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // ? |
| 2127 | 2112 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 2128 | 2113 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| 2129 | AM_RANGE(0x500004, 0x500005) AM_READ | |
| 2114 | AM_RANGE(0x500004, 0x500005) AM_READ | |
| 2130 | 2115 | AM_RANGE(0x8000f0, 0x8000f1) AM_RAM // NVRAM |
| 2131 | 2116 | AM_RANGE(0x800100, 0x8001ff) AM_RAM // NVRAM |
| 2132 | 2117 | AM_RANGE(0x900000, 0x900001) AM_WRITENOP // ? |
| 2133 | AM_RANGE(0x900002, 0x900003) AM_WRITE | |
| 2118 | AM_RANGE(0x900002, 0x900003) AM_WRITE | |
| 2134 | 2119 | AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 2135 | 2120 | AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2136 | 2121 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| r14896 | r14897 | |
| 2158 | 2143 | AM_RANGE(0xf05000, 0xf050ff) AM_RAM // Backup RAM? |
| 2159 | 2144 | AM_RANGE(0x100000, 0x100001) AM_WRITENOP // ? 1 (start of interrupts, main loop: watchdog?) |
| 2160 | 2145 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP // ? 0/1 (IRQ acknowledge?) |
| 2161 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2146 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2162 | 2147 | AM_RANGE(0x400000, 0x400001) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Sound Enable (bit 4?) |
| 2163 | 2148 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 2164 | 2149 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| r14896 | r14897 | |
| 2184 | 2169 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 2185 | 2170 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Video Registers |
| 2186 | 2171 | AM_RANGE(0x500006, 0x500007) AM_READ_PORT("EXTRA") // Buttons 4,5,6 |
| 2187 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2172 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2188 | 2173 | AM_RANGE(0x700000, 0x7003ff) AM_RAM |
| 2189 | 2174 | AM_RANGE(0x700400, 0x700fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2190 | 2175 | AM_RANGE(0x701000, 0x70ffff) AM_RAM // |
| r14896 | r14897 | |
| 2217 | 2202 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP // Watchdog |
| 2218 | 2203 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP // ? IRQ Ack |
| 2219 | 2204 | AM_RANGE(0x500000, 0x500001) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Video Registers |
| 2220 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2205 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2221 | 2206 | AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2222 | 2207 | AM_RANGE(0x800000, 0x800005) AM_RAM AM_BASE(m_vctrl_0) // VRAM Ctrl |
| 2223 | 2208 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(seta_vram_0_w) AM_BASE(m_vram_0 ) // VRAM |
| r14896 | r14897 | |
| 2239 | 2224 | // the spritey low bits are mapped to 1 in every 4 bytes here as if it were a 32-bit bus..which is weird |
| 2240 | 2225 | // other ram is similar.. |
| 2241 | 2226 | |
| 2242 | ||
| 2227 | ||
| 2243 | 2228 | { |
| 2244 | seta001_device *dev = | |
| 2229 | seta001_device *dev = | |
| 2245 | 2230 | if ((offset&1)==0) spriteylow_w8(dev, offset>>1, (data & 0xff00) >> 8); |
| 2246 | 2231 | } |
| 2247 | 2232 | |
| 2248 | ||
| 2233 | ||
| 2249 | 2234 | { |
| 2250 | seta001_device *dev = | |
| 2235 | seta001_device *dev = | |
| 2251 | 2236 | if ((offset&1)==0) spritectrl_w8(dev, offset>>1, (data & 0xff00) >> 8); |
| 2252 | 2237 | } |
| 2253 | 2238 | |
| 2254 | ||
| 2239 | ||
| 2255 | 2240 | { |
| 2256 | seta001_device *dev = | |
| 2241 | seta001_device *dev = | |
| 2257 | 2242 | if ((offset&1)==1) spritecodelow_w8(dev, offset>>1, (data & 0xff00) >> 8); |
| 2258 | 2243 | if ((offset&1)==0) spritecodehigh_w8(dev, offset>>1, (data & 0xff00) >> 8); |
| 2259 | 2244 | } |
| 2260 | 2245 | |
| 2261 | ||
| 2246 | ||
| 2262 | 2247 | { |
| 2263 | 2248 | UINT16 ret; |
| 2264 | seta001_device *dev = | |
| 2249 | seta001_device *dev = | |
| 2265 | 2250 | if ((offset&1)==1) |
| 2266 | 2251 | ret = spritecodelow_r8(dev, offset>>1); |
| 2267 | 2252 | else |
| r14896 | r14897 | |
| 2296 | 2281 | |
| 2297 | 2282 | AM_RANGE(0xe00000, 0xe03fff) AM_RAM_WRITE(seta_vram_0_w) AM_BASE(m_vram_0 ) // VRAM - draws wheel if you reset enough times.. |
| 2298 | 2283 | AM_RANGE(0xe40000, 0xe40005) AM_RAM AM_BASE(m_vctrl_0) // VRAM Ctrl |
| 2299 | AM_RANGE(0xf00000, 0xf03fff) AM_READWRITE_LEGACY(setaroul_spritecode_r, setaroul_spritecode_w) | |
| 2300 | AM_RANGE(0xf40000, 0xf40bff) AM_WRITE_LEGACY(setaroul_spriteylow_w) | |
| 2301 | AM_RANGE(0xf40c00, 0xf40c11) AM_WRITE_LEGACY(setaroul_spritectrl_w) | |
| 2284 | AM_RANGE(0xf00000, 0xf03fff) AM_READWRITE(setaroul_spritecode_r, setaroul_spritecode_w) | |
| 2285 | AM_RANGE(0xf40000, 0xf40bff) AM_WRITE(setaroul_spriteylow_w) | |
| 2286 | AM_RANGE(0xf40c00, 0xf40c11) AM_WRITE(setaroul_spritectrl_w) | |
| 2302 | 2287 | ADDRESS_MAP_END |
| 2303 | 2288 | |
| 2304 | 2289 | /*************************************************************************** |
| r14896 | r14897 | |
| 2314 | 2299 | AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P1") // P1 |
| 2315 | 2300 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 |
| 2316 | 2301 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 2317 | AM_RANGE(0x400008, 0x40000b) AM_READ | |
| 2302 | AM_RANGE(0x400008, 0x40000b) AM_READ | |
| 2318 | 2303 | AM_RANGE(0x40000c, 0x40000d) AM_READWRITE(watchdog_reset16_r,watchdog_reset16_w) // Watchdog (extdwnhl (R) & sokonuke (W) MUST RETURN $FFFF) |
| 2319 | 2304 | AM_RANGE(0x500000, 0x500003) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Video Registers |
| 2320 | 2305 | AM_RANGE(0x500004, 0x500007) AM_NOP // IRQ Ack (extdwnhl (R) & sokonuke (W)) |
| r14896 | r14897 | |
| 2344 | 2329 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM |
| 2345 | 2330 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 2346 | 2331 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| 2347 | AM_RANGE(0x500004, 0x500007) AM_READ | |
| 2332 | AM_RANGE(0x500004, 0x500007) AM_READ | |
| 2348 | 2333 | AM_RANGE(0x500008, 0x500009) AM_READ_PORT("COINS") // Coins |
| 2349 | 2334 | AM_RANGE(0x50000c, 0x50000d) AM_READWRITE(watchdog_reset16_r,watchdog_reset16_w) // xx Watchdog? (sokonuke) |
| 2350 | 2335 | AM_RANGE(0x600000, 0x600005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // ? Coin Lockout + Video Registers |
| r14896 | r14897 | |
| 2364 | 2349 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 2365 | 2350 | AM_RANGE(0xb04000, 0xb07fff) AM_RAM // tested |
| 2366 | 2351 | #if __uPD71054_TIMER |
| 2367 | AM_RANGE(0xc00000, 0xc00007) AM_WRITE | |
| 2352 | AM_RANGE(0xc00000, 0xc00007) AM_WRITE | |
| 2368 | 2353 | #else |
| 2369 | 2354 | AM_RANGE(0xc00000, 0xc00007) AM_WRITENOP // ? |
| 2370 | 2355 | #endif |
| r14896 | r14897 | |
| 2378 | 2363 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 2379 | 2364 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| 2380 | 2365 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins |
| 2381 | AM_RANGE(0x500008, 0x50000b) AM_READ | |
| 2366 | AM_RANGE(0x500008, 0x50000b) AM_READ | |
| 2382 | 2367 | AM_RANGE(0x50000c, 0x50000d) AM_WRITE(watchdog_reset16_w) // Watchdog |
| 2383 | 2368 | AM_RANGE(0x600000, 0x600005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // ? Coin Lockout + Video Registers |
| 2384 | 2369 | AM_RANGE(0x600006, 0x600007) AM_WRITENOP // ? |
| r14896 | r14897 | |
| 2393 | 2378 | AM_RANGE(0xa80000, 0xa80001) AM_RAM // ? $4000 |
| 2394 | 2379 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 2395 | 2380 | #if __uPD71054_TIMER |
| 2396 | AM_RANGE(0xc00000, 0xc00007) AM_WRITE | |
| 2381 | AM_RANGE(0xc00000, 0xc00007) AM_WRITE | |
| 2397 | 2382 | #else |
| 2398 | 2383 | AM_RANGE(0xc00000, 0xc00007) AM_WRITENOP // ? |
| 2399 | 2384 | #endif |
| r14896 | r14897 | |
| 2405 | 2390 | Krazy Bowl |
| 2406 | 2391 | ***************************************************************************/ |
| 2407 | 2392 | |
| 2408 | ||
| 2393 | ||
| 2409 | 2394 | { |
| 2410 | 2395 | // analog ports |
| 2411 | int dir1x = input_port_read(space->machine(), "TRACK1_X") & 0xfff; | |
| 2412 | int dir1y = input_port_read(space->machine(), "TRACK1_Y") & 0xfff; | |
| 2413 | int dir2x = input_port_read(space->machine(), "TRACK2_X") & 0xfff; | |
| 2414 | int dir2y = input_port_read(space->machine(), "TRACK2_Y") & 0xfff; | |
| 2396 | int dir1x = input_port_read(machine(), "TRACK1_X") & 0xfff; | |
| 2397 | int dir1y = input_port_read(machine(), "TRACK1_Y") & 0xfff; | |
| 2398 | int dir2x = input_port_read(machine(), "TRACK2_X") & 0xfff; | |
| 2399 | int dir2y = input_port_read(machine(), "TRACK2_Y") & 0xfff; | |
| 2415 | 2400 | |
| 2416 | 2401 | switch (offset) |
| 2417 | 2402 | { |
| r14896 | r14897 | |
| 2424 | 2409 | case 0xc/2: return dir2y & 0xff; |
| 2425 | 2410 | case 0xe/2: return dir2y >> 8; |
| 2426 | 2411 | default: |
| 2427 | logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space | |
| 2412 | logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space. | |
| 2428 | 2413 | return 0; |
| 2429 | 2414 | } |
| 2430 | 2415 | } |
| r14896 | r14897 | |
| 2434 | 2419 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM // RAM |
| 2435 | 2420 | AM_RANGE(0x100000, 0x100001) AM_READNOP // ? |
| 2436 | 2421 | AM_RANGE(0x200000, 0x200001) AM_READNOP // ? |
| 2437 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2422 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2438 | 2423 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // ? |
| 2439 | 2424 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 2440 | 2425 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| 2441 | 2426 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins |
| 2442 | AM_RANGE(0x600000, 0x60000f) AM_READ | |
| 2427 | AM_RANGE(0x600000, 0x60000f) AM_READ | |
| 2443 | 2428 | AM_RANGE(0x8000f0, 0x8000f1) AM_RAM // NVRAM |
| 2444 | 2429 | AM_RANGE(0x800100, 0x8001ff) AM_RAM // NVRAM |
| 2445 | 2430 | AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| r14896 | r14897 | |
| 2455 | 2440 | Mobile Suit Gundam |
| 2456 | 2441 | ***************************************************************************/ |
| 2457 | 2442 | |
| 2458 | ||
| 2443 | ||
| 2459 | 2444 | { |
| 2460 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2461 | 2445 | // swap $500002 with $500004 |
| 2462 | 2446 | switch( offset ) |
| 2463 | 2447 | { |
| 2464 | 2448 | case 1: offset = 2; break; |
| 2465 | 2449 | case 2: offset = 1; break; |
| 2466 | 2450 | } |
| 2467 | s | |
| 2451 | s | |
| 2468 | 2452 | } |
| 2469 | 2453 | |
| 2470 | 2454 | /* Mirror RAM is necessary or startup, to clear Work RAM after the test */ |
| r14896 | r14897 | |
| 2478 | 2462 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 2479 | 2463 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // Lev 2 IRQ Ack |
| 2480 | 2464 | AM_RANGE(0x400004, 0x400005) AM_WRITENOP // Lev 4 IRQ Ack |
| 2481 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE_LEGACY(msgundam_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Video Registers | |
| 2482 | AM_RANGE(0x600000, 0x600003) AM_READ_LEGACY(seta_dsw_r) // DSW | |
| 2465 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(msgundam_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Video Registers | |
| 2466 | AM_RANGE(0x600000, 0x600003) AM_READ(seta_dsw_r) // DSW | |
| 2483 | 2467 | AM_RANGE(0x700400, 0x700fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2484 | 2468 | AM_RANGE(0x800000, 0x8005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 2485 | 2469 | AM_RANGE(0x800600, 0x800607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| r14896 | r14897 | |
| 2491 | 2475 | AM_RANGE(0xb80000, 0xb80005) AM_RAM AM_BASE(m_vctrl_2) // VRAM 2&3 Ctrl |
| 2492 | 2476 | AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 2493 | 2477 | #if __uPD71054_TIMER |
| 2494 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 2478 | AM_RANGE(0xd00000, 0xd00007) AM_WRITE | |
| 2495 | 2479 | #else |
| 2496 | 2480 | AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP // ? |
| 2497 | 2481 | #endif |
| r14896 | r14897 | |
| 2507 | 2491 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 2508 | 2492 | AM_RANGE(0x100000, 0x17ffff) AM_ROM // ROM |
| 2509 | 2493 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM |
| 2510 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2494 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2511 | 2495 | AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P1") // P1 |
| 2512 | 2496 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 |
| 2513 | 2497 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| r14896 | r14897 | |
| 2536 | 2520 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 2537 | 2521 | AM_RANGE(0x100000, 0x17ffff) AM_ROM // ROM |
| 2538 | 2522 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM |
| 2539 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2523 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2540 | 2524 | AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P1") // P1 |
| 2541 | 2525 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 |
| 2542 | 2526 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| r14896 | r14897 | |
| 2559 | 2543 | Pro Mahjong Kiwame |
| 2560 | 2544 | ***************************************************************************/ |
| 2561 | 2545 | |
| 2562 | ||
| 2546 | ||
| 2563 | 2547 | { |
| 2564 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2565 | return state->m_kiwame_nvram[offset] & 0xff; | |
| 2548 | return m_kiwame_nvram[offset] & 0xff; | |
| 2566 | 2549 | } |
| 2567 | 2550 | |
| 2568 | ||
| 2551 | ||
| 2569 | 2552 | { |
| 2570 | 2553 | if (ACCESSING_BITS_0_7) |
| 2571 | 2554 | { |
| 2572 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2573 | COMBINE_DATA( &state->m_kiwame_nvram[offset] ); | |
| 2555 | COMBINE_DATA( &m_kiwame_nvram[offset] ); | |
| 2574 | 2556 | } |
| 2575 | 2557 | } |
| 2576 | 2558 | |
| 2577 | ||
| 2559 | ||
| 2578 | 2560 | { |
| 2579 | 2561 | int row_select = kiwame_nvram_r( space, 0x10a/2,0x00ff ) & 0x1f; |
| 2580 | 2562 | int i; |
| r14896 | r14897 | |
| 2585 | 2567 | |
| 2586 | 2568 | switch( offset ) |
| 2587 | 2569 | { |
| 2588 | case 0x00/2: return input_port_read( | |
| 2570 | case 0x00/2: return input_port_read( | |
| 2589 | 2571 | case 0x02/2: return 0xffff; |
| 2590 | case 0x04/2: return input_port_read( | |
| 2572 | case 0x04/2: return input_port_read( | |
| 2591 | 2573 | // case 0x06/2: |
| 2592 | 2574 | case 0x08/2: return 0xffff; |
| 2593 | 2575 | |
| 2594 | 2576 | default: |
| 2595 | logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space | |
| 2577 | logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space. | |
| 2596 | 2578 | return 0x0000; |
| 2597 | 2579 | } |
| 2598 | 2580 | } |
| r14896 | r14897 | |
| 2600 | 2582 | static ADDRESS_MAP_START( kiwame_map, AS_PROGRAM, 16, seta_state ) |
| 2601 | 2583 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 2602 | 2584 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM |
| 2603 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE | |
| 2585 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE | |
| 2604 | 2586 | AM_RANGE(0x800000, 0x803fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 2605 | 2587 | /**/AM_RANGE(0x900000, 0x900001) AM_RAM // ? 0x4000 |
| 2606 | 2588 | /**/AM_RANGE(0xa00000, 0xa005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 2607 | 2589 | AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 2608 | 2590 | AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2609 | 2591 | AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 2610 | AM_RANGE(0xd00000, 0xd00009) AM_READ_LEGACY(kiwame_input_r) // mahjong panel | |
| 2611 | AM_RANGE(0xe00000, 0xe00003) AM_READ_LEGACY(seta_dsw_r) // DSW | |
| 2592 | AM_RANGE(0xd00000, 0xd00009) AM_READ(kiwame_input_r) // mahjong panel | |
| 2593 | AM_RANGE(0xe00000, 0xe00003) AM_READ(seta_dsw_r) // DSW | |
| 2612 | 2594 | ADDRESS_MAP_END |
| 2613 | 2595 | |
| 2614 | 2596 | |
| r14896 | r14897 | |
| 2616 | 2598 | Thunder & Lightning / Wit's |
| 2617 | 2599 | ***************************************************************************/ |
| 2618 | 2600 | |
| 2619 | ||
| 2601 | ||
| 2620 | 2602 | { |
| 2621 | // logerror("PC %06X - Protection Read\n", cpu_get_pc(&space | |
| 2603 | // logerror("PC %06X - Protection Read\n", cpu_get_pc(&space. | |
| 2622 | 2604 | return 0x00dd; |
| 2623 | 2605 | } |
| 2624 | ||
| 2606 | ||
| 2625 | 2607 | { |
| 2626 | // logerror("PC %06X - Protection Written: %04X <- %04X\n", cpu_get_pc(&space | |
| 2608 | // logerror("PC %06X - Protection Written: %04X <- %04X\n", cpu_get_pc(&space. | |
| 2627 | 2609 | } |
| 2628 | 2610 | |
| 2629 | 2611 | /* Similar to downtown etc. */ |
| r14896 | r14897 | |
| 2634 | 2616 | AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 2635 | 2617 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP // ? |
| 2636 | 2618 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP // ? |
| 2637 | AM_RANGE(0x400000, 0x40ffff) AM_WRITE | |
| 2619 | AM_RANGE(0x400000, 0x40ffff) AM_WRITE | |
| 2638 | 2620 | AM_RANGE(0x500000, 0x500001) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout |
| 2639 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2621 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2640 | 2622 | AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2641 | 2623 | AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1") // P1 |
| 2642 | 2624 | AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2") // P2 |
| 2643 | 2625 | AM_RANGE(0xb00004, 0xb00005) AM_READ_PORT("COINS") // Coins |
| 2644 | AM_RANGE(0xb0000c, 0xb0000d) AM_READ | |
| 2626 | AM_RANGE(0xb0000c, 0xb0000d) AM_READ | |
| 2645 | 2627 | AM_RANGE(0xb00008, 0xb00009) AM_READ_PORT("P3") // P3 (wits) |
| 2646 | 2628 | AM_RANGE(0xb0000a, 0xb0000b) AM_READ_PORT("P4") // P4 (wits) |
| 2647 | 2629 | /**/AM_RANGE(0xc00000, 0xc00001) AM_RAM // ? 0x4000 |
| r14896 | r14897 | |
| 2658 | 2640 | // AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 2659 | 2641 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP // ? |
| 2660 | 2642 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP // ? |
| 2661 | // AM_RANGE(0x400000, 0x40ffff) AM_WRITE | |
| 2643 | // AM_RANGE(0x400000, 0x40ffff) AM_WRITE | |
| 2662 | 2644 | AM_RANGE(0x500000, 0x500001) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout |
| 2663 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2645 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2664 | 2646 | AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2665 | 2647 | AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1") // P1 |
| 2666 | 2648 | AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2") // P2 |
| 2667 | 2649 | AM_RANGE(0xb00004, 0xb00005) AM_READ_PORT("COINS") // Coins |
| 2668 | // AM_RANGE(0xb0000c, 0xb0000d) AM_READ | |
| 2650 | // AM_RANGE(0xb0000c, 0xb0000d) AM_READ | |
| 2669 | 2651 | AM_RANGE(0xb00008, 0xb00009) AM_READ_PORT("P3") // P3 (wits) |
| 2670 | 2652 | AM_RANGE(0xb0000a, 0xb0000b) AM_READ_PORT("P4") // P4 (wits) |
| 2671 | 2653 | /**/AM_RANGE(0xc00000, 0xc00001) AM_RAM // ? 0x4000 |
| r14896 | r14897 | |
| 2679 | 2661 | Wiggie Waggie |
| 2680 | 2662 | ***************************************************************************/ |
| 2681 | 2663 | |
| 2682 | ||
| 2664 | ||
| 2683 | 2665 | { |
| 2684 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2685 | 2666 | |
| 2686 | return | |
| 2667 | return | |
| 2687 | 2668 | } |
| 2688 | 2669 | |
| 2689 | ||
| 2670 | ||
| 2690 | 2671 | { |
| 2691 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2692 | 2672 | |
| 2693 | state->m_wiggie_soundlatch = data >> 8; | |
| 2694 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); | |
| 2673 | m_wiggie_soundlatch = data >> 8; | |
| 2674 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); | |
| 2695 | 2675 | } |
| 2696 | 2676 | |
| 2697 | 2677 | |
| r14896 | r14897 | |
| 2700 | 2680 | AM_RANGE(0xffc000, 0xffffff) AM_RAM // RAM |
| 2701 | 2681 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP // ? |
| 2702 | 2682 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP // ? |
| 2703 | AM_RANGE(0x400000, 0x40ffff) AM_WRITE | |
| 2683 | AM_RANGE(0x400000, 0x40ffff) AM_WRITE | |
| 2704 | 2684 | AM_RANGE(0x500000, 0x500001) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout |
| 2705 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2685 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2706 | 2686 | AM_RANGE(0x700000, 0x7003ff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2707 | 2687 | AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1") // P1 |
| 2708 | 2688 | AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2") // P2 |
| 2709 | 2689 | AM_RANGE(0xb00004, 0xb00005) AM_READ_PORT("COINS") // Coins |
| 2710 | AM_RANGE(0xb0000c, 0xb0000d) AM_READ | |
| 2690 | AM_RANGE(0xb0000c, 0xb0000d) AM_READ | |
| 2711 | 2691 | AM_RANGE(0xb00008, 0xb00009) AM_READ_PORT("P3") // P3 (wits) |
| 2712 | 2692 | AM_RANGE(0xb0000a, 0xb0000b) AM_READ_PORT("P4") // P4 (wits) |
| 2713 | 2693 | /**/AM_RANGE(0xc00000, 0xc00001) AM_RAM // ? 0x4000 |
| r14896 | r14897 | |
| 2721 | 2701 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 2722 | 2702 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 2723 | 2703 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2724 | AM_RANGE(0xa000, 0xa000) AM_READ | |
| 2704 | AM_RANGE(0xa000, 0xa000) AM_READ | |
| 2725 | 2705 | ADDRESS_MAP_END |
| 2726 | 2706 | |
| 2727 | 2707 | |
| r14896 | r14897 | |
| 2740 | 2720 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // ? (end of lev 2) |
| 2741 | 2721 | AM_RANGE(0x400004, 0x400005) AM_WRITENOP // ? (end of lev 2) |
| 2742 | 2722 | AM_RANGE(0x500000, 0x500001) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Video Registers |
| 2743 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2723 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2744 | 2724 | AM_RANGE(0xa00000, 0xa005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 2745 | 2725 | AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 2746 | 2726 | /**/AM_RANGE(0xa80000, 0xa80001) AM_RAM // ? 0x4000 |
| r14896 | r14897 | |
| 2753 | 2733 | Ultra Toukond Densetsu |
| 2754 | 2734 | ***************************************************************************/ |
| 2755 | 2735 | |
| 2756 | ||
| 2736 | ||
| 2757 | 2737 | { |
| 2758 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2759 | 2738 | if (ACCESSING_BITS_0_7) |
| 2760 | 2739 | { |
| 2761 | cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE); | |
| 2762 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 2740 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); | |
| 2741 | soundlatch_byte_w(*&space, 0, data & 0xff); | |
| 2763 | 2742 | } |
| 2764 | 2743 | } |
| 2765 | 2744 | |
| r14896 | r14897 | |
| 2770 | 2749 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 |
| 2771 | 2750 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins |
| 2772 | 2751 | AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // ? Coin Lockout + Video Registers |
| 2773 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2752 | AM_RANGE(0x600000, 0x600003) AM_READ | |
| 2774 | 2753 | AM_RANGE(0x700400, 0x700fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2775 | 2754 | AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(seta_vram_0_w) AM_BASE(m_vram_0) // VRAM 0&1 |
| 2776 | 2755 | AM_RANGE(0x880000, 0x883fff) AM_RAM_WRITE(seta_vram_2_w) AM_BASE(m_vram_2) // VRAM 2&3 |
| r14896 | r14897 | |
| 2779 | 2758 | AM_RANGE(0xa00000, 0xa005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 2780 | 2759 | AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 2781 | 2760 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| 2782 | AM_RANGE(0xc00000, 0xc00001) AM_WRITE | |
| 2761 | AM_RANGE(0xc00000, 0xc00001) AM_WRITE | |
| 2783 | 2762 | AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP // ? ack |
| 2784 | 2763 | ADDRESS_MAP_END |
| 2785 | 2764 | |
| r14896 | r14897 | |
| 2787 | 2766 | Pairs Love |
| 2788 | 2767 | ***************************************************************************/ |
| 2789 | 2768 | |
| 2790 | ||
| 2769 | ||
| 2791 | 2770 | { |
| 2792 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2793 | 2771 | int retdata; |
| 2794 | 2772 | |
| 2795 | retdata = state->m_pairslove_protram[offset]; | |
| 2796 | //mame_printf_debug("pairs love protection? read %06x %04x %04x\n",cpu_get_pc(&space->device()), offset,retdata); | |
| 2797 | state->m_pairslove_protram[offset] = state->m_pairslove_protram_old[offset]; | |
| 2773 | retdata = m_pairslove_protram[offset]; | |
| 2774 | //mame_printf_debug("pairs love protection? read %06x %04x %04x\n",cpu_get_pc(&space.device()), offset,retdata); | |
| 2775 | m_pairslove_protram[offset] = m_pairslove_protram_old[offset]; | |
| 2798 | 2776 | return retdata; |
| 2799 | 2777 | } |
| 2800 | 2778 | |
| 2801 | ||
| 2779 | ||
| 2802 | 2780 | { |
| 2803 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2804 | //mame_printf_debug("pairs love protection? write %06x %04x %04x\n",cpu_get_pc(&space->device()), offset,data); | |
| 2805 | state->m_pairslove_protram_old[offset] = state->m_pairslove_protram[offset]; | |
| 2806 | state->m_pairslove_protram[offset] = data; | |
| 2781 | //mame_printf_debug("pairs love protection? write %06x %04x %04x\n",cpu_get_pc(&space.device()), offset,data); | |
| 2782 | m_pairslove_protram_old[offset] = m_pairslove_protram[offset]; | |
| 2783 | m_pairslove_protram[offset] = data; | |
| 2807 | 2784 | } |
| 2808 | 2785 | |
| 2809 | 2786 | static ADDRESS_MAP_START( pairlove_map, AS_PROGRAM, 16, seta_state ) |
| 2810 | 2787 | AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM |
| 2811 | 2788 | AM_RANGE(0x100000, 0x100001) AM_WRITENOP // ? 1 (start of interrupts, main loop: watchdog?) |
| 2812 | 2789 | AM_RANGE(0x200000, 0x200001) AM_WRITENOP // ? 0/1 (IRQ acknowledge?) |
| 2813 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2790 | AM_RANGE(0x300000, 0x300003) AM_READ | |
| 2814 | 2791 | AM_RANGE(0x400000, 0x400001) AM_RAM_WRITE(seta_vregs_w) AM_BASE(m_vregs) // Coin Lockout + Sound Enable (bit 4?) |
| 2815 | 2792 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 |
| 2816 | 2793 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 |
| 2817 | 2794 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins |
| 2818 | AM_RANGE(0x900000, 0x9001ff) AM_READWRITE | |
| 2795 | AM_RANGE(0x900000, 0x9001ff) AM_READWRITE | |
| 2819 | 2796 | AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound |
| 2820 | 2797 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2821 | 2798 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| r14896 | r14897 | |
| 2838 | 2815 | AM_RANGE(0x610004, 0x610005) AM_READ_PORT("INPUT") |
| 2839 | 2816 | AM_RANGE(0x610006, 0x610007) AM_WRITENOP |
| 2840 | 2817 | AM_RANGE(0x620000, 0x620003) AM_WRITENOP // protection |
| 2841 | AM_RANGE(0x630000, 0x630003) AM_READ | |
| 2818 | AM_RANGE(0x630000, 0x630003) AM_READ | |
| 2842 | 2819 | AM_RANGE(0x640400, 0x640fff) AM_WRITEONLY AM_BASE_SIZE(m_paletteram, m_paletteram_size) // Palette |
| 2843 | 2820 | AM_RANGE(0x650000, 0x650003) AM_DEVWRITE8_LEGACY("ymsnd", ym3812_w, 0x00ff) |
| 2844 | 2821 | AM_RANGE(0x658000, 0x658001) AM_DEVWRITE8("oki", okim6295_device, write, 0x00ff) |
| r14896 | r14897 | |
| 2858 | 2835 | International Toote |
| 2859 | 2836 | ***************************************************************************/ |
| 2860 | 2837 | |
| 2861 | ||
| 2838 | ||
| 2862 | 2839 | { |
| 2863 | 2840 | int shift = offset * 4; |
| 2864 | return ((((input_port_read(space->machine(), "DSW1") >> shift) & 0xf)) << 0) | | |
| 2865 | ((((input_port_read(space->machine(), "DSW2_3") >> shift) & 0xf)) << 4) | | |
| 2866 | ((((input_port_read(space->machine(), "DSW2_3") >> (shift+8)) & 0xf)) << 8) ; | |
| 2841 | return ((((input_port_read(machine(), "DSW1") >> shift) & 0xf)) << 0) | | |
| 2842 | ((((input_port_read(machine(), "DSW2_3") >> shift) & 0xf)) << 4) | | |
| 2843 | ((((input_port_read(machine(), "DSW2_3") >> (shift+8)) & 0xf)) << 8) ; | |
| 2867 | 2844 | } |
| 2868 | 2845 | |
| 2869 | ||
| 2846 | ||
| 2870 | 2847 | { |
| 2871 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2872 | 2848 | |
| 2873 | switch( * | |
| 2849 | switch( * | |
| 2874 | 2850 | { |
| 2875 | case 0x08: return input_port_read(space->machine(), "BET0"); | |
| 2876 | case 0x10: return input_port_read(space->machine(), "BET1"); | |
| 2877 | case 0x20: return input_port_read(space->machine(), "BET2"); | |
| 2878 | case 0x40: return input_port_read(space->machine(), "BET3"); | |
| 2879 | case 0x80: return input_port_read(space->machine(), "BET4"); | |
| 2851 | case 0x08: return input_port_read(machine(), "BET0"); | |
| 2852 | case 0x10: return input_port_read(machine(), "BET1"); | |
| 2853 | case 0x20: return input_port_read(machine(), "BET2"); | |
| 2854 | case 0x40: return input_port_read(machine(), "BET3"); | |
| 2855 | case 0x80: return input_port_read(machine(), "BET4"); | |
| 2880 | 2856 | } |
| 2881 | 2857 | |
| 2882 | logerror("%06X: unknown read, select = %04x\n",cpu_get_pc(&space | |
| 2858 | logerror("%06X: unknown read, select = %04x\n",cpu_get_pc(&space. | |
| 2883 | 2859 | return 0xffff; |
| 2884 | 2860 | } |
| 2885 | 2861 | |
| 2886 | ||
| 2862 | ||
| 2887 | 2863 | { |
| 2888 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2889 | 2864 | |
| 2890 | return | |
| 2865 | return | |
| 2891 | 2866 | } |
| 2892 | 2867 | |
| 2893 | 2868 | static ADDRESS_MAP_START( inttoote_map, AS_PROGRAM, 16, seta_state ) |
| 2894 | 2869 | AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM (up to 2MB) |
| 2895 | 2870 | |
| 2896 | AM_RANGE(0x200000, 0x200001) AM_RAM_READ | |
| 2871 | AM_RANGE(0x200000, 0x200001) AM_RAM_READ | |
| 2897 | 2872 | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("P1") |
| 2898 | 2873 | AM_RANGE(0x200010, 0x200011) AM_READ_PORT("P2") AM_WRITENOP |
| 2899 | 2874 | |
| r14896 | r14897 | |
| 2904 | 2879 | AM_RANGE(0x300040, 0x300041) AM_WRITENOP // lev4 ack |
| 2905 | 2880 | AM_RANGE(0x300060, 0x300061) AM_WRITENOP // lev6 ack |
| 2906 | 2881 | |
| 2907 | AM_RANGE(0x500000, 0x500003) AM_READ | |
| 2882 | AM_RANGE(0x500000, 0x500003) AM_READ | |
| 2908 | 2883 | |
| 2909 | AM_RANGE(0x700000, 0x700101) AM_RAM_READ | |
| 2884 | AM_RANGE(0x700000, 0x700101) AM_RAM_READ | |
| 2910 | 2885 | |
| 2911 | 2886 | AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff) |
| 2912 | 2887 | |
| r14896 | r14897 | |
| 2925 | 2900 | AM_RANGE(0xffc000, 0xffffff) AM_RAM // RAM |
| 2926 | 2901 | ADDRESS_MAP_END |
| 2927 | 2902 | |
| 2928 | ||
| 2903 | ||
| 2929 | 2904 | { |
| 2930 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2931 | 2905 | |
| 2932 | switch( | |
| 2906 | switch( | |
| 2933 | 2907 | { |
| 2934 | case 0x08: return input_port_read(space->machine(), "BET0"); | |
| 2935 | case 0x10: return input_port_read(space->machine(), "BET1"); | |
| 2936 | case 0x20: return input_port_read(space->machine(), "BET2"); | |
| 2937 | case 0x40: return input_port_read(space->machine(), "BET3"); | |
| 2938 | case 0x80: return input_port_read(space->machine(), "BET4"); | |
| 2908 | case 0x08: return input_port_read(machine(), "BET0"); | |
| 2909 | case 0x10: return input_port_read(machine(), "BET1"); | |
| 2910 | case 0x20: return input_port_read(machine(), "BET2"); | |
| 2911 | case 0x40: return input_port_read(machine(), "BET3"); | |
| 2912 | case 0x80: return input_port_read(machine(), "BET4"); | |
| 2939 | 2913 | } |
| 2940 | 2914 | |
| 2941 | 2915 | return 0xffff; |
| 2942 | 2916 | } |
| 2943 | 2917 | |
| 2944 | ||
| 2918 | ||
| 2945 | 2919 | { |
| 2946 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 2947 | 2920 | |
| 2948 | 2921 | /* other bits used too */ |
| 2949 | | |
| 2922 | | |
| 2950 | 2923 | } |
| 2951 | 2924 | |
| 2952 | ||
| 2925 | ||
| 2953 | 2926 | { |
| 2954 | return 0xffff;// | |
| 2927 | return 0xffff;// | |
| 2955 | 2928 | } |
| 2956 | 2929 | |
| 2957 | 2930 | /* same as International Toote but without the protection and different RTC hook-up */ |
| 2958 | 2931 | static ADDRESS_MAP_START( jockeyc_map, AS_PROGRAM, 16, seta_state ) |
| 2959 | 2932 | AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM (up to 2MB) |
| 2960 | 2933 | |
| 2961 | AM_RANGE(0x200000, 0x200001) AM_READWRITE | |
| 2934 | AM_RANGE(0x200000, 0x200001) AM_READWRITE | |
| 2962 | 2935 | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("P1") |
| 2963 | 2936 | AM_RANGE(0x200010, 0x200011) AM_READ_PORT("P2") AM_WRITENOP |
| 2964 | 2937 | |
| r14896 | r14897 | |
| 2971 | 2944 | AM_RANGE(0x300040, 0x300041) AM_WRITENOP // lev4 ack |
| 2972 | 2945 | AM_RANGE(0x300060, 0x300061) AM_WRITENOP // lev6 ack |
| 2973 | 2946 | |
| 2974 | AM_RANGE(0x500000, 0x500003) AM_READ_LEGACY(inttoote_dsw_r) // DSW x 3 | |
| 2975 | AM_RANGE(0x600000, 0x600003) AM_READ_LEGACY(unk_r) | |
| 2947 | AM_RANGE(0x500000, 0x500003) AM_READ(inttoote_dsw_r) // DSW x 3 | |
| 2948 | AM_RANGE(0x600000, 0x600003) AM_READ(unk_r) | |
| 2976 | 2949 | |
| 2977 | 2950 | AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff) |
| 2978 | 2951 | |
| r14896 | r14897 | |
| 3000 | 2973 | |
| 3001 | 2974 | ***************************************************************************/ |
| 3002 | 2975 | |
| 3003 | ||
| 2976 | ||
| 3004 | 2977 | { |
| 3005 | UINT8 *rom = | |
| 2978 | UINT8 *rom = | |
| 3006 | 2979 | int bank = data >> 4; |
| 3007 | 2980 | |
| 3008 | memory_set_bankptr( | |
| 2981 | memory_set_bankptr( | |
| 3009 | 2982 | } |
| 3010 | 2983 | |
| 3011 | ||
| 2984 | ||
| 3012 | 2985 | { |
| 3013 | 2986 | sub_bankswitch_w(space,offset,data); |
| 3014 | seta_coin_lockout_w( | |
| 2987 | seta_coin_lockout_w( | |
| 3015 | 2988 | } |
| 3016 | 2989 | |
| 3017 | 2990 | |
| r14896 | r14897 | |
| 3019 | 2992 | Thundercade |
| 3020 | 2993 | ***************************************************************************/ |
| 3021 | 2994 | |
| 3022 | ||
| 2995 | ||
| 3023 | 2996 | |
| 3024 | 2997 | static ADDRESS_MAP_START( tndrcade_sub_map, AS_PROGRAM, 8, seta_state ) |
| 3025 | 2998 | AM_RANGE(0x0000, 0x01ff) AM_RAM // RAM |
| 3026 | AM_RANGE(0x0800, 0x0800) AM_READ_LEGACY(ff_r) // ? (bits 0/1/2/3: 1 -> do test 0-ff/100-1e0/5001-57ff/banked rom) | |
| 3027 | //AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_r) // | |
| 3028 | //AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_r) // | |
| 2999 | AM_RANGE(0x0800, 0x0800) AM_READ(ff_r) // ? (bits 0/1/2/3: 1 -> do test 0-ff/100-1e0/5001-57ff/banked rom) | |
| 3000 | //AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_byte_r) // | |
| 3001 | //AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_byte_r) // | |
| 3029 | 3002 | AM_RANGE(0x1000, 0x1000) AM_READ_PORT("P1") // P1 |
| 3030 | AM_RANGE(0x1000, 0x1000) AM_WRITE | |
| 3003 | AM_RANGE(0x1000, 0x1000) AM_WRITE | |
| 3031 | 3004 | AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P2") // P2 |
| 3032 | 3005 | AM_RANGE(0x1002, 0x1002) AM_READ_PORT("COINS") // Coins |
| 3033 | 3006 | AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w) |
| r14896 | r14897 | |
| 3045 | 3018 | |
| 3046 | 3019 | static ADDRESS_MAP_START( twineagl_sub_map, AS_PROGRAM, 8, seta_state ) |
| 3047 | 3020 | AM_RANGE(0x0000, 0x01ff) AM_RAM // RAM |
| 3048 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_r) // | |
| 3049 | AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_r) // | |
| 3021 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_byte_r) // | |
| 3022 | AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_byte_r) // | |
| 3050 | 3023 | AM_RANGE(0x1000, 0x1000) AM_READ_PORT("P1") // P1 |
| 3051 | AM_RANGE(0x1000, 0x1000) AM_WRITE | |
| 3024 | AM_RANGE(0x1000, 0x1000) AM_WRITE | |
| 3052 | 3025 | AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P2") // P2 |
| 3053 | 3026 | AM_RANGE(0x1002, 0x1002) AM_READ_PORT("COINS") // Coins |
| 3054 | 3027 | AM_RANGE(0x5000, 0x57ff) AM_RAM AM_BASE(m_sharedram) // Shared RAM |
| r14896 | r14897 | |
| 3062 | 3035 | DownTown |
| 3063 | 3036 | ***************************************************************************/ |
| 3064 | 3037 | |
| 3065 | ||
| 3038 | ||
| 3066 | 3039 | { |
| 3067 | int dir1 = input_port_read(space->machine(), "ROT1"); // analog port | |
| 3068 | int dir2 = input_port_read(space->machine(), "ROT2"); // analog port | |
| 3040 | int dir1 = input_port_read(machine(), "ROT1"); // analog port | |
| 3041 | int dir2 = input_port_read(machine(), "ROT2"); // analog port | |
| 3069 | 3042 | |
| 3070 | 3043 | dir1 = (~ (0x800 >> dir1)) & 0xfff; |
| 3071 | 3044 | dir2 = (~ (0x800 >> dir2)) & 0xfff; |
| 3072 | 3045 | |
| 3073 | 3046 | switch (offset) |
| 3074 | 3047 | { |
| 3075 | case 0: return (input_port_read( | |
| 3048 | case 0: return (input_port_read( | |
| 3076 | 3049 | case 1: return (dir1 & 0xff); // lower 8 bits of p1 rotation |
| 3077 | case 2: return input_port_read( | |
| 3050 | case 2: return input_port_read( | |
| 3078 | 3051 | case 3: return 0xff; // ? |
| 3079 | 3052 | case 4: return (dir2 >> 8); // upper 4 bits of p2 rotation + ? |
| 3080 | 3053 | case 5: return (dir2 & 0xff); // lower 8 bits of p2 rotation |
| 3081 | case 6: return input_port_read( | |
| 3054 | case 6: return input_port_read( | |
| 3082 | 3055 | case 7: return 0xff; // ? |
| 3083 | 3056 | } |
| 3084 | 3057 | |
| r14896 | r14897 | |
| 3087 | 3060 | |
| 3088 | 3061 | static ADDRESS_MAP_START( downtown_sub_map, AS_PROGRAM, 8, seta_state ) |
| 3089 | 3062 | AM_RANGE(0x0000, 0x01ff) AM_RAM // RAM |
| 3090 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_r) // | |
| 3091 | AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_r) // | |
| 3092 | AM_RANGE(0x1000, 0x1007) AM_READ_LEGACY(downtown_ip_r) // Input Ports | |
| 3093 | AM_RANGE(0x1000, 0x1000) AM_WRITE_LEGACY(sub_bankswitch_lockout_w) // ROM Bank + Coin Lockout | |
| 3063 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_byte_r) // | |
| 3064 | AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_byte_r) // | |
| 3065 | AM_RANGE(0x1000, 0x1007) AM_READ(downtown_ip_r) // Input Ports | |
| 3066 | AM_RANGE(0x1000, 0x1000) AM_WRITE(sub_bankswitch_lockout_w) // ROM Bank + Coin Lockout | |
| 3094 | 3067 | AM_RANGE(0x5000, 0x57ff) AM_RAM AM_BASE(m_sharedram) // Shared RAM |
| 3095 | 3068 | AM_RANGE(0x7000, 0x7fff) AM_ROM // ROM |
| 3096 | 3069 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // Banked ROM |
| r14896 | r14897 | |
| 3105 | 3078 | static MACHINE_RESET(calibr50) |
| 3106 | 3079 | { |
| 3107 | 3080 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3108 | sub_bankswitch_w(space, 0, 0); | |
| 3081 | seta_state *state = machine.driver_data<seta_state>(); | |
| 3082 | state->sub_bankswitch_w(*space, 0, 0); | |
| 3109 | 3083 | } |
| 3110 | 3084 | |
| 3111 | ||
| 3085 | ||
| 3112 | 3086 | { |
| 3113 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 3114 | state->soundlatch2_w(*space,0,data); | |
| 3115 | device_spin_until_time(&space->device(), attotime::from_usec(50)); // Allow the other cpu to reply | |
| 3087 | soundlatch2_byte_w(space,0,data); | |
| 3088 | device_spin_until_time(&space.device(), attotime::from_usec(50)); // Allow the other cpu to reply | |
| 3116 | 3089 | } |
| 3117 | 3090 | |
| 3118 | 3091 | static ADDRESS_MAP_START( calibr50_sub_map, AS_PROGRAM, 8, seta_state ) |
| 3119 | 3092 | AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_r,seta_sound_w) // Sound |
| 3120 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r) // From Main CPU | |
| 3121 | AM_RANGE(0x4000, 0x4000) AM_WRITE_LEGACY(sub_bankswitch_w) // Bankswitching | |
| 3093 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 3094 | AM_RANGE(0x4000, 0x4000) AM_WRITE(sub_bankswitch_w) // Bankswitching | |
| 3122 | 3095 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // Banked ROM |
| 3123 | 3096 | AM_RANGE(0xc000, 0xffff) AM_ROM // ROM |
| 3124 | AM_RANGE(0xc000, 0xc000) AM_WRITE | |
| 3097 | AM_RANGE(0xc000, 0xc000) AM_WRITE | |
| 3125 | 3098 | ADDRESS_MAP_END |
| 3126 | 3099 | |
| 3127 | 3100 | |
| r14896 | r14897 | |
| 3131 | 3104 | |
| 3132 | 3105 | static ADDRESS_MAP_START( metafox_sub_map, AS_PROGRAM, 8, seta_state ) |
| 3133 | 3106 | AM_RANGE(0x0000, 0x01ff) AM_RAM // RAM |
| 3134 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_r) // | |
| 3135 | AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_r) // | |
| 3107 | AM_RANGE(0x0800, 0x0800) AM_READ(soundlatch_byte_r) // | |
| 3108 | AM_RANGE(0x0801, 0x0801) AM_READ(soundlatch2_byte_r) // | |
| 3136 | 3109 | AM_RANGE(0x1000, 0x1000) AM_READ_PORT("COINS") // Coins |
| 3137 | AM_RANGE(0x1000, 0x1000) AM_WRITE | |
| 3110 | AM_RANGE(0x1000, 0x1000) AM_WRITE | |
| 3138 | 3111 | AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P1") // P1 |
| 3139 | 3112 | //AM_RANGE(0x1004, 0x1004) AM_READNOP // ? |
| 3140 | 3113 | AM_RANGE(0x1006, 0x1006) AM_READ_PORT("P2") // P2 |
| r14896 | r14897 | |
| 3159 | 3132 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 3160 | 3133 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym3438_r, ym3438_w) |
| 3161 | 3134 | AM_RANGE(0x80, 0x80) AM_WRITENOP //? |
| 3162 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) | |
| 3135 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) | |
| 3163 | 3136 | ADDRESS_MAP_END |
| 3164 | 3137 | |
| 3165 | 3138 | |
| r14896 | r14897 | |
| 8569 | 8542 | ADDRESS_MAP_UNMAP_HIGH |
| 8570 | 8543 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 8571 | 8544 | AM_RANGE(0x8000, 0xdfff) AM_ROM//ROMBANK("bank1") |
| 8572 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r) | |
| 8545 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) | |
| 8573 | 8546 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 8574 | 8547 | ADDRESS_MAP_END |
| 8575 | 8548 | |
| r14896 | r14897 | |
| 8579 | 8552 | AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 8580 | 8553 | //AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_DEVWRITE_LEGACY("upd", upd7759_control_w) |
| 8581 | 8554 | //AM_RANGE(0x80, 0x80) AM_MIRROR(0x3f) AM_DEVREADWRITE_LEGACY("upd", upd7759_status_r, upd7759_port_w) |
| 8582 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_READ(soundlatch_r) | |
| 8555 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_READ(soundlatch_byte_r) | |
| 8583 | 8556 | ADDRESS_MAP_END |
| 8584 | 8557 | |
| 8585 | 8558 | |
| r14896 | r14897 | |
| 10447 | 10420 | ROM_LOAD16_BYTE( "ufo018.bin", 0x001, 0x200, CRC(1c584d5f) SHA1(f1c7e3da8b108d78b459cae53fabb6e28d3a7ee8) ) |
| 10448 | 10421 | ROM_END |
| 10449 | 10422 | |
| 10450 | ||
| 10423 | ||
| 10451 | 10424 | { |
| 10452 | 10425 | /* At several points in the code, the program checks if four |
| 10453 | 10426 | consecutive bytes in this range are equal to a string, and if they |
| r14896 | r14897 | |
| 10479 | 10452 | |
| 10480 | 10453 | /* Extra RAM ? Check code at 0x00ba90 */ |
| 10481 | 10454 | /* 2000F8 = A3 enables it, 2000F8 = 00 disables? see downtown too */ |
| 10482 | ||
| 10455 | ||
| 10483 | 10456 | { |
| 10484 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 10485 | 10457 | |
| 10486 | 10458 | // protection check at boot |
| 10487 | logerror("%04x: twineagl_200100_r %d\n",cpu_get_pc(&space->device()),offset); | |
| 10488 | return state->m_twineagl_xram[offset]; | |
| 10459 | logerror("%04x: twineagl_200100_r %d\n",cpu_get_pc(&space.device()),offset); | |
| 10460 | return m_twineagl_xram[offset]; | |
| 10489 | 10461 | } |
| 10490 | ||
| 10462 | ||
| 10491 | 10463 | { |
| 10492 | logerror("%04x: twineagl_200100_w %d = %02x\n",cpu_get_pc(&space | |
| 10464 | logerror("%04x: twineagl_200100_w %d = %02x\n",cpu_get_pc(&space. | |
| 10493 | 10465 | |
| 10494 | 10466 | if (ACCESSING_BITS_0_7) |
| 10495 | 10467 | { |
| 10496 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 10497 | state->m_twineagl_xram[offset] = data & 0xff; | |
| 10468 | m_twineagl_xram[offset] = data & 0xff; | |
| 10498 | 10469 | } |
| 10499 | 10470 | } |
| 10500 | 10471 | |
| 10501 | 10472 | static DRIVER_INIT( twineagl ) |
| 10502 | 10473 | { |
| 10474 | seta_state *state = machine.driver_data<seta_state>(); | |
| 10503 | 10475 | /* debug? */ |
| 10504 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 10476 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 10505 | 10477 | |
| 10506 | 10478 | /* This allows 2 simultaneous players and the use of the "Copyright" Dip Switch. */ |
| 10507 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 10479 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 10508 | 10480 | } |
| 10509 | 10481 | |
| 10510 | 10482 | |
| 10511 | 10483 | /* Protection? NVRAM is handled writing commands here */ |
| 10512 | ||
| 10484 | ||
| 10513 | 10485 | { |
| 10514 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 10515 | int job = state->m_downtown_protection[0xf8/2] & 0xff; | |
| 10486 | int job = m_downtown_protection[0xf8/2] & 0xff; | |
| 10516 | 10487 | |
| 10517 | 10488 | switch (job) |
| 10518 | 10489 | { |
| r14896 | r14897 | |
| 10523 | 10494 | else return 0; |
| 10524 | 10495 | } |
| 10525 | 10496 | default: |
| 10526 | return | |
| 10497 | return | |
| 10527 | 10498 | } |
| 10528 | 10499 | } |
| 10529 | 10500 | |
| 10530 | ||
| 10501 | ||
| 10531 | 10502 | { |
| 10532 | seta_state *state = space->machine().driver_data<seta_state>(); | |
| 10533 | COMBINE_DATA(&state->m_downtown_protection[offset]); | |
| 10503 | COMBINE_DATA(&m_downtown_protection[offset]); | |
| 10534 | 10504 | } |
| 10535 | 10505 | |
| 10536 | 10506 | static DRIVER_INIT( downtown ) |
| 10537 | 10507 | { |
| 10538 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x2001ff, FUNC(downtown_protection_r), FUNC(downtown_protection_w)); | |
| 10508 | seta_state *state = machine.driver_data<seta_state>(); | |
| 10509 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x200000, 0x2001ff, read16_delegate(FUNC(seta_state::downtown_protection_r),state), write16_delegate(FUNC(seta_state::downtown_protection_w),state)); | |
| 10539 | 10510 | } |
| 10540 | 10511 | |
| 10541 | 10512 | |
| 10542 | ||
| 10513 | ||
| 10543 | 10514 | { |
| 10544 | 10515 | /* At some points in the code, the program checks if four |
| 10545 | 10516 | consecutive bytes in this range are equal to a string, and if they |
| r14896 | r14897 | |
| 10555 | 10526 | |
| 10556 | 10527 | static DRIVER_INIT( arbalest ) |
| 10557 | 10528 | { |
| 10558 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000, 0x8000f, FUNC(arbalest_debug_r)); | |
| 10529 | seta_state *state = machine.driver_data<seta_state>(); | |
| 10530 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x80000, 0x8000f, read16_delegate(FUNC(seta_state::arbalest_debug_r),state)); | |
| 10559 | 10531 | } |
| 10560 | 10532 | |
| 10561 | 10533 | |
| r14896 | r14897 | |
| 10614 | 10586 | |
| 10615 | 10587 | static DRIVER_INIT( zombraid ) |
| 10616 | 10588 | { |
| 10617 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf00002, 0xf00003, FUNC(zombraid_gun_r)); | |
| 10618 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf00000, 0xf00001, FUNC(zombraid_gun_w)); | |
| 10589 | seta_state *state = machine.driver_data<seta_state>(); | |
| 10590 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf00002, 0xf00003, read16_delegate(FUNC(seta_state::zombraid_gun_r),state)); | |
| 10591 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xf00000, 0xf00001, write16_delegate(FUNC(seta_state::zombraid_gun_w),state)); | |
| 10619 | 10592 | } |
| 10620 | 10593 | |
| 10621 | 10594 | |
| r14896 | r14897 | |
| 10666 | 10639 | |
| 10667 | 10640 | /* X1_010 is not used. */ |
| 10668 | 10641 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x100000, 0x103fff); |
| 10642 | seta_state *state = machine.driver_data<seta_state>(); | |
| 10643 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xB00008, 0xB00009, write16_delegate(FUNC(seta_state::wiggie_soundlatch_w),state)); | |
| 10669 | 10644 | |
| 10670 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xB00008, 0xB00009, FUNC(wiggie_soundlatch_w)); | |
| 10671 | ||
| 10672 | 10645 | } |
| 10673 | 10646 | |
| 10674 | 10647 | static DRIVER_INIT( crazyfgt ) |
| r14896 | r14897 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | m_input_mux = (data & 0x30) >> 4; |
| 67 | 67 | |
| 68 | flip_screen_set_no_update( | |
| 68 | flip_screen_set_no_update( | |
| 69 | 69 | |
| 70 | 70 | coin_counter_w(machine(), 0,data & 1); |
| 71 | 71 | |
| r14896 | r14897 | |
| 180 | 180 | static ADDRESS_MAP_START( laserbat_io_map, AS_IO, 8, laserbat_state ) |
| 181 | 181 | AM_RANGE(0x00, 0x00) AM_WRITE(laserbat_cnteff_w) |
| 182 | 182 | AM_RANGE(0x01, 0x01) AM_WRITE(video_extra_w) |
| 183 | AM_RANGE(0x02, 0x02) AM_READ(laserbat_input_r) AM_WRITE | |
| 183 | AM_RANGE(0x02, 0x02) AM_READ(laserbat_input_r) AM_WRITE | |
| 184 | 184 | AM_RANGE(0x04, 0x05) AM_WRITE(sprite_x_y_w) |
| 185 | 185 | AM_RANGE(0x06, 0x06) AM_WRITE(laserbat_input_mux_w) |
| 186 | AM_RANGE(0x07, 0x07) AM_WRITE | |
| 186 | AM_RANGE(0x07, 0x07) AM_WRITE | |
| 187 | 187 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE") |
| 188 | 188 | ADDRESS_MAP_END |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | static ADDRESS_MAP_START( catnmous_io_map, AS_IO, 8, laserbat_state ) |
| 192 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_w) // soundlatch ? | |
| 192 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_byte_w) // soundlatch ? | |
| 193 | 193 | AM_RANGE(0x01, 0x01) AM_WRITE(video_extra_w) |
| 194 | 194 | AM_RANGE(0x02, 0x02) AM_READ(laserbat_input_r) |
| 195 | 195 | AM_RANGE(0x02, 0x02) AM_WRITENOP // unknown |
| r14896 | r14897 | |
| 650 | 650 | AY8910_LEGACY_OUTPUT, |
| 651 | 651 | AY8910_DEFAULT_LOADS, |
| 652 | 652 | DEVCB_NULL, |
| 653 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 653 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 654 | 654 | DEVCB_NULL,//ay8910_port0a_w, |
| 655 | 655 | DEVCB_NULL |
| 656 | 656 | }; |
| r14896 | r14897 | |
|---|---|---|
| 135 | 135 | AM_RANGE(0x3004, 0x3004) AM_WRITEONLY AM_BASE(m_flipscreen_x) |
| 136 | 136 | AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_BASE(m_flipscreen_y) |
| 137 | 137 | AM_RANGE(0x3800, 0x3800) AM_WRITE(tp84_sh_irqtrigger_w) |
| 138 | AM_RANGE(0x3a00, 0x3a00) AM_WRITE(soundlatch_w) | |
| 138 | AM_RANGE(0x3a00, 0x3a00) AM_WRITE(soundlatch_byte_w) | |
| 139 | 139 | AM_RANGE(0x3c00, 0x3c00) AM_WRITEONLY AM_BASE(m_scroll_x) |
| 140 | 140 | AM_RANGE(0x3e00, 0x3e00) AM_WRITEONLY AM_BASE(m_scroll_y) |
| 141 | 141 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(m_bg_videoram) |
| r14896 | r14897 | |
| 161 | 161 | AM_RANGE(0x1c04, 0x1c04) AM_WRITEONLY AM_BASE(m_flipscreen_x) |
| 162 | 162 | AM_RANGE(0x1c05, 0x1c05) AM_WRITEONLY AM_BASE(m_flipscreen_y) |
| 163 | 163 | AM_RANGE(0x1e00, 0x1e00) AM_WRITE(tp84_sh_irqtrigger_w) |
| 164 | AM_RANGE(0x1e80, 0x1e80) AM_WRITE(soundlatch_w) | |
| 164 | AM_RANGE(0x1e80, 0x1e80) AM_WRITE(soundlatch_byte_w) | |
| 165 | 165 | AM_RANGE(0x1f00, 0x1f00) AM_WRITEONLY AM_BASE(m_scroll_x) |
| 166 | 166 | AM_RANGE(0x1f80, 0x1f80) AM_WRITEONLY AM_BASE(m_scroll_y) |
| 167 | 167 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
| 189 | 189 | static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, tp84_state ) |
| 190 | 190 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 191 | 191 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 192 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 192 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 193 | 193 | AM_RANGE(0x8000, 0x8000) AM_READ(tp84_sh_timer_r) |
| 194 | 194 | AM_RANGE(0xa000, 0xa1ff) AM_WRITE(tp84_filter_w) |
| 195 | 195 | AM_RANGE(0xc000, 0xc000) AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 171 | 171 | /* The sound system comes all but verbatim from Double Dragon */ |
| 172 | 172 | WRITE8_MEMBER(vball_state::cpu_sound_command_w) |
| 173 | 173 | { |
| 174 | soundlatch_w(space, offset, data); | |
| 174 | soundlatch_byte_w(space, offset, data); | |
| 175 | 175 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 176 | 176 | } |
| 177 | 177 | |
| r14896 | r14897 | |
| 187 | 187 | */ |
| 188 | 188 | WRITE8_MEMBER(vball_state::vb_scrollx_hi_w) |
| 189 | 189 | { |
| 190 | flip_screen_set( | |
| 190 | flip_screen_set( | |
| 191 | 191 | m_vb_scrollx_hi = (data & 0x02) << 7; |
| 192 | 192 | vb_bgprombank_w(machine(), (data >> 2) & 0x07); |
| 193 | 193 | vb_spprombank_w(machine(), (data >> 5) & 0x07); |
| r14896 | r14897 | |
| 229 | 229 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 230 | 230 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 231 | 231 | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 232 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r) | |
| 232 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r) | |
| 233 | 233 | ADDRESS_MAP_END |
| 234 | 234 | |
| 235 | 235 |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | 0x001f PORT-AD |
| 47 | 47 | */ |
| 48 | 48 | |
| 49 | ||
| 49 | ||
| 50 | 50 | { |
| 51 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 52 | 51 | UINT8 res; |
| 53 | 52 | |
| 54 | 53 | res = 0xff; |
| 55 | 54 | offset &= 0x1f; // mirror? |
| 56 | 55 | |
| 57 | if(offset & 0x20 && !space | |
| 56 | if(offset & 0x20 && !space. | |
| 58 | 57 | printf("Reading from mirror %08x?\n",offset); |
| 59 | 58 | |
| 60 | 59 | switch(offset) |
| 61 | 60 | { |
| 62 | case 0x01: res = input_port_read(space->machine(), "PORTA"); break; // P1 | |
| 63 | case 0x03: res = input_port_read(space->machine(), "PORTB"); break; // P2 | |
| 64 | case 0x05: res = input_port_read(space->machine(), "PORTC"); break; // SYSTEM | |
| 65 | case 0x07: res = state->m_system_output | 0xf0; break; // port D, read-backs value written | |
| 66 | case 0x09: res = input_port_read(space->machine(), "PORTE"); break; // P3 | |
| 67 | case 0x0b: res = input_port_read(space->machine(), "PORTF"); break; // P4 | |
| 61 | case 0x01: res = input_port_read(machine(), "PORTA"); break; // P1 | |
| 62 | case 0x03: res = input_port_read(machine(), "PORTB"); break; // P2 | |
| 63 | case 0x05: res = input_port_read(machine(), "PORTC"); break; // SYSTEM | |
| 64 | case 0x07: res = m_system_output | 0xf0; break; // port D, read-backs value written | |
| 65 | case 0x09: res = input_port_read(machine(), "PORTE"); break; // P3 | |
| 66 | case 0x0b: res = input_port_read(machine(), "PORTF"); break; // P4 | |
| 68 | 67 | case 0x1b: res = 0; break; // Serial COM READ status |
| 69 | 68 | } |
| 70 | 69 | |
| 71 | 70 | return res; |
| 72 | 71 | } |
| 73 | 72 | |
| 74 | ||
| 73 | ||
| 75 | 74 | { |
| 76 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 77 | 75 | offset &= 0x1f; // mirror? |
| 78 | 76 | |
| 79 | if(offset & 0x20 && !space | |
| 77 | if(offset & 0x20 && !space. | |
| 80 | 78 | printf("Reading from mirror %08x?\n",offset); |
| 81 | 79 | |
| 82 | 80 | switch(offset) |
| 83 | 81 | { |
| 84 | 82 | case 0x07: |
| 85 | | |
| 83 | | |
| 86 | 84 | /*Why does the BIOS tests these as ACTIVE HIGH? A program bug?*/ |
| 87 | coin_counter_w(space->machine(), 0,~data & 0x01); | |
| 88 | coin_counter_w(space->machine(), 1,~data & 0x02); | |
| 89 | coin_lockout_w(space->machine(), 0,~data & 0x04); | |
| 90 | coin_lockout_w(space->machine(), 1,~data & 0x08); | |
| 85 | coin_counter_w(machine(), 0,~data & 0x01); | |
| 86 | coin_counter_w(machine(), 1,~data & 0x02); | |
| 87 | coin_lockout_w(machine(), 0,~data & 0x04); | |
| 88 | coin_lockout_w(machine(), 1,~data & 0x08); | |
| 91 | 89 | break; |
| 92 | 90 | } |
| 93 | 91 | } |
| 94 | 92 | |
| 95 | ||
| 93 | ||
| 96 | 94 | { |
| 97 | 95 | UINT8 res; |
| 98 | 96 | const char *const lgnames[] = { "LIGHTX", "LIGHTY" }; |
| r14896 | r14897 | |
| 103 | 101 | { |
| 104 | 102 | case 0x01: |
| 105 | 103 | case 0x03: |
| 106 | res = input_port_read( | |
| 104 | res = input_port_read( | |
| 107 | 105 | res = BITSWAP8(res, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3; |
| 108 | res |= (input_port_read( | |
| 106 | res |= (input_port_read( | |
| 109 | 107 | break; |
| 110 | 108 | default: res = stv_ioga_r(space,offset); break; |
| 111 | 109 | } |
| r14896 | r14897 | |
| 113 | 111 | return res; |
| 114 | 112 | } |
| 115 | 113 | |
| 116 | ||
| 114 | ||
| 117 | 115 | { |
| 118 | //saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 119 | 116 | UINT8 res; |
| 120 | 117 | |
| 121 | 118 | res = 0xff; |
| r14896 | r14897 | |
| 139 | 136 | return res; |
| 140 | 137 | } |
| 141 | 138 | |
| 142 | ||
| 139 | ||
| 143 | 140 | { |
| 144 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 145 | 141 | |
| 146 | 142 | switch(offset) |
| 147 | 143 | { |
| 148 | case 0x13: state->m_serial_tx = (data << 8) | (state->m_serial_tx & 0xff); break; | |
| 149 | case 0x15: state->m_serial_tx = (data & 0xff) | (state->m_serial_tx & 0xff00); break; | |
| 144 | case 0x13: m_serial_tx = (data << 8) | (m_serial_tx & 0xff); break; | |
| 145 | case 0x15: m_serial_tx = (data & 0xff) | (m_serial_tx & 0xff00); break; | |
| 150 | 146 | default: stv_ioga_w(space,offset,data); break; |
| 151 | 147 | } |
| 152 | 148 | } |
| 153 | 149 | |
| 154 | ||
| 150 | ||
| 155 | 151 | { |
| 156 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 157 | 152 | const char *const mpnames[2][5] = { |
| 158 | 153 | {"P1_KEY0", "P1_KEY1", "P1_KEY2", "P1_KEY3", "P1_KEY4"}, |
| 159 | 154 | {"P2_KEY0", "P2_KEY1", "P2_KEY2", "P2_KEY3", "P2_KEY4"} }; |
| r14896 | r14897 | |
| 165 | 160 | { |
| 166 | 161 | case 0x01: |
| 167 | 162 | case 0x03: |
| 168 | if( | |
| 163 | if( | |
| 169 | 164 | res = stv_ioga_r(space,offset); |
| 170 | 165 | else // mahjong panel select |
| 171 | 166 | { |
| r14896 | r14897 | |
| 173 | 168 | |
| 174 | 169 | for(i=0;i<5;i++) |
| 175 | 170 | { |
| 176 | if(state->m_mux_data & 1 << i) | |
| 177 | res = input_port_read(space->machine(), mpnames[offset >> 1][i]); | |
| 171 | if(m_mux_data & 1 << i) | |
| 172 | res = input_port_read(machine(), mpnames[offset >> 1][i]); | |
| 178 | 173 | } |
| 179 | 174 | } |
| 180 | 175 | break; |
| r14896 | r14897 | |
| 184 | 179 | return res; |
| 185 | 180 | } |
| 186 | 181 | |
| 187 | ||
| 182 | ||
| 188 | 183 | { |
| 189 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 190 | 184 | |
| 191 | 185 | switch(offset) |
| 192 | 186 | { |
| 193 | case 0x09: state->m_mux_data = data ^ 0xff; break; | |
| 194 | case 0x11: state->m_port_sel = data; break; | |
| 187 | case 0x09: m_mux_data = data ^ 0xff; break; | |
| 188 | case 0x11: m_port_sel = data; break; | |
| 195 | 189 | default: stv_ioga_w(space,offset,data); break; |
| 196 | 190 | } |
| 197 | 191 | } |
| 198 | 192 | |
| 199 | 193 | /* remaps with a 8-bit handler because MAME can't install r/w handlers with a different bus parallelism than the CPU native one, shrug ... */ |
| 200 | ||
| 194 | ||
| 201 | 195 | { |
| 202 | //saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 203 | 196 | UINT32 res; |
| 204 | 197 | |
| 205 | 198 | res = 0; |
| r14896 | r14897 | |
| 213 | 206 | return res; |
| 214 | 207 | } |
| 215 | 208 | |
| 216 | ||
| 209 | ||
| 217 | 210 | { |
| 218 | //saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 219 | 211 | |
| 220 | 212 | if(ACCESSING_BITS_16_23) |
| 221 | 213 | stv_ioga_w(space,offset*4+1,data >> 16); |
| r14896 | r14897 | |
| 227 | 219 | return; |
| 228 | 220 | } |
| 229 | 221 | |
| 230 | ||
| 222 | ||
| 231 | 223 | { |
| 232 | 224 | UINT32 res; |
| 233 | 225 | |
| r14896 | r14897 | |
| 237 | 229 | if(ACCESSING_BITS_0_7) |
| 238 | 230 | res |= critcrsh_ioga_r(space,offset*4+3); |
| 239 | 231 | if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31) |
| 240 | if(!space | |
| 232 | if(!space. | |
| 241 | 233 | printf("Warning: IOGA reads from odd offset %02x %08x!\n",offset*4,mem_mask); |
| 242 | 234 | |
| 243 | 235 | return res; |
| 244 | 236 | } |
| 245 | 237 | |
| 246 | ||
| 238 | ||
| 247 | 239 | { |
| 248 | 240 | UINT32 res; |
| 249 | 241 | |
| r14896 | r14897 | |
| 253 | 245 | if(ACCESSING_BITS_0_7) |
| 254 | 246 | res |= stvmp_ioga_r(space,offset*4+3); |
| 255 | 247 | if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31) |
| 256 | if(!space | |
| 248 | if(!space. | |
| 257 | 249 | printf("Warning: IOGA reads from odd offset %02x %08x!\n",offset*4,mem_mask); |
| 258 | 250 | |
| 259 | 251 | return res; |
| 260 | 252 | } |
| 261 | 253 | |
| 262 | ||
| 254 | ||
| 263 | 255 | { |
| 264 | 256 | if(ACCESSING_BITS_16_23) |
| 265 | 257 | stvmp_ioga_w(space,offset*4+1,data >> 16); |
| 266 | 258 | if(ACCESSING_BITS_0_7) |
| 267 | 259 | stvmp_ioga_w(space,offset*4+3,data); |
| 268 | 260 | if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31) |
| 269 | if(!space | |
| 261 | if(!space. | |
| 270 | 262 | printf("Warning: IOGA writes to odd offset %02x (%08x) -> %08x!",offset*4,mem_mask,data); |
| 271 | 263 | } |
| 272 | 264 | |
| 273 | ||
| 265 | ||
| 274 | 266 | { |
| 275 | 267 | UINT32 res; |
| 276 | 268 | |
| r14896 | r14897 | |
| 280 | 272 | if(ACCESSING_BITS_0_7) |
| 281 | 273 | res |= magzun_ioga_r(space,offset*4+3); |
| 282 | 274 | if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31) |
| 283 | if(!space | |
| 275 | if(!space. | |
| 284 | 276 | printf("Warning: IOGA reads from odd offset %02x %08x!\n",offset*4,mem_mask); |
| 285 | 277 | |
| 286 | 278 | return res; |
| 287 | 279 | } |
| 288 | 280 | |
| 289 | ||
| 281 | ||
| 290 | 282 | { |
| 291 | 283 | if(ACCESSING_BITS_16_23) |
| 292 | 284 | magzun_ioga_w(space,offset*4+1,data >> 16); |
| 293 | 285 | if(ACCESSING_BITS_0_7) |
| 294 | 286 | magzun_ioga_w(space,offset*4+3,data); |
| 295 | 287 | if(ACCESSING_BITS_8_15 || ACCESSING_BITS_24_31) |
| 296 | if(!space | |
| 288 | if(!space. | |
| 297 | 289 | printf("Warning: IOGA writes to odd offset %02x (%08x) -> %08x!",offset*4,mem_mask,data); |
| 298 | 290 | } |
| 299 | 291 | |
| r14896 | r14897 | |
| 352 | 344 | sh2drc_set_options(machine.device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); |
| 353 | 345 | sh2drc_set_options(machine.device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); |
| 354 | 346 | |
| 355 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(stv_ioga_r32), FUNC(stv_ioga_w32)); | |
| 356 | machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(stv_ioga_r32), FUNC(stv_ioga_w32)); | |
| 347 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stv_ioga_r32),state), write32_delegate(FUNC(saturn_state::stv_ioga_w32),state)); | |
| 348 | machine.device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stv_ioga_r32),state), write32_delegate(FUNC(saturn_state::stv_ioga_w32),state)); | |
| 357 | 349 | |
| 358 | 350 | state->m_vdp2.pal = 0; |
| 359 | 351 | } |
| r14896 | r14897 | |
| 361 | 353 | DRIVER_INIT(critcrsh) |
| 362 | 354 | { |
| 363 | 355 | DRIVER_INIT_CALL(stv); |
| 364 | ||
| 365 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(critcrsh_ioga_r32), FUNC(stv_ioga_w32)); | |
| 366 | machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(critcrsh_ioga_r32), FUNC(stv_ioga_w32)); | |
| 356 | saturn_state *state = machine.driver_data<saturn_state>(); | |
| 357 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::critcrsh_ioga_r32),state), write32_delegate(FUNC(saturn_state::stv_ioga_w32),state)); | |
| 358 | machine.device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::critcrsh_ioga_r32),state), write32_delegate(FUNC(saturn_state::stv_ioga_w32),state)); | |
| 367 | 359 | } |
| 368 | 360 | |
| 369 | 361 | /* |
| r14896 | r14897 | |
| 374 | 366 | TODO: game doesn't work if not in debugger? |
| 375 | 367 | */ |
| 376 | 368 | |
| 377 | ||
| 369 | ||
| 378 | 370 | { |
| 379 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 380 | 371 | |
| 381 | if(cpu_get_pc(&space | |
| 372 | if(cpu_get_pc(&space. | |
| 382 | 373 | |
| 383 | if(cpu_get_pc(&space | |
| 374 | if(cpu_get_pc(&space. | |
| 384 | 375 | |
| 385 | return | |
| 376 | return | |
| 386 | 377 | } |
| 387 | 378 | |
| 388 | ||
| 379 | ||
| 389 | 380 | { |
| 390 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 391 | 381 | |
| 392 | if(cpu_get_pc(&space | |
| 382 | if(cpu_get_pc(&space. | |
| 393 | 383 | |
| 394 | return | |
| 384 | return | |
| 395 | 385 | } |
| 396 | 386 | |
| 397 | 387 | DRIVER_INIT(magzun) |
| 398 | 388 | { |
| 389 | saturn_state *state = machine.driver_data<saturn_state>(); | |
| 399 | 390 | sh2drc_add_pcflush(machine.device("maincpu"), 0x604bf20); |
| 400 | 391 | sh2drc_add_pcflush(machine.device("maincpu"), 0x604bfbe); |
| 401 | 392 | sh2drc_add_pcflush(machine.device("maincpu"), 0x604c006); |
| 402 | 393 | |
| 403 | 394 | DRIVER_INIT_CALL(stv); |
| 404 | 395 | |
| 405 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(magzun_ioga_r32), FUNC(magzun_ioga_w32)); | |
| 406 | machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(magzun_ioga_r32), FUNC(magzun_ioga_w32)); | |
| 396 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::magzun_ioga_r32),state), write32_delegate(FUNC(saturn_state::magzun_ioga_w32),state)); | |
| 397 | machine.device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::magzun_ioga_r32),state), write32_delegate(FUNC(saturn_state::magzun_ioga_w32),state)); | |
| 407 | 398 | |
| 408 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x608e830, 0x608e833, FUNC(magzun_hef_hack_r) ); | |
| 409 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60ff3b4, 0x60ff3b7, FUNC(magzun_rx_hack_r) ); | |
| 399 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x608e830, 0x608e833, read32_delegate(FUNC(saturn_state::magzun_hef_hack_r),state)); | |
| 400 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x60ff3b4, 0x60ff3b7, read32_delegate(FUNC(saturn_state::magzun_rx_hack_r),state)); | |
| 410 | 401 | |
| 411 | 402 | /* Program ROM patches, don't understand how to avoid these two checks ... */ |
| 412 | 403 | { |
| r14896 | r14897 | |
| 422 | 413 | DRIVER_INIT(stvmp) |
| 423 | 414 | { |
| 424 | 415 | DRIVER_INIT_CALL(stv); |
| 425 | ||
| 426 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(stvmp_ioga_r32), FUNC(stvmp_ioga_w32)); | |
| 427 | machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x00400000, 0x0040003f, FUNC(stvmp_ioga_r32), FUNC(stvmp_ioga_w32)); | |
| 416 | saturn_state *state = machine.driver_data<saturn_state>(); | |
| 417 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stvmp_ioga_r32),state), write32_delegate(FUNC(saturn_state::stvmp_ioga_w32),state)); | |
| 418 | machine.device("slave")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x00400000, 0x0040003f, read32_delegate(FUNC(saturn_state::stvmp_ioga_r32),state), write32_delegate(FUNC(saturn_state::stvmp_ioga_w32),state)); | |
| 428 | 419 | } |
| 429 | 420 | |
| 430 | 421 | |
| r14896 | r14897 | |
| 672 | 663 | |
| 673 | 664 | */ |
| 674 | 665 | |
| 675 | ||
| 666 | ||
| 676 | 667 | { |
| 677 | saturn_state *state = space->machine().driver_data<saturn_state>(); | |
| 678 | 668 | |
| 679 | if(cpu_get_pc(&space | |
| 669 | if(cpu_get_pc(&space. | |
| 680 | 670 | |
| 681 | return | |
| 671 | return | |
| 682 | 672 | } |
| 683 | 673 | |
| 684 | 674 | DRIVER_INIT( astrass ) |
| 685 | 675 | { |
| 676 | saturn_state *state = machine.driver_data<saturn_state>(); | |
| 686 | 677 | sh2drc_add_pcflush(machine.device("maincpu"), 0x60011ba); |
| 687 | 678 | sh2drc_add_pcflush(machine.device("maincpu"), 0x605b9da); |
| 688 | 679 | |
| 689 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 680 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 690 | 681 | |
| 691 | 682 | install_astrass_protection(machine); |
| 692 | 683 |
| r14896 | r14897 | |
|---|---|---|
| 93 | 93 | DECLARE_WRITE32_MEMBER( bios_ext4_ram_w ); |
| 94 | 94 | |
| 95 | 95 | DECLARE_WRITE32_MEMBER( bios_ram_w ); |
| 96 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 97 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 98 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 99 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 100 | DECLARE_READ8_MEMBER(vga_setting); | |
| 96 | 101 | }; |
| 97 | 102 | |
| 98 | 103 | |
| r14896 | r14897 | |
| 381 | 386 | ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask); |
| 382 | 387 | } |
| 383 | 388 | |
| 384 | ||
| 389 | ||
| 385 | 390 | { |
| 386 | queen_state *state = space->machine().driver_data<queen_state>(); | |
| 387 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 391 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 388 | 392 | |
| 389 | 393 | switch(offset % 8) { |
| 390 | 394 | case 1: |
| 391 | data = | |
| 395 | data = | |
| 392 | 396 | break; |
| 393 | 397 | case 2: |
| 394 | data = | |
| 398 | data = | |
| 395 | 399 | break; |
| 396 | 400 | case 3: |
| 397 | data = | |
| 401 | data = | |
| 398 | 402 | break; |
| 399 | 403 | case 7: |
| 400 | data = | |
| 404 | data = | |
| 401 | 405 | break; |
| 402 | 406 | } |
| 403 | 407 | return data; |
| 404 | 408 | } |
| 405 | 409 | |
| 406 | 410 | |
| 407 | ||
| 411 | ||
| 408 | 412 | { |
| 409 | queen_state *state = space->machine().driver_data<queen_state>(); | |
| 410 | state->m_at_pages[offset % 0x10] = data; | |
| 413 | m_at_pages[offset % 0x10] = data; | |
| 411 | 414 | |
| 412 | 415 | switch(offset % 8) { |
| 413 | 416 | case 1: |
| 414 | | |
| 417 | | |
| 415 | 418 | break; |
| 416 | 419 | case 2: |
| 417 | | |
| 420 | | |
| 418 | 421 | break; |
| 419 | 422 | case 3: |
| 420 | | |
| 423 | | |
| 421 | 424 | break; |
| 422 | 425 | case 7: |
| 423 | | |
| 426 | | |
| 424 | 427 | break; |
| 425 | 428 | } |
| 426 | 429 | } |
| 427 | 430 | |
| 428 | static READ32_HANDLER(at_page32_r) | |
| 429 | { | |
| 430 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 431 | } | |
| 432 | 431 | |
| 433 | ||
| 434 | static WRITE32_HANDLER(at_page32_w) | |
| 435 | { | |
| 436 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 437 | } | |
| 438 | ||
| 439 | 432 | static READ8_DEVICE_HANDLER(at_dma8237_2_r) |
| 440 | 433 | { |
| 441 | 434 | return i8237_r(device, offset / 2); |
| r14896 | r14897 | |
| 468 | 461 | } |
| 469 | 462 | |
| 470 | 463 | |
| 471 | ||
| 464 | ||
| 472 | 465 | { |
| 473 | queen_state *state = space->machine().driver_data<queen_state>(); | |
| 474 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 466 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 475 | 467 | & 0xFF0000; |
| 476 | 468 | |
| 477 | return space | |
| 469 | return space. | |
| 478 | 470 | } |
| 479 | 471 | |
| 480 | 472 | |
| 481 | ||
| 473 | ||
| 482 | 474 | { |
| 483 | queen_state *state = space->machine().driver_data<queen_state>(); | |
| 484 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 475 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 485 | 476 | & 0xFF0000; |
| 486 | 477 | |
| 487 | space | |
| 478 | space. | |
| 488 | 479 | } |
| 489 | 480 | |
| 490 | 481 | static void set_dma_channel(device_t *device, int channel, int state) |
| r14896 | r14897 | |
| 502 | 493 | { |
| 503 | 494 | DEVCB_LINE(pc_dma_hrq_changed), |
| 504 | 495 | DEVCB_NULL, |
| 505 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 506 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 496 | DEVCB_DRIVER_MEMBER(queen_state, pc_dma_read_byte), | |
| 497 | DEVCB_DRIVER_MEMBER(queen_state, pc_dma_write_byte), | |
| 507 | 498 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 508 | 499 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 509 | 500 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 540 | 531 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 541 | 532 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 542 | 533 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) /* todo: nvram (CMOS Setup Save)*/ |
| 543 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 534 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 544 | 535 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 545 | 536 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 546 | 537 | AM_RANGE(0x00e8, 0x00ef) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | static MACHINE_START( timelimt ) |
| 23 | 23 | { |
| 24 | soundlatch_setclearedvalue( | |
| 24 | machine.driver_data<timelimt_state>()->soundlatch_setclearedvalue( | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | static MACHINE_RESET( timelimt ) |
| r14896 | r14897 | |
| 47 | 47 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* rom */ |
| 48 | 48 | AM_RANGE(0x8000, 0x87ff) AM_RAM /* ram */ |
| 49 | 49 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(timelimt_videoram_w) AM_BASE(m_videoram) /* video ram */ |
| 50 | AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(timelimt_bg_videoram_w) AM_BASE(m_bg_videoram | |
| 50 | AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(timelimt_bg_videoram_w) AM_BASE_SIZE(m_bg_videoram, | |
| 51 | 51 | AM_RANGE(0x9800, 0x98ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* sprite ram */ |
| 52 | 52 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("INPUTS") |
| 53 | 53 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM") |
| 54 | 54 | AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") |
| 55 | 55 | AM_RANGE(0xb000, 0xb000) AM_WRITE(nmi_enable_w) /* nmi enable */ |
| 56 | 56 | AM_RANGE(0xb003, 0xb003) AM_WRITE(sound_reset_w)/* sound reset ? */ |
| 57 | AM_RANGE(0xb800, 0xb800) AM_WRITE(soundlatch_w) /* sound write */ | |
| 57 | AM_RANGE(0xb800, 0xb800) AM_WRITE(soundlatch_byte_w) /* sound write */ | |
| 58 | 58 | AM_RANGE(0xb800, 0xb800) AM_READNOP /* NMI ack? */ |
| 59 | 59 | AM_RANGE(0xc800, 0xc800) AM_WRITE(timelimt_scroll_x_lsb_w) |
| 60 | 60 | AM_RANGE(0xc801, 0xc801) AM_WRITE(timelimt_scroll_x_msb_w) |
| r14896 | r14897 | |
| 75 | 75 | |
| 76 | 76 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, timelimt_state ) |
| 77 | 77 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 78 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_w) | |
| 78 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w) | |
| 79 | 79 | AM_RANGE(0x8c, 0x8d) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_address_data_w) |
| 80 | 80 | AM_RANGE(0x8e, 0x8f) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_address_data_w) |
| 81 | 81 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 210 | 210 | { |
| 211 | 211 | AY8910_LEGACY_OUTPUT, |
| 212 | 212 | AY8910_DEFAULT_LOADS, |
| 213 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 213 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 214 | 214 | DEVCB_NULL, |
| 215 | 215 | DEVCB_NULL, |
| 216 | 216 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 165 | 165 | : tnzs_state(mconfig, type, tag) { } |
| 166 | 166 | |
| 167 | 167 | UINT8 m_last_trackball_val[2]; |
| 168 | DECLARE_READ8_MEMBER(trackball_r); | |
| 169 | DECLARE_WRITE8_MEMBER(champbwl_misc_w); | |
| 170 | DECLARE_WRITE8_MEMBER(doraemon_outputs_w); | |
| 168 | 171 | }; |
| 169 | 172 | |
| 170 | 173 | |
| 171 | 174 | |
| 172 | ||
| 175 | ||
| 173 | 176 | { |
| 174 | champbwl_state *state = space->machine().driver_data<champbwl_state>(); | |
| 175 | 177 | UINT8 ret; |
| 176 | UINT8 port4 = input_port_read(space->machine(), "FAKEX"); | |
| 177 | UINT8 port5 = input_port_read(space->machine(), "FAKEY"); | |
| 178 | UINT8 port4 = input_port_read(machine(), "FAKEX"); | |
| 179 | UINT8 port5 = input_port_read(machine(), "FAKEY"); | |
| 178 | 180 | |
| 179 | ret = (((port4 - | |
| 181 | ret = (((port4 - | |
| 180 | 182 | |
| 181 | state->m_last_trackball_val[0] = port4; | |
| 182 | state->m_last_trackball_val[1] = port5; | |
| 183 | m_last_trackball_val[0] = port4; | |
| 184 | m_last_trackball_val[1] = port5; | |
| 183 | 185 | |
| 184 | 186 | return ret; |
| 185 | 187 | } |
| 186 | 188 | |
| 187 | ||
| 189 | ||
| 188 | 190 | { |
| 189 | coin_counter_w(space->machine(), 0, data & 1); | |
| 190 | coin_counter_w(space->machine(), 1, data & 2); | |
| 191 | coin_counter_w(machine(), 0, data & 1); | |
| 192 | coin_counter_w(machine(), 1, data & 2); | |
| 191 | 193 | |
| 192 | coin_lockout_w(space->machine(), 0, ~data & 8); | |
| 193 | coin_lockout_w(space->machine(), 1, ~data & 4); | |
| 194 | coin_lockout_w(machine(), 0, ~data & 8); | |
| 195 | coin_lockout_w(machine(), 1, ~data & 4); | |
| 194 | 196 | |
| 195 | memory_set_bank( | |
| 197 | memory_set_bank( | |
| 196 | 198 | } |
| 197 | 199 | |
| 198 | static ADDRESS_MAP_START( champbwl_map, AS_PROGRAM, 8, | |
| 200 | static ADDRESS_MAP_START( champbwl_map, AS_PROGRAM, 8, champbwl_state ) | |
| 199 | 201 | AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION("maincpu", 0x10000) |
| 200 | 202 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 201 | 203 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram") |
| r14896 | r14897 | |
| 206 | 208 | AM_RANGE(0xe300, 0xe303) AM_MIRROR(0xfc) AM_DEVWRITE_LEGACY("spritegen", spritectrl_w8) /* control registers (0x80 mirror used by Arkanoid 2) */ |
| 207 | 209 | AM_RANGE(0xe800, 0xe800) AM_DEVWRITE_LEGACY("spritegen", spritebgflag_w8) /* enable / disable background transparency */ |
| 208 | 210 | |
| 209 | AM_RANGE(0xf000, 0xf000) AM_READ | |
| 211 | AM_RANGE(0xf000, 0xf000) AM_READ | |
| 210 | 212 | AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN0") |
| 211 | 213 | AM_RANGE(0xf004, 0xf004) AM_READ_PORT("IN1") |
| 212 | 214 | AM_RANGE(0xf006, 0xf006) AM_READ_PORT("IN2") |
| 213 | 215 | AM_RANGE(0xf007, 0xf007) AM_READ_PORT("IN3") |
| 214 | 216 | |
| 215 | AM_RANGE(0xf000, 0xf000) AM_WRITE | |
| 217 | AM_RANGE(0xf000, 0xf000) AM_WRITE | |
| 216 | 218 | AM_RANGE(0xf002, 0xf002) AM_WRITENOP //buttons light? |
| 217 | 219 | AM_RANGE(0xf004, 0xf004) AM_WRITENOP //buttons light? |
| 218 | 220 | AM_RANGE(0xf006, 0xf006) AM_WRITENOP //buttons light? |
| r14896 | r14897 | |
| 221 | 223 | |
| 222 | 224 | |
| 223 | 225 | |
| 224 | ||
| 226 | ||
| 225 | 227 | { |
| 226 | coin_counter_w(space->machine(), 0, data & 1); // coin in counter | |
| 227 | coin_counter_w(space->machine(), 1, data & 2); // gift out counter | |
| 228 | coin_counter_w(machine(), 0, data & 1); // coin in counter | |
| 229 | coin_counter_w(machine(), 1, data & 2); // gift out counter | |
| 228 | 230 | |
| 229 | coin_lockout_w(space->machine(), 0, ~data & 8); // coin lockout | |
| 230 | ticket_dispenser_w(space->machine().device("hopper"), 0, (data & 0x04) ? 0x00 : 0x80); // gift out motor | |
| 231 | coin_lockout_w(machine(), 0, ~data & 8); // coin lockout | |
| 232 | machine().device<ticket_dispenser_device>("hopper")->write(*&space, 0, (data & 0x04) ? 0x00 : 0x80); // gift out motor | |
| 231 | 233 | |
| 232 | memory_set_bank( | |
| 234 | memory_set_bank( | |
| 233 | 235 | |
| 234 | 236 | // popmessage("%02x", data); |
| 235 | 237 | } |
| 236 | 238 | |
| 237 | static ADDRESS_MAP_START( doraemon, AS_PROGRAM, 8, | |
| 239 | static ADDRESS_MAP_START( doraemon, AS_PROGRAM, 8, champbwl_state ) | |
| 238 | 240 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 239 | 241 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 240 | 242 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram") |
| r14896 | r14897 | |
| 244 | 246 | AM_RANGE(0xe000, 0xe2ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r8, spriteylow_w8) |
| 245 | 247 | AM_RANGE(0xe300, 0xe303) AM_DEVWRITE_LEGACY("spritegen", spritectrl_w8) |
| 246 | 248 | AM_RANGE(0xe800, 0xe800) AM_DEVWRITE_LEGACY("spritegen", spritebgflag_w8) /* enable / disable background transparency */ |
| 247 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("IN0") AM_WRITE | |
| 249 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("IN0") AM_WRITE | |
| 248 | 250 | AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN1") AM_WRITENOP // Ack? |
| 249 | 251 | AM_RANGE(0xf004, 0xf004) AM_WRITENOP // Ack? |
| 250 | 252 | AM_RANGE(0xf006, 0xf006) AM_READ_PORT("DSW") AM_WRITENOP // Ack? |
| r14896 | r14897 | |
| 396 | 398 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 397 | 399 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 398 | 400 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 399 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r) // sensor | |
| 401 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // sensor | |
| 400 | 402 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 401 | 403 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) |
| 402 | 404 | INPUT_PORTS_END |
| r14896 | r14897 | |
| 541 | 543 | |
| 542 | 544 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 543 | 545 | MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) |
| 544 | MCFG_TICKET_DISPENSER_ADD("hopper", 2000, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) | |
| 546 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) | |
| 545 | 547 | |
| 546 | 548 | MCFG_MACHINE_START(doraemon) |
| 547 | 549 |
| r14896 | r14897 | |
|---|---|---|
| 156 | 156 | AM_RANGE(0x870000, 0x8700ff) AM_DEVWRITE_LEGACY("k055555", k055555_word_w) // PCU2 |
| 157 | 157 | AM_RANGE(0x880000, 0x880003) AM_DEVREADWRITE8_LEGACY("ymz", ymz280b_r, ymz280b_w, 0xff00) |
| 158 | 158 | AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) // Graphic planes |
| 159 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM_WRITE(paletteram | |
| 159 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM_WRITE(paletteram | |
| 160 | 160 | AM_RANGE(0xb04000, 0xb047ff) AM_READ(bishi_mirror_r) // bug in the ram/rom test? |
| 161 | 161 | AM_RANGE(0xc00000, 0xc01fff) AM_READ(bishi_K056832_rom_r) |
| 162 | 162 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | public: |
| 67 | 67 | vamphalf_state(const machine_config &mconfig, device_type type, const char *tag) |
| 68 | : driver_device(mconfig, type, tag) | |
| 68 | : driver_device(mconfig, type, tag), | |
| 69 | m_tiles(*this,"tiles"), | |
| 70 | m_wram(*this,"wram"), | |
| 71 | m_tiles32(*this,"tiles32"), | |
| 72 | m_wram32(*this,"wram32") | |
| 69 | 73 | { |
| 70 | 74 | m_has_extra_gfx = 0; |
| 71 | 75 | } |
| 72 | 76 | |
| 73 | UINT16 *m_tiles; | |
| 74 | UINT16 *m_wram; | |
| 75 | UINT32 *m_tiles32; | |
| 76 | UINT32 *m_wram32; | |
| 77 | required_shared_ptr<UINT16> m_tiles; | |
| 78 | required_shared_ptr<UINT16> m_wram; | |
| 79 | required_shared_ptr<UINT32> m_tiles32; | |
| 80 | required_shared_ptr<UINT32> m_wram32; | |
| 77 | 81 | int m_flip_bit; |
| 78 | 82 | int m_flipscreen; |
| 79 | 83 | int m_palshift; |
| r14896 | r14897 | |
| 319 | 323 | } |
| 320 | 324 | |
| 321 | 325 | static ADDRESS_MAP_START( common_map, AS_PROGRAM, 16, vamphalf_state ) |
| 322 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(m_wram) | |
| 323 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_BASE(m_tiles) | |
| 324 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 326 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_SHARE("wram") | |
| 327 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_SHARE("tiles") | |
| 328 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 325 | 329 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("user1",0) |
| 326 | 330 | ADDRESS_MAP_END |
| 327 | 331 | |
| 328 | 332 | static ADDRESS_MAP_START( common_32bit_map, AS_PROGRAM, 32, vamphalf_state ) |
| 329 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(m_wram32) | |
| 330 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_BASE(m_tiles32) | |
| 333 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_SHARE("wram32") | |
| 334 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_SHARE("tiles32") | |
| 331 | 335 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM_WRITE(paletteram32_w) AM_SHARE("paletteram") |
| 332 | 336 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("user1",0) |
| 333 | 337 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 441 | 445 | ADDRESS_MAP_END |
| 442 | 446 | |
| 443 | 447 | static ADDRESS_MAP_START( aoh_map, AS_PROGRAM, 32, vamphalf_state ) |
| 444 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_BASE(m_wram32) | |
| 445 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_BASE(m_tiles32) | |
| 448 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE("wram32") | |
| 449 | AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_SHARE("tiles32") | |
| 446 | 450 | AM_RANGE(0x80000000, 0x8000ffff) AM_RAM_WRITE(paletteram32_w) AM_SHARE("paletteram") |
| 447 | 451 | AM_RANGE(0x80210000, 0x80210003) AM_READ_PORT("SYSTEM") |
| 448 | 452 | AM_RANGE(0x80220000, 0x80220003) AM_READ_PORT("P1_P2") |
| r14896 | r14897 | |
| 525 | 529 | // 16bit version |
| 526 | 530 | if(state->m_tiles != NULL) |
| 527 | 531 | { |
| 528 | if(state->m_tiles[offs] & 0x0100) continue; | |
| 532 | if(state->m_tiles.target()[offs] & 0x0100) continue; | |
| 529 | 533 | |
| 530 | code = state->m_tiles[offs+1]; | |
| 531 | color = (state->m_tiles[offs+2] >> state->m_palshift) & 0x7f; | |
| 534 | code = state->m_tiles.target()[offs+1]; | |
| 535 | color = (state->m_tiles.target()[offs+2] >> state->m_palshift) & 0x7f; | |
| 532 | 536 | |
| 533 | 537 | // boonggab |
| 534 | 538 | if(state->m_has_extra_gfx) |
| 535 | 539 | { |
| 536 | code |= ((state->m_tiles[offs+2] & 0x100) << 8); | |
| 540 | code |= ((state->m_tiles.target()[offs+2] & 0x100) << 8); | |
| 537 | 541 | } |
| 538 | 542 | |
| 539 | x = state->m_tiles[offs+3] & 0x01ff; | |
| 540 | y = 256 - (state->m_tiles[offs] & 0x00ff); | |
| 543 | x = state->m_tiles.target()[offs+3] & 0x01ff; | |
| 544 | y = 256 - (state->m_tiles.target()[offs] & 0x00ff); | |
| 541 | 545 | |
| 542 | fx = state->m_tiles[offs] & 0x8000; | |
| 543 | fy = state->m_tiles[offs] & 0x4000; | |
| 546 | fx = state->m_tiles.target()[offs] & 0x8000; | |
| 547 | fy = state->m_tiles.target()[offs] & 0x4000; | |
| 544 | 548 | } |
| 545 | 549 | // 32bit version |
| 546 | 550 | else |
| 547 | 551 | { |
| 548 | 552 | offs /= 2; |
| 549 | 553 | |
| 550 | if(state->m_tiles32[offs] & 0x01000000) continue; | |
| 554 | if(state->m_tiles32.target()[offs] & 0x01000000) continue; | |
| 551 | 555 | |
| 552 | code = state->m_tiles32[offs] & 0xffff; | |
| 553 | color = ((state->m_tiles32[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; | |
| 556 | code = state->m_tiles32.target()[offs] & 0xffff; | |
| 557 | color = ((state->m_tiles32.target()[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; | |
| 554 | 558 | |
| 555 | x = state->m_tiles32[offs+1] & 0x01ff; | |
| 556 | y = 256 - ((state->m_tiles32[offs] & 0x00ff0000) >> 16); | |
| 559 | x = state->m_tiles32.target()[offs+1] & 0x01ff; | |
| 560 | y = 256 - ((state->m_tiles32.target()[offs] & 0x00ff0000) >> 16); | |
| 557 | 561 | |
| 558 | fx = state->m_tiles32[offs] & 0x80000000; | |
| 559 | fy = state->m_tiles32[offs] & 0x40000000; | |
| 562 | fx = state->m_tiles32.target()[offs] & 0x80000000; | |
| 563 | fy = state->m_tiles32.target()[offs] & 0x40000000; | |
| 560 | 564 | } |
| 561 | 565 | |
| 562 | 566 | if(state->m_flipscreen) |
| r14896 | r14897 | |
| 603 | 607 | offs = (block + cnt) / 2; |
| 604 | 608 | { |
| 605 | 609 | offs /= 2; |
| 606 | code = (state->m_tiles32[offs] & 0xffff) | ((state->m_tiles32[offs] & 0x3000000) >> 8); | |
| 607 | color = ((state->m_tiles32[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; | |
| 610 | code = (state->m_tiles32.target()[offs] & 0xffff) | ((state->m_tiles32.target()[offs] & 0x3000000) >> 8); | |
| 611 | color = ((state->m_tiles32.target()[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; | |
| 608 | 612 | |
| 609 | x = state->m_tiles32[offs+1] & 0x01ff; | |
| 610 | y = 256 - ((state->m_tiles32[offs] & 0x00ff0000) >> 16); | |
| 613 | x = state->m_tiles32.target()[offs+1] & 0x01ff; | |
| 614 | y = 256 - ((state->m_tiles32.target()[offs] & 0x00ff0000) >> 16); | |
| 611 | 615 | |
| 612 | fx = state->m_tiles32[offs] & 0x4000000; | |
| 613 | fy = 0; // not used ? or it's state->m_tiles32[offs] & 0x8000000? | |
| 616 | fx = state->m_tiles32.target()[offs] & 0x4000000; | |
| 617 | fy = 0; // not used ? or it's state->m_tiles32.target()[offs] & 0x8000000? | |
| 614 | 618 | } |
| 615 | 619 | |
| 616 | 620 | if(state->m_flipscreen) |
| r14896 | r14897 | |
| 2084 | 2088 | device_eat_cycles(&space.device(), 50); |
| 2085 | 2089 | } |
| 2086 | 2090 | |
| 2087 | return m_wram[(0x4a840/2)+offset]; | |
| 2091 | return m_wram.target()[(0x4a840/2)+offset]; | |
| 2088 | 2092 | } |
| 2089 | 2093 | |
| 2090 | 2094 | READ16_MEMBER(vamphalf_state::vamphafk_speedup_r) |
| r14896 | r14897 | |
| 2097 | 2101 | device_eat_cycles(&space.device(), 50); |
| 2098 | 2102 | } |
| 2099 | 2103 | |
| 2100 | return m_wram[(0x4a6d0/2)+offset]; | |
| 2104 | return m_wram.target()[(0x4a6d0/2)+offset]; | |
| 2101 | 2105 | } |
| 2102 | 2106 | |
| 2103 | 2107 | READ16_MEMBER(vamphalf_state::misncrft_speedup_r) |
| r14896 | r14897 | |
| 2110 | 2114 | device_eat_cycles(&space.device(), 50); |
| 2111 | 2115 | } |
| 2112 | 2116 | |
| 2113 | return m_wram[(0x72eb4/2)+offset]; | |
| 2117 | return m_wram.target()[(0x72eb4/2)+offset]; | |
| 2114 | 2118 | } |
| 2115 | 2119 | |
| 2116 | 2120 | READ16_MEMBER(vamphalf_state::coolmini_speedup_r) |
| r14896 | r14897 | |
| 2123 | 2127 | device_eat_cycles(&space.device(), 50); |
| 2124 | 2128 | } |
| 2125 | 2129 | |
| 2126 | return m_wram[(0xd2e80/2)+offset]; | |
| 2130 | return m_wram.target()[(0xd2e80/2)+offset]; | |
| 2127 | 2131 | } |
| 2128 | 2132 | |
| 2129 | 2133 | READ16_MEMBER(vamphalf_state::suplup_speedup_r) |
| r14896 | r14897 | |
| 2136 | 2140 | device_eat_cycles(&space.device(), 50); |
| 2137 | 2141 | } |
| 2138 | 2142 | |
| 2139 | return m_wram[(0x11605c/2)+offset]; | |
| 2143 | return m_wram.target()[(0x11605c/2)+offset]; | |
| 2140 | 2144 | } |
| 2141 | 2145 | |
| 2142 | 2146 | READ16_MEMBER(vamphalf_state::luplup_speedup_r) |
| r14896 | r14897 | |
| 2149 | 2153 | device_eat_cycles(&space.device(), 50); |
| 2150 | 2154 | } |
| 2151 | 2155 | |
| 2152 | return m_wram[(0x115e84/2)+offset]; | |
| 2156 | return m_wram.target()[(0x115e84/2)+offset]; | |
| 2153 | 2157 | } |
| 2154 | 2158 | |
| 2155 | 2159 | READ16_MEMBER(vamphalf_state::luplup29_speedup_r) |
| r14896 | r14897 | |
| 2162 | 2166 | device_eat_cycles(&space.device(), 50); |
| 2163 | 2167 | } |
| 2164 | 2168 | |
| 2165 | return m_wram[(0x113f08/2)+offset]; | |
| 2169 | return m_wram.target()[(0x113f08/2)+offset]; | |
| 2166 | 2170 | } |
| 2167 | 2171 | |
| 2168 | 2172 | READ16_MEMBER(vamphalf_state::puzlbang_speedup_r) |
| r14896 | r14897 | |
| 2175 | 2179 | device_eat_cycles(&space.device(), 50); |
| 2176 | 2180 | } |
| 2177 | 2181 | |
| 2178 | return m_wram[(0x113ecc/2)+offset]; | |
| 2182 | return m_wram.target()[(0x113ecc/2)+offset]; | |
| 2179 | 2183 | } |
| 2180 | 2184 | |
| 2181 | 2185 | READ32_MEMBER(vamphalf_state::wyvernwg_speedup_r) |
| r14896 | r14897 | |
| 2190 | 2194 | device_eat_cycles(&space.device(), 50); |
| 2191 | 2195 | } |
| 2192 | 2196 | |
| 2193 | return m_wram32[0x00b56fc/4]; | |
| 2197 | return m_wram32.target()[0x00b56fc/4]; | |
| 2194 | 2198 | } |
| 2195 | 2199 | |
| 2196 | 2200 | READ32_MEMBER(vamphalf_state::wyvernwga_speedup_r) |
| r14896 | r14897 | |
| 2205 | 2209 | device_eat_cycles(&space.device(), 50); |
| 2206 | 2210 | } |
| 2207 | 2211 | |
| 2208 | return m_wram32[0x00b74f8/4]; | |
| 2212 | return m_wram32.target()[0x00b74f8/4]; | |
| 2209 | 2213 | } |
| 2210 | 2214 | |
| 2211 | 2215 | |
| r14896 | r14897 | |
| 2220 | 2224 | device_eat_cycles(&space.device(), 50); |
| 2221 | 2225 | } |
| 2222 | 2226 | |
| 2223 | return m_wram32[0x005e874/4]; | |
| 2227 | return m_wram32.target()[0x005e874/4]; | |
| 2224 | 2228 | } |
| 2225 | 2229 | |
| 2226 | 2230 | READ32_MEMBER(vamphalf_state::mrkicker_speedup_r) |
| r14896 | r14897 | |
| 2234 | 2238 | device_eat_cycles(&space.device(), 50); |
| 2235 | 2239 | } |
| 2236 | 2240 | |
| 2237 | return m_wram32[0x00701a4/4]; | |
| 2241 | return m_wram32.target()[0x00701a4/4]; | |
| 2238 | 2242 | } |
| 2239 | 2243 | |
| 2240 | 2244 | |
| r14896 | r14897 | |
| 2248 | 2252 | device_eat_cycles(&space.device(), 50); |
| 2249 | 2253 | } |
| 2250 | 2254 | |
| 2251 | return m_wram[(0xcde70/2)+offset]; | |
| 2255 | return m_wram.target()[(0xcde70/2)+offset]; | |
| 2252 | 2256 | } |
| 2253 | 2257 | |
| 2254 | 2258 | READ32_MEMBER(vamphalf_state::aoh_speedup_r) |
| r14896 | r14897 | |
| 2263 | 2267 | } |
| 2264 | 2268 | |
| 2265 | 2269 | |
| 2266 | return m_wram32[0x28a09c/4]; | |
| 2270 | return m_wram32.target()[0x28a09c/4]; | |
| 2267 | 2271 | } |
| 2268 | 2272 | |
| 2269 | 2273 | READ16_MEMBER(vamphalf_state::jmpbreak_speedup_r) |
| r14896 | r14897 | |
| 2276 | 2280 | device_eat_cycles(&space.device(), 50); |
| 2277 | 2281 | } |
| 2278 | 2282 | |
| 2279 | return m_wram[(0x00906fc / 2)+offset]; | |
| 2283 | return m_wram.target()[(0x00906fc / 2)+offset]; | |
| 2280 | 2284 | } |
| 2281 | 2285 | |
| 2282 | 2286 | READ16_MEMBER(vamphalf_state::mrdig_speedup_r) |
| r14896 | r14897 | |
| 2289 | 2293 | device_eat_cycles(&space.device(), 50); |
| 2290 | 2294 | } |
| 2291 | 2295 | |
| 2292 | return m_wram[(0x00a99c / 2)+offset]; | |
| 2296 | return m_wram.target()[(0x00a99c / 2)+offset]; | |
| 2293 | 2297 | } |
| 2294 | 2298 | |
| 2295 | 2299 | READ16_MEMBER(vamphalf_state::dtfamily_speedup_r) |
| r14896 | r14897 | |
| 2300 | 2304 | if (pc == 0x12fa6) |
| 2301 | 2305 | device_spin_until_interrupt(&space.device()); |
| 2302 | 2306 | |
| 2303 | return m_wram[0xcc2a8 / 2]; | |
| 2307 | return m_wram.target()[0xcc2a8 / 2]; | |
| 2304 | 2308 | |
| 2305 | 2309 | } |
| 2306 | 2310 | |
| r14896 | r14897 | |
| 2310 | 2314 | if (cpu_get_pc(&space.device()) == 0x130c2) |
| 2311 | 2315 | device_spin_until_interrupt(&space.device()); |
| 2312 | 2316 | |
| 2313 | return m_wram[0x780d8 / 2]; | |
| 2317 | return m_wram.target()[0x780d8 / 2]; | |
| 2314 | 2318 | |
| 2315 | 2319 | } |
| 2316 | 2320 | |
| r14896 | r14897 | |
| 2322 | 2326 | device_spin_until_interrupt(&space.device()); |
| 2323 | 2327 | } |
| 2324 | 2328 | |
| 2325 | return m_wram[(0xf1b7c / 2)+offset]; | |
| 2329 | return m_wram.target()[(0xf1b7c / 2)+offset]; | |
| 2326 | 2330 | } |
| 2327 | 2331 | |
| 2328 | 2332 | static DRIVER_INIT( vamphalf ) |
| r14896 | r14897 | |
|---|---|---|
| 94 | 94 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") |
| 95 | 95 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSWA") |
| 96 | 96 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSWB") |
| 97 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) | |
| 97 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) | |
| 98 | 98 | AM_RANGE(0xc802, 0xc803) AM_WRITE(c1942_scroll_w) |
| 99 | 99 | AM_RANGE(0xc804, 0xc804) AM_WRITE(c1942_c804_w) |
| 100 | 100 | AM_RANGE(0xc805, 0xc805) AM_WRITE(c1942_palette_bank_w) |
| r14896 | r14897 | |
| 108 | 108 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, _1942_state ) |
| 109 | 109 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 110 | 110 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 111 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 111 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 112 | 112 | AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 113 | 113 | AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 114 | 114 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | public: |
| 20 | 20 | mayumi_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | : driver_device(mconfig, type, tag) { } | |
| 21 | : driver_device(mconfig, type, tag) , | |
| 22 | m_videoram(*this, "videoram"){ } | |
| 22 | 23 | |
| 23 | 24 | /* memory pointers */ |
| 24 | UINT8 | |
| 25 | required_shared_ptr<UINT8> | |
| 25 | 26 | // UINT8 * m_nvram; // this currently uses generic nvram handlers |
| 26 | 27 | |
| 27 | 28 | /* video-related */ |
| r14896 | r14897 | |
| 46 | 47 | static TILE_GET_INFO( get_tile_info ) |
| 47 | 48 | { |
| 48 | 49 | mayumi_state *state = machine.driver_data<mayumi_state>(); |
| 49 | int code = state->m_videoram[tile_index] + (state->m_videoram[tile_index + 0x800] & 0x1f) * 0x100; | |
| 50 | int col = (state->m_videoram[tile_index + 0x1000] >> 3) & 0x1f; | |
| 50 | int code = state->m_videoram.target()[tile_index] + (state->m_videoram.target()[tile_index + 0x800] & 0x1f) * 0x100; | |
| 51 | int col = (state->m_videoram.target()[tile_index + 0x1000] >> 3) & 0x1f; | |
| 51 | 52 | |
| 52 | 53 | SET_TILE_INFO(0, code, col, 0); |
| 53 | 54 | } |
| r14896 | r14897 | |
| 60 | 61 | |
| 61 | 62 | WRITE8_MEMBER(mayumi_state::mayumi_videoram_w) |
| 62 | 63 | { |
| 63 | m_videoram[offset] = data; | |
| 64 | m_videoram.target()[offset] = data; | |
| 64 | 65 | m_tilemap->mark_tile_dirty(offset & 0x7ff); |
| 65 | 66 | } |
| 66 | 67 | |
| r14896 | r14897 | |
| 99 | 100 | |
| 100 | 101 | m_int_enable = data & 1; |
| 101 | 102 | |
| 102 | flip_screen_set( | |
| 103 | flip_screen_set( | |
| 103 | 104 | } |
| 104 | 105 | |
| 105 | 106 | WRITE8_MEMBER(mayumi_state::input_sel_w) |
| r14896 | r14897 | |
| 139 | 140 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 140 | 141 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 141 | 142 | AM_RANGE(0xc000, 0xdfff) AM_RAM AM_SHARE("nvram") |
| 142 | AM_RANGE(0xe000, 0xf7ff) AM_RAM_WRITE(mayumi_videoram_w) AM_ | |
| 143 | AM_RANGE(0xe000, 0xf7ff) AM_RAM_WRITE(mayumi_videoram_w) AM_ | |
| 143 | 144 | ADDRESS_MAP_END |
| 144 | 145 | |
| 145 | 146 |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | AM_RANGE(0x00000, 0x01fff) AM_RAM |
| 64 | 64 | AM_RANGE(0x02000, 0x027ff) AM_RAM_WRITE(raiden_background_w) AM_BASE(m_back_data) |
| 65 | 65 | AM_RANGE(0x02800, 0x02fff) AM_RAM_WRITE(raiden_foreground_w) AM_BASE(m_fore_data) |
| 66 | AM_RANGE(0x03000, 0x03fff) AM_RAM_WRITE(paletteram | |
| 66 | AM_RANGE(0x03000, 0x03fff) AM_RAM_WRITE(paletteram | |
| 67 | 67 | AM_RANGE(0x04000, 0x04fff) AM_RAM AM_SHARE("share1") |
| 68 | 68 | AM_RANGE(0x07ffe, 0x0afff) AM_WRITENOP |
| 69 | 69 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| r14896 | r14897 | |
| 104 | 104 | AM_RANGE(0x00000, 0x05fff) AM_RAM |
| 105 | 105 | AM_RANGE(0x06000, 0x067ff) AM_RAM_WRITE(raiden_background_w) AM_BASE(m_back_data) |
| 106 | 106 | AM_RANGE(0x06800, 0x06fff) AM_RAM_WRITE(raiden_foreground_w) AM_BASE(m_fore_data) |
| 107 | AM_RANGE(0x07000, 0x07fff) AM_RAM_WRITE(paletteram | |
| 107 | AM_RANGE(0x07000, 0x07fff) AM_RAM_WRITE(paletteram | |
| 108 | 108 | AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE("share1") |
| 109 | 109 | //AM_RANGE(0x07ffe, 0x0afff) AM_WRITENOP |
| 110 | 110 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 125 | 125 | AM_RANGE(0x08d400, 0x08d7ff) AM_RAM |
| 126 | 126 | AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(bloodbro_txvideoram_w) AM_BASE(m_txvideoram) |
| 127 | 127 | AM_RANGE(0x08e000, 0x08e7ff) AM_RAM |
| 128 | AM_RANGE(0x08e800, 0x08f7ff) AM_RAM_WRITE(paletteram | |
| 128 | AM_RANGE(0x08e800, 0x08f7ff) AM_RAM_WRITE(paletteram | |
| 129 | 129 | AM_RANGE(0x08f800, 0x08ffff) AM_RAM |
| 130 | 130 | AM_RANGE(0x0a0000, 0x0a000d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w) |
| 131 | 131 | AM_RANGE(0x0c0000, 0x0c007f) AM_RAM AM_BASE(m_scroll) |
| r14896 | r14897 | |
| 151 | 151 | AM_RANGE(0x0c1002, 0x0c1003) AM_READ_PORT("IN0") |
| 152 | 152 | AM_RANGE(0x0c1004, 0x0c1005) AM_READ_PORT("IN1") |
| 153 | 153 | AM_RANGE(0x0c1000, 0x0c17ff) AM_RAM |
| 154 | AM_RANGE(0x128000, 0x1287ff) AM_RAM_WRITE(paletteram | |
| 154 | AM_RANGE(0x128000, 0x1287ff) AM_RAM_WRITE(paletteram | |
| 155 | 155 | AM_RANGE(0x120000, 0x128fff) AM_RAM |
| 156 | 156 | ADDRESS_MAP_END |
| 157 | 157 |
| r14896 | r14897 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | ***************************************************************************/ |
| 82 | 82 | |
| 83 | ||
| 83 | ||
| 84 | 84 | { |
| 85 | galaxia_state *state = space->machine().driver_data<galaxia_state>(); | |
| 86 | // space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos()); | |
| 87 | state->m_bg_tilemap->mark_tile_dirty(offset); | |
| 88 | state->cvs_video_or_color_ram_w(*space, offset, data); | |
| 85 | // machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
| 86 | m_bg_tilemap->mark_tile_dirty(offset); | |
| 87 | cvs_video_or_color_ram_w(*&space, offset, data); | |
| 89 | 88 | } |
| 90 | 89 | |
| 91 | ||
| 90 | ||
| 92 | 91 | { |
| 93 | galaxia_state *state = space->machine().driver_data<galaxia_state>(); | |
| 94 | space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos()); | |
| 92 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
| 95 | 93 | |
| 96 | 94 | // fixed scrolling area |
| 97 | 95 | for (int i = 1; i < 6; i++) |
| 98 | | |
| 96 | | |
| 99 | 97 | } |
| 100 | 98 | |
| 101 | ||
| 99 | ||
| 102 | 100 | { |
| 103 | 101 | // d0/d1: maybe coincounter |
| 104 | 102 | // other bits: unknown |
| 105 | 103 | } |
| 106 | 104 | |
| 107 | ||
| 105 | ||
| 108 | 106 | { |
| 109 | 107 | // cvs-style video fx? or lamps? |
| 110 | 108 | } |
| 111 | 109 | |
| 112 | ||
| 110 | ||
| 113 | 111 | { |
| 114 | galaxia_state *state = space->machine().driver_data<galaxia_state>(); | |
| 115 | space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos()); | |
| 116 | return state->m_collision_register; | |
| 112 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
| 113 | return m_collision_register; | |
| 117 | 114 | } |
| 118 | 115 | |
| 119 | ||
| 116 | ||
| 120 | 117 | { |
| 121 | galaxia_state *state = space->machine().driver_data<galaxia_state>(); | |
| 122 | space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos()); | |
| 123 | state->m_collision_register = 0; | |
| 118 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
| 119 | m_collision_register = 0; | |
| 124 | 120 | return 0xff; |
| 125 | 121 | } |
| 126 | 122 | |
| r14896 | r14897 | |
| 130 | 126 | AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("s2636_0", s2636_work_ram_r, s2636_work_ram_w) |
| 131 | 127 | AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("s2636_1", s2636_work_ram_r, s2636_work_ram_w) |
| 132 | 128 | AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("s2636_2", s2636_work_ram_r, s2636_work_ram_w) |
| 133 | AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE | |
| 129 | AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE | |
| 134 | 130 | AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM |
| 135 | 131 | AM_RANGE(0x2000, 0x33ff) AM_ROM |
| 136 | 132 | AM_RANGE(0x7214, 0x7214) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 140 | 136 | AM_RANGE(0x0000, 0x13ff) AM_ROM |
| 141 | 137 | AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM |
| 142 | 138 | AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE_LEGACY("s2636_0", s2636_work_ram_r, s2636_work_ram_w) |
| 143 | AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE | |
| 139 | AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE | |
| 144 | 140 | AM_RANGE(0x1c00, 0x1cff) AM_MIRROR(0x6000) AM_RAM AM_BASE(m_bullet_ram) |
| 145 | 141 | AM_RANGE(0x2000, 0x33ff) AM_ROM |
| 146 | 142 | ADDRESS_MAP_END |
| 147 | 143 | |
| 148 | 144 | static ADDRESS_MAP_START( galaxia_io_map, AS_IO, 8, galaxia_state ) |
| 149 | 145 | ADDRESS_MAP_UNMAP_HIGH |
| 150 | AM_RANGE(0x00, 0x00) AM_WRITE | |
| 146 | AM_RANGE(0x00, 0x00) AM_WRITE | |
| 151 | 147 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") |
| 152 | 148 | AM_RANGE(0x05, 0x05) AM_READNOP |
| 153 | 149 | AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW0") |
| 154 | 150 | AM_RANGE(0x07, 0x07) AM_READ_PORT("DSW1") |
| 155 | 151 | AM_RANGE(0xac, 0xac) AM_READNOP |
| 156 | AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_READWRITE_LEGACY(galaxia_collision_r, galaxia_ctrlport_w) | |
| 157 | AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE_LEGACY(galaxia_collision_clear, galaxia_dataport_w) | |
| 152 | AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_READWRITE(galaxia_collision_r, galaxia_ctrlport_w) | |
| 153 | AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE(galaxia_collision_clear, galaxia_dataport_w) | |
| 158 | 154 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE") |
| 159 | 155 | AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_RAM AM_BASE(m_fo_state) |
| 160 | 156 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | WRITE16_MEMBER(fromanc2_state::fromanc2_sndcmd_w) |
| 41 | 41 | { |
| 42 | 42 | |
| 43 | soundlatch_w(space, offset, (data >> 8) & 0xff); // 1P (LEFT) | |
| 44 | soundlatch2_w(space, offset, data & 0xff); // 2P (RIGHT) | |
| 43 | soundlatch_byte_w(space, offset, (data >> 8) & 0xff); // 1P (LEFT) | |
| 44 | soundlatch2_byte_w(space, offset, data & 0xff); // 2P (RIGHT) | |
| 45 | 45 | |
| 46 | 46 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 47 | 47 | m_sndcpu_nmi_flag = 0; |
| r14896 | r14897 | |
| 292 | 292 | |
| 293 | 293 | static ADDRESS_MAP_START( fromanc2_sound_io_map, AS_IO, 8, fromanc2_state ) |
| 294 | 294 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 295 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) AM_WRITENOP // snd cmd (1P) / ? | |
| 296 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch2_r) // snd cmd (2P) | |
| 295 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_WRITENOP // snd cmd (1P) / ? | |
| 296 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch2_byte_r) // snd cmd (2P) | |
| 297 | 297 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 298 | 298 | AM_RANGE(0x0c, 0x0c) AM_READ(fromanc2_sndcpu_nmi_clr) |
| 299 | 299 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 243 | 243 | break; |
| 244 | 244 | |
| 245 | 245 | case 0x03: /* FLIP */ |
| 246 | flip_screen_set_no_update( | |
| 246 | flip_screen_set_no_update( | |
| 247 | 247 | machine().tilemap().set_flip_all(bit * (TILEMAP_FLIPX | TILEMAP_FLIPY)); |
| 248 | 248 | break; |
| 249 | 249 | |
| r14896 | r14897 | |
| 285 | 285 | break; |
| 286 | 286 | |
| 287 | 287 | case 0x03: /* FLIP */ |
| 288 | flip_screen_set_no_update( | |
| 288 | flip_screen_set_no_update( | |
| 289 | 289 | machine().tilemap().set_flip_all(bit * (TILEMAP_FLIPX | TILEMAP_FLIPY)); |
| 290 | 290 | break; |
| 291 | 291 | |
| r14896 | r14897 | |
| 345 | 345 | AM_RANGE(0xa180, 0xa180) AM_READ_PORT("DSW2") |
| 346 | 346 | AM_RANGE(0xa000, 0xa00f) AM_MIRROR(0x00f0) AM_WRITEONLY AM_BASE(m_radarattr) // jungler writes to a03x |
| 347 | 347 | AM_RANGE(0xa080, 0xa080) AM_WRITE(watchdog_reset_w) |
| 348 | AM_RANGE(0xa100, 0xa100) AM_WRITE(soundlatch_w) | |
| 348 | AM_RANGE(0xa100, 0xa100) AM_WRITE(soundlatch_byte_w) | |
| 349 | 349 | AM_RANGE(0xa130, 0xa130) AM_WRITE(rallyx_scrollx_w) /* only jungler and tactcian */ |
| 350 | 350 | AM_RANGE(0xa140, 0xa140) AM_WRITE(rallyx_scrolly_w) /* only jungler and tactcian */ |
| 351 | 351 | AM_RANGE(0xa180, 0xa187) AM_WRITE(locomotn_latch_w) |
| r14896 | r14897 | |
|---|---|---|
| 48 | 48 | { |
| 49 | 49 | public: |
| 50 | 50 | dai3wksi_state(const machine_config &mconfig, device_type type, const char *tag) |
| 51 | : driver_device(mconfig, type, tag) { } | |
| 51 | : driver_device(mconfig, type, tag) , | |
| 52 | m_dai3wksi_videoram(*this, "dai3wksi_videoram"){ } | |
| 52 | 53 | |
| 53 | 54 | /* video */ |
| 54 | UINT8 * m_dai3wksi_videoram; | |
| 55 | size_t m_dai3wksi_videoram_size; | |
| 55 | required_shared_ptr<UINT8> m_dai3wksi_videoram; | |
| 56 | 56 | int m_dai3wksi_flipscreen; |
| 57 | 57 | int m_dai3wksi_redscreen; |
| 58 | 58 | int m_dai3wksi_redterop; |
| r14896 | r14897 | |
| 134 | 134 | |
| 135 | 135 | dai3wksi_get_pens(pens); |
| 136 | 136 | |
| 137 | for (offs = 0; offs < state->m_dai3wksi_videoram | |
| 137 | for (offs = 0; offs < state->m_dai3wksi_videoram.bytes(); offs++) | |
| 138 | 138 | { |
| 139 | 139 | offs_t i; |
| 140 | 140 | |
| 141 | 141 | UINT8 x = offs << 2; |
| 142 | 142 | UINT8 y = offs >> 6; |
| 143 | UINT8 data = state->m_dai3wksi_videoram[offs]; | |
| 143 | UINT8 data = state->m_dai3wksi_videoram.target()[offs]; | |
| 144 | 144 | UINT8 color; |
| 145 | 145 | int value = (x >> 2) + ((y >> 5) << 6) + 64 * 8 * (state->m_dai3wksi_redterop ? 1 : 0); |
| 146 | 146 | |
| r14896 | r14897 | |
| 509 | 509 | AM_RANGE(0x3000, 0x3000) AM_WRITE(dai3wksi_audio_1_w) |
| 510 | 510 | AM_RANGE(0x3400, 0x3400) AM_WRITE(dai3wksi_audio_2_w) |
| 511 | 511 | AM_RANGE(0x3800, 0x3800) AM_WRITE(dai3wksi_audio_3_w) |
| 512 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_ | |
| 512 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_ | |
| 513 | 513 | ADDRESS_MAP_END |
| 514 | 514 | |
| 515 | 515 |
| r14896 | r14897 | |
|---|---|---|
| 155 | 155 | static ADDRESS_MAP_START( base_mem, AS_PROGRAM, 16, realbrk_state ) |
| 156 | 156 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM |
| 157 | 157 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(m_spriteram) // Sprites |
| 158 | AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(paletteram | |
| 158 | AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(paletteram | |
| 159 | 159 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(realbrk_vram_0_w) AM_BASE(m_vram_0 ) // Background (0) |
| 160 | 160 | AM_RANGE(0x602000, 0x603fff) AM_RAM_WRITE(realbrk_vram_1_w) AM_BASE(m_vram_1 ) // Background (1) |
| 161 | 161 | AM_RANGE(0x604000, 0x604fff) AM_RAM_WRITE(realbrk_vram_2_w) AM_BASE(m_vram_2 ) // Text (2) |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | public: |
| 59 | 59 | diverboy_state(const machine_config &mconfig, device_type type, const char *tag) |
| 60 | : driver_device(mconfig, type, tag) { } | |
| 60 | : driver_device(mconfig, type, tag) , | |
| 61 | m_spriteram(*this, "spriteram"){ } | |
| 61 | 62 | |
| 62 | 63 | /* memory pointers */ |
| 63 | UINT16 | |
| 64 | required_shared_ptr<UINT16> | |
| 64 | 65 | // UINT16 * m_paletteram; // currently this uses generic palette handling |
| 65 | size_t m_spriteram_size; | |
| 66 | 66 | |
| 67 | 67 | /* devices */ |
| 68 | 68 | device_t *m_audiocpu; |
| r14896 | r14897 | |
| 77 | 77 | static void draw_sprites( running_machine& machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 78 | 78 | { |
| 79 | 79 | diverboy_state *state = machine.driver_data<diverboy_state>(); |
| 80 | UINT16 *source = state->m_spriteram; | |
| 81 | UINT16 *finish = source + (state->m_spriteram_size / 2); | |
| 80 | UINT16 *source = state->m_spriteram.target(); | |
| 81 | UINT16 *finish = source + (state->m_spriteram.bytes() / 2); | |
| 82 | 82 | |
| 83 | 83 | while (source < finish) |
| 84 | 84 | { |
| r14896 | r14897 | |
| 123 | 123 | |
| 124 | 124 | if (ACCESSING_BITS_0_7) |
| 125 | 125 | { |
| 126 | soundlatch_w(space, 0, data & 0xff); | |
| 126 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 127 | 127 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 128 | 128 | } |
| 129 | 129 | } |
| r14896 | r14897 | |
| 142 | 142 | static ADDRESS_MAP_START( diverboy_map, AS_PROGRAM, 16, diverboy_state ) |
| 143 | 143 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 144 | 144 | AM_RANGE(0x040000, 0x04ffff) AM_RAM |
| 145 | AM_RANGE(0x080000, 0x083fff) AM_RAM AM_ | |
| 145 | AM_RANGE(0x080000, 0x083fff) AM_RAM AM_ | |
| 146 | 146 | AM_RANGE(0x100000, 0x100001) AM_WRITE(soundcmd_w) |
| 147 | AM_RANGE(0x140000, 0x1407ff) AM_WRITE(paletteram | |
| 147 | AM_RANGE(0x140000, 0x1407ff) AM_WRITE(paletteram | |
| 148 | 148 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("P1_P2") |
| 149 | 149 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("DSW") |
| 150 | 150 | AM_RANGE(0x180008, 0x180009) AM_READ_PORT("COINS") |
| r14896 | r14897 | |
| 161 | 161 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 162 | 162 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("oki", okibank_w) |
| 163 | 163 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 164 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 164 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 165 | 165 | ADDRESS_MAP_END |
| 166 | 166 | |
| 167 | 167 |
| r14896 | r14897 | |
|---|---|---|
| 71 | 71 | AM_RANGE(0x9800, 0x985f) AM_MIRROR(0x80) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 72 | 72 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("P1") |
| 73 | 73 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("P2") |
| 74 | AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW") AM_WRITE(soundlatch_w) | |
| 74 | AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW") AM_WRITE(soundlatch_byte_w) | |
| 75 | 75 | ADDRESS_MAP_END |
| 76 | 76 | |
| 77 | 77 | static ADDRESS_MAP_START( carjmbre_sound_map, AS_PROGRAM, 8, carjmbre_state ) |
| r14896 | r14897 | |
| 82 | 82 | |
| 83 | 83 | static ADDRESS_MAP_START( carjmbre_sound_io_map, AS_IO, 8, carjmbre_state ) |
| 84 | 84 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 85 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 85 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 86 | 86 | AM_RANGE(0x10, 0x10) AM_WRITENOP //?? written on init/0xff sound command reset |
| 87 | 87 | AM_RANGE(0x20, 0x21) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 88 | 88 | AM_RANGE(0x22, 0x22) AM_WRITENOP //?? written before and after 0x21 with same value |
| r14896 | r14897 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | AM_RANGE(0x160000, 0x16ffff) AM_READ(varia_crom_read) // cgrom read window .. |
| 238 | 238 | |
| 239 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 239 | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram | |
| 240 | 240 | AM_RANGE(0x174000, 0x174fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 241 | 241 | AM_RANGE(0x175000, 0x177fff) AM_RAM |
| 242 | 242 | AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_BASE(m_tlookup) |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | { |
| 36 | 36 | if (offset == 0) |
| 37 | 37 | { |
| 38 | soundlatch_w(space,0,data); | |
| 38 | soundlatch_byte_w(space,0,data); | |
| 39 | 39 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 40 | 40 | } |
| 41 | 41 | } |
| r14896 | r14897 | |
| 111 | 111 | AM_RANGE(0x080000, 0x080001) AM_WRITE(battlera_adpcm_data_w) |
| 112 | 112 | AM_RANGE(0x1fe800, 0x1fe80f) AM_DEVWRITE_LEGACY("c6280", c6280_w) |
| 113 | 113 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank7") /* Main ram */ |
| 114 | AM_RANGE(0x1ff000, 0x1ff001) AM_READ(soundlatch_r) AM_DEVWRITE_LEGACY("msm", battlera_adpcm_reset_w) | |
| 114 | AM_RANGE(0x1ff000, 0x1ff001) AM_READ(soundlatch_byte_r) AM_DEVWRITE_LEGACY("msm", battlera_adpcm_reset_w) | |
| 115 | 115 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| 116 | 116 | ADDRESS_MAP_END |
| 117 | 117 |
| r14896 | r14897 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | WRITE8_MEMBER(flower_state::sound_command_w) |
| 104 | 104 | { |
| 105 | soundlatch_w(space, 0, data); | |
| 105 | soundlatch_byte_w(space, 0, data); | |
| 106 | 106 | |
| 107 | 107 | if (*m_sn_nmi_enable & 1) |
| 108 | 108 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| r14896 | r14897 | |
| 135 | 135 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 136 | 136 | AM_RANGE(0x4000, 0x4000) AM_WRITE(flower_soundcpu_irq_ack) |
| 137 | 137 | AM_RANGE(0x4001, 0x4001) AM_WRITEONLY AM_BASE(m_sn_nmi_enable) |
| 138 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 138 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 139 | 139 | AM_RANGE(0x8000, 0x803f) AM_DEVWRITE_LEGACY("flower", flower_sound1_w) |
| 140 | 140 | AM_RANGE(0xa000, 0xa03f) AM_DEVWRITE_LEGACY("flower", flower_sound2_w) |
| 141 | 141 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 223 | 223 | |
| 224 | 224 | WRITE8_MEMBER(xain_state::xain_sound_command_w) |
| 225 | 225 | { |
| 226 | soundlatch_w(space,offset,data); | |
| 226 | soundlatch_byte_w(space,offset,data); | |
| 227 | 227 | cputag_set_input_line(machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE); |
| 228 | 228 | } |
| 229 | 229 | |
| r14896 | r14897 | |
| 406 | 406 | AM_RANGE(0x3a0d, 0x3a0d) AM_WRITE(xain_flipscreen_w) |
| 407 | 407 | AM_RANGE(0x3a0e, 0x3a0e) AM_WRITE(xain_68705_w) |
| 408 | 408 | AM_RANGE(0x3a0f, 0x3a0f) AM_WRITE(xainCPUA_bankswitch_w) |
| 409 | AM_RANGE(0x3c00, 0x3dff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 410 | AM_RANGE(0x3e00, 0x3fff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 409 | AM_RANGE(0x3c00, 0x3dff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 410 | AM_RANGE(0x3e00, 0x3fff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 411 | 411 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 412 | 412 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 413 | 413 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 437 | 437 | |
| 438 | 438 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, xain_state ) |
| 439 | 439 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 440 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_r) | |
| 440 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r) | |
| 441 | 441 | AM_RANGE(0x2800, 0x2801) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 442 | 442 | AM_RANGE(0x3000, 0x3001) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 443 | 443 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | public: |
| 41 | 41 | firefox_state(const machine_config &mconfig, device_type type, const char *tag) |
| 42 | 42 | : driver_device(mconfig, type, tag), |
| 43 | m_laserdisc(*this, "laserdisc") { } | |
| 43 | m_laserdisc(*this, "laserdisc") , | |
| 44 | m_tileram(*this, "tileram"), | |
| 45 | m_spriteram(*this, "spriteram"), | |
| 46 | m_sprite_palette(*this, "sprite_palette"), | |
| 47 | m_tile_palette(*this, "tile_palette"){ } | |
| 44 | 48 | |
| 45 | 49 | required_device<phillips_22vp931_device> m_laserdisc; |
| 50 | required_shared_ptr<unsigned char> m_tileram; | |
| 51 | required_shared_ptr<UINT8> m_spriteram; | |
| 52 | required_shared_ptr<unsigned char> m_sprite_palette; | |
| 53 | required_shared_ptr<unsigned char> m_tile_palette; | |
| 46 | 54 | int m_n_disc_lock; |
| 47 | 55 | int m_n_disc_data; |
| 48 | 56 | int m_n_disc_read_data; |
| 49 | unsigned char *m_tileram; | |
| 50 | unsigned char *m_tile_palette; | |
| 51 | unsigned char *m_sprite_palette; | |
| 52 | 57 | x2212_device *m_nvram_1c; |
| 53 | 58 | x2212_device *m_nvram_1d; |
| 54 | 59 | tilemap_t *m_bgtiles; |
| r14896 | r14897 | |
| 56 | 61 | UINT8 m_sound_to_main_flag; |
| 57 | 62 | UINT8 m_main_to_sound_flag; |
| 58 | 63 | int m_sprite_bank; |
| 59 | UINT8 *m_spriteram; | |
| 60 | 64 | DECLARE_READ8_MEMBER(firefox_disc_status_r); |
| 61 | 65 | DECLARE_READ8_MEMBER(firefox_disc_data_r); |
| 62 | 66 | DECLARE_WRITE8_MEMBER(firefox_disc_read_w); |
| r14896 | r14897 | |
| 186 | 190 | static TILE_GET_INFO( bgtile_get_info ) |
| 187 | 191 | { |
| 188 | 192 | firefox_state *state = machine.driver_data<firefox_state>(); |
| 189 | SET_TILE_INFO(0, state->m_tileram[tile_index], 0, 0); | |
| 193 | SET_TILE_INFO(0, state->m_tileram.target()[tile_index], 0, 0); | |
| 190 | 194 | } |
| 191 | 195 | |
| 192 | 196 | |
| 193 | 197 | WRITE8_MEMBER(firefox_state::tileram_w) |
| 194 | 198 | { |
| 195 | m_tileram[offset] = data; | |
| 199 | m_tileram.target()[offset] = data; | |
| 196 | 200 | m_bgtiles->mark_tile_dirty(offset); |
| 197 | 201 | } |
| 198 | 202 | |
| r14896 | r14897 | |
| 261 | 265 | |
| 262 | 266 | WRITE8_MEMBER(firefox_state::tile_palette_w) |
| 263 | 267 | { |
| 264 | m_tile_palette[ offset ] = data; | |
| 268 | m_tile_palette.target()[ offset ] = data; | |
| 265 | 269 | set_rgba( machine(), 0, offset & 0xff, m_tile_palette ); |
| 266 | 270 | } |
| 267 | 271 | |
| 268 | 272 | WRITE8_MEMBER(firefox_state::sprite_palette_w) |
| 269 | 273 | { |
| 270 | m_sprite_palette[ offset ] = data; | |
| 274 | m_sprite_palette.target()[ offset ] = data; | |
| 271 | 275 | set_rgba( machine(), 256, offset & 0xff, m_sprite_palette ); |
| 272 | 276 | } |
| 273 | 277 | |
| r14896 | r14897 | |
| 297 | 301 | READ8_MEMBER(firefox_state::sound_to_main_r) |
| 298 | 302 | { |
| 299 | 303 | m_sound_to_main_flag = 0; |
| 300 | return soundlatch2_r(space, 0); | |
| 304 | return soundlatch2_byte_r(space, 0); | |
| 301 | 305 | } |
| 302 | 306 | |
| 303 | 307 | WRITE8_MEMBER(firefox_state::main_to_sound_w) |
| 304 | 308 | { |
| 305 | 309 | m_main_to_sound_flag = 1; |
| 306 | soundlatch_w(space, 0, data); | |
| 310 | soundlatch_byte_w(space, 0, data); | |
| 307 | 311 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 308 | 312 | } |
| 309 | 313 | |
| r14896 | r14897 | |
| 317 | 321 | READ8_MEMBER(firefox_state::main_to_sound_r) |
| 318 | 322 | { |
| 319 | 323 | m_main_to_sound_flag = 0; |
| 320 | return soundlatch_r(space, 0); | |
| 324 | return soundlatch_byte_r(space, 0); | |
| 321 | 325 | } |
| 322 | 326 | |
| 323 | 327 | WRITE8_MEMBER(firefox_state::sound_to_main_w) |
| 324 | 328 | { |
| 325 | 329 | m_sound_to_main_flag = 1; |
| 326 | soundlatch2_w(space, 0, data); | |
| 330 | soundlatch2_byte_w(space, 0, data); | |
| 327 | 331 | } |
| 328 | 332 | |
| 329 | 333 | |
| r14896 | r14897 | |
| 496 | 500 | |
| 497 | 501 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, firefox_state ) |
| 498 | 502 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 499 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(tileram_w) AM_BASE(m_tileram) | |
| 500 | AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(m_spriteram) | |
| 501 | AM_RANGE(0x2800, 0x2aff) AM_RAM_WRITE(sprite_palette_w) AM_BASE(m_sprite_palette) | |
| 503 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(tileram_w) AM_SHARE("tileram") | |
| 504 | AM_RANGE(0x2000, 0x27ff) AM_RAM AM_SHARE("spriteram") | |
| 505 | AM_RANGE(0x2800, 0x2aff) AM_RAM_WRITE(sprite_palette_w) AM_SHARE("sprite_palette") | |
| 502 | 506 | AM_RANGE(0x2b00, 0x2b00) AM_MIRROR(0x04ff) AM_WRITE(firefox_objram_bank_w) |
| 503 | AM_RANGE(0x2c00, 0x2eff) AM_RAM_WRITE(tile_palette_w) AM_ | |
| 507 | AM_RANGE(0x2c00, 0x2eff) AM_RAM_WRITE(tile_palette_w) AM_ | |
| 504 | 508 | AM_RANGE(0x3000, 0x3fff) AM_ROMBANK("bank1") |
| 505 | 509 | AM_RANGE(0x4000, 0x40ff) AM_READWRITE(nvram_r, nvram_w) /* NOVRAM */ |
| 506 | 510 | AM_RANGE(0x4100, 0x4100) AM_MIRROR(0x00f8) AM_READ_PORT("rdin0") /* RDIN0 */ |
| r14896 | r14897 | |
|---|---|---|
| 162 | 162 | |
| 163 | 163 | static ADDRESS_MAP_START( mainevt_map, AS_PROGRAM, 8, mainevt_state ) |
| 164 | 164 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(mainevt_bankswitch_w) |
| 165 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_w) /* probably */ | |
| 165 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w) /* probably */ | |
| 166 | 166 | AM_RANGE(0x1f88, 0x1f88) AM_WRITE(mainevt_sh_irqtrigger_w) /* probably */ |
| 167 | 167 | AM_RANGE(0x1f8c, 0x1f8d) AM_WRITENOP /* ??? */ |
| 168 | 168 | AM_RANGE(0x1f90, 0x1f90) AM_WRITE(mainevt_coin_w) /* coin counters + lamps */ |
| r14896 | r14897 | |
| 179 | 179 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w) |
| 180 | 180 | |
| 181 | 181 | AM_RANGE(0x4000, 0x5dff) AM_RAM |
| 182 | AM_RANGE(0x5e00, 0x5fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_SHARE("paletteram") | |
| 182 | AM_RANGE(0x5e00, 0x5fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_be_w) AM_SHARE("paletteram") | |
| 183 | 183 | AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1") |
| 184 | 184 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 185 | 185 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 187 | 187 | |
| 188 | 188 | static ADDRESS_MAP_START( devstors_map, AS_PROGRAM, 8, mainevt_state ) |
| 189 | 189 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(mainevt_bankswitch_w) |
| 190 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_w) /* probably */ | |
| 190 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w) /* probably */ | |
| 191 | 191 | AM_RANGE(0x1f88, 0x1f88) AM_WRITE(mainevt_sh_irqtrigger_w) /* probably */ |
| 192 | 192 | AM_RANGE(0x1f90, 0x1f90) AM_WRITE(mainevt_coin_w) /* coin counters + lamps */ |
| 193 | 193 | AM_RANGE(0x1fb2, 0x1fb2) AM_WRITE(dv_nmienable_w) |
| r14896 | r14897 | |
| 203 | 203 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w) |
| 204 | 204 | |
| 205 | 205 | AM_RANGE(0x4000, 0x5dff) AM_RAM |
| 206 | AM_RANGE(0x5e00, 0x5fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_SHARE("paletteram") | |
| 206 | AM_RANGE(0x5e00, 0x5fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_be_w) AM_SHARE("paletteram") | |
| 207 | 207 | AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1") |
| 208 | 208 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 209 | 209 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 213 | 213 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 214 | 214 | AM_RANGE(0x8000, 0x83ff) AM_RAM |
| 215 | 215 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w) |
| 216 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 216 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 217 | 217 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r,k007232_w) |
| 218 | 218 | AM_RANGE(0xd000, 0xd000) AM_DEVREAD_LEGACY("upd", mainevt_sh_busy_r) |
| 219 | 219 | AM_RANGE(0xe000, 0xe000) AM_WRITE(mainevt_sh_irqcontrol_w) |
| r14896 | r14897 | |
| 223 | 223 | static ADDRESS_MAP_START( devstors_sound_map, AS_PROGRAM, 8, mainevt_state ) |
| 224 | 224 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 225 | 225 | AM_RANGE(0x8000, 0x83ff) AM_RAM |
| 226 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 226 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 227 | 227 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r,k007232_w) |
| 228 | 228 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) |
| 229 | 229 | AM_RANGE(0xe000, 0xe000) AM_WRITE(devstor_sh_irqcontrol_w) |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | static SCREEN_UPDATE_RGB32( wcvol95 ) |
| 69 | 69 | { |
| 70 | 70 | //FIXME: flip_screen_x should not be written! |
| 71 | flip_screen_set_no_update(screen.machine(), 1); | |
| 72 | ||
| 73 | 71 | deco156_state *state = screen.machine().driver_data<deco156_state>(); |
| 72 | state->flip_screen_set_no_update(1); | |
| 74 | 73 | |
| 75 | 74 | screen.machine().priority_bitmap.fill(0); |
| 76 | 75 | bitmap.fill(0); |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | WRITE16_MEMBER(toki_state::tokib_soundcommand16_w) |
| 47 | 47 | { |
| 48 | soundlatch_w(space, 0, data & 0xff); | |
| 48 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 49 | 49 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 50 | 50 | } |
| 51 | 51 | |
| r14896 | r14897 | |
| 93 | 93 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 94 | 94 | AM_RANGE(0x060000, 0x06d7ff) AM_RAM |
| 95 | 95 | AM_RANGE(0x06d800, 0x06dfff) AM_RAM AM_SHARE("spriteram") |
| 96 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_WRITE(paletteram | |
| 96 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_WRITE(paletteram | |
| 97 | 97 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_BASE(m_background1_videoram16) |
| 98 | 98 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_BASE(m_background2_videoram16) |
| 99 | 99 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_BASE(m_videoram) |
| r14896 | r14897 | |
| 108 | 108 | static ADDRESS_MAP_START( tokib_map, AS_PROGRAM, 16, toki_state ) |
| 109 | 109 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 110 | 110 | AM_RANGE(0x060000, 0x06dfff) AM_RAM |
| 111 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_WRITE(paletteram | |
| 111 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_WRITE(paletteram | |
| 112 | 112 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_BASE(m_background1_videoram16) |
| 113 | 113 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_BASE(m_background2_videoram16) |
| 114 | 114 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_BASE(m_videoram) |
| r14896 | r14897 | |
| 136 | 136 | AM_RANGE(0xe400, 0xe400) AM_WRITE(toki_adpcm_data_w) |
| 137 | 137 | AM_RANGE(0xec00, 0xec01) AM_MIRROR(0x0008) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) |
| 138 | 138 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 139 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 139 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 140 | 140 | ADDRESS_MAP_END |
| 141 | 141 | |
| 142 | 142 | /*****************************************************************************/ |
| r14896 | r14897 | |
|---|---|---|
| 214 | 214 | |
| 215 | 215 | WRITE8_MEMBER(renegade_state::sound_w) |
| 216 | 216 | { |
| 217 | soundlatch_w(space, offset, data); | |
| 217 | soundlatch_byte_w(space, offset, data); | |
| 218 | 218 | cputag_set_input_line(machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE); |
| 219 | 219 | } |
| 220 | 220 | |
| r14896 | r14897 | |
| 647 | 647 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(renegade_videoram2_w) AM_BASE(m_videoram2) |
| 648 | 648 | AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(m_spriteram) |
| 649 | 649 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(renegade_videoram_w) AM_BASE(m_videoram) |
| 650 | AM_RANGE(0x3000, 0x30ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 651 | AM_RANGE(0x3100, 0x31ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 650 | AM_RANGE(0x3000, 0x30ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 651 | AM_RANGE(0x3100, 0x31ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 652 | 652 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("IN0") AM_WRITE(renegade_scroll0_w) /* Player#1 controls, P1,P2 start */ |
| 653 | 653 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("IN1") AM_WRITE(renegade_scroll1_w) /* Player#2 controls, coin triggers */ |
| 654 | 654 | AM_RANGE(0x3802, 0x3802) AM_READ_PORT("DSW2") AM_WRITE(sound_w) /* DIP2 various IO ports */ |
| r14896 | r14897 | |
| 663 | 663 | |
| 664 | 664 | static ADDRESS_MAP_START( renegade_sound_map, AS_PROGRAM, 8, renegade_state ) |
| 665 | 665 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 666 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_r) | |
| 666 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r) | |
| 667 | 667 | AM_RANGE(0x1800, 0x1800) AM_WRITENOP // this gets written the same values as 0x2000 |
| 668 | 668 | AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("adpcm", adpcm_play_w) |
| 669 | 669 | AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE_LEGACY("ymsnd", ym3526_r,ym3526_w) |
| r14896 | r14897 | |
|---|---|---|
| 299 | 299 | AM_RANGE(0x8033, 0x8033) AM_WRITEONLY AM_BASE(m_scroll) /* not used in Juno */ |
| 300 | 300 | AM_RANGE(0x8034, 0x8035) AM_WRITE(flip_screen_w) |
| 301 | 301 | AM_RANGE(0x8040, 0x8040) AM_WRITE(junofrst_sh_irqtrigger_w) |
| 302 | AM_RANGE(0x8050, 0x8050) AM_WRITE(soundlatch_w) | |
| 302 | AM_RANGE(0x8050, 0x8050) AM_WRITE(soundlatch_byte_w) | |
| 303 | 303 | AM_RANGE(0x8060, 0x8060) AM_WRITE(junofrst_bankselect_w) |
| 304 | 304 | AM_RANGE(0x8070, 0x8073) AM_WRITE(junofrst_blitter_w) |
| 305 | 305 | AM_RANGE(0x8100, 0x8fff) AM_RAM |
| r14896 | r14897 | |
| 311 | 311 | static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, junofrst_state ) |
| 312 | 312 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 313 | 313 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 314 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 314 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 315 | 315 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 316 | 316 | AM_RANGE(0x4001, 0x4001) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 317 | 317 | AM_RANGE(0x4002, 0x4002) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| 318 | AM_RANGE(0x5000, 0x5000) AM_WRITE(soundlatch2_w) | |
| 318 | AM_RANGE(0x5000, 0x5000) AM_WRITE(soundlatch2_byte_w) | |
| 319 | 319 | AM_RANGE(0x6000, 0x6000) AM_WRITE(junofrst_i8039_irq_w) |
| 320 | 320 | ADDRESS_MAP_END |
| 321 | 321 | |
| r14896 | r14897 | |
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, junofrst_state ) |
| 329 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_r) | |
| 329 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_byte_r) | |
| 330 | 330 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 331 | 331 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w) |
| 332 | 332 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | public: |
| 53 | 53 | caswin_state(const machine_config &mconfig, device_type type, const char *tag) |
| 54 | : driver_device(mconfig, type, tag) { } | |
| 54 | : driver_device(mconfig, type, tag) , | |
| 55 | m_sc0_vram(*this, "sc0_vram"), | |
| 56 | m_sc0_attr(*this, "sc0_attr"){ } | |
| 55 | 57 | |
| 56 | UINT8 *m_sc0_vram; | |
| 57 | UINT8 *m_sc0_attr; | |
| 58 | required_shared_ptr<UINT8> m_sc0_vram; | |
| 59 | required_shared_ptr<UINT8> m_sc0_attr; | |
| 58 | 60 | tilemap_t *m_sc0_tilemap; |
| 59 | 61 | DECLARE_WRITE8_MEMBER(sc0_vram_w); |
| 60 | 62 | DECLARE_WRITE8_MEMBER(sc0_attr_w); |
| r14896 | r14897 | |
| 70 | 72 | static TILE_GET_INFO( get_sc0_tile_info ) |
| 71 | 73 | { |
| 72 | 74 | caswin_state *state = machine.driver_data<caswin_state>(); |
| 73 | int tile = (state->m_sc0_vram[tile_index] | ((state->m_sc0_attr[tile_index] & 0x70)<<4)) & 0x7ff; | |
| 74 | int colour = state->m_sc0_attr[tile_index] & 0xf; | |
| 75 | int tile = (state->m_sc0_vram.target()[tile_index] | ((state->m_sc0_attr.target()[tile_index] & 0x70)<<4)) & 0x7ff; | |
| 76 | int colour = state->m_sc0_attr.target()[tile_index] & 0xf; | |
| 75 | 77 | |
| 76 | 78 | SET_TILE_INFO( |
| 77 | 79 | 0, |
| r14896 | r14897 | |
| 95 | 97 | |
| 96 | 98 | WRITE8_MEMBER(caswin_state::sc0_vram_w) |
| 97 | 99 | { |
| 98 | m_sc0_vram[offset] = data; | |
| 100 | m_sc0_vram.target()[offset] = data; | |
| 99 | 101 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 100 | 102 | } |
| 101 | 103 | |
| 102 | 104 | WRITE8_MEMBER(caswin_state::sc0_attr_w) |
| 103 | 105 | { |
| 104 | m_sc0_attr[offset] = data; | |
| 106 | m_sc0_attr.target()[offset] = data; | |
| 105 | 107 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 106 | 108 | } |
| 107 | 109 | |
| r14896 | r14897 | |
| 115 | 117 | /*---- ---x flip screen */ |
| 116 | 118 | WRITE8_MEMBER(caswin_state::vvillage_vregs_w) |
| 117 | 119 | { |
| 118 | flip_screen_set( | |
| 120 | flip_screen_set( | |
| 119 | 121 | } |
| 120 | 122 | |
| 121 | 123 | /********************** |
| r14896 | r14897 | |
| 158 | 160 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 159 | 161 | AM_RANGE(0xa000, 0xa000) AM_READ(vvillage_rng_r) //accessed by caswin only |
| 160 | 162 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("nvram") |
| 161 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(m_sc0_vram) | |
| 162 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(sc0_attr_w) AM_BASE(m_sc0_attr) | |
| 163 | AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(sc0_vram_w) AM_SHARE("sc0_vram") | |
| 164 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(sc0_attr_w) AM_SHARE("sc0_attr") | |
| 163 | 165 | ADDRESS_MAP_END |
| 164 | 166 | |
| 165 | 167 | static ADDRESS_MAP_START( vvillage_io, AS_IO, 8, caswin_state ) |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | public: |
| 54 | 54 | hitpoker_state(const machine_config &mconfig, device_type type, const char *tag) |
| 55 | : driver_device(mconfig, type, tag) { } | |
| 55 | : driver_device(mconfig, type, tag) , | |
| 56 | m_sys_regs(*this, "sys_regs"){ } | |
| 56 | 57 | |
| 57 | UINT8 | |
| 58 | required_shared_ptr<UINT8> | |
| 58 | 59 | UINT8 m_pic_data; |
| 59 | 60 | UINT8 *m_videoram; |
| 60 | 61 | UINT8 *m_paletteram; |
| r14896 | r14897 | |
| 128 | 129 | { |
| 129 | 130 | // UINT8 *ROM = machine().region("maincpu")->base(); |
| 130 | 131 | |
| 131 | // if(m_sys_regs[0x00] & 0x10) | |
| 132 | // if(m_sys_regs.target()[0x00] & 0x10) | |
| 132 | 133 | m_videoram[offset] = data; |
| 133 | 134 | } |
| 134 | 135 | |
| r14896 | r14897 | |
| 220 | 221 | return (m_pic_data & 0x7f) | (m_pic_data & 0x40 ? 0x80 : 0x00); |
| 221 | 222 | } |
| 222 | 223 | |
| 223 | return m_sys_regs[offset]; | |
| 224 | return m_sys_regs.target()[offset]; | |
| 224 | 225 | } |
| 225 | 226 | |
| 226 | 227 | WRITE8_MEMBER(hitpoker_state::hitpoker_pic_w) |
| r14896 | r14897 | |
| 228 | 229 | if(offset == 0) |
| 229 | 230 | m_pic_data = (data & 0xff);// | (data & 0x40) ? 0x80 : 0x00; |
| 230 | 231 | // logerror("%02x W\n",data); |
| 231 | m_sys_regs[offset] = data; | |
| 232 | m_sys_regs.target()[offset] = data; | |
| 232 | 233 | } |
| 233 | 234 | |
| 234 | 235 | #if 0 |
| r14896 | r14897 | |
| 262 | 263 | ADDRESS_MAP_END |
| 263 | 264 | |
| 264 | 265 | static ADDRESS_MAP_START( hitpoker_io, AS_IO, 8, hitpoker_state ) |
| 265 | AM_RANGE(MC68HC11_IO_PORTA, MC68HC11_IO_PORTA) AM_READWRITE(hitpoker_pic_r,hitpoker_pic_w) AM_ | |
| 266 | AM_RANGE(MC68HC11_IO_PORTA, MC68HC11_IO_PORTA) AM_READWRITE(hitpoker_pic_r,hitpoker_pic_w) AM_ | |
| 266 | 267 | ADDRESS_MAP_END |
| 267 | 268 | |
| 268 | 269 | static INPUT_PORTS_START( hitpoker ) |
| r14896 | r14897 | |
|---|---|---|
| 255 | 255 | AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 256 | 256 | AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 257 | 257 | AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE_LEGACY("tc0080vco", tc0080vco_word_r, tc0080vco_word_w) |
| 258 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 258 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 259 | 259 | ADDRESS_MAP_END |
| 260 | 260 | |
| 261 | 261 | static ADDRESS_MAP_START( recordbr_map, AS_PROGRAM, 16, taitoh_state ) |
| r14896 | r14897 | |
| 266 | 266 | AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 267 | 267 | AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 268 | 268 | AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE_LEGACY("tc0080vco", tc0080vco_word_r, tc0080vco_word_w) |
| 269 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 269 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 270 | 270 | ADDRESS_MAP_END |
| 271 | 271 | |
| 272 | 272 | static ADDRESS_MAP_START( dleague_map, AS_PROGRAM, 16, taitoh_state ) |
| r14896 | r14897 | |
| 276 | 276 | AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 277 | 277 | AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 278 | 278 | AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE_LEGACY("tc0080vco", tc0080vco_word_r, tc0080vco_word_w) |
| 279 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 279 | AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram | |
| 280 | 280 | AM_RANGE(0x600000, 0x600001) AM_WRITENOP /* ?? writes zero once per frame */ |
| 281 | 281 | ADDRESS_MAP_END |
| 282 | 282 |
| r14896 | r14897 | |
|---|---|---|
| 76 | 76 | AM_RANGE(0x020000, 0x023fff) AM_RAM |
| 77 | 77 | AM_RANGE(0x030000, 0x0307ff) AM_RAM_WRITE(ginganin_txtram16_w) AM_BASE(m_txtram) |
| 78 | 78 | AM_RANGE(0x040000, 0x0407ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 79 | AM_RANGE(0x050000, 0x0507ff) AM_RAM_WRITE(paletteram | |
| 79 | AM_RANGE(0x050000, 0x0507ff) AM_RAM_WRITE(paletteram | |
| 80 | 80 | AM_RANGE(0x060000, 0x06000f) AM_RAM_WRITE(ginganin_vregs16_w) AM_BASE(m_vregs) |
| 81 | 81 | AM_RANGE(0x068000, 0x06bfff) AM_RAM_WRITE(ginganin_fgram16_w) AM_BASE(m_fgram) |
| 82 | 82 | AM_RANGE(0x070000, 0x070001) AM_READ_PORT("P1_P2") |
| r14896 | r14897 | |
| 93 | 93 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ginganin_state ) |
| 94 | 94 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 95 | 95 | AM_RANGE(0x0800, 0x0807) AM_DEVREADWRITE("6840ptm", ptm6840_device, read, write) |
| 96 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_r) | |
| 96 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r) | |
| 97 | 97 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ymsnd", y8950_w) |
| 98 | 98 | AM_RANGE(0x2800, 0x2801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 99 | 99 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | if (ACCESSING_BITS_0_7) |
| 24 | 24 | { |
| 25 | soundlatch_w(space, offset, data & 0xff); | |
| 25 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 26 | 26 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 27 | 27 | } |
| 28 | 28 | } |
| r14896 | r14897 | |
| 43 | 43 | AM_RANGE(0xffc000, 0xffc2ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 44 | 44 | AM_RANGE(0xffc300, 0xffcfff) AM_RAM |
| 45 | 45 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(tail2nos_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 46 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 46 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 47 | 47 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("INPUTS") AM_WRITE(tail2nos_gfxbank_w) |
| 48 | 48 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") |
| 49 | 49 | AM_RANGE(0xfff008, 0xfff009) AM_WRITE(sound_command_w) |
| r14896 | r14897 | |
| 57 | 57 | |
| 58 | 58 | static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, tail2nos_state ) |
| 59 | 59 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 60 | AM_RANGE(0x07, 0x07) AM_READ(soundlatch_r) AM_WRITENOP /* the write is a clear pending command */ | |
| 60 | AM_RANGE(0x07, 0x07) AM_READ(soundlatch_byte_r) AM_WRITENOP /* the write is a clear pending command */ | |
| 61 | 61 | AM_RANGE(0x08, 0x0b) AM_DEVWRITE_LEGACY("ymsnd", ym2608_w) |
| 62 | 62 | #if 0 |
| 63 | 63 | AM_RANGE(0x18, 0x1b) AM_DEVREAD_LEGACY("ymsnd", ym2608_r) |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | { |
| 63 | 63 | public: |
| 64 | 64 | m79amb_state(const machine_config &mconfig, device_type type, const char *tag) |
| 65 | : driver_device(mconfig, type, tag) { } | |
| 65 | : driver_device(mconfig, type, tag) , | |
| 66 | m_videoram(*this, "videoram"), | |
| 67 | m_mask(*this, "mask"){ } | |
| 66 | 68 | |
| 67 | 69 | /* memory pointers */ |
| 68 | UINT8 * m_videoram; | |
| 69 | UINT8 * m_mask; | |
| 70 | required_shared_ptr<UINT8> m_videoram; | |
| 71 | required_shared_ptr<UINT8> m_mask; | |
| 70 | 72 | |
| 71 | 73 | /* misc */ |
| 72 | 74 | UINT8 m_lut_gun1[0x100]; |
| r14896 | r14897 | |
| 80 | 82 | |
| 81 | 83 | WRITE8_MEMBER(m79amb_state::ramtek_videoram_w) |
| 82 | 84 | { |
| 83 | m_videoram[offset] = data & ~*m_mask; | |
| 85 | m_videoram.target()[offset] = data & ~*m_mask.target(); | |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | static SCREEN_UPDATE_RGB32( ramtek ) |
| r14896 | r14897 | |
| 92 | 94 | { |
| 93 | 95 | int i; |
| 94 | 96 | |
| 95 | UINT8 data = state->m_videoram[offs]; | |
| 97 | UINT8 data = state->m_videoram.target()[offs]; | |
| 96 | 98 | int y = offs >> 5; |
| 97 | 99 | int x = (offs & 0x1f) << 3; |
| 98 | 100 | |
| r14896 | r14897 | |
| 135 | 137 | |
| 136 | 138 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, m79amb_state ) |
| 137 | 139 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 138 | AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(ramtek_videoram_w) AM_ | |
| 140 | AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(ramtek_videoram_w) AM_ | |
| 139 | 141 | AM_RANGE(0x6000, 0x63ff) AM_RAM /* ?? */ |
| 140 | 142 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("8000") AM_DEVWRITE_LEGACY("discrete", m79amb_8000_w) |
| 141 | AM_RANGE(0x8001, 0x8001) AM_WRITEONLY AM_ | |
| 143 | AM_RANGE(0x8001, 0x8001) AM_WRITEONLY AM_ | |
| 142 | 144 | AM_RANGE(0x8002, 0x8002) AM_READ_PORT("8002") AM_WRITE(m79amb_8002_w) |
| 143 | 145 | AM_RANGE(0x8003, 0x8003) AM_DEVWRITE_LEGACY("discrete", m79amb_8003_w) |
| 144 | 146 | AM_RANGE(0x8004, 0x8004) AM_READ(gray5bit_controller0_r) |
| r14896 | r14897 | |
|---|---|---|
| 38 | 38 | public: |
| 39 | 39 | koftball_state(const machine_config &mconfig, device_type type, const char *tag) |
| 40 | 40 | : driver_device(mconfig, type, tag), |
| 41 | m_maincpu(*this,"maincpu") | |
| 42 | { } | |
| 41 | m_maincpu(*this,"maincpu"), | |
| 42 | m_main_ram(*this, "main_ram"), | |
| 43 | m_bmc_1_videoram(*this, "bmc_1_videoram"), | |
| 44 | m_bmc_2_videoram(*this, "bmc_2_videoram"){ } | |
| 43 | 45 | |
| 44 | UINT16 *m_bmc_1_videoram; | |
| 45 | UINT16 *m_bmc_2_videoram; | |
| 46 | UINT16 *m_main_ram; | |
| 46 | required_device<cpu_device> m_maincpu; | |
| 47 | required_shared_ptr<UINT16> m_main_ram; | |
| 48 | required_shared_ptr<UINT16> m_bmc_1_videoram; | |
| 49 | required_shared_ptr<UINT16> m_bmc_2_videoram; | |
| 47 | 50 | tilemap_t *m_tilemap_1; |
| 48 | 51 | tilemap_t *m_tilemap_2; |
| 49 | 52 | UINT8 *m_bmc_colorram; |
| 50 | 53 | int m_clr_offset; |
| 51 | 54 | UINT16 m_prot_data; |
| 52 | 55 | |
| 53 | required_device<cpu_device> m_maincpu; | |
| 54 | 56 | DECLARE_WRITE16_MEMBER(bmc_RAMDAC_offset_w); |
| 55 | 57 | DECLARE_WRITE16_MEMBER(bmc_RAMDAC_color_w); |
| 56 | 58 | DECLARE_READ16_MEMBER(bmc_RAMDAC_color_r); |
| r14896 | r14897 | |
| 65 | 67 | static TILE_GET_INFO( get_t1_tile_info ) |
| 66 | 68 | { |
| 67 | 69 | koftball_state *state = machine.driver_data<koftball_state>(); |
| 68 | int data = state->m_bmc_1_videoram[tile_index]; | |
| 70 | int data = state->m_bmc_1_videoram.target()[tile_index]; | |
| 69 | 71 | SET_TILE_INFO( |
| 70 | 72 | 0, |
| 71 | 73 | data, |
| r14896 | r14897 | |
| 76 | 78 | static TILE_GET_INFO( get_t2_tile_info ) |
| 77 | 79 | { |
| 78 | 80 | koftball_state *state = machine.driver_data<koftball_state>(); |
| 79 | int data = state->m_bmc_2_videoram[tile_index]; | |
| 81 | int data = state->m_bmc_2_videoram.target()[tile_index]; | |
| 80 | 82 | SET_TILE_INFO( |
| 81 | 83 | 0, |
| 82 | 84 | data, |
| r14896 | r14897 | |
| 145 | 147 | |
| 146 | 148 | WRITE16_MEMBER(koftball_state::bmc_1_videoram_w) |
| 147 | 149 | { |
| 148 | COMBINE_DATA(&m_bmc_1_videoram[offset]); | |
| 150 | COMBINE_DATA(&m_bmc_1_videoram.target()[offset]); | |
| 149 | 151 | m_tilemap_1->mark_tile_dirty(offset); |
| 150 | 152 | } |
| 151 | 153 | |
| 152 | 154 | WRITE16_MEMBER(koftball_state::bmc_2_videoram_w) |
| 153 | 155 | { |
| 154 | COMBINE_DATA(&m_bmc_2_videoram[offset]); | |
| 156 | COMBINE_DATA(&m_bmc_2_videoram.target()[offset]); | |
| 155 | 157 | m_tilemap_2->mark_tile_dirty(offset); |
| 156 | 158 | } |
| 157 | 159 | |
| 158 | 160 | static ADDRESS_MAP_START( koftball_mem, AS_PROGRAM, 16, koftball_state ) |
| 159 | 161 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 160 | AM_RANGE(0x220000, 0x22ffff) AM_RAM AM_ | |
| 162 | AM_RANGE(0x220000, 0x22ffff) AM_RAM AM_ | |
| 161 | 163 | |
| 162 | AM_RANGE(0x260000, 0x260fff) AM_WRITE(bmc_1_videoram_w) AM_BASE(m_bmc_1_videoram) | |
| 163 | AM_RANGE(0x261000, 0x261fff) AM_WRITE(bmc_2_videoram_w) AM_BASE(m_bmc_2_videoram) | |
| 164 | AM_RANGE(0x260000, 0x260fff) AM_WRITE(bmc_1_videoram_w) AM_SHARE("bmc_1_videoram") | |
| 165 | AM_RANGE(0x261000, 0x261fff) AM_WRITE(bmc_2_videoram_w) AM_SHARE("bmc_2_videoram") | |
| 164 | 166 | AM_RANGE(0x262000, 0x26ffff) AM_RAM |
| 165 | 167 | |
| 166 | 168 | AM_RANGE(0x280000, 0x28ffff) AM_RAM /* unused ? */ |
| r14896 | r14897 | |
| 313 | 315 | int offset=0; |
| 314 | 316 | while(nvram[offset]!=0xffff) |
| 315 | 317 | { |
| 316 | state->m_main_ram[offset]=nvram[offset]; | |
| 318 | state->m_main_ram.target()[offset]=nvram[offset]; | |
| 317 | 319 | ++offset; |
| 318 | 320 | } |
| 319 | 321 | } |
| r14896 | r14897 | |
|---|---|---|
| 24 | 24 | { |
| 25 | 25 | public: |
| 26 | 26 | atarisy4_state(const machine_config &mconfig, device_type type, const char *tag) |
| 27 | : driver_device(mconfig, type, tag) { } | |
| 27 | : driver_device(mconfig, type, tag) , | |
| 28 | m_m68k_ram(*this, "m68k_ram"), | |
| 29 | m_screen_ram(*this, "screen_ram"){ } | |
| 28 | 30 | |
| 29 | 31 | UINT8 m_r_color_table[256]; |
| 30 | 32 | UINT8 m_g_color_table[256]; |
| 31 | 33 | UINT8 m_b_color_table[256]; |
| 32 | 34 | UINT16 m_dsp_bank[2]; |
| 33 | 35 | UINT8 m_csr[2]; |
| 34 | UINT16 | |
| 36 | required_shared_ptr<UINT16> | |
| 35 | 37 | UINT16 *m_shared_ram[2]; |
| 36 | UINT16 | |
| 38 | required_shared_ptr<UINT16> | |
| 37 | 39 | poly_manager *m_poly; |
| 38 | 40 | DECLARE_WRITE16_MEMBER(gpu_w); |
| 39 | 41 | DECLARE_READ16_MEMBER(gpu_r); |
| r14896 | r14897 | |
| 168 | 170 | |
| 169 | 171 | for (y = cliprect.min_y; y <= cliprect.max_y; ++y) |
| 170 | 172 | { |
| 171 | UINT16 *src = &state->m_screen_ram[(offset + (4096 * y)) / 2]; | |
| 173 | UINT16 *src = &state->m_screen_ram.target()[(offset + (4096 * y)) / 2]; | |
| 172 | 174 | UINT32 *dest = &bitmap.pix32(y, cliprect.min_x); |
| 173 | 175 | int x; |
| 174 | 176 | |
| r14896 | r14897 | |
| 223 | 225 | { |
| 224 | 226 | if (x >= 0 && x <= 511) |
| 225 | 227 | { |
| 226 | UINT16 pix = state->m_screen_ram[xy_to_screen_addr(x,y) >> 1]; | |
| 228 | UINT16 pix = state->m_screen_ram.target()[xy_to_screen_addr(x,y) >> 1]; | |
| 227 | 229 | |
| 228 | 230 | if (x & 1) |
| 229 | 231 | pix = (pix & (0x00ff)) | gpu.idr << 8; |
| 230 | 232 | else |
| 231 | 233 | pix = (pix & (0xff00)) | gpu.idr; |
| 232 | 234 | |
| 233 | state->m_screen_ram[xy_to_screen_addr(x,y) >> 1] = pix; | |
| 235 | state->m_screen_ram.target()[xy_to_screen_addr(x,y) >> 1] = pix; | |
| 234 | 236 | } |
| 235 | 237 | ++x; |
| 236 | 238 | } |
| r14896 | r14897 | |
| 269 | 271 | clip.set(0, 511, 0, 511); |
| 270 | 272 | |
| 271 | 273 | extra->color = color; |
| 272 | extra->screen_ram = state->m_screen_ram; | |
| 274 | extra->screen_ram = state->m_screen_ram.target(); | |
| 273 | 275 | |
| 274 | 276 | v1.x = gpu.points[0].x; |
| 275 | 277 | v1.y = gpu.points[0].y; |
| r14896 | r14897 | |
| 371 | 373 | |
| 372 | 374 | for (i = 0; i < gpu.gr[3]; ++i) |
| 373 | 375 | { |
| 374 | UINT16 val = state->m_screen_ram[offset >> 1]; | |
| 376 | UINT16 val = state->m_screen_ram.target()[offset >> 1]; | |
| 375 | 377 | val >>= (~offset & 1) << 3; |
| 376 | 378 | |
| 377 | 379 | if (gpu.gr[4] & 0x10) |
| r14896 | r14897 | |
| 627 | 629 | *************************************/ |
| 628 | 630 | |
| 629 | 631 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy4_state ) |
| 630 | AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_ | |
| 632 | AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_ | |
| 631 | 633 | AM_RANGE(0x010000, 0x01ffff) AM_RAM |
| 632 | 634 | AM_RANGE(0x580000, 0x580001) AM_READ_PORT("JOYSTICK") |
| 633 | 635 | AM_RANGE(0x588000, 0x588001) AM_READ(analog_r) |
| r14896 | r14897 | |
| 636 | 638 | AM_RANGE(0x7c6000, 0x7c6001) AM_READWRITE(dsp1_status_r, dsp1_control_w) |
| 637 | 639 | AM_RANGE(0x7f0000, 0x7f4fff) AM_READWRITE(m68k_shared_0_r, m68k_shared_0_w) |
| 638 | 640 | AM_RANGE(0x7f6000, 0x7f6001) AM_READWRITE(dsp0_status_r, dsp0_control_w) |
| 639 | AM_RANGE(0xa00400, 0xbfffff) AM_RAM AM_ | |
| 641 | AM_RANGE(0xa00400, 0xbfffff) AM_RAM AM_ | |
| 640 | 642 | AM_RANGE(0xff8000, 0xff8fff) AM_READWRITE(gpu_r, gpu_w) |
| 641 | 643 | ADDRESS_MAP_END |
| 642 | 644 |
| r14896 | r14897 | |
|---|---|---|
| 708 | 708 | bit 0 contains the screen orientation. |
| 709 | 709 | */ |
| 710 | 710 | state->m_ym2149_portb = data; |
| 711 | flip_screen_set( | |
| 711 | state->flip_screen_set( | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | READ8_MEMBER(lucky74_state::usart_8251_r) |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | WRITE16_MEMBER(cninja_state::cninja_sound_w) |
| 58 | 58 | { |
| 59 | 59 | |
| 60 | soundlatch_w(space, 0, data & 0xff); | |
| 60 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 61 | 61 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | WRITE16_MEMBER(cninja_state::stoneage_sound_w) |
| 65 | 65 | { |
| 66 | 66 | |
| 67 | soundlatch_w(space, 0, data & 0xff); | |
| 67 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 68 | 68 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 69 | 69 | } |
| 70 | 70 | |
| r14896 | r14897 | |
| 307 | 307 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w) |
| 308 | 308 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 309 | 309 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 310 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 310 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 311 | 311 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 312 | 312 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 313 | 313 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
| 319 | 319 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 320 | 320 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 321 | 321 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 322 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 322 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 323 | 323 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 324 | 324 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 325 | 325 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
| 329 | 329 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 330 | 330 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 331 | 331 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 332 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 332 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 333 | 333 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 334 | 334 | ADDRESS_MAP_END |
| 335 | 335 |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | UINT8 *m_rambase_ae00; |
| 142 | 142 | UINT8 *m_rambase_c000; |
| 143 | DECLARE_WRITE8_MEMBER(wardner_ramrom_bank_sw); | |
| 143 | 144 | }; |
| 144 | 145 | |
| 145 | 146 | |
| 146 | ||
| 147 | ||
| 147 | 148 | { |
| 148 | wardner_state *state = space->machine().driver_data<wardner_state>(); | |
| 149 | if (state->m_wardner_membank != data) { | |
| 149 | if (m_wardner_membank != data) { | |
| 150 | 150 | int bankaddress = 0; |
| 151 | 151 | |
| 152 | 152 | address_space *mainspace; |
| 153 | UINT8 *RAM = | |
| 153 | UINT8 *RAM = | |
| 154 | 154 | |
| 155 | mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 156 | state->m_wardner_membank = data; | |
| 155 | mainspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 156 | m_wardner_membank = data; | |
| 157 | 157 | |
| 158 | 158 | if (data) |
| 159 | 159 | { |
| r14896 | r14897 | |
| 169 | 169 | case 6: bankaddress = 0x30000; break; /* not used */ |
| 170 | 170 | default: bankaddress = 0x00000; break; /* not used */ |
| 171 | 171 | } |
| 172 | memory_set_bankptr( | |
| 172 | memory_set_bankptr( | |
| 173 | 173 | } |
| 174 | 174 | else |
| 175 | 175 | { |
| 176 | mainspace->install_read_handler(0x8000, 0x8fff, read8_delegate(FUNC(wardner_state::wardner_sprite_r), | |
| 176 | mainspace->install_read_handler(0x8000, 0x8fff, read8_delegate(FUNC(wardner_state::wardner_sprite_r), | |
| 177 | 177 | mainspace->install_read_bank(0xa000, 0xadff, "bank4"); |
| 178 | 178 | mainspace->install_read_bank(0xae00, 0xafff, "bank2"); |
| 179 | 179 | mainspace->install_read_bank(0xc000, 0xc7ff, "bank3"); |
| 180 | memory_set_bankptr(space->machine(), "bank1", &RAM[0x0000]); | |
| 181 | memory_set_bankptr(space->machine(), "bank2", state->m_rambase_ae00); | |
| 182 | memory_set_bankptr(space->machine(), "bank3", state->m_rambase_c000); | |
| 183 | memory_set_bankptr(space->machine(), "bank4", state->m_generic_paletteram_8); | |
| 180 | memory_set_bankptr(machine(), "bank1", &RAM[0x0000]); | |
| 181 | memory_set_bankptr(machine(), "bank2", m_rambase_ae00); | |
| 182 | memory_set_bankptr(machine(), "bank3", m_rambase_c000); | |
| 183 | memory_set_bankptr(machine(), "bank4", m_generic_paletteram_8); | |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | } |
| r14896 | r14897 | |
| 190 | 190 | wardner_state *state = machine.driver_data<wardner_state>(); |
| 191 | 191 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 192 | 192 | |
| 193 | wardner_ramrom_bank_sw(space,0,1); /* Dummy value to ensure restoration */ | |
| 194 | wardner_ramrom_bank_sw(space,0,state->m_wardner_membank); | |
| 193 | state->wardner_ramrom_bank_sw(*space,0,1); /* Dummy value to ensure restoration */ | |
| 194 | state->wardner_ramrom_bank_sw(*space,0,state->m_wardner_membank); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | |
| r14896 | r14897 | |
| 205 | 205 | |
| 206 | 206 | AM_RANGE(0x8000, 0x8fff) AM_WRITE(wardner_sprite_w) AM_SHARE("spriteram") |
| 207 | 207 | AM_RANGE(0x9000, 0x9fff) AM_ROM |
| 208 | AM_RANGE(0xa000, 0xadff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_SHARE("paletteram") | |
| 208 | AM_RANGE(0xa000, 0xadff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 209 | 209 | AM_RANGE(0xae00, 0xafff) AM_RAM AM_BASE(m_rambase_ae00) |
| 210 | 210 | AM_RANGE(0xb000, 0xbfff) AM_ROM |
| 211 | 211 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_BASE(m_rambase_c000) AM_SHARE("share1") /* Shared RAM with Sound Z80 */ |
| r14896 | r14897 | |
| 231 | 231 | AM_RANGE(0x5a, 0x5a) AM_WRITE(wardner_coin_dsp_w) /* Machine system control */ |
| 232 | 232 | AM_RANGE(0x5c, 0x5c) AM_WRITE(wardner_control_w) /* Machine system control */ |
| 233 | 233 | AM_RANGE(0x60, 0x65) AM_READWRITE(wardner_videoram_r, wardner_videoram_w) /* data from video layer RAM */ |
| 234 | AM_RANGE(0x70, 0x70) AM_WRITE | |
| 234 | AM_RANGE(0x70, 0x70) AM_WRITE | |
| 235 | 235 | ADDRESS_MAP_END |
| 236 | 236 | |
| 237 | 237 |
| r14896 | r14897 | |
|---|---|---|
| 356 | 356 | { |
| 357 | 357 | public: |
| 358 | 358 | missile_state(const machine_config &mconfig, device_type type, const char *tag) |
| 359 | : driver_device(mconfig, type, tag) { } | |
| 359 | : driver_device(mconfig, type, tag) , | |
| 360 | m_videoram(*this, "videoram"){ } | |
| 360 | 361 | |
| 361 | UINT8 | |
| 362 | required_shared_ptr<UINT8> | |
| 362 | 363 | const UINT8 *m_writeprom; |
| 363 | 364 | emu_timer *m_irq_timer; |
| 364 | 365 | emu_timer *m_cpu_timer; |
| r14896 | r14897 | |
| 493 | 494 | if (address < 0x4000) |
| 494 | 495 | { |
| 495 | 496 | missile_state *state = direct.space().machine().driver_data<missile_state>(); |
| 496 | direct.explicit_configure(0x0000 | offset, 0x3fff | offset, 0x3fff, state->m_videoram); | |
| 497 | direct.explicit_configure(0x0000 | offset, 0x3fff | offset, 0x3fff, state->m_videoram.target()); | |
| 497 | 498 | return ~0; |
| 498 | 499 | } |
| 499 | 500 | |
| r14896 | r14897 | |
| 594 | 595 | static void write_vram(address_space *space, offs_t address, UINT8 data) |
| 595 | 596 | { |
| 596 | 597 | missile_state *state = space->machine().driver_data<missile_state>(); |
| 597 | UINT8 *videoram = state->m_videoram; | |
| 598 | UINT8 *videoram = state->m_videoram.target(); | |
| 598 | 599 | static const UINT8 data_lookup[4] = { 0x00, 0x0f, 0xf0, 0xff }; |
| 599 | 600 | offs_t vramaddr; |
| 600 | 601 | UINT8 vramdata; |
| r14896 | r14897 | |
| 626 | 627 | static UINT8 read_vram(address_space *space, offs_t address) |
| 627 | 628 | { |
| 628 | 629 | missile_state *state = space->machine().driver_data<missile_state>(); |
| 629 | UINT8 *videoram = state->m_videoram; | |
| 630 | UINT8 *videoram = state->m_videoram.target(); | |
| 630 | 631 | offs_t vramaddr; |
| 631 | 632 | UINT8 vramdata; |
| 632 | 633 | UINT8 vrammask; |
| r14896 | r14897 | |
| 670 | 671 | static SCREEN_UPDATE_IND16( missile ) |
| 671 | 672 | { |
| 672 | 673 | missile_state *state = screen.machine().driver_data<missile_state>(); |
| 673 | UINT8 *videoram = state->m_videoram; | |
| 674 | UINT8 *videoram = state->m_videoram.target(); | |
| 674 | 675 | int x, y; |
| 675 | 676 | |
| 676 | 677 | /* draw the bitmap to the screen, looping over Y */ |
| r14896 | r14897 | |
| 712 | 713 | |
| 713 | 714 | WRITE8_MEMBER(missile_state::missile_w) |
| 714 | 715 | { |
| 715 | UINT8 *videoram = m_videoram; | |
| 716 | UINT8 *videoram = m_videoram.target(); | |
| 716 | 717 | /* if we're in MADSEL mode, write to video RAM */ |
| 717 | 718 | if (get_madsel(&space)) |
| 718 | 719 | { |
| r14896 | r14897 | |
| 769 | 770 | |
| 770 | 771 | READ8_MEMBER(missile_state::missile_r) |
| 771 | 772 | { |
| 772 | UINT8 *videoram = m_videoram; | |
| 773 | UINT8 *videoram = m_videoram.target(); | |
| 773 | 774 | UINT8 result = 0xff; |
| 774 | 775 | |
| 775 | 776 | /* if we're in MADSEL mode, read from video RAM */ |
| r14896 | r14897 | |
| 829 | 830 | |
| 830 | 831 | /* complete memory map derived from schematics (implemented above) */ |
| 831 | 832 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, missile_state ) |
| 832 | AM_RANGE(0x0000, 0xffff) AM_READWRITE(missile_r, missile_w) AM_ | |
| 833 | AM_RANGE(0x0000, 0xffff) AM_READWRITE(missile_r, missile_w) AM_ | |
| 833 | 834 | ADDRESS_MAP_END |
| 834 | 835 | |
| 835 | 836 | |
| r14896 | r14897 | |
| 1279 | 1280 | GAME( 1980, missile, 0, missile, missile, 0, ROT0, "Atari", "Missile Command (rev 3)", GAME_SUPPORTS_SAVE ) |
| 1280 | 1281 | GAME( 1980, missile2, missile, missile, missile, 0, ROT0, "Atari", "Missile Command (rev 2)", GAME_SUPPORTS_SAVE ) |
| 1281 | 1282 | GAME( 1980, missile1, missile, missile, missile, 0, ROT0, "Atari", "Missile Command (rev 1)", GAME_SUPPORTS_SAVE ) |
| 1282 | GAME( 1981, suprmatk, missile, missile, suprmatk, suprmatk, ROT0, "Atari / Gencomp", "Super Missile Attack (for rev 1)", GAME_SUPPORTS_SAVE ) | |
| 1283 | GAME( 1981, suprmatkd,missile, missile, suprmatk, 0, ROT0, "Atari / Gencomp", "Super Missile Attack (not encrypted)", GAME_SUPPORTS_SAVE ) | |
| 1283 | GAME( 1981, suprmatk, missile, missile, suprmatk, suprmatk, ROT0, "Atari / General Computer Corporation", "Super Missile Attack (for rev 1)", GAME_SUPPORTS_SAVE ) | |
| 1284 | GAME( 1981, suprmatkd,missile, missile, suprmatk, 0, ROT0, "Atari / General Computer Corporation", "Super Missile Attack (not encrypted)", GAME_SUPPORTS_SAVE ) | |
| 1284 | 1285 | |
| 1285 | 1286 | /* the bootlegs are on different hardware and don't work */ |
| 1286 | 1287 | GAME( 198?, mcombat, missile, missile, missile, 0, ROT0, "bootleg (Videotron)", "Missile Combat (Videotron bootleg, set 1)", GAME_NOT_WORKING ) |
| r14896 | r14897 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | public: |
| 40 | 40 | go2000_state(const machine_config &mconfig, device_type type, const char *tag) |
| 41 | : driver_device(mconfig, type, tag) { } | |
| 41 | : driver_device(mconfig, type, tag) , | |
| 42 | m_videoram(*this, "videoram"), | |
| 43 | m_videoram2(*this, "videoram2"){ } | |
| 42 | 44 | |
| 43 | 45 | /* memory pointers */ |
| 44 | UINT16 * m_videoram; | |
| 45 | UINT16 * m_videoram2; | |
| 46 | required_shared_ptr<UINT16> m_videoram; | |
| 47 | required_shared_ptr<UINT16> m_videoram2; | |
| 46 | 48 | // UINT16 * m_paletteram; // currently this uses generic palette handling |
| 47 | 49 | |
| 48 | 50 | /* devices */ |
| r14896 | r14897 | |
| 54 | 56 | |
| 55 | 57 | WRITE16_MEMBER(go2000_state::sound_cmd_w) |
| 56 | 58 | { |
| 57 | soundlatch_w(space, offset, data & 0xff); | |
| 59 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 58 | 60 | device_set_input_line(m_soundcpu, 0, HOLD_LINE); |
| 59 | 61 | } |
| 60 | 62 | |
| 61 | 63 | static ADDRESS_MAP_START( go2000_map, AS_PROGRAM, 16, go2000_state ) |
| 62 | 64 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 63 | 65 | AM_RANGE(0x200000, 0x203fff) AM_RAM |
| 64 | AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE(m_videoram) | |
| 65 | AM_RANGE(0x610000, 0x61ffff) AM_RAM AM_BASE(m_videoram2) | |
| 66 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 66 | AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("videoram") | |
| 67 | AM_RANGE(0x610000, 0x61ffff) AM_RAM AM_SHARE("videoram2") | |
| 68 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 67 | 69 | AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("INPUTS") |
| 68 | 70 | AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW") |
| 69 | 71 | AM_RANGE(0x620002, 0x620003) AM_WRITE(sound_cmd_w) |
| r14896 | r14897 | |
| 84 | 86 | |
| 85 | 87 | static ADDRESS_MAP_START( go2000_sound_io, AS_IO, 8, go2000_state ) |
| 86 | 88 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 87 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 89 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 88 | 90 | AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("dac1", dac_w) |
| 89 | 91 | AM_RANGE(0x03, 0x03) AM_WRITE(go2000_pcm_1_bankswitch_w) |
| 90 | 92 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 181 | 183 | { |
| 182 | 184 | for (y = 0; y < 32; y++) |
| 183 | 185 | { |
| 184 | int tile = state->m_videoram[count]; | |
| 185 | int attr = state->m_videoram2[count]; | |
| 186 | int tile = state->m_videoram.target()[count]; | |
| 187 | int attr = state->m_videoram2.target()[count]; | |
| 186 | 188 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8); |
| 187 | 189 | count++; |
| 188 | 190 | } |
| r14896 | r14897 | |
| 193 | 195 | { |
| 194 | 196 | for (y = 0; y < 32; y++) |
| 195 | 197 | { |
| 196 | int tile = state->m_videoram[count]; | |
| 197 | int attr = state->m_videoram2[count]; | |
| 198 | int tile = state->m_videoram.target()[count]; | |
| 199 | int attr = state->m_videoram2.target()[count]; | |
| 198 | 200 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf); |
| 199 | 201 | count++; |
| 200 | 202 | } |
| r14896 | r14897 | |
| 215 | 217 | int dx, dy; |
| 216 | 218 | int flipx, y0; |
| 217 | 219 | |
| 218 | int y = state->m_videoram[offs + 0 + 0x00000 / 2]; | |
| 219 | int x = state->m_videoram[offs + 1 + 0x00000 / 2]; | |
| 220 | int dim = state->m_videoram2[offs + 0 + 0x00000 / 2]; | |
| 220 | int y = state->m_videoram.target()[offs + 0 + 0x00000 / 2]; | |
| 221 | int x = state->m_videoram.target()[offs + 1 + 0x00000 / 2]; | |
| 222 | int dim = state->m_videoram2.target()[offs + 0 + 0x00000 / 2]; | |
| 221 | 223 | |
| 222 | 224 | int bank = (x >> 12) & 0xf; |
| 223 | 225 | |
| r14896 | r14897 | |
| 266 | 268 | for (dx = 0; dx < dimx * 8; dx += 8) |
| 267 | 269 | { |
| 268 | 270 | int addr = (srcpg * 0x20 * 0x20) + ((srcx + tile_x) & 0x1f) * 0x20 + ((srcy + tile_y) & 0x1f); |
| 269 | int tile = state->m_videoram[addr + 0x00000 / 2]; | |
| 270 | int attr = state->m_videoram2[addr + 0x00000 / 2]; | |
| 271 | int tile = state->m_videoram.target()[addr + 0x00000 / 2]; | |
| 272 | int attr = state->m_videoram2.target()[addr + 0x00000 / 2]; | |
| 271 | 273 | |
| 272 | 274 | int sx = x + dx; |
| 273 | 275 | int sy = (y + dy) & 0xff; |
| r14896 | r14897 | |
| 278 | 280 | if (flipx) |
| 279 | 281 | tile_flipx = !tile_flipx; |
| 280 | 282 | |
| 281 | if (flip_screen | |
| 283 | if (state->flip_screen | |
| 282 | 284 | { |
| 283 | 285 | sx = max_x - sx; |
| 284 | 286 | sy = max_y - sy; |
| r14896 | r14897 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | WRITE8_MEMBER(jack_state::jack_sh_command_w) |
| 67 | 67 | { |
| 68 | soundlatch_w(space, 0, data); | |
| 68 | soundlatch_byte_w(space, 0, data); | |
| 69 | 69 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 70 | 70 | } |
| 71 | 71 | |
| r14896 | r14897 | |
| 74 | 74 | |
| 75 | 75 | WRITE8_MEMBER(jack_state::joinem_misc_w) |
| 76 | 76 | { |
| 77 | flip_screen_set( | |
| 77 | flip_screen_set( | |
| 78 | 78 | m_joinem_snd_bit = data & 1; |
| 79 | 79 | } |
| 80 | 80 | |
| r14896 | r14897 | |
| 776 | 776 | { |
| 777 | 777 | AY8910_LEGACY_OUTPUT, |
| 778 | 778 | AY8910_DEFAULT_LOADS, |
| 779 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 779 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 780 | 780 | DEVCB_DEVICE_HANDLER("audiocpu", timer_r) |
| 781 | 781 | }; |
| 782 | 782 |
| r14896 | r14897 | |
|---|---|---|
| 71 | 71 | AM_RANGE(0x1830, 0x1830) AM_READ_PORT("DSW2") |
| 72 | 72 | AM_RANGE(0x1830, 0x1830) AM_WRITE(dogfgt_soundlatch_w) |
| 73 | 73 | AM_RANGE(0x1840, 0x1840) AM_WRITE(dogfgt_soundcontrol_w) |
| 74 | AM_RANGE(0x1870, 0x187f) AM_WRITE(paletteram_BBGGGRRR_w) AM_SHARE("paletteram") | |
| 74 | AM_RANGE(0x1870, 0x187f) AM_WRITE(paletteram_BBGGGRRR_byte_w) AM_SHARE("paletteram") | |
| 75 | 75 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(dogfgt_bitmapram_r, dogfgt_bitmapram_w) |
| 76 | 76 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 77 | 77 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 179 | 179 | |
| 180 | 180 | WRITE8_MEMBER(taitosj_state::taitosj_soundcommand_w) |
| 181 | 181 | { |
| 182 | soundlatch_w(space,offset,data); | |
| 182 | soundlatch_byte_w(space,offset,data); | |
| 183 | 183 | if (!m_sndnmi_disable) cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 184 | 184 | } |
| 185 | 185 | |
| r14896 | r14897 | |
| 346 | 346 | AM_RANGE(0x4803, 0x4803) AM_DEVREAD_LEGACY("ay3", ay8910_r) |
| 347 | 347 | AM_RANGE(0x4804, 0x4805) AM_DEVWRITE_LEGACY("ay4", ay8910_address_data_w) |
| 348 | 348 | AM_RANGE(0x4805, 0x4805) AM_DEVREAD_LEGACY("ay4", ay8910_r) |
| 349 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_r) | |
| 349 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r) | |
| 350 | 350 | AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostic ROM */ |
| 351 | 351 | ADDRESS_MAP_END |
| 352 | 352 |
| r14896 | r14897 | |
|---|---|---|
| 110 | 110 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, vigilant_state ) |
| 111 | 111 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 112 | 112 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 113 | AM_RANGE(0x80, 0x81) AM_READ(soundlatch_r) AM_DEVWRITE_LEGACY("m72", vigilant_sample_addr_w) /* STL / STH */ | |
| 113 | AM_RANGE(0x80, 0x81) AM_READ(soundlatch_byte_r) AM_DEVWRITE_LEGACY("m72", vigilant_sample_addr_w) /* STL / STH */ | |
| 114 | 114 | AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w) /* COUNT UP */ |
| 115 | 115 | AM_RANGE(0x83, 0x83) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) /* IRQ clear */ |
| 116 | 116 | AM_RANGE(0x84, 0x84) AM_DEVREAD_LEGACY("m72", m72_sample_r) /* S ROM C */ |
| r14896 | r14897 | |
| 120 | 120 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 121 | 121 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 122 | 122 | AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 123 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) /* SDRE */ | |
| 123 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) /* SDRE */ | |
| 124 | 124 | AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("m72", vigilant_sample_addr_w) /* STL / STH */ |
| 125 | 125 | AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w) /* COUNT UP */ |
| 126 | 126 | AM_RANGE(0x83, 0x83) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) /* IRQ clear */ |
| r14896 | r14897 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | WRITE8_MEMBER(nbmj8991_state::nbmj8991_soundbank_w) |
| 50 | 50 | { |
| 51 | if (!(data & 0x80)) soundlatch_clear_w(space, 0, 0); | |
| 51 | if (!(data & 0x80)) soundlatch_clear_byte_w(space, 0, 0); | |
| 52 | 52 | memory_set_bank(machine(), "bank1", data & 0x03); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | WRITE8_MEMBER(nbmj8991_state::nbmj8991_sound_w) |
| 56 | 56 | { |
| 57 | soundlatch_w(space, 0, data); | |
| 57 | soundlatch_byte_w(space, 0, data); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | READ8_MEMBER(nbmj8991_state::nbmj8991_sound_r) |
| 61 | 61 | { |
| 62 | 62 | int data; |
| 63 | 63 | |
| 64 | data = soundlatch_r(space,0); | |
| 64 | data = soundlatch_byte_r(space,0); | |
| 65 | 65 | return data; |
| 66 | 66 | } |
| 67 | 67 |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | WRITE8_MEMBER(galivan_state::galivan_sound_command_w) |
| 39 | 39 | { |
| 40 | soundlatch_w(space,0,((data & 0x7f) << 1) | 1); | |
| 40 | soundlatch_byte_w(space,0,((data & 0x7f) << 1) | 1); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | READ8_MEMBER(galivan_state::soundlatch_clear_r) |
| 44 | 44 | { |
| 45 | soundlatch_clear_w(space, 0, 0); | |
| 45 | soundlatch_clear_byte_w(space, 0, 0); | |
| 46 | 46 | return 0; |
| 47 | 47 | } |
| 48 | 48 | |
| r14896 | r14897 | |
| 118 | 118 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("dac1", dac_w) |
| 119 | 119 | AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("dac2", dac_w) |
| 120 | 120 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r) |
| 121 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r) | |
| 121 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r) | |
| 122 | 122 | ADDRESS_MAP_END |
| 123 | 123 | |
| 124 | 124 |
| r14896 | r14897 | |
|---|---|---|
| 20 | 20 | { |
| 21 | 21 | public: |
| 22 | 22 | deshoros_state(const machine_config &mconfig, device_type type, const char *tag) |
| 23 | : driver_device(mconfig, type, tag) { } | |
| 23 | : driver_device(mconfig, type, tag) , | |
| 24 | m_io_ram(*this, "io_ram"){ } | |
| 24 | 25 | |
| 25 | UINT8 | |
| 26 | required_shared_ptr<UINT8> | |
| 26 | 27 | char m_led_array[21]; |
| 27 | 28 | UINT8 m_bank; |
| 28 | 29 | DECLARE_READ8_MEMBER(io_r); |
| r14896 | r14897 | |
| 83 | 84 | case 0x03: return input_port_read(machine(), "KEY0" ); |
| 84 | 85 | case 0x04: return input_port_read(machine(), "KEY1" ); |
| 85 | 86 | case 0x05: return input_port_read(machine(), "SYSTEM" ); |
| 86 | case 0x0a: return m_io_ram[offset]; //"buzzer" 0 read | |
| 87 | case 0x0b: return m_io_ram[offset]; //"buzzer" 1 read | |
| 87 | case 0x0a: return m_io_ram.target()[offset]; //"buzzer" 0 read | |
| 88 | case 0x0b: return m_io_ram.target()[offset]; //"buzzer" 1 read | |
| 88 | 89 | } |
| 89 | 90 | // printf("R -> [%02x]\n",offset); |
| 90 | 91 | |
| 91 | return m_io_ram[offset]; | |
| 92 | return m_io_ram.target()[offset]; | |
| 92 | 93 | } |
| 93 | 94 | |
| 94 | 95 | WRITE8_MEMBER(deshoros_state::io_w) |
| r14896 | r14897 | |
| 97 | 98 | { |
| 98 | 99 | case 0x00: /*Printer data*/ return; |
| 99 | 100 | case 0x02: update_led_array(data); return; |
| 100 | case 0x05: coin_lockout_w(machine(), 0,m_io_ram[offset] & 1);return; | |
| 101 | case 0x05: coin_lockout_w(machine(), 0,m_io_ram.target()[offset] & 1);return; | |
| 101 | 102 | case 0x06: /*Printer IRQ enable*/ return; |
| 102 | 103 | // case 0x0a: "buzzer" 0 write |
| 103 | 104 | // case 0x0b: "buzzer" 1 write |
| 104 | 105 | case 0x0c: answer_bankswitch(machine(),data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data... |
| 105 | 106 | } |
| 106 | m_io_ram[offset] = data; | |
| 107 | m_io_ram.target()[offset] = data; | |
| 107 | 108 | // printf("%02x -> [%02x]\n",data,offset); |
| 108 | 109 | } |
| 109 | 110 | |
| 110 | 111 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, deshoros_state ) |
| 111 | 112 | AM_RANGE(0x0000, 0x5fff) AM_ROMBANK("bank1") |
| 112 | 113 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 113 | AM_RANGE(0x9000, 0x900f) AM_READWRITE(io_r,io_w) AM_ | |
| 114 | AM_RANGE(0x9000, 0x900f) AM_READWRITE(io_r,io_w) AM_ | |
| 114 | 115 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 115 | 116 | ADDRESS_MAP_END |
| 116 | 117 |
| r14896 | r14897 | |
|---|---|---|
| 24 | 24 | { |
| 25 | 25 | public: |
| 26 | 26 | igs_m027_state(const machine_config &mconfig, device_type type, const char *tag) |
| 27 | : driver_device(mconfig, type, tag) { } | |
| 27 | : driver_device(mconfig, type, tag) , | |
| 28 | m_igs_mainram(*this, "igs_mainram"), | |
| 29 | m_igs_cg_videoram(*this, "igs_cg_videoram"), | |
| 30 | m_igs_palette32(*this, "igs_palette32"), | |
| 31 | m_igs_tx_videoram(*this, "igs_tx_videoram"), | |
| 32 | m_igs_bg_videoram(*this, "igs_bg_videoram"){ } | |
| 28 | 33 | |
| 29 | UINT32 *m_igs_mainram; | |
| 30 | UINT32 *m_igs_cg_videoram; | |
| 31 | UINT32 *m_igs_tx_videoram; | |
| 32 | UINT32 *m_igs_bg_videoram; | |
| 33 | UINT32 *m_igs_palette32; | |
| 34 | required_shared_ptr<UINT32> m_igs_mainram; | |
| 35 | required_shared_ptr<UINT32> m_igs_cg_videoram; | |
| 36 | required_shared_ptr<UINT32> m_igs_palette32; | |
| 37 | required_shared_ptr<UINT32> m_igs_tx_videoram; | |
| 38 | required_shared_ptr<UINT32> m_igs_bg_videoram; | |
| 34 | 39 | tilemap_t *m_igs_tx_tilemap; |
| 35 | 40 | tilemap_t *m_igs_bg_tilemap; |
| 36 | 41 | DECLARE_WRITE32_MEMBER(igs_cg_videoram_w); |
| r14896 | r14897 | |
| 58 | 63 | /* CGLayer */ |
| 59 | 64 | WRITE32_MEMBER(igs_m027_state::igs_cg_videoram_w) |
| 60 | 65 | { |
| 61 | COMBINE_DATA(&m_igs_cg_videoram[offset]); | |
| 66 | COMBINE_DATA(&m_igs_cg_videoram.target()[offset]); | |
| 62 | 67 | //if(data!=0) |
| 63 | logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(&space.device()),offset ,m_igs_cg_videoram[offset]); | |
| 68 | logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(&space.device()),offset ,m_igs_cg_videoram.target()[offset]); | |
| 64 | 69 | |
| 65 | 70 | |
| 66 | 71 | |
| r14896 | r14897 | |
| 101 | 106 | /* TX Layer */ |
| 102 | 107 | WRITE32_MEMBER(igs_m027_state::igs_tx_videoram_w) |
| 103 | 108 | { |
| 104 | COMBINE_DATA(&m_igs_tx_videoram[offset]); | |
| 109 | COMBINE_DATA(&m_igs_tx_videoram.target()[offset]); | |
| 105 | 110 | m_igs_tx_tilemap->mark_tile_dirty(offset); |
| 106 | 111 | //if(data!=0) |
| 107 | //logerror( "TX VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_tx_videoram[offset]); | |
| 112 | //logerror( "TX VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_tx_videoram.target()[offset]); | |
| 108 | 113 | } |
| 109 | 114 | |
| 110 | 115 | static TILE_GET_INFO( get_tx_tilemap_tile_info ) |
| r14896 | r14897 | |
| 112 | 117 | igs_m027_state *state = machine.driver_data<igs_m027_state>(); |
| 113 | 118 | //ppppppppNNNNNNNN |
| 114 | 119 | int tileno,colour; |
| 115 | tileno = state->m_igs_tx_videoram[tile_index] & 0xffff; | |
| 116 | colour = (state->m_igs_tx_videoram[tile_index]>>0x10) & 0xffff; | |
| 120 | tileno = state->m_igs_tx_videoram.target()[tile_index] & 0xffff; | |
| 121 | colour = (state->m_igs_tx_videoram.target()[tile_index]>>0x10) & 0xffff; | |
| 117 | 122 | |
| 118 | 123 | SET_TILE_INFO(0,tileno,colour,0); |
| 119 | 124 | } |
| r14896 | r14897 | |
| 121 | 126 | /* BG Layer */ |
| 122 | 127 | WRITE32_MEMBER(igs_m027_state::igs_bg_videoram_w) |
| 123 | 128 | { |
| 124 | COMBINE_DATA(&m_igs_bg_videoram[offset]); | |
| 129 | COMBINE_DATA(&m_igs_bg_videoram.target()[offset]); | |
| 125 | 130 | m_igs_bg_tilemap->mark_tile_dirty(offset); |
| 126 | 131 | //if(data!=0) |
| 127 | logerror("BG VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_bg_videoram[offset]); | |
| 132 | logerror("BG VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_bg_videoram.target()[offset]); | |
| 128 | 133 | } |
| 129 | 134 | |
| 130 | 135 | static TILE_GET_INFO( get_bg_tilemap_tile_info ) |
| r14896 | r14897 | |
| 132 | 137 | igs_m027_state *state = machine.driver_data<igs_m027_state>(); |
| 133 | 138 | //ppppppppNNNNNNNN |
| 134 | 139 | int tileno,colour; |
| 135 | tileno = state->m_igs_bg_videoram[tile_index] & 0xffff; | |
| 136 | colour = (state->m_igs_bg_videoram[tile_index]>>0x10) & 0xffff; | |
| 140 | tileno = state->m_igs_bg_videoram.target()[tile_index] & 0xffff; | |
| 141 | colour = (state->m_igs_bg_videoram.target()[tile_index]>>0x10) & 0xffff; | |
| 137 | 142 | |
| 138 | 143 | SET_TILE_INFO(0,tileno,colour,0); |
| 139 | 144 | } |
| r14896 | r14897 | |
| 142 | 147 | /* Palette Layer */ |
| 143 | 148 | WRITE32_MEMBER(igs_m027_state::igs_palette32_w) |
| 144 | 149 | { |
| 145 | m_generic_paletteram_16.set_target((UINT16 *)m_igs_palette32, 0x800); | |
| 146 | COMBINE_DATA(&m_igs_palette32[offset]); | |
| 147 | //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2,m_generic_paletteram_16[offset*2],0); | |
| 148 | //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2+1,m_generic_paletteram_16[offset*2+1],0); | |
| 150 | m_generic_paletteram_16.set_target((UINT16 *)m_igs_palette32.target(), 0x800); | |
| 151 | COMBINE_DATA(&m_igs_palette32.target()[offset]); | |
| 152 | //paletteram_xGGGGGRRRRRBBBBB_word_w(offset*2,m_generic_paletteram_16[offset*2],0); | |
| 153 | //paletteram_xGGGGGRRRRRBBBBB_word_w(offset*2+1,m_generic_paletteram_16[offset*2+1],0); | |
| 149 | 154 | //if(data!=0) |
| 150 | //fprintf(stdout,"PALETTE RAM OFFSET %x ,data %x!\n",offset ,m_igs_palette32[offset]); | |
| 155 | //fprintf(stdout,"PALETTE RAM OFFSET %x ,data %x!\n",offset ,m_igs_palette32.target()[offset]); | |
| 151 | 156 | } |
| 152 | 157 | |
| 153 | 158 | |
| r14896 | r14897 | |
| 194 | 199 | static ADDRESS_MAP_START( igs_majhong_map, AS_PROGRAM, 32, igs_m027_state ) |
| 195 | 200 | AM_RANGE(0x00000000, 0x00003fff) AM_ROM /* Internal ROM */ |
| 196 | 201 | AM_RANGE(0x08000000, 0x0807ffff) AM_ROM AM_REGION("user1", 0)/* Game ROM */ |
| 197 | AM_RANGE(0x10000000, 0x100003ff) AM_RAM AM_ | |
| 202 | AM_RANGE(0x10000000, 0x100003ff) AM_RAM AM_ | |
| 198 | 203 | AM_RANGE(0x18000000, 0x18007fff) AM_RAM |
| 199 | 204 | |
| 200 | AM_RANGE(0x38001000, 0x380017ff) AM_RAM_WRITE(igs_cg_videoram_w) AM_BASE(m_igs_cg_videoram) //0x200 * 1 CG PALETTE? | |
| 201 | AM_RANGE(0x38001800, 0x38001fff) AM_RAM_WRITE(igs_palette32_w) AM_BASE(m_igs_palette32) //0x200 * 1 | |
| 205 | AM_RANGE(0x38001000, 0x380017ff) AM_RAM_WRITE(igs_cg_videoram_w) AM_SHARE("igs_cg_videoram") //0x200 * 1 CG PALETTE? | |
| 206 | AM_RANGE(0x38001800, 0x38001fff) AM_RAM_WRITE(igs_palette32_w) AM_SHARE("igs_palette32") //0x200 * 1 | |
| 202 | 207 | |
| 203 | AM_RANGE(0x38004000, 0x38005FFF) AM_RAM_WRITE(igs_tx_videoram_w) AM_BASE(m_igs_tx_videoram) /* Text Layer */ | |
| 204 | AM_RANGE(0x38006000, 0x38007FFF) AM_RAM_WRITE(igs_bg_videoram_w) AM_BASE(m_igs_bg_videoram) /* CG Layer */ | |
| 208 | AM_RANGE(0x38004000, 0x38005FFF) AM_RAM_WRITE(igs_tx_videoram_w) AM_SHARE("igs_tx_videoram") /* Text Layer */ | |
| 209 | AM_RANGE(0x38006000, 0x38007FFF) AM_RAM_WRITE(igs_bg_videoram_w) AM_SHARE("igs_bg_videoram") /* CG Layer */ | |
| 205 | 210 | |
| 206 | 211 | |
| 207 | 212 | AM_RANGE(0x38002010, 0x38002017) AM_RAM //?????????????? |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | { |
| 54 | 54 | if (ACCESSING_BITS_0_7) |
| 55 | 55 | { |
| 56 | soundlatch_w(space, 0, data & 0xff); | |
| 56 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 57 | 57 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 58 | 58 | } |
| 59 | 59 | } |
| r14896 | r14897 | |
| 62 | 62 | { |
| 63 | 63 | if (ACCESSING_BITS_0_7) |
| 64 | 64 | { |
| 65 | soundlatch_w(space, 0, data & 0xff); | |
| 65 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 66 | 66 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 67 | 67 | } |
| 68 | 68 | |
| r14896 | r14897 | |
| 100 | 100 | AM_RANGE(0x880000, 0x8817ff) AM_RAM_WRITE(splash_vram_w) AM_BASE(m_videoram) /* Video RAM */ |
| 101 | 101 | AM_RANGE(0x881800, 0x881803) AM_RAM AM_BASE(m_vregs) /* Scroll registers */ |
| 102 | 102 | AM_RANGE(0x881804, 0x881fff) AM_RAM /* Work RAM */ |
| 103 | AM_RANGE(0x8c0000, 0x8c0fff) AM_RAM_WRITE(paletteram | |
| 103 | AM_RANGE(0x8c0000, 0x8c0fff) AM_RAM_WRITE(paletteram | |
| 104 | 104 | AM_RANGE(0x900000, 0x900fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 105 | 105 | AM_RANGE(0xffc000, 0xffffff) AM_RAM /* Work RAM */ |
| 106 | 106 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 123 | 123 | AM_RANGE(0x0000, 0xd7ff) AM_ROM /* ROM */ |
| 124 | 124 | AM_RANGE(0xd800, 0xd800) AM_WRITE(splash_adpcm_data_w) /* ADPCM data for the MSM5205 chip */ |
| 125 | 125 | // AM_RANGE(0xe000, 0xe000) AM_WRITENOP /* ??? */ |
| 126 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r) /* Sound latch */ | |
| 126 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) /* Sound latch */ | |
| 127 | 127 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r,ym3812_w) /* YM3812 */ |
| 128 | 128 | AM_RANGE(0xf800, 0xffff) AM_RAM /* RAM */ |
| 129 | 129 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 179 | 179 | AM_RANGE(0x880000, 0x8817ff) AM_RAM_WRITE(splash_vram_w) AM_BASE(m_videoram) /* Video RAM */ |
| 180 | 180 | AM_RANGE(0x881800, 0x881803) AM_RAM AM_BASE(m_vregs) /* Scroll registers */ |
| 181 | 181 | AM_RANGE(0x881804, 0x881fff) AM_RAM /* Work RAM */ |
| 182 | AM_RANGE(0x8c0000, 0x8c0fff) AM_RAM_WRITE(paletteram | |
| 182 | AM_RANGE(0x8c0000, 0x8c0fff) AM_RAM_WRITE(paletteram | |
| 183 | 183 | AM_RANGE(0xa00000, 0xa00001) AM_READ(roldfrog_bombs_r) |
| 184 | 184 | AM_RANGE(0xd00000, 0xd00fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 185 | 185 | AM_RANGE(0xe00000, 0xe00001) AM_WRITEONLY AM_BASE(m_bitmap_mode) /* Bitmap Mode? */ |
| r14896 | r14897 | |
| 204 | 204 | AM_RANGE(0x40, 0x40) AM_NOP |
| 205 | 205 | AM_RANGE(0x31, 0x31) AM_WRITE(sound_bank_w) |
| 206 | 206 | AM_RANGE(0x37, 0x37) AM_WRITE(roldfrog_vblank_ack_w ) |
| 207 | AM_RANGE(0x70, 0x70) AM_READ(soundlatch_r) | |
| 207 | AM_RANGE(0x70, 0x70) AM_READ(soundlatch_byte_r) | |
| 208 | 208 | |
| 209 | 209 | AM_RANGE(0x0, 0xff) AM_READ(roldfrog_unk_r) |
| 210 | 210 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 222 | 222 | |
| 223 | 223 | WRITE16_MEMBER(splash_state::funystrp_sh_irqtrigger_w) |
| 224 | 224 | { |
| 225 | soundlatch_w(space, 0, data>>8); | |
| 225 | soundlatch_byte_w(space, 0, data>>8); | |
| 226 | 226 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 227 | 227 | } |
| 228 | 228 | |
| r14896 | r14897 | |
| 240 | 240 | AM_RANGE(0x880000, 0x8817ff) AM_RAM_WRITE(splash_vram_w) AM_BASE(m_videoram) /* Video RAM */ |
| 241 | 241 | AM_RANGE(0x881800, 0x881803) AM_RAM AM_BASE(m_vregs) /* Scroll registers */ |
| 242 | 242 | AM_RANGE(0x881804, 0x881fff) AM_WRITENOP |
| 243 | AM_RANGE(0x8c0000, 0x8c0fff) AM_RAM_WRITE(paletteram | |
| 243 | AM_RANGE(0x8c0000, 0x8c0fff) AM_RAM_WRITE(paletteram | |
| 244 | 244 | AM_RANGE(0xd00000, 0xd01fff) AM_READWRITE(spr_read, spr_write) AM_BASE(m_spriteram) /* Sprite RAM */ |
| 245 | 245 | AM_RANGE(0xfe0000, 0xffffff) AM_RAM AM_MASK(0xffff) /* there's fe0000 <-> ff0000 compare */ /* Work RAM */ |
| 246 | 246 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 285 | 285 | AM_RANGE(0x00, 0x00) AM_WRITE(msm1_data_w) |
| 286 | 286 | AM_RANGE(0x01, 0x01) AM_WRITE(msm2_data_w) |
| 287 | 287 | AM_RANGE(0x02, 0x02) AM_WRITE(sound_bank_w) |
| 288 | AM_RANGE(0x03, 0x03) AM_READ(soundlatch_r) | |
| 288 | AM_RANGE(0x03, 0x03) AM_READ(soundlatch_byte_r) | |
| 289 | 289 | AM_RANGE(0x04, 0x04) AM_READ(int_source_r) |
| 290 | 290 | AM_RANGE(0x06, 0x06) AM_WRITE(msm1_interrupt_w) |
| 291 | 291 | AM_RANGE(0x07, 0x07) AM_WRITE(msm2_interrupt_w) |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | public: |
| 80 | 80 | subsino2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 81 | : driver_device(mconfig, type, tag) { } | |
| 81 | : driver_device(mconfig, type, tag) , | |
| 82 | m_outputs16(*this, "outputs16"), | |
| 83 | m_outputs(*this, "outputs"), | |
| 84 | m_am188em_regs(*this, "am188eregs"){ } | |
| 82 | 85 | |
| 83 | 86 | UINT8 *m_hm86171_colorram; |
| 84 | 87 | layer_t m_layers[2]; |
| r14896 | r14897 | |
| 91 | 94 | UINT8 m_ss9601_disable; |
| 92 | 95 | int m_hm86171_offs; |
| 93 | 96 | UINT8 m_dsw_mask; |
| 94 | UINT8 *m_outputs; | |
| 95 | UINT16 *m_outputs16; | |
| 96 | UINT8 *m_am188em_regs; | |
| 97 | required_shared_ptr<UINT16> m_outputs16; | |
| 98 | required_shared_ptr<UINT8> m_outputs; | |
| 99 | required_shared_ptr<UINT8> m_am188em_regs; | |
| 97 | 100 | UINT16 m_bishjan_sel; |
| 98 | 101 | UINT16 m_bishjan_input; |
| 99 | 102 | DECLARE_WRITE8_MEMBER(ss9601_byte_lo_w); |
| r14896 | r14897 | |
| 829 | 832 | |
| 830 | 833 | READ8_MEMBER(subsino2_state::am188em_regs_r) |
| 831 | 834 | { |
| 832 | return m_am188em_regs[offset]; | |
| 835 | return m_am188em_regs.target()[offset]; | |
| 833 | 836 | } |
| 834 | 837 | |
| 835 | 838 | WRITE8_MEMBER(subsino2_state::am188em_regs_w) |
| 836 | 839 | { |
| 837 | m_am188em_regs[offset] = data; | |
| 840 | m_am188em_regs.target()[offset] = data; | |
| 838 | 841 | } |
| 839 | 842 | |
| 840 | 843 | static MACHINE_RESET( am188em ) |
| 841 | 844 | { |
| 842 | 845 | subsino2_state *state = machine.driver_data<subsino2_state>(); |
| 843 | 846 | // start with masked interrupts |
| 844 | state->m_am188em_regs[AM188EM_IMASK+0] = 0xfd; | |
| 845 | state->m_am188em_regs[AM188EM_IMASK+1] = 0x07; | |
| 846 | state->m_am188em_regs[AM188EM_I0CON+0] = 0x0f; | |
| 847 | state->m_am188em_regs[AM188EM_I0CON+1] = 0x00; | |
| 847 | state->m_am188em_regs.target()[AM188EM_IMASK+0] = 0xfd; | |
| 848 | state->m_am188em_regs.target()[AM188EM_IMASK+1] = 0x07; | |
| 849 | state->m_am188em_regs.target()[AM188EM_I0CON+0] = 0x0f; | |
| 850 | state->m_am188em_regs.target()[AM188EM_I0CON+1] = 0x00; | |
| 848 | 851 | } |
| 849 | 852 | |
| 850 | 853 | static INTERRUPT_GEN( am188em_int0_irq ) |
| 851 | 854 | { |
| 852 | 855 | subsino2_state *state = device->machine().driver_data<subsino2_state>(); |
| 853 | if ( ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x10) == 0) || // IMASK.I0 mask | |
| 854 | ((state->m_am188em_regs[AM188EM_I0CON+0] & 0x08) == 0) ) // I0CON.MSK mask | |
| 856 | if ( ((state->m_am188em_regs.target()[AM188EM_IMASK+0] & 0x10) == 0) || // IMASK.I0 mask | |
| 857 | ((state->m_am188em_regs.target()[AM188EM_I0CON+0] & 0x08) == 0) ) // I0CON.MSK mask | |
| 855 | 858 | device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x0c); // INT0 (background scrolling in xplan) |
| 856 | 859 | } |
| 857 | 860 | |
| 858 | 861 | static TIMER_DEVICE_CALLBACK( am188em_timer2_irq ) |
| 859 | 862 | { |
| 860 | 863 | subsino2_state *state = timer.machine().driver_data<subsino2_state>(); |
| 861 | if ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask | |
| 864 | if ((state->m_am188em_regs.target()[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask | |
| 862 | 865 | cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0x4c/4); |
| 863 | 866 | } |
| 864 | 867 | |
| r14896 | r14897 | |
| 916 | 919 | |
| 917 | 920 | return (res << 8) | // high byte |
| 918 | 921 | input_port_read(machine(), "SYSTEM") | // low byte |
| 919 | (ticket_dispenser_ | |
| 922 | (machine().device<ticket_dispenser_ | |
| 920 | 923 | ; |
| 921 | 924 | } |
| 922 | 925 | |
| 923 | 926 | WRITE16_MEMBER(subsino2_state::bishjan_outputs_w) |
| 924 | 927 | { |
| 925 | m_outputs16[offset] = data; | |
| 928 | m_outputs16.target()[offset] = data; | |
| 926 | 929 | |
| 927 | 930 | switch (offset) |
| 928 | 931 | { |
| r14896 | r14897 | |
| 930 | 933 | if (ACCESSING_BITS_0_7) |
| 931 | 934 | { |
| 932 | 935 | // coin out data & 0x01; |
| 933 | ticket_dispenser_ | |
| 936 | machine().device<ticket_dispenser_ | |
| 934 | 937 | coin_counter_w(machine(), 0, data & 0x0010 ); |
| 935 | 938 | } |
| 936 | 939 | break; |
| 937 | 940 | } |
| 938 | 941 | |
| 939 | // popmessage("0: %04x", m_outputs16[0]); | |
| 942 | // popmessage("0: %04x", m_outputs16.target()[0]); | |
| 940 | 943 | } |
| 941 | 944 | |
| 942 | 945 | |
| r14896 | r14897 | |
| 994 | 997 | |
| 995 | 998 | WRITE8_MEMBER(subsino2_state::expcard_outputs_w) |
| 996 | 999 | { |
| 997 | m_outputs[offset] = data; | |
| 1000 | m_outputs.target()[offset] = data; | |
| 998 | 1001 | |
| 999 | 1002 | switch (offset) |
| 1000 | 1003 | { |
| r14896 | r14897 | |
| 1021 | 1024 | break; |
| 1022 | 1025 | } |
| 1023 | 1026 | |
| 1024 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); | |
| 1027 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); | |
| 1025 | 1028 | } |
| 1026 | 1029 | |
| 1027 | 1030 | /*************************************************************************** |
| r14896 | r14897 | |
| 1030 | 1033 | |
| 1031 | 1034 | WRITE8_MEMBER(subsino2_state::mtrain_outputs_w) |
| 1032 | 1035 | { |
| 1033 | m_outputs[offset] = data; | |
| 1036 | m_outputs.target()[offset] = data; | |
| 1034 | 1037 | |
| 1035 | 1038 | switch (offset) |
| 1036 | 1039 | { |
| r14896 | r14897 | |
| 1056 | 1059 | break; |
| 1057 | 1060 | } |
| 1058 | 1061 | |
| 1059 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); | |
| 1062 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); | |
| 1060 | 1063 | } |
| 1061 | 1064 | |
| 1062 | 1065 | WRITE8_MEMBER(subsino2_state::mtrain_videoram_w) |
| r14896 | r14897 | |
| 1160 | 1163 | |
| 1161 | 1164 | WRITE8_MEMBER(subsino2_state::saklove_outputs_w) |
| 1162 | 1165 | { |
| 1163 | m_outputs[offset] = data; | |
| 1166 | m_outputs.target()[offset] = data; | |
| 1164 | 1167 | |
| 1165 | 1168 | switch (offset) |
| 1166 | 1169 | { |
| r14896 | r14897 | |
| 1180 | 1183 | break; |
| 1181 | 1184 | } |
| 1182 | 1185 | |
| 1183 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); | |
| 1186 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); | |
| 1184 | 1187 | } |
| 1185 | 1188 | |
| 1186 | 1189 | static ADDRESS_MAP_START( saklove_map, AS_PROGRAM, 8, subsino2_state ) |
| r14896 | r14897 | |
| 1242 | 1245 | |
| 1243 | 1246 | WRITE8_MEMBER(subsino2_state::xplan_outputs_w) |
| 1244 | 1247 | { |
| 1245 | m_outputs[offset] = data; | |
| 1248 | m_outputs.target()[offset] = data; | |
| 1246 | 1249 | |
| 1247 | 1250 | switch (offset) |
| 1248 | 1251 | { |
| r14896 | r14897 | |
| 1270 | 1273 | break; |
| 1271 | 1274 | } |
| 1272 | 1275 | |
| 1273 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); | |
| 1276 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); | |
| 1274 | 1277 | } |
| 1275 | 1278 | |
| 1276 | 1279 | static ADDRESS_MAP_START( xplan_map, AS_PROGRAM, 8, subsino2_state ) |
| r14896 | r14897 | |
| 1344 | 1347 | |
| 1345 | 1348 | WRITE8_MEMBER(subsino2_state::xtrain_outputs_w) |
| 1346 | 1349 | { |
| 1347 | m_outputs[offset] = data; | |
| 1350 | m_outputs.target()[offset] = data; | |
| 1348 | 1351 | |
| 1349 | 1352 | switch (offset) |
| 1350 | 1353 | { |
| r14896 | r14897 | |
| 1373 | 1376 | break; |
| 1374 | 1377 | } |
| 1375 | 1378 | |
| 1376 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); | |
| 1379 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); | |
| 1377 | 1380 | } |
| 1378 | 1381 | |
| 1379 | 1382 | static ADDRESS_MAP_START( expcard_io, AS_IO, 8, subsino2_state ) |
| r14896 | r14897 | |
| 2161 | 2164 | MCFG_TIMER_ADD_PERIODIC("timer", h8_timer_irq, attotime::from_hz(60)) // timer, ?? Hz |
| 2162 | 2165 | |
| 2163 | 2166 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 2164 | MCFG_TICKET_DISPENSER_ADD("hopper", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 2167 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 2165 | 2168 | |
| 2166 | 2169 | // video hardware |
| 2167 | 2170 | MCFG_SCREEN_ADD("screen", RASTER) |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | { |
| 17 | 17 | public: |
| 18 | 18 | buster_state(const machine_config &mconfig, device_type type, const char *tag) |
| 19 | : driver_device(mconfig, type, tag) { } | |
| 19 | : driver_device(mconfig, type, tag) , | |
| 20 | m_vram(*this, "vram"){ } | |
| 20 | 21 | |
| 21 | UINT8 | |
| 22 | required_shared_ptr<UINT8> | |
| 22 | 23 | DECLARE_READ8_MEMBER(test_r); |
| 23 | 24 | }; |
| 24 | 25 | |
| r14896 | r14897 | |
| 40 | 41 | { |
| 41 | 42 | for (x=0;x<32;x++) |
| 42 | 43 | { |
| 43 | int tile = (state->m_vram[count+1])|(state->m_vram[count]<<8); | |
| 44 | int tile = (state->m_vram.target()[count+1])|(state->m_vram.target()[count]<<8); | |
| 44 | 45 | //int colour = tile>>12; |
| 45 | 46 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*4); |
| 46 | 47 | |
| r14896 | r14897 | |
| 58 | 59 | #endif |
| 59 | 60 | |
| 60 | 61 | static ADDRESS_MAP_START( mainmap, AS_PROGRAM, 8, buster_state ) |
| 61 | AM_RANGE(0x0000, 0x3fff) AM_ROM// AM_ | |
| 62 | AM_RANGE(0x0000, 0x3fff) AM_ROM// AM_ | |
| 62 | 63 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("wram") |
| 63 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_ | |
| 64 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_ | |
| 64 | 65 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 65 | 66 | AM_RANGE(0x6001, 0x6001) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 66 | 67 | AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
|---|---|---|
| 219 | 219 | AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w) |
| 220 | 220 | AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) |
| 221 | 221 | AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") |
| 222 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE(m_videoram1 | |
| 222 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE_SIZE(m_videoram1, | |
| 223 | 223 | ADDRESS_MAP_END |
| 224 | 224 | |
| 225 | 225 | |
| r14896 | r14897 | |
| 230 | 230 | AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) |
| 231 | 231 | AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") |
| 232 | 232 | AM_RANGE(0x6400, 0x6400) AM_READ(routex_prot_read) |
| 233 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE(m_videoram1 | |
| 233 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE_SIZE(m_videoram1, | |
| 234 | 234 | ADDRESS_MAP_END |
| 235 | 235 | |
| 236 | 236 | |
| r14896 | r14897 | |
| 240 | 240 | AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w) |
| 241 | 241 | AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) |
| 242 | 242 | AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") |
| 243 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE(m_videoram1 | |
| 243 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE_SIZE(m_videoram1, | |
| 244 | 244 | ADDRESS_MAP_END |
| 245 | 245 | |
| 246 | 246 | |
| r14896 | r14897 | |
| 251 | 251 | AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) |
| 252 | 252 | AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_WRITE(speakres_out2_w) |
| 253 | 253 | AM_RANGE(0x6000, 0x6000) AM_READ(speakres_in3_r) |
| 254 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE(m_videoram1 | |
| 254 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE_SIZE(m_videoram1, | |
| 255 | 255 | ADDRESS_MAP_END |
| 256 | 256 | |
| 257 | 257 | |
| r14896 | r14897 | |
| 263 | 263 | AM_RANGE(0x5800, 0x5800) AM_READWRITE(ttmahjng_input_port_matrix_r, ttmahjng_input_port_matrix_w) |
| 264 | 264 | AM_RANGE(0x6800, 0x6800) AM_DEVWRITE_LEGACY("ay8910", ay8910_data_w) |
| 265 | 265 | AM_RANGE(0x6900, 0x6900) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w) |
| 266 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE(m_videoram1 | |
| 266 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_BASE_SIZE(m_videoram1, | |
| 267 | 267 | ADDRESS_MAP_END |
| 268 | 268 | |
| 269 | 269 |
| r14896 | r14897 | |
|---|---|---|
| 125 | 125 | { |
| 126 | 126 | public: |
| 127 | 127 | m63_state(const machine_config &mconfig, device_type type, const char *tag) |
| 128 | : driver_device(mconfig, type, tag) { } | |
| 128 | : driver_device(mconfig, type, tag) , | |
| 129 | m_spriteram(*this, "spriteram"), | |
| 130 | m_scrollram(*this, "scrollram"), | |
| 131 | m_videoram2(*this, "videoram2"), | |
| 132 | m_videoram(*this, "videoram"), | |
| 133 | m_colorram(*this, "colorram"){ } | |
| 129 | 134 | |
| 130 | UINT8 * m_videoram; | |
| 131 | UINT8 * m_colorram; | |
| 132 | UINT8 * m_spriteram; | |
| 133 | UINT8 * m_videoram2; | |
| 134 | UINT8 * m_scrollram; | |
| 135 | size_t m_spriteram_size; | |
| 135 | required_shared_ptr<UINT8> m_spriteram; | |
| 136 | required_shared_ptr<UINT8> m_scrollram; | |
| 137 | required_shared_ptr<UINT8> m_videoram2; | |
| 138 | required_shared_ptr<UINT8> m_videoram; | |
| 139 | required_shared_ptr<UINT8> m_colorram; | |
| 136 | 140 | |
| 137 | 141 | UINT8 m_nmi_mask; |
| 138 | 142 | |
| r14896 | r14897 | |
| 232 | 236 | WRITE8_MEMBER(m63_state::m63_videoram_w) |
| 233 | 237 | { |
| 234 | 238 | |
| 235 | m_videoram[offset] = data; | |
| 239 | m_videoram.target()[offset] = data; | |
| 236 | 240 | m_bg_tilemap->mark_tile_dirty(offset); |
| 237 | 241 | } |
| 238 | 242 | |
| 239 | 243 | WRITE8_MEMBER(m63_state::m63_colorram_w) |
| 240 | 244 | { |
| 241 | 245 | |
| 242 | m_colorram[offset] = data; | |
| 246 | m_colorram.target()[offset] = data; | |
| 243 | 247 | m_bg_tilemap->mark_tile_dirty(offset); |
| 244 | 248 | } |
| 245 | 249 | |
| 246 | 250 | WRITE8_MEMBER(m63_state::m63_videoram2_w) |
| 247 | 251 | { |
| 248 | 252 | |
| 249 | m_videoram2[offset] = data; | |
| 253 | m_videoram2.target()[offset] = data; | |
| 250 | 254 | m_fg_tilemap->mark_tile_dirty(offset); |
| 251 | 255 | } |
| 252 | 256 | |
| r14896 | r14897 | |
| 262 | 266 | |
| 263 | 267 | WRITE8_MEMBER(m63_state::m63_flipscreen_w) |
| 264 | 268 | { |
| 265 | if (flip_screen | |
| 269 | if (flip_screen | |
| 266 | 270 | { |
| 267 | flip_screen_set( | |
| 271 | flip_screen_set( | |
| 268 | 272 | machine().tilemap().mark_all_dirty(); |
| 269 | 273 | } |
| 270 | 274 | } |
| r14896 | r14897 | |
| 272 | 276 | WRITE8_MEMBER(m63_state::fghtbskt_flipscreen_w) |
| 273 | 277 | { |
| 274 | 278 | |
| 275 | flip_screen_set(machine(), data); | |
| 276 | m_fg_flag = flip_screen_get(machine()) ? TILE_FLIPX : 0; | |
| 279 | flip_screen_set(data); | |
| 280 | m_fg_flag = flip_screen() ? TILE_FLIPX : 0; | |
| 277 | 281 | } |
| 278 | 282 | |
| 279 | 283 | |
| r14896 | r14897 | |
| 281 | 285 | { |
| 282 | 286 | m63_state *state = machine.driver_data<m63_state>(); |
| 283 | 287 | |
| 284 | int attr = state->m_colorram[tile_index]; | |
| 285 | int code = state->m_videoram[tile_index] | ((attr & 0x30) << 4); | |
| 288 | int attr = state->m_colorram.target()[tile_index]; | |
| 289 | int code = state->m_videoram.target()[tile_index] | ((attr & 0x30) << 4); | |
| 286 | 290 | int color = (attr & 0x0f) + (state->m_pal_bank << 4); |
| 287 | 291 | |
| 288 | 292 | SET_TILE_INFO(1, code, color, 0); |
| r14896 | r14897 | |
| 292 | 296 | { |
| 293 | 297 | m63_state *state = machine.driver_data<m63_state>(); |
| 294 | 298 | |
| 295 | int code = state->m_videoram2[tile_index]; | |
| 299 | int code = state->m_videoram2.target()[tile_index]; | |
| 296 | 300 | |
| 297 | 301 | SET_TILE_INFO(0, code, 0, state->m_fg_flag); |
| 298 | 302 | } |
| r14896 | r14897 | |
| 313 | 317 | m63_state *state = machine.driver_data<m63_state>(); |
| 314 | 318 | int offs; |
| 315 | 319 | |
| 316 | for (offs = 0; offs < state->m_spriteram | |
| 320 | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) | |
| 317 | 321 | { |
| 318 | int code = state->m_spriteram[offs + 1] | ((state->m_spriteram[offs + 2] & 0x10) << 4); | |
| 319 | int color = (state->m_spriteram[offs + 2] & 0x0f) + (state->m_pal_bank << 4); | |
| 320 | int flipx = state->m_spriteram[offs + 2] & 0x20; | |
| 322 | int code = state->m_spriteram.target()[offs + 1] | ((state->m_spriteram.target()[offs + 2] & 0x10) << 4); | |
| 323 | int color = (state->m_spriteram.target()[offs + 2] & 0x0f) + (state->m_pal_bank << 4); | |
| 324 | int flipx = state->m_spriteram.target()[offs + 2] & 0x20; | |
| 321 | 325 | int flipy = 0; |
| 322 | int sx = state->m_spriteram[offs + 3]; | |
| 323 | int sy = state->m_sy_offset - state->m_spriteram[offs]; | |
| 326 | int sx = state->m_spriteram.target()[offs + 3]; | |
| 327 | int sy = state->m_sy_offset - state->m_spriteram.target()[offs]; | |
| 324 | 328 | |
| 325 | if (flip_screen | |
| 329 | if (state->flip_screen | |
| 326 | 330 | { |
| 327 | 331 | sx = 240 - sx; |
| 328 | 332 | sy = state->m_sy_offset - sy; |
| r14896 | r14897 | |
| 356 | 360 | int col; |
| 357 | 361 | |
| 358 | 362 | for (col = 0; col < 32; col++) |
| 359 | state->m_bg_tilemap->set_scrolly(col, state->m_scrollram[col * 8]); | |
| 363 | state->m_bg_tilemap->set_scrolly(col, state->m_scrollram.target()[col * 8]); | |
| 360 | 364 | |
| 361 | 365 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 362 | 366 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r14896 | r14897 | |
| 426 | 430 | { |
| 427 | 431 | switch (m_p2 & 0xf0) |
| 428 | 432 | { |
| 429 | case 0x60: return soundlatch_r(space, 0); ; | |
| 433 | case 0x60: return soundlatch_byte_r(space, 0); ; | |
| 430 | 434 | case 0x70: return machine().region("user1")->base()[((m_p1 & 0x1f) << 8) | offset]; |
| 431 | 435 | } |
| 432 | 436 | return 0xff; |
| r14896 | r14897 | |
| 450 | 454 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 451 | 455 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 452 | 456 | AM_RANGE(0xe000, 0xe1ff) AM_RAM |
| 453 | AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 454 | AM_RANGE(0xe300, 0xe3ff) AM_RAM AM_BASE(m_scrollram) | |
| 455 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(m63_videoram2_w) AM_BASE(m_videoram2) | |
| 456 | AM_RANGE(0xe800, 0xebff) AM_RAM_WRITE(m63_videoram_w) AM_BASE(m_videoram) | |
| 457 | AM_RANGE(0xec00, 0xefff) AM_RAM_WRITE(m63_colorram_w) AM_BASE(m_colorram) | |
| 457 | AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_SHARE("spriteram") | |
| 458 | AM_RANGE(0xe300, 0xe3ff) AM_RAM AM_SHARE("scrollram") | |
| 459 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(m63_videoram2_w) AM_SHARE("videoram2") | |
| 460 | AM_RANGE(0xe800, 0xebff) AM_RAM_WRITE(m63_videoram_w) AM_SHARE("videoram") | |
| 461 | AM_RANGE(0xec00, 0xefff) AM_RAM_WRITE(m63_colorram_w) AM_SHARE("colorram") | |
| 458 | 462 | AM_RANGE(0xf000, 0xf000) AM_WRITE(nmi_mask_w) |
| 459 | 463 | AM_RANGE(0xf002, 0xf002) AM_WRITE(m63_flipscreen_w) |
| 460 | 464 | AM_RANGE(0xf003, 0xf003) AM_WRITE(m63_palbank_w) |
| 461 | 465 | AM_RANGE(0xf006, 0xf007) AM_WRITE(coin_w) |
| 462 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) | |
| 466 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1") AM_WRITE(soundlatch_byte_w) | |
| 463 | 467 | AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2") AM_WRITENOP /* continues game when in stop mode (cleared by NMI handler) */ |
| 464 | 468 | AM_RANGE(0xf802, 0xf802) AM_READ_PORT("DSW1") |
| 465 | 469 | AM_RANGE(0xf803, 0xf803) AM_WRITE(snd_irq_w) |
| r14896 | r14897 | |
| 471 | 475 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 472 | 476 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 473 | 477 | AM_RANGE(0xd000, 0xd1ff) AM_RAM |
| 474 | AM_RANGE(0xd200, 0xd2ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 475 | AM_RANGE(0xd300, 0xd3ff) AM_RAM AM_BASE(m_scrollram) | |
| 476 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(m63_videoram2_w) AM_BASE(m_videoram2) | |
| 477 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(m63_videoram_w) AM_BASE(m_videoram) | |
| 478 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(m63_colorram_w) AM_BASE(m_colorram) | |
| 478 | AM_RANGE(0xd200, 0xd2ff) AM_RAM AM_SHARE("spriteram") | |
| 479 | AM_RANGE(0xd300, 0xd3ff) AM_RAM AM_SHARE("scrollram") | |
| 480 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(m63_videoram2_w) AM_SHARE("videoram2") | |
| 481 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(m63_videoram_w) AM_SHARE("videoram") | |
| 482 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(m63_colorram_w) AM_SHARE("colorram") | |
| 479 | 483 | AM_RANGE(0xf000, 0xf000) AM_READ(snd_status_r) |
| 480 | 484 | AM_RANGE(0xf001, 0xf001) AM_READ_PORT("P1") |
| 481 | 485 | AM_RANGE(0xf002, 0xf002) AM_READ_PORT("P2") |
| 482 | 486 | AM_RANGE(0xf003, 0xf003) AM_READ_PORT("DSW") |
| 483 | 487 | AM_RANGE(0xf000, 0xf000) AM_WRITE(snd_irq_w) |
| 484 | 488 | AM_RANGE(0xf001, 0xf001) AM_WRITENOP |
| 485 | AM_RANGE(0xf002, 0xf002) AM_WRITE(soundlatch_w) | |
| 489 | AM_RANGE(0xf002, 0xf002) AM_WRITE(soundlatch_byte_w) | |
| 486 | 490 | AM_RANGE(0xf800, 0xf800) AM_WRITENOP |
| 487 | 491 | AM_RANGE(0xf801, 0xf801) AM_WRITE(nmi_mask_w) |
| 488 | 492 | AM_RANGE(0xf802, 0xf802) AM_WRITE(fghtbskt_flipscreen_w) |
| r14896 | r14897 | |
|---|---|---|
| 196 | 196 | if (ACCESSING_BITS_0_7) |
| 197 | 197 | { |
| 198 | 198 | machine().scheduler().synchronize(); |
| 199 | return soundlatch2_r(space, 0 ); | |
| 199 | return soundlatch2_byte_r(space, 0 ); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | return 0; |
| r14896 | r14897 | |
| 207 | 207 | if (ACCESSING_BITS_0_7) |
| 208 | 208 | { |
| 209 | 209 | machine().scheduler().synchronize(); |
| 210 | soundlatch_w(space, 0x00, data & 0xff); | |
| 210 | soundlatch_byte_w(space, 0x00, data & 0xff); | |
| 211 | 211 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 212 | 212 | } |
| 213 | 213 | } |
| r14896 | r14897 | |
| 300 | 300 | AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(fg_tilemap_w) AM_BASE(m_fgtilemap_ram) // fix ram |
| 301 | 301 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(m_spriteram) // obj ram |
| 302 | 302 | AM_RANGE(0x880000, 0x88000b) AM_READ(unk880000_r) |
| 303 | AM_RANGE(0x900000, 0x907fff) AM_RAM_WRITE(paletteram | |
| 303 | AM_RANGE(0x900000, 0x907fff) AM_RAM_WRITE(paletteram | |
| 304 | 304 | |
| 305 | 305 | //AM_RANGE(0x980000, 0x9807ff) AM_WRITEONLY // bg pal |
| 306 | //AM_RANGE(0x980800, 0x980fff) AM_WRITE(paletteram | |
| 306 | //AM_RANGE(0x980800, 0x980fff) AM_WRITE(paletteram | |
| 307 | 307 | // the two above are as tested by the game code, I've only rolled them into one below to get colours to show right. |
| 308 | 308 | AM_RANGE(0x980000, 0x980fff) AM_RAM_WRITE(tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(m_tilemap_paletteram16) |
| 309 | 309 | |
| r14896 | r14897 | |
| 351 | 351 | AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 352 | 352 | AM_RANGE(0x20, 0x20) AM_WRITE(tecmosys_oki_bank_w) |
| 353 | 353 | AM_RANGE(0x30, 0x30) AM_WRITE(tecmosys_z80_bank_w) |
| 354 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_r) | |
| 355 | AM_RANGE(0x50, 0x50) AM_WRITE(soundlatch2_w) | |
| 354 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r) | |
| 355 | AM_RANGE(0x50, 0x50) AM_WRITE(soundlatch2_byte_w) | |
| 356 | 356 | AM_RANGE(0x60, 0x61) AM_DEVREADWRITE_LEGACY("ymz", ymz280b_r, ymz280b_w) |
| 357 | 357 | ADDRESS_MAP_END |
| 358 | 358 |
| r14896 | r14897 | |
|---|---|---|
| 166 | 166 | |
| 167 | 167 | WRITE16_MEMBER(dassault_state::dassault_sound_w) |
| 168 | 168 | { |
| 169 | soundlatch_w(space, 0, data & 0xff); | |
| 169 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 170 | 170 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); /* IRQ1 */ |
| 171 | 171 | } |
| 172 | 172 | |
| r14896 | r14897 | |
| 254 | 254 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w) |
| 255 | 255 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 256 | 256 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 257 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 257 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 258 | 258 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 259 | 259 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 260 | 260 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 88 | 88 | AM_RANGE(0xd400, 0xd7ff) AM_READ(galaxold_videoram_r) |
| 89 | 89 | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 90 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 91 | AM_RANGE(0xd860, 0xd87f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 90 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 91 | AM_RANGE(0xd860, 0xd87f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 92 | 92 | |
| 93 | 93 | AM_RANGE(0xd880, 0xd8ff) AM_RAM |
| 94 | 94 |
| r14896 | r14897 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | WRITE16_MEMBER(tatsumi_state::cyclwarr_sound_w) |
| 201 | 201 | { |
| 202 | soundlatch_w(space, 0, data >> 8); | |
| 202 | soundlatch_byte_w(space, 0, data >> 8); | |
| 203 | 203 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 204 | 204 | } |
| 205 | 205 | |
| r14896 | r14897 | |
| 307 | 307 | AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w) |
| 308 | 308 | AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_BASE(m_spriteram) |
| 309 | 309 | AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_BASE(m_sprite_control_ram) |
| 310 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 310 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 311 | 311 | AM_RANGE(0x140000, 0x1bffff) AM_ROMBANK("bank2") /* CPU B ROM */ |
| 312 | 312 | AM_RANGE(0x2c0000, 0x33ffff) AM_ROMBANK("bank1") /* CPU A ROM */ |
| 313 | 313 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 328 | 328 | |
| 329 | 329 | AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) |
| 330 | 330 | AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) |
| 331 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 331 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 332 | 332 | AM_RANGE(0x140000, 0x1bffff) AM_ROMBANK("bank2") /* CPU B ROM */ |
| 333 | 333 | AM_RANGE(0x2c0000, 0x33ffff) AM_ROMBANK("bank1") /* CPU A ROM */ |
| 334 | 334 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 338 | 338 | AM_RANGE(0xe000, 0xffef) AM_RAM |
| 339 | 339 | AM_RANGE(0xfff0, 0xfff1) AM_DEVREADWRITE_LEGACY("ymsnd", tatsumi_hack_ym2151_r, ym2151_w) |
| 340 | 340 | AM_RANGE(0xfff4, 0xfff4) AM_DEVREAD_LEGACY("oki", tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write) |
| 341 | AM_RANGE(0xfffc, 0xfffc) AM_READ(soundlatch_r) | |
| 341 | AM_RANGE(0xfffc, 0xfffc) AM_READ(soundlatch_byte_r) | |
| 342 | 342 | AM_RANGE(0xfffe, 0xfffe) AM_WRITENOP |
| 343 | 343 | ADDRESS_MAP_END |
| 344 | 344 | |
| r14896 | r14897 | |
| 363 | 363 | AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w) |
| 364 | 364 | AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_BASE(m_spriteram) |
| 365 | 365 | AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_BASE(m_sprite_control_ram) |
| 366 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 366 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 367 | 367 | AM_RANGE(0x100000, 0x17ffff) AM_ROMBANK("bank2") /* CPU A ROM */ |
| 368 | 368 | AM_RANGE(0x200000, 0x27ffff) AM_ROMBANK("bank1") /* CPU B ROM */ |
| 369 | 369 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 382 | 382 | |
| 383 | 383 | AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) |
| 384 | 384 | AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) |
| 385 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 385 | AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram | |
| 386 | 386 | AM_RANGE(0x100000, 0x17ffff) AM_ROMBANK("bank2") /* CPU A ROM */ |
| 387 | 387 | AM_RANGE(0x200000, 0x27ffff) AM_ROMBANK("bank1") /* CPU B ROM */ |
| 388 | 388 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | WRITE16_MEMBER(supbtime_state::sound_w) |
| 54 | 54 | { |
| 55 | soundlatch_w(space, 0, data & 0xff); | |
| 55 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 56 | 56 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 57 | 57 | } |
| 58 | 58 | |
| r14896 | r14897 | |
| 64 | 64 | AM_RANGE(0x104000, 0x11ffff) AM_WRITENOP /* Nothing there */ |
| 65 | 65 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 66 | 66 | AM_RANGE(0x120800, 0x13ffff) AM_WRITENOP /* Nothing there */ |
| 67 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 67 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 68 | 68 | AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r) |
| 69 | 69 | AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP |
| 70 | 70 | AM_RANGE(0x1a0000, 0x1a0001) AM_WRITE(sound_w) |
| r14896 | r14897 | |
| 79 | 79 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 80 | 80 | AM_RANGE(0x100000, 0x100001) AM_WRITE(sound_w) |
| 81 | 81 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 82 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 82 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 83 | 83 | AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r) |
| 84 | 84 | AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP |
| 85 | 85 | AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM |
| r14896 | r14897 | |
| 100 | 100 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 101 | 101 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 102 | 102 | AM_RANGE(0x130000, 0x130001) AM_NOP /* This board only has 1 oki chip */ |
| 103 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 103 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 104 | 104 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 105 | 105 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 106 | 106 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | { |
| 28 | 28 | public: |
| 29 | 29 | toratora_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | : driver_device(mconfig, type, tag) { } | |
| 30 | : driver_device(mconfig, type, tag) , | |
| 31 | m_videoram(*this, "videoram"){ } | |
| 31 | 32 | |
| 32 | 33 | /* memory pointers */ |
| 33 | UINT8 * m_videoram; | |
| 34 | size_t m_videoram_size; | |
| 34 | required_shared_ptr<UINT8> m_videoram; | |
| 35 | 35 | |
| 36 | 36 | /* video-related */ |
| 37 | 37 | int m_timer; |
| r14896 | r14897 | |
| 73 | 73 | toratora_state *state = screen.machine().driver_data<toratora_state>(); |
| 74 | 74 | offs_t offs; |
| 75 | 75 | |
| 76 | for (offs = 0; offs < state->m_videoram | |
| 76 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 77 | 77 | { |
| 78 | 78 | int i; |
| 79 | 79 | |
| 80 | 80 | UINT8 y = offs >> 5; |
| 81 | 81 | UINT8 x = offs << 3; |
| 82 | UINT8 data = state->m_videoram[offs]; | |
| 82 | UINT8 data = state->m_videoram.target()[offs]; | |
| 83 | 83 | |
| 84 | 84 | for (i = 0; i < 8; i++) |
| 85 | 85 | { |
| r14896 | r14897 | |
| 92 | 92 | |
| 93 | 93 | /* the video system clears as it writes out the pixels */ |
| 94 | 94 | if (state->m_clear_tv) |
| 95 | state->m_videoram[offs] = 0; | |
| 95 | state->m_videoram.target()[offs] = 0; | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | state->m_clear_tv = 0; |
| r14896 | r14897 | |
| 311 | 311 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, toratora_state ) |
| 312 | 312 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 313 | 313 | AM_RANGE(0x1000, 0x7fff) AM_ROM /* not fully populated */ |
| 314 | AM_RANGE(0x8000, 0x9fff) AM_RAM AM_ | |
| 314 | AM_RANGE(0x8000, 0x9fff) AM_RAM AM_ | |
| 315 | 315 | AM_RANGE(0xa000, 0xf047) AM_NOP |
| 316 | 316 | AM_RANGE(0xf048, 0xf049) AM_NOP |
| 317 | 317 | AM_RANGE(0xf04a, 0xf04a) AM_WRITE(clear_tv_w) /* the read is mark *LEDEN, but not used */ |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | { |
| 41 | 41 | |
| 42 | 42 | if (m_palette_selected) |
| 43 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 43 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 44 | 44 | else |
| 45 | 45 | m_ram[offset] = data; |
| 46 | 46 | } |
| r14896 | r14897 | |
| 150 | 150 | |
| 151 | 151 | static ADDRESS_MAP_START( gbusters_map, AS_PROGRAM, 8, gbusters_state ) |
| 152 | 152 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(gbusters_coin_counter_w) /* coin counters */ |
| 153 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_w) /* sound code # */ | |
| 153 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w) /* sound code # */ | |
| 154 | 154 | AM_RANGE(0x1f88, 0x1f88) AM_WRITE(gbusters_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 155 | 155 | AM_RANGE(0x1f8c, 0x1f8c) AM_WRITE(watchdog_reset_w) /* watchdog reset */ |
| 156 | 156 | AM_RANGE(0x1f90, 0x1f90) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 171 | 171 | static ADDRESS_MAP_START( gbusters_sound_map, AS_PROGRAM, 8, gbusters_state ) |
| 172 | 172 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM 878h01.rom */ |
| 173 | 173 | AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ |
| 174 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 174 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 175 | 175 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */ |
| 176 | 176 | AM_RANGE(0xc001, 0xc001) AM_DEVREAD_LEGACY("ymsnd", ym2151_status_port_r) /* YM 2151 */ |
| 177 | 177 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM 2151 */ |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | { |
| 31 | 31 | |
| 32 | 32 | // bit 0 is flipscreen |
| 33 | flip_screen_set( | |
| 33 | flip_screen_set( | |
| 34 | 34 | |
| 35 | 35 | // bit 5 goes to 8910 #0 BDIR pin |
| 36 | 36 | if ((m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00) |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | { |
| 54 | 54 | public: |
| 55 | 55 | r2dtank_state(const machine_config &mconfig, device_type type, const char *tag) |
| 56 | : driver_device(mconfig, type, tag) { } | |
| 56 | : driver_device(mconfig, type, tag) , | |
| 57 | m_videoram(*this, "videoram"), | |
| 58 | m_colorram(*this, "colorram"){ } | |
| 57 | 59 | |
| 58 | UINT8 *m_videoram; | |
| 59 | UINT8 *m_colorram; | |
| 60 | required_shared_ptr<UINT8> m_videoram; | |
| 61 | required_shared_ptr<UINT8> m_colorram; | |
| 60 | 62 | UINT8 m_flipscreen; |
| 61 | 63 | UINT32 m_ttl74123_output; |
| 62 | 64 | UINT8 m_AY8910_selected; |
| r14896 | r14897 | |
| 106 | 108 | |
| 107 | 109 | READ8_MEMBER(r2dtank_state::audio_command_r) |
| 108 | 110 | { |
| 109 | UINT8 ret = soundlatch_r(space, 0); | |
| 111 | UINT8 ret = soundlatch_byte_r(space, 0); | |
| 110 | 112 | |
| 111 | 113 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", cpu_get_pc(&space.device()), ret); |
| 112 | 114 | |
| r14896 | r14897 | |
| 116 | 118 | |
| 117 | 119 | WRITE8_MEMBER(r2dtank_state::audio_command_w) |
| 118 | 120 | { |
| 119 | soundlatch_w(space, 0, ~data); | |
| 121 | soundlatch_byte_w(space, 0, ~data); | |
| 120 | 122 | cputag_set_input_line(machine(), "audiocpu", M6800_IRQ_LINE, HOLD_LINE); |
| 121 | 123 | |
| 122 | 124 | if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", cpu_get_pc(&space.device()), data^0xff); |
| r14896 | r14897 | |
| 125 | 127 | |
| 126 | 128 | READ8_MEMBER(r2dtank_state::audio_answer_r) |
| 127 | 129 | { |
| 128 | UINT8 ret = soundlatch2_r(space, 0); | |
| 130 | UINT8 ret = soundlatch2_byte_r(space, 0); | |
| 129 | 131 | if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", cpu_get_pc(&space.device()), ret); |
| 130 | 132 | |
| 131 | 133 | return ret; |
| r14896 | r14897 | |
| 138 | 140 | if (cpu_get_pc(&space.device()) == 0xfb12) |
| 139 | 141 | data = 0x00; |
| 140 | 142 | |
| 141 | soundlatch2_w(space, 0, data); | |
| 143 | soundlatch2_byte_w(space, 0, data); | |
| 142 | 144 | cputag_set_input_line(machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE); |
| 143 | 145 | |
| 144 | 146 | if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", cpu_get_pc(&space.device()), data); |
| r14896 | r14897 | |
| 351 | 353 | if (state->m_flipscreen) |
| 352 | 354 | offs = offs ^ 0x1fff; |
| 353 | 355 | |
| 354 | data = state->m_videoram[offs]; | |
| 355 | fore_color = (state->m_colorram[offs] >> 5) & 0x07; | |
| 356 | data = state->m_videoram.target()[offs]; | |
| 357 | fore_color = (state->m_colorram.target()[offs] >> 5) & 0x07; | |
| 356 | 358 | |
| 357 | 359 | for (i = 0; i < 8; i++) |
| 358 | 360 | { |
| r14896 | r14897 | |
| 415 | 417 | |
| 416 | 418 | |
| 417 | 419 | static ADDRESS_MAP_START( r2dtank_main_map, AS_PROGRAM, 8, r2dtank_state ) |
| 418 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_ | |
| 420 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_ | |
| 419 | 421 | AM_RANGE(0x2000, 0x3fff) AM_RAM |
| 420 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 422 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 421 | 423 | AM_RANGE(0x6000, 0x7fff) AM_RAM |
| 422 | 424 | AM_RANGE(0x8000, 0x8003) AM_DEVREAD("pia_main", pia6821_device, read) AM_DEVWRITE_LEGACY("pia_main", pia_comp_w) |
| 423 | 425 | AM_RANGE(0x8004, 0x8004) AM_READWRITE(audio_answer_r, audio_command_w) |
| r14896 | r14897 | |
|---|---|---|
| 1076 | 1076 | static ADDRESS_MAP_START( rtype_sound_portmap, AS_IO, 8, m72_state ) |
| 1077 | 1077 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1078 | 1078 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1079 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r) | |
| 1079 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) | |
| 1080 | 1080 | AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) |
| 1081 | 1081 | AM_RANGE(0x84, 0x84) AM_DEVREAD_LEGACY("m72", m72_sample_r) |
| 1082 | 1082 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1084 | 1084 | static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, m72_state ) |
| 1085 | 1085 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1086 | 1086 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1087 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r) | |
| 1087 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) | |
| 1088 | 1088 | AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) |
| 1089 | 1089 | AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w) |
| 1090 | 1090 | AM_RANGE(0x84, 0x84) AM_DEVREAD_LEGACY("m72", m72_sample_r) |
| r14896 | r14897 | |
| 1093 | 1093 | static ADDRESS_MAP_START( rtype2_sound_portmap, AS_IO, 8, m72_state ) |
| 1094 | 1094 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1095 | 1095 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1096 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) | |
| 1096 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) | |
| 1097 | 1097 | AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("m72", rtype2_sample_addr_w) |
| 1098 | 1098 | AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w) |
| 1099 | 1099 | AM_RANGE(0x83, 0x83) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) |
| r14896 | r14897 | |
| 1105 | 1105 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1106 | 1106 | AM_RANGE(0x10, 0x13) AM_DEVWRITE_LEGACY("m72", poundfor_sample_addr_w) |
| 1107 | 1107 | AM_RANGE(0x40, 0x41) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1108 | AM_RANGE(0x42, 0x42) AM_READ(soundlatch_r) | |
| 1108 | AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r) | |
| 1109 | 1109 | AM_RANGE(0x42, 0x42) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) |
| 1110 | 1110 | ADDRESS_MAP_END |
| 1111 | 1111 |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | WRITE8_MEMBER(pokechmp_state::pokechmp_sound_w) |
| 89 | 89 | { |
| 90 | soundlatch_w(space, 0, data); | |
| 90 | soundlatch_byte_w(space, 0, data); | |
| 91 | 91 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 92 | 92 | } |
| 93 | 93 | |
| r14896 | r14897 | |
| 136 | 136 | AM_RANGE(0x1800, 0x1800) AM_WRITENOP /* MSM5205 chip on Pocket Gal, not connected here? */ |
| 137 | 137 | // AM_RANGE(0x2000, 0x2000) AM_WRITE(pokechmp_sound_bank_w)/ * might still be sound bank */ |
| 138 | 138 | AM_RANGE(0x2800, 0x2800) AM_DEVREADWRITE("oki", okim6295_device, read, write) // extra |
| 139 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 139 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 140 | 140 | // AM_RANGE(0x3400, 0x3400) AM_READ_LEGACY(pokechmp_adpcm_reset_r) /* ? not sure */ |
| 141 | 141 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank3") |
| 142 | 142 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 445 | 445 | public: |
| 446 | 446 | mastboy_state(const machine_config &mconfig, device_type type, const char *tag) |
| 447 | 447 | : driver_device(mconfig, type, tag), |
| 448 | m_nvram(*this, "nvram") { } | |
| 448 | m_nvram(*this, "nvram") , | |
| 449 | m_workram(*this, "workram"), | |
| 450 | m_tileram(*this, "tileram"), | |
| 451 | m_colram(*this, "colram"){ } | |
| 449 | 452 | |
| 450 | 453 | required_shared_ptr<UINT8> m_nvram; |
| 451 | UINT8* m_tileram; | |
| 454 | required_shared_ptr<UINT8> m_workram; | |
| 455 | required_shared_ptr<UINT8> m_tileram; | |
| 456 | required_shared_ptr<UINT8> m_colram; | |
| 452 | 457 | UINT8* m_vram; |
| 453 | UINT8* m_colram; | |
| 454 | UINT8* m_workram; | |
| 455 | 458 | UINT8 m_bank; |
| 456 | 459 | int m_irq0_ack; |
| 457 | 460 | int m_backupram_enabled; |
| r14896 | r14897 | |
| 490 | 493 | |
| 491 | 494 | for (i=0;i<0x200;i+=2) |
| 492 | 495 | { |
| 493 | int coldat = state->m_colram[i+1] | (state->m_colram[i+0]<<8); | |
| 496 | int coldat = state->m_colram.target()[i+1] | (state->m_colram.target()[i+0]<<8); | |
| 494 | 497 | |
| 495 | 498 | palette_set_color_rgb(screen.machine(),i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4)); |
| 496 | 499 | } |
| r14896 | r14897 | |
| 500 | 503 | for (x=0;x<32;x++) |
| 501 | 504 | { |
| 502 | 505 | /* bytes 0 and 3 seem to be unused for rendering , they appear to contain data the game uses internally */ |
| 503 | int tileno = (state->m_tileram[count+1]|(state->m_tileram[count+2]<<8))&0xfff; | |
| 504 | int attr = (state->m_tileram[count+2]&0xf0)>>4; | |
| 506 | int tileno = (state->m_tileram.target()[count+1]|(state->m_tileram.target()[count+2]<<8))&0xfff; | |
| 507 | int attr = (state->m_tileram.target()[count+2]&0xf0)>>4; | |
| 505 | 508 | gfx_element *gfx; |
| 506 | 509 | |
| 507 | 510 | if (tileno&0x800) |
| r14896 | r14897 | |
| 603 | 606 | |
| 604 | 607 | READ8_MEMBER(mastboy_state::mastboy_backupram_r) |
| 605 | 608 | { |
| 606 | return m_nvram[offset]; | |
| 609 | return m_nvram.target()[offset]; | |
| 607 | 610 | } |
| 608 | 611 | |
| 609 | 612 | WRITE8_MEMBER(mastboy_state::mastboy_backupram_w) |
| 610 | 613 | { |
| 611 | 614 | // if (m_backupram_enabled) |
| 612 | 615 | // { |
| 613 | m_nvram[offset] = data; | |
| 616 | m_nvram.target()[offset] = data; | |
| 614 | 617 | // } |
| 615 | 618 | // else |
| 616 | 619 | // { |
| r14896 | r14897 | |
| 702 | 705 | AM_RANGE(0x0000, 0x3fff) AM_ROM // Internal ROM |
| 703 | 706 | AM_RANGE(0x4000, 0x7fff) AM_ROM // External ROM |
| 704 | 707 | |
| 705 | AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(m_workram)// work ram | |
| 706 | AM_RANGE(0x9000, 0x9fff) AM_RAM AM_BASE(m_tileram)// tilemap ram | |
| 707 | AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_BASE(m_colram) AM_MIRROR(0x0e00) // colour ram | |
| 708 | AM_RANGE(0x8000, 0x8fff) AM_RAM AM_SHARE("workram")// work ram | |
| 709 | AM_RANGE(0x9000, 0x9fff) AM_RAM AM_SHARE("tileram")// tilemap ram | |
| 710 | AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_SHARE("colram") AM_MIRROR(0x0e00) // colour ram | |
| 708 | 711 | |
| 709 | 712 | AM_RANGE(0xc000, 0xffff) AM_READWRITE(banked_ram_r,banked_ram_w) // mastboy bank area read / write |
| 710 | 713 |
| r14896 | r14897 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | public: |
| 40 | 40 | rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag) |
| 41 | : driver_device(mconfig, type, tag) { } | |
| 41 | : driver_device(mconfig, type, tag) , | |
| 42 | m_colorram(*this, "colorram"), | |
| 43 | m_videoram(*this, "videoram"){ } | |
| 42 | 44 | |
| 43 | 45 | int m_gfxbank; |
| 44 | UINT8 *m_videoram; | |
| 45 | UINT8 *m_colorram; | |
| 46 | required_shared_ptr<UINT8> m_colorram; | |
| 47 | required_shared_ptr<UINT8> m_videoram; | |
| 46 | 48 | tilemap_t *m_bg_tilemap; |
| 47 | 49 | int m_keyboard_cmd; |
| 48 | 50 | DECLARE_WRITE8_MEMBER(rmhaihai_videoram_w); |
| r14896 | r14897 | |
| 58 | 60 | |
| 59 | 61 | WRITE8_MEMBER(rmhaihai_state::rmhaihai_videoram_w) |
| 60 | 62 | { |
| 61 | m_videoram[offset] = data; | |
| 63 | m_videoram.target()[offset] = data; | |
| 62 | 64 | m_bg_tilemap->mark_tile_dirty(offset); |
| 63 | 65 | } |
| 64 | 66 | |
| 65 | 67 | WRITE8_MEMBER(rmhaihai_state::rmhaihai_colorram_w) |
| 66 | 68 | { |
| 67 | m_colorram[offset] = data; | |
| 69 | m_colorram.target()[offset] = data; | |
| 68 | 70 | m_bg_tilemap->mark_tile_dirty(offset); |
| 69 | 71 | } |
| 70 | 72 | |
| 71 | 73 | static TILE_GET_INFO( get_bg_tile_info ) |
| 72 | 74 | { |
| 73 | 75 | rmhaihai_state *state = machine.driver_data<rmhaihai_state>(); |
| 74 | int attr = state->m_colorram[tile_index]; | |
| 75 | int code = state->m_videoram[tile_index] + (state->m_gfxbank << 12) + ((attr & 0x07) << 8) + ((attr & 0x80) << 4); | |
| 76 | int attr = state->m_colorram.target()[tile_index]; | |
| 77 | int code = state->m_videoram.target()[tile_index] + (state->m_gfxbank << 12) + ((attr & 0x07) << 8) + ((attr & 0x80) << 4); | |
| 76 | 78 | int color = (state->m_gfxbank << 5) + (attr >> 3); |
| 77 | 79 | |
| 78 | 80 | SET_TILE_INFO(0, code, color, 0); |
| r14896 | r14897 | |
| 165 | 167 | |
| 166 | 168 | WRITE8_MEMBER(rmhaihai_state::ctrl_w) |
| 167 | 169 | { |
| 168 | flip_screen_set( | |
| 170 | flip_screen_set( | |
| 169 | 171 | |
| 170 | 172 | // (data & 0x02) is switched on and off in service mode |
| 171 | 173 | |
| r14896 | r14897 | |
| 197 | 199 | static ADDRESS_MAP_START( rmhaihai_map, AS_PROGRAM, 8, rmhaihai_state ) |
| 198 | 200 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 199 | 201 | AM_RANGE(0xa000, 0xa7ff) AM_RAM |
| 200 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(rmhaihai_colorram_w) AM_BASE(m_colorram) | |
| 201 | AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(rmhaihai_videoram_w) AM_BASE(m_videoram) | |
| 202 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(rmhaihai_colorram_w) AM_SHARE("colorram") | |
| 203 | AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(rmhaihai_videoram_w) AM_SHARE("videoram") | |
| 202 | 204 | AM_RANGE(0xb83c, 0xb83c) AM_WRITENOP // ?? |
| 203 | 205 | AM_RANGE(0xbc00, 0xbc00) AM_WRITENOP // ?? |
| 204 | 206 | AM_RANGE(0xc000, 0xdfff) AM_ROM |
| r14896 | r14897 | |
| 222 | 224 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 223 | 225 | AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") |
| 224 | 226 | AM_RANGE(0xa000, 0xa7ff) AM_RAM |
| 225 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(rmhaihai_colorram_w) AM_BASE(m_colorram) | |
| 226 | AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(rmhaihai_videoram_w) AM_BASE(m_videoram) | |
| 227 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(rmhaihai_colorram_w) AM_SHARE("colorram") | |
| 228 | AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(rmhaihai_videoram_w) AM_SHARE("videoram") | |
| 227 | 229 | AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("bank2") |
| 228 | 230 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 229 | 231 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 441 | 441 | static ADDRESS_MAP_START( topspeed_map, AS_PROGRAM, 16, topspeed_state ) |
| 442 | 442 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 443 | 443 | AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE_SIZE(m_sharedram, m_sharedram_size) |
| 444 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(paletteram | |
| 444 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(paletteram | |
| 445 | 445 | AM_RANGE(0x600002, 0x600003) AM_WRITE(cpua_ctrl_w) |
| 446 | 446 | AM_RANGE(0x7e0000, 0x7e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 447 | 447 | AM_RANGE(0x7e0002, 0x7e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| r14896 | r14897 | |
|---|---|---|
| 442 | 442 | |
| 443 | 443 | memory_configure_bank(machine(), "bank1", 0, 16, machine().region("maincpu")->base() + 0x10000, 0x4000); |
| 444 | 444 | |
| 445 | if ( !strcmp( | |
| 445 | if ( !strcmp( | |
| 446 | 446 | { |
| 447 | 447 | m_maincpu->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::ridleofp_port_f8_read), this)); |
| 448 | 448 | m_maincpu->memory().space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::ridleofp_port_fa_write), this)); |
| 449 | 449 | } |
| 450 | else if ( !strcmp( | |
| 450 | else if ( !strcmp( | |
| 451 | 451 | { |
| 452 | 452 | m_maincpu->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::hangonjr_port_f8_read), this)); |
| 453 | 453 | m_maincpu->memory().space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::hangonjr_port_fa_write), this)); |
| 454 | 454 | } |
| 455 | else if ( !strcmp( | |
| 455 | else if ( !strcmp( | |
| 456 | 456 | { |
| 457 | 457 | mc8123_decrypt_rom(machine(), "maincpu", "user1", "bank1", 8); |
| 458 | 458 | } |
| 459 | else if ( !strcmp( | |
| 459 | else if ( !strcmp( | |
| 460 | 460 | { |
| 461 | 461 | mc8123_decrypt_rom(machine(), "maincpu", "user1", NULL, 0); |
| 462 | 462 | } |
| 463 | else if ( !strcmp( | |
| 463 | else if ( !strcmp( | |
| 464 | 464 | { |
| 465 | 465 | sega_315_5177_decode(machine(), "maincpu"); |
| 466 | 466 | } |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w) |
| 71 | 71 | { |
| 72 | soundlatch_w(space, 0, data); | |
| 72 | soundlatch_byte_w(space, 0, data); | |
| 73 | 73 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 74 | 74 | } |
| 75 | 75 | |
| r14896 | r14897 | |
| 114 | 114 | static ADDRESS_MAP_START( amspdwy_sound_map, AS_PROGRAM, 8, amspdwy_state ) |
| 115 | 115 | AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM |
| 116 | 116 | // AM_RANGE(0x8000, 0x8000) AM_WRITENOP // ? Written with 0 at the start |
| 117 | AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_r) // From Main CPU | |
| 117 | AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 118 | 118 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // |
| 119 | 119 | AM_RANGE(0xc000, 0xdfff) AM_RAM // Work RAM |
| 120 | 120 | AM_RANGE(0xffff, 0xffff) AM_READNOP // ??? IY = FFFF at the start ? |
| r14896 | r14897 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | WRITE8_MEMBER(fantland_state::fantland_soundlatch_w) |
| 77 | 77 | { |
| 78 | soundlatch_w(space, 0, data); | |
| 78 | soundlatch_byte_w(space, 0, data); | |
| 79 | 79 | device_set_input_line(m_audio_cpu, INPUT_LINE_NMI, PULSE_LINE); |
| 80 | 80 | } |
| 81 | 81 | |
| r14896 | r14897 | |
| 123 | 123 | AM_RANGE( 0x00000, 0x07fff ) AM_RAM |
| 124 | 124 | AM_RANGE( 0x08000, 0x7ffff ) AM_ROM |
| 125 | 125 | |
| 126 | AM_RANGE( 0xa2000, 0xa21ff ) AM_RAM_WRITE(paletteram | |
| 126 | AM_RANGE( 0xa2000, 0xa21ff ) AM_RAM_WRITE(paletteram | |
| 127 | 127 | |
| 128 | 128 | AM_RANGE( 0xa3000, 0xa3001 ) AM_READ_PORT("a3000") AM_WRITE(fantland_nmi_enable_16_w ) |
| 129 | 129 | AM_RANGE( 0xa3002, 0xa3003 ) AM_READ_PORT("a3002") AM_WRITE(fantland_soundlatch_16_w ) |
| r14896 | r14897 | |
| 143 | 143 | AM_RANGE( 0x00000, 0x07fff ) AM_RAM |
| 144 | 144 | AM_RANGE( 0x10000, 0x2ffff ) AM_ROM |
| 145 | 145 | |
| 146 | AM_RANGE( 0x52000, 0x521ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_SHARE("paletteram") | |
| 146 | AM_RANGE( 0x52000, 0x521ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w ) AM_SHARE("paletteram") | |
| 147 | 147 | |
| 148 | 148 | AM_RANGE( 0x53000, 0x53000 ) AM_READ_PORT("P1") AM_WRITE(fantland_nmi_enable_w ) |
| 149 | 149 | AM_RANGE( 0x53001, 0x53001 ) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 235 | 235 | AM_RANGE( 0x00000, 0x07fff ) AM_RAM |
| 236 | 236 | AM_RANGE( 0x10000, 0x2ffff ) AM_ROM |
| 237 | 237 | |
| 238 | AM_RANGE( 0x52000, 0x521ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_SHARE("paletteram") | |
| 238 | AM_RANGE( 0x52000, 0x521ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w ) AM_SHARE("paletteram") | |
| 239 | 239 | AM_RANGE( 0x53000, 0x53001 ) AM_READWRITE(borntofi_inputs_r, borntofi_nmi_enable_w ) |
| 240 | 240 | AM_RANGE( 0x53002, 0x53002 ) AM_READ_PORT( "DSW" ) AM_WRITE(fantland_soundlatch_w ) |
| 241 | 241 | AM_RANGE( 0x53003, 0x53003 ) AM_READ_PORT( "Controls" ) |
| r14896 | r14897 | |
| 264 | 264 | AM_RANGE(0x30000, 0x3ffff) AM_ROM |
| 265 | 265 | AM_RANGE(0x70000, 0x7ffff) AM_ROM |
| 266 | 266 | |
| 267 | AM_RANGE(0x52000, 0x521ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_SHARE( "paletteram" ) | |
| 267 | AM_RANGE(0x52000, 0x521ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w ) AM_SHARE( "paletteram" ) | |
| 268 | 268 | |
| 269 | 269 | AM_RANGE(0x53000, 0x53000) AM_READ_PORT( "53000" ) AM_WRITE(borntofi_nmi_enable_w ) |
| 270 | 270 | AM_RANGE(0x53001, 0x53001) AM_READ_PORT( "53001" ) |
| r14896 | r14897 | |
| 292 | 292 | ADDRESS_MAP_END |
| 293 | 293 | |
| 294 | 294 | static ADDRESS_MAP_START( fantland_sound_iomap, AS_IO, 8, fantland_state ) |
| 295 | AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_r ) | |
| 295 | AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r ) | |
| 296 | 296 | AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w ) |
| 297 | 297 | AM_RANGE( 0x0180, 0x0180 ) AM_DEVWRITE_LEGACY("dac", dac_w ) |
| 298 | 298 | ADDRESS_MAP_END |
| 299 | 299 | |
| 300 | 300 | static ADDRESS_MAP_START( galaxygn_sound_iomap, AS_IO, 8, fantland_state ) |
| 301 | AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_r ) | |
| 301 | AM_RANGE( 0x0080, 0x0080 ) AM_READ(soundlatch_byte_r ) | |
| 302 | 302 | AM_RANGE( 0x0100, 0x0101 ) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w ) |
| 303 | 303 | ADDRESS_MAP_END |
| 304 | 304 | |
| r14896 | r14897 | |
| 400 | 400 | |
| 401 | 401 | static ADDRESS_MAP_START( borntofi_sound_map, AS_PROGRAM, 8, fantland_state ) |
| 402 | 402 | AM_RANGE( 0x00000, 0x003ff ) AM_RAM |
| 403 | AM_RANGE( 0x04000, 0x04000 ) AM_READ(soundlatch_r) | |
| 403 | AM_RANGE( 0x04000, 0x04000 ) AM_READ(soundlatch_byte_r) | |
| 404 | 404 | AM_RANGE( 0x04000, 0x0401f ) AM_WRITE(borntofi_msm5205_w) |
| 405 | 405 | AM_RANGE( 0x08000, 0x0ffff ) AM_ROM |
| 406 | 406 | AM_RANGE( 0xf8000, 0xfffff ) AM_ROM |
| r14896 | r14897 | |
| 419 | 419 | AM_RANGE(0xb000, 0xb000) AM_WRITENOP // on a car crash / hit |
| 420 | 420 | AM_RANGE(0xc000, 0xc000) AM_WRITENOP // "" |
| 421 | 421 | |
| 422 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r ) // during NMI | |
| 422 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r ) // during NMI | |
| 423 | 423 | ADDRESS_MAP_END |
| 424 | 424 | |
| 425 | 425 |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | * |
| 68 | 68 | *************************************/ |
| 69 | 69 | |
| 70 | ||
| 70 | ||
| 71 | 71 | { |
| 72 | 72 | if (ACCESSING_BITS_0_7) |
| 73 | 73 | { |
| 74 | atarig1_state *state = space->machine().driver_data<atarig1_state>(); | |
| 75 | atarirle_control_w(state->m_rle, data & 7); | |
| 74 | atarirle_control_w(m_rle, data & 7); | |
| 76 | 75 | } |
| 77 | 76 | } |
| 78 | 77 | |
| 79 | 78 | |
| 80 | ||
| 79 | ||
| 81 | 80 | { |
| 82 | atarig1_state *state = space->machine().driver_data<atarig1_state>(); | |
| 83 | COMBINE_DATA(state->m_mo_command); | |
| 84 | atarirle_command_w(state->m_rle, (data == 0 && state->m_is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); | |
| 81 | COMBINE_DATA(m_mo_command); | |
| 82 | atarirle_command_w(m_rle, (data == 0 && m_is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); | |
| 85 | 83 | } |
| 86 | 84 | |
| 87 | 85 | |
| r14896 | r14897 | |
| 92 | 90 | * |
| 93 | 91 | *************************************/ |
| 94 | 92 | |
| 95 | ||
| 93 | ||
| 96 | 94 | { |
| 97 | atarig1_state *state = space->machine().driver_data<atarig1_state>(); | |
| 98 | int temp = input_port_read(space->machine(), "IN0"); | |
| 99 | if (state->m_cpu_to_sound_ready) temp ^= 0x1000; | |
| 95 | int temp = input_port_read(machine(), "IN0"); | |
| 96 | if (m_cpu_to_sound_ready) temp ^= 0x1000; | |
| 100 | 97 | temp ^= 0x2000; /* A2DOK always high for now */ |
| 101 | 98 | return temp; |
| 102 | 99 | } |
| 103 | 100 | |
| 104 | 101 | |
| 105 | ||
| 102 | ||
| 106 | 103 | { |
| 107 | atarig1_state *state = space->machine().driver_data<atarig1_state>(); | |
| 108 | state->m_which_input = offset; | |
| 104 | m_which_input = offset; | |
| 109 | 105 | } |
| 110 | 106 | |
| 111 | 107 | |
| 112 | ||
| 108 | ||
| 113 | 109 | { |
| 114 | 110 | static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2" }; |
| 115 | atarig1_state *state = space->machine().driver_data<atarig1_state>(); | |
| 116 | 111 | |
| 117 | 112 | /* Pit Fighter has no A2D, just another input port */ |
| 118 | if (state->m_is_pitfight) | |
| 119 | return input_port_read(space->machine(), "ADC0"); | |
| 113 | if (m_is_pitfight) | |
| 114 | return input_port_read(machine(), "ADC0"); | |
| 120 | 115 | |
| 121 | 116 | /* otherwise, assume it's hydra */ |
| 122 | if (state->m_which_input < 3) | |
| 123 | return input_port_read(space->machine(), adcnames[state->m_which_input]) << 8; | |
| 117 | if (m_which_input < 3) | |
| 118 | return input_port_read(machine(), adcnames[m_which_input]) << 8; | |
| 124 | 119 | |
| 125 | 120 | return 0; |
| 126 | 121 | } |
| r14896 | r14897 | |
| 133 | 128 | * |
| 134 | 129 | *************************************/ |
| 135 | 130 | |
| 136 | ||
| 131 | ||
| 137 | 132 | { |
| 138 | 133 | /* if the bank has changed, copy the memory; Pit Fighter needs this */ |
| 139 | if (bank != | |
| 134 | if (bank != | |
| 140 | 135 | { |
| 141 | 136 | /* bank 0 comes from the copy we made earlier */ |
| 142 | 137 | if (bank == 0) |
| 143 | memcpy( | |
| 138 | memcpy( | |
| 144 | 139 | else |
| 145 | memcpy( | |
| 140 | memcpy( | |
| 146 | 141 | |
| 147 | 142 | /* remember the current bank */ |
| 148 | | |
| 143 | | |
| 149 | 144 | } |
| 150 | 145 | } |
| 151 | 146 | |
| r14896 | r14897 | |
| 155 | 150 | atarig1_state *state = machine.driver_data<atarig1_state>(); |
| 156 | 151 | int bank = state->m_bslapstic_bank; |
| 157 | 152 | state->m_bslapstic_bank = -1; |
| 158 | update_bank( | |
| 153 | state->update_bank( | |
| 159 | 154 | } |
| 160 | 155 | |
| 161 | 156 | |
| 162 | ||
| 157 | ||
| 163 | 158 | { |
| 164 | atarig1_state *state = space->machine().driver_data<atarig1_state>(); | |
| 165 | int result = state->m_bslapstic_base[offset & 0xfff]; | |
| 159 | int result = m_bslapstic_base[offset & 0xfff]; | |
| 166 | 160 | |
| 167 | 161 | /* the cheap replacement slapstic just triggers on the simple banking */ |
| 168 | 162 | /* addresses; a software patch ensure that this is good enough */ |
| 169 | 163 | |
| 170 | 164 | /* offset 0 primes the chip */ |
| 171 | 165 | if (offset == 0) |
| 172 | | |
| 166 | | |
| 173 | 167 | |
| 174 | 168 | /* one of 4 bankswitchers produces the result */ |
| 175 | else if ( | |
| 169 | else if ( | |
| 176 | 170 | { |
| 177 | 171 | if (offset == 0x42) |
| 178 | update_bank( | |
| 172 | update_bank( | |
| 179 | 173 | else if (offset == 0x52) |
| 180 | update_bank( | |
| 174 | update_bank( | |
| 181 | 175 | else if (offset == 0x62) |
| 182 | update_bank( | |
| 176 | update_bank( | |
| 183 | 177 | else if (offset == 0x72) |
| 184 | update_bank( | |
| 178 | update_bank( | |
| 185 | 179 | } |
| 186 | 180 | return result; |
| 187 | 181 | } |
| r14896 | r14897 | |
| 192 | 186 | atarig1_state *state = machine.driver_data<atarig1_state>(); |
| 193 | 187 | |
| 194 | 188 | /* install a read handler */ |
| 195 | state->m_bslapstic_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 189 | state->m_bslapstic_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 196 | 190 | |
| 197 | 191 | /* allocate memory for a copy of bank 0 */ |
| 198 | 192 | state->m_bslapstic_bank0 = auto_alloc_array(machine, UINT8, 0x2000); |
| r14896 | r14897 | |
| 219 | 213 | AM_RANGE(0xf88000, 0xf8ffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 220 | 214 | AM_RANGE(0xf90000, 0xf90001) AM_WRITE_LEGACY(atarigen_sound_upper_w) |
| 221 | 215 | AM_RANGE(0xf98000, 0xf98001) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 222 | AM_RANGE(0xfa0000, 0xfa0001) AM_WRITE | |
| 216 | AM_RANGE(0xfa0000, 0xfa0001) AM_WRITE | |
| 223 | 217 | AM_RANGE(0xfb0000, 0xfb0001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 224 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ_LEGACY(special_port0_r) | |
| 225 | AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE_LEGACY(a2d_data_r, a2d_select_w) | |
| 218 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ(special_port0_r) | |
| 219 | AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE(a2d_data_r, a2d_select_w) | |
| 226 | 220 | AM_RANGE(0xfd0000, 0xfd0001) AM_READ_LEGACY(atarigen_sound_upper_r) |
| 227 | 221 | AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 228 | 222 | /* AM_RANGE(0xfe0000, 0xfe7fff) AM_READ_LEGACY(from_r)*/ |
| 229 | 223 | AM_RANGE(0xfe8000, 0xfe89ff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 230 | 224 | AM_RANGE(0xff0000, 0xff0fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram_r, atarirle_spriteram_w) |
| 231 | AM_RANGE(0xff2000, 0xff2001) AM_WRITE | |
| 225 | AM_RANGE(0xff2000, 0xff2001) AM_WRITE | |
| 232 | 226 | AM_RANGE(0xff4000, 0xff5fff) AM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 233 | 227 | AM_RANGE(0xff6000, 0xff6fff) AM_WRITE_LEGACY(atarigen_alpha_w) AM_BASE(m_alpha) |
| 234 | 228 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 66 | 66 | * |
| 67 | 67 | *************************************/ |
| 68 | 68 | |
| 69 | ||
| 69 | ||
| 70 | 70 | { |
| 71 | toobin_state *state = space->machine().driver_data<toobin_state>(); | |
| 72 | int oldword = state->m_interrupt_scan[offset]; | |
| 71 | int oldword = m_interrupt_scan[offset]; | |
| 73 | 72 | int newword = oldword; |
| 74 | 73 | COMBINE_DATA(&newword); |
| 75 | 74 | |
| 76 | 75 | /* if something changed, update the word in memory */ |
| 77 | 76 | if (oldword != newword) |
| 78 | 77 | { |
| 79 | state->m_interrupt_scan[offset] = newword; | |
| 80 | atarigen_scanline_int_set(*space->machine().primary_screen, newword & 0x1ff); | |
| 78 | m_interrupt_scan[offset] = newword; | |
| 79 | atarigen_scanline_int_set(*machine().primary_screen, newword & 0x1ff); | |
| 81 | 80 | } |
| 82 | 81 | } |
| 83 | 82 | |
| r14896 | r14897 | |
| 89 | 88 | * |
| 90 | 89 | *************************************/ |
| 91 | 90 | |
| 92 | ||
| 91 | ||
| 93 | 92 | { |
| 94 | toobin_state *state = space->machine().driver_data<toobin_state>(); | |
| 95 | int result = input_port_read(space->machine(), "FF9000"); | |
| 96 | if (atarigen_get_hblank(*space->machine().primary_screen)) result ^= 0x8000; | |
| 97 | if (state->m_cpu_to_sound_ready) result ^= 0x2000; | |
| 93 | int result = input_port_read(machine(), "FF9000"); | |
| 94 | if (atarigen_get_hblank(*machine().primary_screen)) result ^= 0x8000; | |
| 95 | if (m_cpu_to_sound_ready) result ^= 0x2000; | |
| 98 | 96 | return result; |
| 99 | 97 | } |
| 100 | 98 | |
| r14896 | r14897 | |
| 118 | 116 | AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x4500fe) AM_WRITE(watchdog_reset16_w) |
| 119 | 117 | AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_sound_w) |
| 120 | 118 | AM_RANGE(0xff8300, 0xff8301) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(toobin_intensity_w) |
| 121 | AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE | |
| 119 | AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE | |
| 122 | 120 | AM_RANGE(0xff8380, 0xff8381) AM_MIRROR(0x45003e) AM_READWRITE_LEGACY(atarimo_0_slipram_r, toobin_slip_w) |
| 123 | 121 | AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w) |
| 124 | 122 | AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| r14896 | r14897 | |
| 126 | 124 | AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_xscroll_w) AM_BASE(m_xscroll) |
| 127 | 125 | AM_RANGE(0xff8700, 0xff8701) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_yscroll_w) AM_BASE(m_yscroll) |
| 128 | 126 | AM_RANGE(0xff8800, 0xff8801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800") |
| 129 | AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ | |
| 127 | AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ | |
| 130 | 128 | AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ_LEGACY(atarigen_sound_r) |
| 131 | 129 | AM_RANGE(0xffa000, 0xffafff) AM_MIRROR(0x451000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 132 | 130 | AM_RANGE(0xffc000, 0xffffff) AM_MIRROR(0x450000) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(m_fore_data) |
| 88 | 88 | AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(m_mid_data) |
| 89 | 89 | AM_RANGE(0x102800, 0x1037ff) AM_RAM_WRITE(legionna_text_w) AM_BASE(m_textram) |
| 90 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 90 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 91 | 91 | AM_RANGE(0x105000, 0x105fff) AM_RAM AM_SHARE("spriteram") |
| 92 | 92 | AM_RANGE(0x106000, 0x107fff) AM_RAM |
| 93 | 93 | AM_RANGE(0x108000, 0x11ffff) AM_RAM /* main ram */ |
| r14896 | r14897 | |
| 103 | 103 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(m_mid_data) |
| 104 | 104 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(m_textram) |
| 105 | 105 | AM_RANGE(0x103000, 0x103fff) AM_RAM AM_SHARE("spriteram") |
| 106 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 106 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 107 | 107 | AM_RANGE(0x108000, 0x11ffff) AM_RAM |
| 108 | 108 | ADDRESS_MAP_END |
| 109 | 109 | |
| r14896 | r14897 | |
| 116 | 116 | AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(m_mid_data) |
| 117 | 117 | AM_RANGE(0x102800, 0x1037ff) AM_RAM_WRITE(legionna_text_w) AM_BASE(m_textram) |
| 118 | 118 | AM_RANGE(0x103800, 0x103fff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(m_fore_data) |
| 119 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 119 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 120 | 120 | AM_RANGE(0x105000, 0x105fff) AM_RAM AM_SHARE("spriteram") |
| 121 | 121 | AM_RANGE(0x106000, 0x1067ff) AM_RAM |
| 122 | 122 | AM_RANGE(0x106800, 0x106fff) AM_RAM |
| r14896 | r14897 | |
| 129 | 129 | { |
| 130 | 130 | offset^=1; |
| 131 | 131 | COMBINE_DATA(&m_generic_paletteram_16[offset]); |
| 132 | paletteram | |
| 132 | paletteram | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static ADDRESS_MAP_START( denjinmk_map, AS_PROGRAM, 16, legionna_state ) |
| r14896 | r14897 | |
| 157 | 157 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(m_fore_data) |
| 158 | 158 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(m_mid_data) |
| 159 | 159 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(m_textram) |
| 160 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 161 | AM_RANGE(0x104000, 0x104fff) AM_RAM//_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 160 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 161 | AM_RANGE(0x104000, 0x104fff) AM_RAM//_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 162 | 162 | AM_RANGE(0x105000, 0x105fff) AM_RAM |
| 163 | 163 | AM_RANGE(0x106000, 0x106fff) AM_RAM |
| 164 | 164 | AM_RANGE(0x107000, 0x107fff) AM_RAM AM_SHARE("spriteram") |
| r14896 | r14897 | |
| 173 | 173 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(m_fore_data) |
| 174 | 174 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(m_mid_data) |
| 175 | 175 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(m_textram) |
| 176 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 176 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 177 | 177 | AM_RANGE(0x104000, 0x104fff) AM_RAM |
| 178 | 178 | AM_RANGE(0x105000, 0x106fff) AM_RAM |
| 179 | 179 | AM_RANGE(0x107000, 0x1077ff) AM_RAM AM_SHARE("spriteram") |
| r14896 | r14897 | |
| 192 | 192 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(m_fore_data) |
| 193 | 193 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(m_mid_data) |
| 194 | 194 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(m_textram) |
| 195 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 195 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 196 | 196 | AM_RANGE(0x104000, 0x104fff) AM_RAM |
| 197 | 197 | AM_RANGE(0x105000, 0x106fff) AM_RAM |
| 198 | 198 | AM_RANGE(0x107000, 0x1077ff) AM_RAM AM_SHARE("spriteram") |
| r14896 | r14897 | |
| 211 | 211 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(legionna_foreground_w) AM_BASE(m_fore_data) |
| 212 | 212 | AM_RANGE(0x101800, 0x101fff) AM_RAM_WRITE(legionna_midground_w) AM_BASE(m_mid_data) |
| 213 | 213 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(legionna_text_w) AM_BASE(m_textram) |
| 214 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 214 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 215 | 215 | AM_RANGE(0x104000, 0x104fff) AM_RAM |
| 216 | 216 | AM_RANGE(0x105000, 0x106fff) AM_RAM |
| 217 | 217 | AM_RANGE(0x107000, 0x1077ff) AM_RAM AM_SHARE("spriteram") |
| r14896 | r14897 | |
| 234 | 234 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 235 | 235 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("oki", okim_rombank_w) |
| 236 | 236 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 237 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 237 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 238 | 238 | ADDRESS_MAP_END |
| 239 | 239 | |
| 240 | 240 | /*****************************************************************************/ |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | public: |
| 20 | 20 | albazc_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | : driver_device(mconfig, type, tag) { } | |
| 21 | : driver_device(mconfig, type, tag) , | |
| 22 | m_spriteram1(*this, "spriteram1"), | |
| 23 | m_spriteram2(*this, "spriteram2"), | |
| 24 | m_spriteram3(*this, "spriteram3"){ } | |
| 22 | 25 | |
| 23 | 26 | /* video-related */ |
| 24 | UINT8 * m_spriteram1; | |
| 25 | UINT8 * m_spriteram2; | |
| 26 | UINT8 * m_spriteram3; | |
| 27 | required_shared_ptr<UINT8> m_spriteram1; | |
| 28 | required_shared_ptr<UINT8> m_spriteram2; | |
| 29 | required_shared_ptr<UINT8> m_spriteram3; | |
| 27 | 30 | UINT8 m_flip_bit; |
| 28 | 31 | DECLARE_WRITE8_MEMBER(hanaroku_out_0_w); |
| 29 | 32 | DECLARE_WRITE8_MEMBER(hanaroku_out_1_w); |
| r14896 | r14897 | |
| 62 | 65 | |
| 63 | 66 | for (i = 511; i >= 0; i--) |
| 64 | 67 | { |
| 65 | int code = state->m_spriteram1[i] | (state->m_spriteram2[i] << 8); | |
| 66 | int color = (state->m_spriteram2[i + 0x200] & 0xf8) >> 3; | |
| 68 | int code = state->m_spriteram1.target()[i] | (state->m_spriteram2.target()[i] << 8); | |
| 69 | int color = (state->m_spriteram2.target()[i + 0x200] & 0xf8) >> 3; | |
| 67 | 70 | int flipx = 0; |
| 68 | 71 | int flipy = 0; |
| 69 | int sx = state->m_spriteram1[i + 0x200] | ((state->m_spriteram2[i + 0x200] & 0x07) << 8); | |
| 70 | int sy = 242 - state->m_spriteram3[i]; | |
| 72 | int sx = state->m_spriteram1.target()[i + 0x200] | ((state->m_spriteram2.target()[i + 0x200] & 0x07) << 8); | |
| 73 | int sy = 242 - state->m_spriteram3.target()[i]; | |
| 71 | 74 | |
| 72 | 75 | if (state->m_flip_bit) |
| 73 | 76 | { |
| r14896 | r14897 | |
| 145 | 148 | if(offset == 0) |
| 146 | 149 | { |
| 147 | 150 | /* core bug with this? */ |
| 148 | //flip_screen_set( | |
| 151 | //flip_screen_set( | |
| 149 | 152 | m_flip_bit = (data & 0x40) >> 6; |
| 150 | 153 | } |
| 151 | 154 | } |
| r14896 | r14897 | |
| 154 | 157 | |
| 155 | 158 | static ADDRESS_MAP_START( hanaroku_map, AS_PROGRAM, 8, albazc_state ) |
| 156 | 159 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 157 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(m_spriteram1) | |
| 158 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_BASE(m_spriteram2) | |
| 159 | AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_BASE(m_spriteram3) | |
| 160 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("spriteram1") | |
| 161 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_SHARE("spriteram2") | |
| 162 | AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_SHARE("spriteram3") | |
| 160 | 163 | AM_RANGE(0xa200, 0xa2ff) AM_WRITENOP // ??? written once during P.O.S.T. |
| 161 | 164 | AM_RANGE(0xa300, 0xa304) AM_WRITE(albazc_vregs_w) // ??? |
| 162 | 165 | AM_RANGE(0xb000, 0xb000) AM_WRITENOP // ??? always 0x40 |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | public: |
| 63 | 63 | midas_state(const machine_config &mconfig, device_type type, const char *tag) |
| 64 | : driver_device(mconfig, type, tag) { } | |
| 64 | : driver_device(mconfig, type, tag) , | |
| 65 | m_gfxregs(*this, "gfxregs"){ } | |
| 65 | 66 | |
| 66 | 67 | UINT16 *m_gfxram; |
| 67 | UINT16 | |
| 68 | required_shared_ptr<UINT16> | |
| 68 | 69 | tilemap_t *m_tmap; |
| 69 | 70 | DECLARE_READ16_MEMBER(ret_ffff); |
| 70 | 71 | DECLARE_WRITE16_MEMBER(midas_gfxregs_w); |
| r14896 | r14897 | |
| 234 | 235 | { |
| 235 | 236 | case 1: |
| 236 | 237 | { |
| 237 | UINT16 addr = m_gfxregs[0]; | |
| 238 | UINT16 addr = m_gfxregs.target()[0]; | |
| 238 | 239 | m_gfxram[addr] = data; |
| 239 | m_gfxregs[0] += m_gfxregs[2]; | |
| 240 | m_gfxregs.target()[0] += m_gfxregs.target()[2]; | |
| 240 | 241 | |
| 241 | 242 | if ( addr >= 0x7000 && addr <= 0x7fff ) m_tmap->mark_tile_dirty(addr - 0x7000); |
| 242 | 243 | |
| r14896 | r14897 | |
| 274 | 275 | |
| 275 | 276 | AM_RANGE(0x9c0000, 0x9c0005) AM_WRITE(midas_gfxregs_w ) AM_BASE(m_gfxregs ) |
| 276 | 277 | |
| 277 | AM_RANGE(0xa00000, 0xa3ffff) AM_RAM_WRITE(paletteram | |
| 278 | AM_RANGE(0xa00000, 0xa3ffff) AM_RAM_WRITE(paletteram | |
| 278 | 279 | AM_RANGE(0xa40000, 0xa7ffff) AM_RAM |
| 279 | 280 | |
| 280 | 281 | AM_RANGE(0xb00000, 0xb00001) AM_READ(ret_ffff ) |
| r14896 | r14897 | |
| 320 | 321 | { |
| 321 | 322 | if (ACCESSING_BITS_0_7) |
| 322 | 323 | { |
| 323 | ticket_dispenser_w(machine().device("prize1"), 0, (data & 0x0001) << 7); | |
| 324 | ticket_dispenser_w(machine().device("prize2"), 0, (data & 0x0002) << 6); | |
| 325 | ticket_dispenser_w(machine().device("ticket"), 0, (data & 0x0010) << 3); | |
| 324 | machine().device<ticket_dispenser_device>("prize1")->write(space, 0, (data & 0x0001) << 7); | |
| 325 | machine().device<ticket_dispenser_device>("prize2")->write(space, 0, (data & 0x0002) << 6); | |
| 326 | machine().device<ticket_dispenser_device>("ticket")->write(space, 0, (data & 0x0010) << 3); | |
| 326 | 327 | // data & 0x0080 ? |
| 327 | 328 | } |
| 328 | 329 | #ifdef MAME_DEBUG |
| r14896 | r14897 | |
| 353 | 354 | |
| 354 | 355 | AM_RANGE(0x9c0000, 0x9c0005) AM_WRITE(midas_gfxregs_w ) AM_BASE(m_gfxregs ) |
| 355 | 356 | |
| 356 | AM_RANGE(0xa00000, 0xa3ffff) AM_RAM_WRITE(paletteram | |
| 357 | AM_RANGE(0xa00000, 0xa3ffff) AM_RAM_WRITE(paletteram | |
| 357 | 358 | AM_RANGE(0xa40000, 0xa7ffff) AM_RAM |
| 358 | 359 | |
| 359 | 360 | AM_RANGE(0xb00000, 0xb00001) AM_READ(ret_ffff ) |
| r14896 | r14897 | |
| 656 | 657 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 657 | 658 | |
| 658 | 659 | PORT_START("HAMMER") // bc0000 |
| 659 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("prize1", ticket_dispenser_line_r) // prize 1 sensor ("tejisw 1") | |
| 660 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("prize2", ticket_dispenser_line_r) // prize 2 sensor ("tejisw 2") | |
| 660 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("prize1", ticket_dispenser_device, line_r) // prize 1 sensor ("tejisw 1") | |
| 661 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("prize2", ticket_dispenser_device, line_r) // prize 2 sensor ("tejisw 2") | |
| 661 | 662 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 662 | 663 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 663 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 664 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 664 | 665 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 665 | 666 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 666 | 667 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_IMPULSE(5) PORT_NAME( "Hammer" ) |
| r14896 | r14897 | |
| 732 | 733 | |
| 733 | 734 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 734 | 735 | |
| 735 | MCFG_TICKET_DISPENSER_ADD("prize1", 1000*5, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 736 | MCFG_TICKET_DISPENSER_ADD("prize2", 1000*5, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 737 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 736 | MCFG_TICKET_DISPENSER_ADD("prize1", attotime::from_msec(1000*5), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 737 | MCFG_TICKET_DISPENSER_ADD("prize2", attotime::from_msec(1000*5), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 738 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 738 | 739 | |
| 739 | 740 | /* video hardware */ |
| 740 | 741 | MCFG_SCREEN_ADD("screen", RASTER) |
| r14896 | r14897 | |
|---|---|---|
| 262 | 262 | { |
| 263 | 263 | public: |
| 264 | 264 | aristmk4_state(const machine_config &mconfig, device_type type, const char *tag) |
| 265 | : driver_device(mconfig, type, tag) { } | |
| 265 | : driver_device(mconfig, type, tag) , | |
| 266 | m_mkiv_vram(*this, "mkiv_vram"){ } | |
| 266 | 267 | |
| 267 | 268 | int m_rtc_address_strobe; |
| 268 | 269 | int m_rtc_data_strobe; |
| 269 | 270 | samples_device *m_samples; |
| 270 | 271 | UINT8 *m_shapeRomPtr; |
| 271 | 272 | UINT8 m_shapeRom[0xc000]; |
| 272 | UINT8 | |
| 273 | required_shared_ptr<UINT8> | |
| 273 | 274 | UINT8 *m_nvram; |
| 274 | 275 | UINT8 m_psg_data; |
| 275 | 276 | int m_ay8910_1; |
| r14896 | r14897 | |
| 361 | 362 | { |
| 362 | 363 | for (x=38;x--;) |
| 363 | 364 | { |
| 364 | color = ((state->m_mkiv_vram[count]) & 0xe0) >> 5; | |
| 365 | tile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0x3ff; | |
| 366 | bgtile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0xff; // first 256 tiles | |
| 365 | color = ((state->m_mkiv_vram.target()[count]) & 0xe0) >> 5; | |
| 366 | tile = (state->m_mkiv_vram.target()[count+1]|state->m_mkiv_vram.target()[count]<<8) & 0x3ff; | |
| 367 | bgtile = (state->m_mkiv_vram.target()[count+1]|state->m_mkiv_vram.target()[count]<<8) & 0xff; // first 256 tiles | |
| 367 | 368 | uBackgroundColour(screen.machine()); // read sw7 |
| 368 | 369 | gfx_element_decode(gfx, bgtile); // force the machine to update only the first 256 tiles. |
| 369 | 370 | // as we only update the background, not the entire display. |
| 370 | flipx = ((state->m_mkiv_vram[count]) & 0x04); | |
| 371 | flipy = ((state->m_mkiv_vram[count]) & 0x08); | |
| 371 | flipx = ((state->m_mkiv_vram.target()[count]) & 0x04); | |
| 372 | flipy = ((state->m_mkiv_vram.target()[count]) & 0x08); | |
| 372 | 373 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color,flipx,flipy,(38-x-1)<<3,(27-y-1)<<3); |
| 373 | 374 | count+=2; |
| 374 | 375 | } |
| r14896 | r14897 | |
| 875 | 876 | ******************************************************************************/ |
| 876 | 877 | |
| 877 | 878 | static ADDRESS_MAP_START( aristmk4_map, AS_PROGRAM, 8, aristmk4_state ) |
| 878 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_ | |
| 879 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_ | |
| 879 | 880 | AM_RANGE(0x0800, 0x17ff) AM_RAM |
| 880 | 881 | AM_RANGE(0x1800, 0x1800) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w) |
| 881 | 882 | AM_RANGE(0x1801, 0x1801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| r14896 | r14897 | |
| 919 | 920 | */ |
| 920 | 921 | |
| 921 | 922 | static ADDRESS_MAP_START( aristmk4_poker_map, AS_PROGRAM, 8, aristmk4_state ) |
| 922 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_ | |
| 923 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_ | |
| 923 | 924 | AM_RANGE(0x0800, 0x17ff) AM_RAM |
| 924 | 925 | AM_RANGE(0x1800, 0x1800) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w) |
| 925 | 926 | AM_RANGE(0x1801, 0x1801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| r14896 | r14897 | |
|---|---|---|
| 48 | 48 | { |
| 49 | 49 | |
| 50 | 50 | if (m_palette_selected) |
| 51 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 51 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 52 | 52 | else |
| 53 | 53 | m_ram[offset] = data; |
| 54 | 54 | } |
| r14896 | r14897 | |
| 91 | 91 | logerror("%04x pmc internal ram %04x = %02x\n",cpu_get_pc(&space.device()),offset,data); |
| 92 | 92 | } |
| 93 | 93 | else |
| 94 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 94 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /* |
| r14896 | r14897 | |
| 397 | 397 | |
| 398 | 398 | static ADDRESS_MAP_START( scontra_map, AS_PROGRAM, 8, thunderx_state ) |
| 399 | 399 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(scontra_bankswitch_w) /* bankswitch control + coin counters */ |
| 400 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_w) | |
| 400 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w) | |
| 401 | 401 | AM_RANGE(0x1f88, 0x1f88) AM_WRITE(thunderx_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 402 | 402 | AM_RANGE(0x1f8c, 0x1f8c) AM_WRITE(watchdog_reset_w) |
| 403 | 403 | AM_RANGE(0x1f90, 0x1f90) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 417 | 417 | |
| 418 | 418 | static ADDRESS_MAP_START( thunderx_map, AS_PROGRAM, 8, thunderx_state ) |
| 419 | 419 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(thunderx_videobank_w) |
| 420 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_w) | |
| 420 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w) | |
| 421 | 421 | AM_RANGE(0x1f88, 0x1f88) AM_WRITE(thunderx_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 422 | 422 | AM_RANGE(0x1f8c, 0x1f8c) AM_WRITE(watchdog_reset_w) |
| 423 | 423 | AM_RANGE(0x1f90, 0x1f90) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 438 | 438 | static ADDRESS_MAP_START( scontra_sound_map, AS_PROGRAM, 8, thunderx_state ) |
| 439 | 439 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM */ |
| 440 | 440 | AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ |
| 441 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 441 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 442 | 442 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */ |
| 443 | 443 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */ |
| 444 | 444 | AM_RANGE(0xf000, 0xf000) AM_DEVWRITE_LEGACY("k007232", scontra_snd_bankswitch_w) /* 007232 bank select */ |
| r14896 | r14897 | |
| 447 | 447 | static ADDRESS_MAP_START( thunderx_sound_map, AS_PROGRAM, 8, thunderx_state ) |
| 448 | 448 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 449 | 449 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 450 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 450 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 451 | 451 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 452 | 452 | ADDRESS_MAP_END |
| 453 | 453 |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | public: |
| 51 | 51 | galaxi_state(const machine_config &mconfig, device_type type, const char *tag) |
| 52 | : driver_device(mconfig, type, tag) { } | |
| 52 | : driver_device(mconfig, type, tag) , | |
| 53 | m_bg1_ram(*this, "bg1_ram"), | |
| 54 | m_bg2_ram(*this, "bg2_ram"), | |
| 55 | m_bg3_ram(*this, "bg3_ram"), | |
| 56 | m_bg4_ram(*this, "bg4_ram"), | |
| 57 | m_fg_ram(*this, "fg_ram"){ } | |
| 53 | 58 | |
| 54 | 59 | /* memory pointers */ |
| 55 | UINT16 * m_bg1_ram; | |
| 56 | UINT16 * m_bg2_ram; | |
| 57 | UINT16 * m_bg3_ram; | |
| 58 | UINT16 * m_bg4_ram; | |
| 59 | UINT16 * m_fg_ram; | |
| 60 | required_shared_ptr<UINT16> m_bg1_ram; | |
| 61 | required_shared_ptr<UINT16> m_bg2_ram; | |
| 62 | required_shared_ptr<UINT16> m_bg3_ram; | |
| 63 | required_shared_ptr<UINT16> m_bg4_ram; | |
| 64 | required_shared_ptr<UINT16> m_fg_ram; | |
| 60 | 65 | // UINT16 * m_paletteram; // currently this uses generic palette handling |
| 61 | 66 | // UINT16 * m_nvram; // currently this uses generic nvram handling |
| 62 | 67 | |
| r14896 | r14897 | |
| 91 | 96 | static TILE_GET_INFO( get_bg1_tile_info ) |
| 92 | 97 | { |
| 93 | 98 | galaxi_state *state = machine.driver_data<galaxi_state>(); |
| 94 | UINT16 code = state->m_bg1_ram[tile_index]; | |
| 99 | UINT16 code = state->m_bg1_ram.target()[tile_index]; | |
| 95 | 100 | SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0); |
| 96 | 101 | } |
| 97 | 102 | |
| 98 | 103 | static TILE_GET_INFO( get_bg2_tile_info ) |
| 99 | 104 | { |
| 100 | 105 | galaxi_state *state = machine.driver_data<galaxi_state>(); |
| 101 | UINT16 code = state->m_bg2_ram[tile_index]; | |
| 106 | UINT16 code = state->m_bg2_ram.target()[tile_index]; | |
| 102 | 107 | SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0); |
| 103 | 108 | } |
| 104 | 109 | |
| 105 | 110 | static TILE_GET_INFO( get_bg3_tile_info ) |
| 106 | 111 | { |
| 107 | 112 | galaxi_state *state = machine.driver_data<galaxi_state>(); |
| 108 | UINT16 code = state->m_bg3_ram[tile_index]; | |
| 113 | UINT16 code = state->m_bg3_ram.target()[tile_index]; | |
| 109 | 114 | SET_TILE_INFO(0, code, (code >> 12), 0); |
| 110 | 115 | } |
| 111 | 116 | |
| 112 | 117 | static TILE_GET_INFO( get_bg4_tile_info ) |
| 113 | 118 | { |
| 114 | 119 | galaxi_state *state = machine.driver_data<galaxi_state>(); |
| 115 | UINT16 code = state->m_bg4_ram[tile_index]; | |
| 120 | UINT16 code = state->m_bg4_ram.target()[tile_index]; | |
| 116 | 121 | SET_TILE_INFO(0, code, (code >> 12), 0); |
| 117 | 122 | } |
| 118 | 123 | |
| 119 | 124 | static TILE_GET_INFO( get_fg_tile_info ) |
| 120 | 125 | { |
| 121 | 126 | galaxi_state *state = machine.driver_data<galaxi_state>(); |
| 122 | UINT16 code = state->m_fg_ram[tile_index]; | |
| 127 | UINT16 code = state->m_fg_ram.target()[tile_index]; | |
| 123 | 128 | SET_TILE_INFO(1, code, 0x20 + (code >> 12), 0); |
| 124 | 129 | } |
| 125 | 130 | |
| 126 | 131 | WRITE16_MEMBER(galaxi_state::galaxi_bg1_w) |
| 127 | 132 | { |
| 128 | COMBINE_DATA(&m_bg1_ram[offset]); | |
| 133 | COMBINE_DATA(&m_bg1_ram.target()[offset]); | |
| 129 | 134 | m_bg1_tmap->mark_tile_dirty(offset); |
| 130 | 135 | } |
| 131 | 136 | |
| 132 | 137 | WRITE16_MEMBER(galaxi_state::galaxi_bg2_w) |
| 133 | 138 | { |
| 134 | COMBINE_DATA(&m_bg2_ram[offset]); | |
| 139 | COMBINE_DATA(&m_bg2_ram.target()[offset]); | |
| 135 | 140 | m_bg2_tmap->mark_tile_dirty(offset); |
| 136 | 141 | } |
| 137 | 142 | |
| 138 | 143 | WRITE16_MEMBER(galaxi_state::galaxi_bg3_w) |
| 139 | 144 | { |
| 140 | COMBINE_DATA(&m_bg3_ram[offset]); | |
| 145 | COMBINE_DATA(&m_bg3_ram.target()[offset]); | |
| 141 | 146 | m_bg3_tmap->mark_tile_dirty(offset); |
| 142 | 147 | } |
| 143 | 148 | |
| 144 | 149 | WRITE16_MEMBER(galaxi_state::galaxi_bg4_w) |
| 145 | 150 | { |
| 146 | COMBINE_DATA(&m_bg4_ram[offset]); | |
| 151 | COMBINE_DATA(&m_bg4_ram.target()[offset]); | |
| 147 | 152 | m_bg4_tmap->mark_tile_dirty(offset); |
| 148 | 153 | } |
| 149 | 154 | |
| 150 | 155 | WRITE16_MEMBER(galaxi_state::galaxi_fg_w) |
| 151 | 156 | { |
| 152 | COMBINE_DATA(&m_fg_ram[offset]); | |
| 157 | COMBINE_DATA(&m_fg_ram.target()[offset]); | |
| 153 | 158 | m_fg_tmap->mark_tile_dirty(offset); |
| 154 | 159 | } |
| 155 | 160 | |
| r14896 | r14897 | |
| 275 | 280 | static ADDRESS_MAP_START( galaxi_map, AS_PROGRAM, 16, galaxi_state ) |
| 276 | 281 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 277 | 282 | |
| 278 | AM_RANGE(0x100000, 0x1003ff) AM_RAM_WRITE(galaxi_bg1_w) AM_BASE(m_bg1_ram) | |
| 279 | AM_RANGE(0x100400, 0x1007ff) AM_RAM_WRITE(galaxi_bg2_w) AM_BASE(m_bg2_ram) | |
| 280 | AM_RANGE(0x100800, 0x100bff) AM_RAM_WRITE(galaxi_bg3_w) AM_BASE(m_bg3_ram) | |
| 281 | AM_RANGE(0x100c00, 0x100fff) AM_RAM_WRITE(galaxi_bg4_w) AM_BASE(m_bg4_ram) | |
| 283 | AM_RANGE(0x100000, 0x1003ff) AM_RAM_WRITE(galaxi_bg1_w) AM_SHARE("bg1_ram") | |
| 284 | AM_RANGE(0x100400, 0x1007ff) AM_RAM_WRITE(galaxi_bg2_w) AM_SHARE("bg2_ram") | |
| 285 | AM_RANGE(0x100800, 0x100bff) AM_RAM_WRITE(galaxi_bg3_w) AM_SHARE("bg3_ram") | |
| 286 | AM_RANGE(0x100c00, 0x100fff) AM_RAM_WRITE(galaxi_bg4_w) AM_SHARE("bg4_ram") | |
| 282 | 287 | |
| 283 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(galaxi_fg_w ) AM_ | |
| 288 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(galaxi_fg_w ) AM_ | |
| 284 | 289 | AM_RANGE(0x102000, 0x1047ff) AM_READNOP // unknown |
| 285 | 290 | |
| 286 | AM_RANGE(0x300000, 0x3007ff) AM_RAM_WRITE(paletteram | |
| 291 | AM_RANGE(0x300000, 0x3007ff) AM_RAM_WRITE(paletteram | |
| 287 | 292 | |
| 288 | 293 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("INPUTS") |
| 289 | 294 | AM_RANGE(0x500000, 0x500001) AM_WRITE(galaxi_500000_w) |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | public: |
| 44 | 44 | murogmbl_state(const machine_config &mconfig, device_type type, const char *tag) |
| 45 | : driver_device(mconfig, type, tag) { } | |
| 45 | : driver_device(mconfig, type, tag) , | |
| 46 | m_video(*this, "video"){ } | |
| 46 | 47 | |
| 47 | UINT8 | |
| 48 | required_shared_ptr<UINT8> m_video; | |
| 48 | 49 | }; |
| 49 | 50 | |
| 50 | 51 | |
| r14896 | r14897 | |
| 77 | 78 | AM_RANGE(0x0000, 0x1fFf) AM_ROM |
| 78 | 79 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 79 | 80 | AM_RANGE(0x4800, 0x4bff) AM_RAM |
| 80 | AM_RANGE(0x5800, 0x5bff) AM_RAM AM_ | |
| 81 | AM_RANGE(0x5800, 0x5bff) AM_RAM AM_ | |
| 81 | 82 | AM_RANGE(0x5c00, 0x5fff) AM_RAM |
| 82 | 83 | AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0") |
| 83 | 84 | AM_RANGE(0x6800, 0x6800) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 102 | 103 | { |
| 103 | 104 | for (x = 0; x < 32; x++) |
| 104 | 105 | { |
| 105 | int tile = state->m_video[count]; | |
| 106 | int tile = state->m_video.target()[count]; | |
| 106 | 107 | drawgfx_opaque(bitmap, cliprect, gfx, tile, 0, 0, 0, x * 8, y * 8); |
| 107 | 108 | |
| 108 | 109 | count++; |
| r14896 | r14897 | |
|---|---|---|
| 144 | 144 | AM_RANGE( 0x31, 0x31) AM_READ(subcpu_halt_clear) |
| 145 | 145 | AM_RANGE( 0x32, 0x32) AM_READ(subcpu_comm_status) |
| 146 | 146 | AM_RANGE( 0x33, 0x33) AM_READ(soundcpu_status_r) |
| 147 | AM_RANGE( 0x40, 0x4f) AM_WRITE(soundlatch_w) | |
| 147 | AM_RANGE( 0x40, 0x4f) AM_WRITE(soundlatch_byte_w) | |
| 148 | 148 | AM_RANGE( 0x50, 0x50) AM_WRITE(bank_w) |
| 149 | 149 | AM_RANGE( 0x60, 0x61) AM_MIRROR(0x02) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 150 | 150 | /* not sure, but the A1 line is ignored, code @ $8b8 */ |
| r14896 | r14897 | |
| 193 | 193 | |
| 194 | 194 | static ADDRESS_MAP_START( soundcpu_io_map, AS_IO, 8, sothello_state ) |
| 195 | 195 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 196 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 196 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 197 | 197 | AM_RANGE(0x01, 0x01) AM_WRITE(msm_data_w) |
| 198 | 198 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("msm", msm_cfg_w) |
| 199 | 199 | AM_RANGE(0x03, 0x03) AM_WRITE(soundcpu_busyflag_set_w) |
| r14896 | r14897 | |
|---|---|---|
| 511 | 511 | |
| 512 | 512 | static WRITE8_DEVICE_HANDLER( flip ) |
| 513 | 513 | { |
| 514 | flip_screen_set(device->machine(), data & 1); | |
| 514 | toypop_state *state = device->machine().driver_data<toypop_state>(); | |
| 515 | state->flip_screen_set(data & 1); | |
| 515 | 516 | } |
| 516 | 517 | |
| 517 | 518 | /* chip #0: player inputs, buttons, coins */ |
| r14896 | r14897 | |
|---|---|---|
| 350 | 350 | |
| 351 | 351 | WRITE16_MEMBER(tumbleb_state::jumppop_sound_w) |
| 352 | 352 | { |
| 353 | soundlatch_w(space, 0, data & 0xff); | |
| 353 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 354 | 354 | device_set_input_line(m_audiocpu, 0, ASSERT_LINE); |
| 355 | 355 | } |
| 356 | 356 | |
| r14896 | r14897 | |
| 654 | 654 | #endif |
| 655 | 655 | AM_RANGE(0x100000, 0x100001) AM_READWRITE(tumblepb_prot_r, tumblepb_oki_w) |
| 656 | 656 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(m_mainram) |
| 657 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 657 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 658 | 658 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* Bootleg sprite buffer */ |
| 659 | 659 | AM_RANGE(0x160800, 0x160807) AM_WRITEONLY /* writes past the end of spriteram */ |
| 660 | 660 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| r14896 | r14897 | |
| 676 | 676 | #endif |
| 677 | 677 | AM_RANGE(0x100000, 0x100003) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2151_r, ym2151_w, 0x00ff) |
| 678 | 678 | AM_RANGE(0x100004, 0x100005) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 679 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram | |
| 679 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram | |
| 680 | 680 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* sprites */ |
| 681 | 681 | AM_RANGE(0x160800, 0x16080f) AM_WRITEONLY /* goes slightly past the end of spriteram? */ |
| 682 | 682 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| r14896 | r14897 | |
| 704 | 704 | AM_RANGE(0x100000, 0x100001) AM_WRITE(semicom_soundcmd_w) |
| 705 | 705 | AM_RANGE(0x100002, 0x100003) AM_WRITE(bcstory_tilebank_w) |
| 706 | 706 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(m_mainram) |
| 707 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 707 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 708 | 708 | AM_RANGE(0x160000, 0x160fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* Bootleg sprite buffer */ |
| 709 | 709 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| 710 | 710 | AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP |
| r14896 | r14897 | |
| 720 | 720 | static ADDRESS_MAP_START( jumppop_main_map, AS_PROGRAM, 16, tumbleb_state ) |
| 721 | 721 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 722 | 722 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(m_mainram) |
| 723 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 723 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 724 | 724 | AM_RANGE(0x160000, 0x160fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* Bootleg sprite buffer */ |
| 725 | 725 | AM_RANGE(0x180000, 0x180001) AM_NOP /* IRQ ack? */ |
| 726 | 726 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("PLAYERS") |
| r14896 | r14897 | |
| 735 | 735 | |
| 736 | 736 | WRITE16_MEMBER(tumbleb_state::jumpkids_sound_w) |
| 737 | 737 | { |
| 738 | soundlatch_w(space, 0, data & 0xff); | |
| 738 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 739 | 739 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 740 | 740 | } |
| 741 | 741 | |
| r14896 | r14897 | |
| 745 | 745 | AM_RANGE(0xa00000, 0xa0000f) AM_RAM AM_BASE(m_control) |
| 746 | 746 | AM_RANGE(0xa20000, 0xa20fff) AM_RAM_WRITE(tumblepb_pf1_data_w) AM_BASE(m_pf1_data) |
| 747 | 747 | AM_RANGE(0xa22000, 0xa22fff) AM_RAM_WRITE(tumblepb_pf2_data_w) AM_BASE(m_pf2_data) |
| 748 | AM_RANGE(0xcf0000, 0xcf05ff) AM_RAM_WRITE(paletteram | |
| 748 | AM_RANGE(0xcf0000, 0xcf05ff) AM_RAM_WRITE(paletteram | |
| 749 | 749 | AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("PLAYERS") AM_WRITE(suprtrio_tilebank_w) |
| 750 | 750 | AM_RANGE(0xe40000, 0xe40001) AM_READ_PORT("SYSTEM") |
| 751 | 751 | AM_RANGE(0xe80002, 0xe80003) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 756 | 756 | static ADDRESS_MAP_START( pangpang_main_map, AS_PROGRAM, 16, tumbleb_state ) |
| 757 | 757 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 758 | 758 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(m_mainram) |
| 759 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 759 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 760 | 760 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* Bootleg sprite buffer */ |
| 761 | 761 | AM_RANGE(0x160800, 0x160807) AM_WRITEONLY // writes past the end of spriteram |
| 762 | 762 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| r14896 | r14897 | |
| 773 | 773 | { |
| 774 | 774 | if (ACCESSING_BITS_0_7) |
| 775 | 775 | { |
| 776 | soundlatch_w(space, 0, data & 0xff); | |
| 776 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 777 | 777 | // needed for Super Trio which reads the sound with polling |
| 778 | 778 | // device_spin_until_time(&space.device(), attotime::from_usec(100)); |
| 779 | 779 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20)); |
| r14896 | r14897 | |
| 793 | 793 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 794 | 794 | AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 795 | 795 | //AM_RANGE(0xf006, 0xf006) ?? |
| 796 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) | |
| 796 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_byte_r) | |
| 797 | 797 | AM_RANGE(0xf00e, 0xf00e) AM_WRITE(oki_sound_bank_w) |
| 798 | 798 | ADDRESS_MAP_END |
| 799 | 799 | |
| r14896 | r14897 | |
| 802 | 802 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 803 | 803 | AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 804 | 804 | //AM_RANGE(0xf006, 0xf006) ?? |
| 805 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) | |
| 805 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_byte_r) | |
| 806 | 806 | AM_RANGE(0xf00e, 0xf00e) AM_WRITE(oki_sound_bank_w) |
| 807 | 807 | ADDRESS_MAP_END |
| 808 | 808 | |
| r14896 | r14897 | |
| 820 | 820 | READ8_MEMBER(tumbleb_state::jumppop_z80latch_r) |
| 821 | 821 | { |
| 822 | 822 | device_set_input_line(m_audiocpu, 0, CLEAR_LINE); |
| 823 | return soundlatch_r(space, 0); | |
| 823 | return soundlatch_byte_r(space, 0); | |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | static ADDRESS_MAP_START( jumppop_sound_io_map, AS_IO, 8, tumbleb_state ) |
| r14896 | r14897 | |
| 839 | 839 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 840 | 840 | AM_RANGE(0x100000, 0x100001) AM_WRITE(jumpkids_sound_w) |
| 841 | 841 | AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(m_mainram) |
| 842 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 842 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 843 | 843 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* Bootleg sprite buffer */ |
| 844 | 844 | AM_RANGE(0x160800, 0x160807) AM_WRITEONLY /* writes past the end of spriteram */ |
| 845 | 845 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepopb_controls_r) |
| r14896 | r14897 | |
| 868 | 868 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 869 | 869 | AM_RANGE(0x9000, 0x9000) AM_WRITE(jumpkids_oki_bank_w) |
| 870 | 870 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 871 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 871 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 872 | 872 | ADDRESS_MAP_END |
| 873 | 873 | |
| 874 | 874 | |
| r14896 | r14897 | |
| 3755 | 3755 | |
| 3756 | 3756 | /* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */ |
| 3757 | 3757 | tumbleb_state *state = machine.driver_data<tumbleb_state>(); |
| 3758 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x140000, 0x140fff, write16_delegate(FUNC(tumbleb_state::paletteram | |
| 3758 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x140000, 0x140fff, write16_delegate(FUNC(tumbleb_state::paletteram | |
| 3759 | 3759 | |
| 3760 | 3760 | /* slightly different banking */ |
| 3761 | 3761 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x100002, 0x100003, write16_delegate(FUNC(tumbleb_state::chokchok_tilebank_w),state)); |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra); |
| 51 | 51 | |
| 52 | ||
| 52 | ||
| 53 | 53 | { |
| 54 | 54 | if (ACCESSING_BITS_16_23) |
| 55 | 55 | { |
| 56 | 56 | data = (data >> 16) & 1; |
| 57 | 57 | |
| 58 | 58 | /* switch banks as appropriate */ |
| 59 | memory_set_bank( | |
| 59 | memory_set_bank( | |
| 60 | 60 | |
| 61 | 61 | /* swap the write handlers between ROM and bank 1 based on the bit */ |
| 62 | 62 | if ((data & 1) == 0) |
| 63 | 63 | /* overlay disabled, map RAM on 0x000000 */ |
| 64 | space | |
| 64 | space. | |
| 65 | 65 | else |
| 66 | 66 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |
| 67 | space | |
| 67 | space. | |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| r14896 | r14897 | |
| 128 | 128 | AM_RANGE(0x800000, 0x800003) AM_READ_PORT("DIPSW1") |
| 129 | 129 | AM_RANGE(0x800010, 0x800013) AM_READ_PORT("DIPSW2") |
| 130 | 130 | AM_RANGE(0xb80000, 0xb8003f) AM_DEVREADWRITE_LEGACY("akiko", amiga_akiko32_r, amiga_akiko32_w) |
| 131 | AM_RANGE(0xbfa000, 0xbfa003) AM_WRITE | |
| 131 | AM_RANGE(0xbfa000, 0xbfa003) AM_WRITE | |
| 132 | 132 | AM_RANGE(0xbfd000, 0xbfefff) AM_READWRITE16_LEGACY(amiga_cia_r, amiga_cia_w, 0xffffffff) |
| 133 | 133 | AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE16_LEGACY(amiga_custom_r, amiga_custom_w, 0xffffffff) AM_BASE(m_custom_regs) |
| 134 | 134 | AM_RANGE(0xe00000, 0xe7ffff) AM_ROM AM_REGION("user1", 0x80000) /* CD32 Extended ROM */ |
| r14896 | r14897 | |
|---|---|---|
| 275 | 275 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 276 | 276 | AM_RANGE(0xfd00, 0xfd01) AM_DEVREADWRITE_LEGACY("ym2151", ym2151_r, ym2151_w) |
| 277 | 277 | AM_RANGE(0xfe00, 0xfe00) AM_DEVWRITE_LEGACY("upd7759", micro3d_upd7759_w) |
| 278 | AM_RANGE(0xff00, 0xff00) AM_WRITE_LEGACY(micro3d_snd_dac_a) | |
| 279 | AM_RANGE(0xff01, 0xff01) AM_WRITE_LEGACY(micro3d_snd_dac_b) | |
| 280 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE_LEGACY(micro3d_sound_io_r, micro3d_sound_io_w) | |
| 278 | AM_RANGE(0xff00, 0xff00) AM_WRITE(micro3d_snd_dac_a) | |
| 279 | AM_RANGE(0xff01, 0xff01) AM_WRITE(micro3d_snd_dac_b) | |
| 280 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(micro3d_sound_io_r, micro3d_sound_io_w) | |
| 281 | 281 | ADDRESS_MAP_END |
| 282 | 282 | |
| 283 | 283 |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | AM_RANGE(0xd400, 0xd400) AM_READ_PORT("IN0") AM_WRITENOP /* interrupt ack? */ |
| 62 | 62 | AM_RANGE(0xd402, 0xd402) AM_READ_PORT("IN1") AM_WRITE(momoko_flipscreen_w) |
| 63 | 63 | AM_RANGE(0xd404, 0xd404) AM_WRITE(watchdog_reset_w) |
| 64 | AM_RANGE(0xd406, 0xd406) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_w) | |
| 64 | AM_RANGE(0xd406, 0xd406) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_byte_w) | |
| 65 | 65 | AM_RANGE(0xd407, 0xd407) AM_READ_PORT("DSW1") |
| 66 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_be_w) AM_SHARE("paletteram") | |
| 66 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_be_w) AM_SHARE("paletteram") | |
| 67 | 67 | AM_RANGE(0xdc00, 0xdc00) AM_WRITE(momoko_fg_scrolly_w) |
| 68 | 68 | AM_RANGE(0xdc01, 0xdc01) AM_WRITE(momoko_fg_scrollx_w) |
| 69 | 69 | AM_RANGE(0xdc02, 0xdc02) AM_WRITE(momoko_fg_select_w) |
| r14896 | r14897 | |
| 217 | 217 | { |
| 218 | 218 | AY8910_LEGACY_OUTPUT, |
| 219 | 219 | AY8910_DEFAULT_LOADS, |
| 220 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 220 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 221 | 221 | DEVCB_NULL, |
| 222 | 222 | DEVCB_NULL, |
| 223 | 223 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | { |
| 31 | 31 | public: |
| 32 | 32 | cabaret_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | : driver_device(mconfig, type, tag) { } | |
| 33 | : driver_device(mconfig, type, tag) , | |
| 34 | m_fg_tile_ram(*this, "fg_tile_ram"), | |
| 35 | m_fg_color_ram(*this, "fg_color_ram"), | |
| 36 | m_bg_scroll(*this, "bg_scroll"), | |
| 37 | m_bg_tile_ram(*this, "bg_tile_ram"){ } | |
| 34 | 38 | |
| 35 | UINT8 *m_bg_tile_ram; | |
| 39 | required_shared_ptr<UINT8> m_fg_tile_ram; | |
| 40 | required_shared_ptr<UINT8> m_fg_color_ram; | |
| 41 | required_shared_ptr<UINT8> m_bg_scroll; | |
| 42 | required_shared_ptr<UINT8> m_bg_tile_ram; | |
| 36 | 43 | tilemap_t *m_bg_tilemap; |
| 37 | UINT8 *m_bg_scroll; | |
| 38 | UINT8 *m_fg_tile_ram; | |
| 39 | UINT8 *m_fg_color_ram; | |
| 40 | 44 | tilemap_t *m_fg_tilemap; |
| 41 | 45 | int m_nmi_enable; |
| 42 | 46 | UINT8 m_out[3]; |
| r14896 | r14897 | |
| 59 | 63 | |
| 60 | 64 | WRITE8_MEMBER(cabaret_state::bg_scroll_w) |
| 61 | 65 | { |
| 62 | m_bg_scroll[offset] = data; | |
| 66 | m_bg_scroll.target()[offset] = data; | |
| 63 | 67 | m_bg_tilemap->set_scrolly(offset,data); |
| 64 | 68 | } |
| 65 | 69 | |
| 66 | 70 | WRITE8_MEMBER(cabaret_state::bg_tile_w) |
| 67 | 71 | { |
| 68 | m_bg_tile_ram[offset] = data; | |
| 72 | m_bg_tile_ram.target()[offset] = data; | |
| 69 | 73 | m_bg_tilemap->mark_tile_dirty(offset); |
| 70 | 74 | } |
| 71 | 75 | |
| 72 | 76 | static TILE_GET_INFO( get_bg_tile_info ) |
| 73 | 77 | { |
| 74 | 78 | cabaret_state *state = machine.driver_data<cabaret_state>(); |
| 75 | int code = state->m_bg_tile_ram[tile_index]; | |
| 79 | int code = state->m_bg_tile_ram.target()[tile_index]; | |
| 76 | 80 | SET_TILE_INFO(1, code & 0xff, 0, 0); |
| 77 | 81 | } |
| 78 | 82 | |
| 79 | 83 | static TILE_GET_INFO( get_fg_tile_info ) |
| 80 | 84 | { |
| 81 | 85 | cabaret_state *state = machine.driver_data<cabaret_state>(); |
| 82 | int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8); | |
| 86 | int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8); | |
| 83 | 87 | int tile = code & 0x1fff; |
| 84 | 88 | SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0); |
| 85 | 89 | } |
| 86 | 90 | |
| 87 | 91 | WRITE8_MEMBER(cabaret_state::fg_tile_w) |
| 88 | 92 | { |
| 89 | m_fg_tile_ram[offset] = data; | |
| 93 | m_fg_tile_ram.target()[offset] = data; | |
| 90 | 94 | m_fg_tilemap->mark_tile_dirty(offset); |
| 91 | 95 | } |
| 92 | 96 | |
| 93 | 97 | WRITE8_MEMBER(cabaret_state::fg_color_w) |
| 94 | 98 | { |
| 95 | m_fg_color_ram[offset] = data; | |
| 99 | m_fg_color_ram.target()[offset] = data; | |
| 96 | 100 | m_fg_tilemap->mark_tile_dirty(offset); |
| 97 | 101 | } |
| 98 | 102 | |
| r14896 | r14897 | |
| 177 | 181 | AM_RANGE( 0x2000, 0x27ff ) AM_RAM_WRITE(fg_tile_w ) AM_BASE(m_fg_tile_ram ) |
| 178 | 182 | AM_RANGE( 0x2800, 0x2fff ) AM_RAM_WRITE(fg_color_w ) AM_BASE(m_fg_color_ram ) |
| 179 | 183 | |
| 180 | AM_RANGE( 0x3000, 0x37ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 181 | AM_RANGE( 0x3800, 0x3fff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 184 | AM_RANGE( 0x3000, 0x37ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 185 | AM_RANGE( 0x3800, 0x3fff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 182 | 186 | |
| 183 | 187 | AM_RANGE( 0x1000, 0x103f ) AM_RAM_WRITE(bg_scroll_w ) AM_BASE(m_bg_scroll ) |
| 184 | 188 |
| r14896 | r14897 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | WRITE8_MEMBER(kchamp_state::sound_command_w) |
| 96 | 96 | { |
| 97 | soundlatch_w(space, 0, data); | |
| 97 | soundlatch_byte_w(space, 0, data); | |
| 98 | 98 | device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); |
| 99 | 99 | } |
| 100 | 100 | |
| r14896 | r14897 | |
| 132 | 132 | static ADDRESS_MAP_START( kchampvs_sound_io_map, AS_IO, 8, kchamp_state ) |
| 133 | 133 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 134 | 134 | AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w) |
| 135 | AM_RANGE(0x01, 0x01) AM_READ(soundlatch_r) | |
| 135 | AM_RANGE(0x01, 0x01) AM_READ(soundlatch_byte_r) | |
| 136 | 136 | AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w) |
| 137 | 137 | AM_RANGE(0x04, 0x04) AM_WRITE(sound_msm_w) |
| 138 | 138 | AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("msm", sound_control_w) |
| r14896 | r14897 | |
| 187 | 187 | AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w) |
| 188 | 188 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 189 | 189 | AM_RANGE(0x05, 0x05) AM_WRITE(kc_sound_control_w) |
| 190 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r) | |
| 190 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r) | |
| 191 | 191 | ADDRESS_MAP_END |
| 192 | 192 | |
| 193 | 193 | static INPUT_PORTS_START( kchampvs ) |
| r14896 | r14897 | |
|---|---|---|
| 59 | 59 | { |
| 60 | 60 | public: |
| 61 | 61 | olibochu_state(const machine_config &mconfig, device_type type, const char *tag) |
| 62 | : driver_device(mconfig, type, tag) { } | |
| 62 | : driver_device(mconfig, type, tag) , | |
| 63 | m_videoram(*this, "videoram"), | |
| 64 | m_colorram(*this, "colorram"), | |
| 65 | m_spriteram(*this, "spriteram"), | |
| 66 | m_spriteram2(*this, "spriteram2"){ } | |
| 63 | 67 | |
| 64 | 68 | /* memory pointers */ |
| 65 | UINT8 * m_videoram; | |
| 66 | UINT8 * m_colorram; | |
| 67 | UINT8 * m_spriteram; | |
| 68 | UINT8 * m_spriteram2; | |
| 69 | required_shared_ptr<UINT8> m_videoram; | |
| 70 | required_shared_ptr<UINT8> m_colorram; | |
| 71 | required_shared_ptr<UINT8> m_spriteram; | |
| 72 | required_shared_ptr<UINT8> m_spriteram2; | |
| 69 | 73 | // UINT8 * m_paletteram; // currently this uses generic palette handling |
| 70 | size_t m_spriteram_size; | |
| 71 | size_t m_spriteram2_size; | |
| 72 | 74 | |
| 73 | 75 | /* video-related */ |
| 74 | 76 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 122 | 124 | |
| 123 | 125 | WRITE8_MEMBER(olibochu_state::olibochu_videoram_w) |
| 124 | 126 | { |
| 125 | m_videoram[offset] = data; | |
| 127 | m_videoram.target()[offset] = data; | |
| 126 | 128 | m_bg_tilemap->mark_tile_dirty(offset); |
| 127 | 129 | } |
| 128 | 130 | |
| 129 | 131 | WRITE8_MEMBER(olibochu_state::olibochu_colorram_w) |
| 130 | 132 | { |
| 131 | m_colorram[offset] = data; | |
| 133 | m_colorram.target()[offset] = data; | |
| 132 | 134 | m_bg_tilemap->mark_tile_dirty(offset); |
| 133 | 135 | } |
| 134 | 136 | |
| 135 | 137 | WRITE8_MEMBER(olibochu_state::olibochu_flipscreen_w) |
| 136 | 138 | { |
| 137 | if (flip_screen | |
| 139 | if (flip_screen | |
| 138 | 140 | { |
| 139 | flip_screen_set( | |
| 141 | flip_screen_set( | |
| 140 | 142 | machine().tilemap().mark_all_dirty(); |
| 141 | 143 | } |
| 142 | 144 | |
| r14896 | r14897 | |
| 146 | 148 | static TILE_GET_INFO( get_bg_tile_info ) |
| 147 | 149 | { |
| 148 | 150 | olibochu_state *state = machine.driver_data<olibochu_state>(); |
| 149 | int attr = state->m_colorram[tile_index]; | |
| 150 | int code = state->m_videoram[tile_index] + ((attr & 0x20) << 3); | |
| 151 | int attr = state->m_colorram.target()[tile_index]; | |
| 152 | int code = state->m_videoram.target()[tile_index] + ((attr & 0x20) << 3); | |
| 151 | 153 | int color = (attr & 0x1f) + 0x20; |
| 152 | 154 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 153 | 155 | |
| r14896 | r14897 | |
| 163 | 165 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 164 | 166 | { |
| 165 | 167 | olibochu_state *state = machine.driver_data<olibochu_state>(); |
| 166 | UINT8 *spriteram = state->m_spriteram; | |
| 167 | UINT8 *spriteram_2 = state->m_spriteram2; | |
| 168 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 169 | UINT8 *spriteram_2 = state->m_spriteram2.target(); | |
| 168 | 170 | int offs; |
| 169 | 171 | |
| 170 | 172 | /* 16x16 sprites */ |
| 171 | for (offs = 0; offs < state->m_spriteram | |
| 173 | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) | |
| 172 | 174 | { |
| 173 | 175 | int attr = spriteram[offs + 1]; |
| 174 | 176 | int code = spriteram[offs]; |
| r14896 | r14897 | |
| 178 | 180 | int sx = spriteram[offs + 3]; |
| 179 | 181 | int sy = ((spriteram[offs + 2] + 8) & 0xff) - 8; |
| 180 | 182 | |
| 181 | if (flip_screen | |
| 183 | if (state->flip_screen | |
| 182 | 184 | { |
| 183 | 185 | sx = 240 - sx; |
| 184 | 186 | sy = 240 - sy; |
| r14896 | r14897 | |
| 194 | 196 | } |
| 195 | 197 | |
| 196 | 198 | /* 8x8 sprites */ |
| 197 | for (offs = 0; offs < state->m_spriteram2 | |
| 199 | for (offs = 0; offs < state->m_spriteram2.bytes(); offs += 4) | |
| 198 | 200 | { |
| 199 | 201 | int attr = spriteram_2[offs + 1]; |
| 200 | 202 | int code = spriteram_2[offs]; |
| r14896 | r14897 | |
| 204 | 206 | int sx = spriteram_2[offs + 3]; |
| 205 | 207 | int sy = spriteram_2[offs + 2]; |
| 206 | 208 | |
| 207 | if (flip_screen | |
| 209 | if (state->flip_screen | |
| 208 | 210 | { |
| 209 | 211 | sx = 248 - sx; |
| 210 | 212 | sy = 248 - sy; |
| r14896 | r14897 | |
| 241 | 243 | for (c = 15; c >= 0; c--) |
| 242 | 244 | if (m_cmd & (1 << c)) break; |
| 243 | 245 | |
| 244 | if (c >= 0) soundlatch_w(space, 0, 15 - c); | |
| 246 | if (c >= 0) soundlatch_byte_w(space, 0, 15 - c); | |
| 245 | 247 | } |
| 246 | 248 | |
| 247 | 249 | |
| 248 | 250 | static ADDRESS_MAP_START( olibochu_map, AS_PROGRAM, 8, olibochu_state ) |
| 249 | 251 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 250 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(olibochu_videoram_w) AM_BASE(m_videoram) | |
| 251 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(olibochu_colorram_w) AM_BASE(m_colorram) | |
| 252 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(olibochu_videoram_w) AM_SHARE("videoram") | |
| 253 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(olibochu_colorram_w) AM_SHARE("colorram") | |
| 252 | 254 | AM_RANGE(0x9000, 0x903f) AM_RAM //??? |
| 253 | 255 | AM_RANGE(0x9800, 0x983f) AM_RAM //??? |
| 254 | 256 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 259 | 261 | AM_RANGE(0xa005, 0xa005) AM_READ_PORT("DSW2") |
| 260 | 262 | AM_RANGE(0xa800, 0xa801) AM_WRITE(sound_command_w) |
| 261 | 263 | AM_RANGE(0xa802, 0xa802) AM_WRITE(olibochu_flipscreen_w) /* bit 6 = enable sound? */ |
| 262 | AM_RANGE(0xf400, 0xf41f) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 263 | AM_RANGE(0xf440, 0xf47f) AM_RAM AM_BASE_SIZE(m_spriteram2, m_spriteram2_size) | |
| 264 | AM_RANGE(0xf400, 0xf41f) AM_RAM AM_SHARE("spriteram") | |
| 265 | AM_RANGE(0xf440, 0xf47f) AM_RAM AM_SHARE("spriteram2") | |
| 264 | 266 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 265 | 267 | ADDRESS_MAP_END |
| 266 | 268 | |
| 267 | 269 | static ADDRESS_MAP_START( olibochu_sound_map, AS_PROGRAM, 8, olibochu_state ) |
| 268 | 270 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 269 | 271 | AM_RANGE(0x6000, 0x63ff) AM_RAM |
| 270 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_r) /* likely ay8910 input port, not direct */ | |
| 272 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) /* likely ay8910 input port, not direct */ | |
| 271 | 273 | AM_RANGE(0x7000, 0x7001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 272 | 274 | AM_RANGE(0x7004, 0x7004) AM_WRITENOP //sound filter? |
| 273 | 275 | AM_RANGE(0x7006, 0x7006) AM_WRITENOP //irq ack? |
| r14896 | r14897 | |
|---|---|---|
| 58 | 58 | { |
| 59 | 59 | if (ACCESSING_BITS_0_7) |
| 60 | 60 | { |
| 61 | soundlatch_w(space, offset, data); | |
| 61 | soundlatch_byte_w(space, offset, data); | |
| 62 | 62 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 63 | 63 | } |
| 64 | 64 | } |
| r14896 | r14897 | |
| 77 | 77 | AM_RANGE(0x80000, 0x8ffff) AM_ROMBANK("bank1") /* Quiz F1 only */ |
| 78 | 78 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 79 | 79 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE(m_video_data) |
| 80 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram | |
| 80 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram | |
| 81 | 81 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 82 | 82 | ADDRESS_MAP_END |
| 83 | 83 | |
| r14896 | r14897 | |
| 86 | 86 | AM_RANGE(0x6000e, 0x60fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 87 | 87 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 88 | 88 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE(m_video_data) |
| 89 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram | |
| 89 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram | |
| 90 | 90 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 91 | 91 | ADDRESS_MAP_END |
| 92 | 92 | |
| r14896 | r14897 | |
| 95 | 95 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 96 | 96 | AM_RANGE(0xc000e, 0xc0fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 97 | 97 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE(m_video_data) |
| 98 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram | |
| 98 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram | |
| 99 | 99 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 100 | 100 | ADDRESS_MAP_END |
| 101 | 101 | |
| r14896 | r14897 | |
| 131 | 131 | static ADDRESS_MAP_START( m90_sound_cpu_io_map, AS_IO, 8, m90_state ) |
| 132 | 132 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 133 | 133 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 134 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) | |
| 134 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) | |
| 135 | 135 | AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("m72", rtype2_sample_addr_w) |
| 136 | 136 | AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w) |
| 137 | 137 | AM_RANGE(0x83, 0x83) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) |
| r14896 | r14897 | |
| 141 | 141 | static ADDRESS_MAP_START( dynablsb_sound_cpu_io_map, AS_IO, 8, m90_state ) |
| 142 | 142 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 143 | 143 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 144 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) | |
| 144 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) | |
| 145 | 145 | AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 146 | 146 | ADDRESS_MAP_END |
| 147 | 147 | |
| r14896 | r14897 | |
| 149 | 149 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 150 | 150 | AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("m72", poundfor_sample_addr_w) |
| 151 | 151 | AM_RANGE(0x40, 0x41) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 152 | AM_RANGE(0x42, 0x42) AM_READ(soundlatch_r) | |
| 152 | AM_RANGE(0x42, 0x42) AM_READ(soundlatch_byte_r) | |
| 153 | 153 | AM_RANGE(0x42, 0x42) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) |
| 154 | 154 | ADDRESS_MAP_END |
| 155 | 155 |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | public: |
| 34 | 34 | tugboat_state(const machine_config &mconfig, device_type type, const char *tag) |
| 35 | : driver_device(mconfig, type, tag) { } | |
| 35 | : driver_device(mconfig, type, tag) , | |
| 36 | m_ram(*this, "ram"){ } | |
| 36 | 37 | |
| 37 | UINT8 | |
| 38 | required_shared_ptr<UINT8> | |
| 38 | 39 | UINT8 m_hd46505_0_reg[18]; |
| 39 | 40 | UINT8 m_hd46505_1_reg[18]; |
| 40 | 41 | int m_reg0; |
| r14896 | r14897 | |
| 86 | 87 | |
| 87 | 88 | WRITE8_MEMBER(tugboat_state::tugboat_score_w) |
| 88 | 89 | { |
| 89 | if (offset>=0x8) m_ram[0x291d + 32*offset + 32*(1-8)] = data ^ 0x0f; | |
| 90 | if (offset<0x8 ) m_ram[0x291d + 32*offset + 32*9] = data ^ 0x0f; | |
| 90 | if (offset>=0x8) m_ram.target()[0x291d + 32*offset + 32*(1-8)] = data ^ 0x0f; | |
| 91 | if (offset<0x8 ) m_ram.target()[0x291d + 32*offset + 32*9] = data ^ 0x0f; | |
| 91 | 92 | } |
| 92 | 93 | |
| 93 | 94 | static void draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, |
| r14896 | r14897 | |
| 100 | 101 | { |
| 101 | 102 | for (x = 0;x < 32;x++) |
| 102 | 103 | { |
| 103 | int code = (state->m_ram[addr + 0x400] << 8) | state->m_ram[addr]; | |
| 104 | int code = (state->m_ram.target()[addr + 0x400] << 8) | state->m_ram.target()[addr]; | |
| 104 | 105 | int color = (code & 0x3c00) >> 10; |
| 105 | 106 | int rgn; |
| 106 | 107 | |
| r14896 | r14897 | |
| 211 | 212 | |
| 212 | 213 | |
| 213 | 214 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tugboat_state ) |
| 214 | AM_RANGE(0x0000, 0x01ff) AM_RAM AM_ | |
| 215 | AM_RANGE(0x0000, 0x01ff) AM_RAM AM_ | |
| 215 | 216 | AM_RANGE(0x1060, 0x1061) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 216 | 217 | AM_RANGE(0x10a0, 0x10a1) AM_WRITE(tugboat_hd46505_0_w) /* scrolling is performed changing the start_addr register (0C/0D) */ |
| 217 | 218 | AM_RANGE(0x10c0, 0x10c1) AM_WRITE(tugboat_hd46505_1_w) |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | public: |
| 80 | 80 | kingdrby_state(const machine_config &mconfig, device_type type, const char *tag) |
| 81 | : driver_device(mconfig, type, tag) { } | |
| 81 | : driver_device(mconfig, type, tag) , | |
| 82 | m_vram(*this, "vram"), | |
| 83 | m_attr(*this, "attr"), | |
| 84 | m_spriteram(*this, "spriteram"){ } | |
| 82 | 85 | |
| 83 | 86 | UINT8 m_sound_cmd; |
| 84 | UINT8 *m_vram; | |
| 85 | UINT8 *m_attr; | |
| 87 | required_shared_ptr<UINT8> m_vram; | |
| 88 | required_shared_ptr<UINT8> m_attr; | |
| 86 | 89 | tilemap_t *m_sc0_tilemap; |
| 87 | 90 | tilemap_t *m_sc0w_tilemap; |
| 88 | 91 | tilemap_t *m_sc1_tilemap; |
| 89 | 92 | UINT8 m_p1_hopper; |
| 90 | 93 | UINT8 m_p2_hopper; |
| 91 | 94 | UINT8 m_mux_data; |
| 92 | UINT8 | |
| 95 | required_shared_ptr<UINT8> | |
| 93 | 96 | DECLARE_WRITE8_MEMBER(sc0_vram_w); |
| 94 | 97 | DECLARE_WRITE8_MEMBER(sc0_attr_w); |
| 95 | 98 | DECLARE_WRITE8_MEMBER(led_array_w); |
| r14896 | r14897 | |
| 121 | 124 | static TILE_GET_INFO( get_sc0_tile_info ) |
| 122 | 125 | { |
| 123 | 126 | kingdrby_state *state = machine.driver_data<kingdrby_state>(); |
| 124 | int tile = state->m_vram[tile_index] | state->m_attr[tile_index]<<8; | |
| 125 | int color = (state->m_attr[tile_index] & 0x06)>>1; | |
| 127 | int tile = state->m_vram.target()[tile_index] | state->m_attr.target()[tile_index]<<8; | |
| 128 | int color = (state->m_attr.target()[tile_index] & 0x06)>>1; | |
| 126 | 129 | |
| 127 | 130 | tile&=0x1ff; |
| 128 | 131 | |
| r14896 | r14897 | |
| 136 | 139 | static TILE_GET_INFO( get_sc1_tile_info ) |
| 137 | 140 | { |
| 138 | 141 | kingdrby_state *state = machine.driver_data<kingdrby_state>(); |
| 139 | int tile = state->m_vram[tile_index] | state->m_attr[tile_index]<<8; | |
| 140 | int color = (state->m_attr[tile_index] & 0x06)>>1; | |
| 142 | int tile = state->m_vram.target()[tile_index] | state->m_attr.target()[tile_index]<<8; | |
| 143 | int color = (state->m_attr.target()[tile_index] & 0x06)>>1; | |
| 141 | 144 | |
| 142 | 145 | tile&=0x1ff; |
| 143 | 146 | //original 0xc |
| r14896 | r14897 | |
| 150 | 153 | color|0x40, |
| 151 | 154 | 0); |
| 152 | 155 | |
| 153 | tileinfo.category = (state->m_attr[tile_index] & 0x08)>>3; | |
| 156 | tileinfo.category = (state->m_attr.target()[tile_index] & 0x08)>>3; | |
| 154 | 157 | } |
| 155 | 158 | |
| 156 | 159 | static VIDEO_START(kingdrby) |
| r14896 | r14897 | |
| 172 | 175 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 173 | 176 | { |
| 174 | 177 | kingdrby_state *state = machine.driver_data<kingdrby_state>(); |
| 175 | UINT8 *spriteram = state->m_spriteram; | |
| 178 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 176 | 179 | int count = 0; |
| 177 | 180 | |
| 178 | 181 | /*sprites not fully understood.*/ |
| r14896 | r14897 | |
| 219 | 222 | kingdrby_state *state = screen.machine().driver_data<kingdrby_state>(); |
| 220 | 223 | const rectangle &visarea = screen.visible_area(); |
| 221 | 224 | rectangle clip; |
| 222 | state->m_sc0_tilemap->set_scrollx(0, state->m_vram[0x342]); | |
| 223 | state->m_sc0_tilemap->set_scrolly(0, state->m_vram[0x341]); | |
| 224 | state->m_sc1_tilemap->set_scrollx(0, state->m_vram[0x342]); | |
| 225 | state->m_sc1_tilemap->set_scrolly(0, state->m_vram[0x341]); | |
| 225 | state->m_sc0_tilemap->set_scrollx(0, state->m_vram.target()[0x342]); | |
| 226 | state->m_sc0_tilemap->set_scrolly(0, state->m_vram.target()[0x341]); | |
| 227 | state->m_sc1_tilemap->set_scrollx(0, state->m_vram.target()[0x342]); | |
| 228 | state->m_sc1_tilemap->set_scrolly(0, state->m_vram.target()[0x341]); | |
| 226 | 229 | state->m_sc0w_tilemap->set_scrolly(0, 32); |
| 227 | 230 | |
| 228 | 231 | /* maybe it needs two window tilemaps? (one at the top, the other at the bottom)*/ |
| r14896 | r14897 | |
| 239 | 242 | |
| 240 | 243 | WRITE8_MEMBER(kingdrby_state::sc0_vram_w) |
| 241 | 244 | { |
| 242 | m_vram[offset] = data; | |
| 245 | m_vram.target()[offset] = data; | |
| 243 | 246 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 244 | 247 | m_sc0w_tilemap->mark_tile_dirty(offset); |
| 245 | 248 | m_sc1_tilemap->mark_tile_dirty(offset); |
| r14896 | r14897 | |
| 247 | 250 | |
| 248 | 251 | WRITE8_MEMBER(kingdrby_state::sc0_attr_w) |
| 249 | 252 | { |
| 250 | m_attr[offset] = data; | |
| 253 | m_attr.target()[offset] = data; | |
| 251 | 254 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 252 | 255 | m_sc0w_tilemap->mark_tile_dirty(offset); |
| 253 | 256 | m_sc1_tilemap->mark_tile_dirty(offset); |
| r14896 | r14897 | |
| 281 | 284 | cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 282 | 285 | state->m_sound_cmd = data; |
| 283 | 286 | /* soundlatch is unneeded since we are already using perfect interleave. */ |
| 284 | // soundlatch_w(space,0, data); | |
| 287 | // soundlatch_byte_w(space,0, data); | |
| 285 | 288 | } |
| 286 | 289 | |
| 287 | 290 | |
| r14896 | r14897 | |
| 386 | 389 | static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, kingdrby_state ) |
| 387 | 390 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 388 | 391 | AM_RANGE(0x3000, 0x33ff) AM_RAM AM_MIRROR(0xc00) AM_SHARE("share1") |
| 389 | AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(m_vram) | |
| 390 | AM_RANGE(0x5000, 0x53ff) AM_RAM_WRITE(sc0_attr_w) AM_BASE(m_attr) | |
| 392 | AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(sc0_vram_w) AM_SHARE("vram") | |
| 393 | AM_RANGE(0x5000, 0x53ff) AM_RAM_WRITE(sc0_attr_w) AM_SHARE("attr") | |
| 391 | 394 | ADDRESS_MAP_END |
| 392 | 395 | |
| 393 | 396 | static ADDRESS_MAP_START( master_io_map, AS_IO, 8, kingdrby_state ) |
| r14896 | r14897 | |
| 402 | 405 | AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) /* I/O Ports */ |
| 403 | 406 | AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) /* I/O Ports */ |
| 404 | 407 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("share1") |
| 405 | AM_RANGE(0x7400, 0x74ff) AM_RAM AM_ | |
| 408 | AM_RANGE(0x7400, 0x74ff) AM_RAM AM_ | |
| 406 | 409 | AM_RANGE(0x7600, 0x7600) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 407 | 410 | AM_RANGE(0x7601, 0x7601) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 408 | 411 | AM_RANGE(0x7801, 0x780f) AM_WRITE(led_array_w) |
| r14896 | r14897 | |
| 422 | 425 | AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) /* I/O Ports */ |
| 423 | 426 | // AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) /* I/O Ports */ |
| 424 | 427 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("share1") |
| 425 | AM_RANGE(0x7400, 0x74ff) AM_RAM AM_ | |
| 428 | AM_RANGE(0x7400, 0x74ff) AM_RAM AM_ | |
| 426 | 429 | AM_RANGE(0x7600, 0x7600) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 427 | 430 | AM_RANGE(0x7601, 0x7601) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 428 | 431 | AM_RANGE(0x7800, 0x7800) AM_READ_PORT("KEY0") |
| r14896 | r14897 | |
|---|---|---|
| 29 | 29 | { |
| 30 | 30 | public: |
| 31 | 31 | r2dx_v33_state(const machine_config &mconfig, device_type type, const char *tag) |
| 32 | : driver_device(mconfig, type, tag) { } | |
| 32 | : driver_device(mconfig, type, tag) , | |
| 33 | m_spriteram(*this, "spriteram"){ } | |
| 33 | 34 | |
| 34 | UINT16 | |
| 35 | required_shared_ptr<UINT16> | |
| 35 | 36 | DECLARE_WRITE16_MEMBER(rdx_bg_vram_w); |
| 36 | 37 | DECLARE_WRITE16_MEMBER(rdx_md_vram_w); |
| 37 | 38 | DECLARE_WRITE16_MEMBER(rdx_fg_vram_w); |
| r14896 | r14897 | |
| 97 | 98 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int pri) |
| 98 | 99 | { |
| 99 | 100 | r2dx_v33_state *state = machine.driver_data<r2dx_v33_state>(); |
| 100 | UINT16 *spriteram16 = state->m_spriteram; | |
| 101 | UINT16 *spriteram16 = state->m_spriteram.target(); | |
| 101 | 102 | int offs,fx,fy,x,y,color,sprite; |
| 102 | 103 | // int cur_pri; |
| 103 | 104 | int dx,dy,ax,ay; |
| r14896 | r14897 | |
| 400 | 401 | AM_RANGE(0x00800, 0x00fff) AM_RAM // copies eeprom here? |
| 401 | 402 | AM_RANGE(0x01000, 0x0bfff) AM_RAM |
| 402 | 403 | |
| 403 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_ | |
| 404 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_ | |
| 404 | 405 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM |
| 405 | 406 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(rdx_bg_vram_w) AM_BASE_LEGACY(&bg_vram) |
| 406 | 407 | AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(rdx_md_vram_w) AM_BASE_LEGACY(&md_vram) |
| r14896 | r14897 | |
| 408 | 409 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(rdx_tx_vram_w) AM_BASE_LEGACY(&tx_vram) |
| 409 | 410 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM /* Stack area */ |
| 410 | 411 | AM_RANGE(0x10000, 0x1efff) AM_RAM |
| 411 | AM_RANGE(0x1f000, 0x1ffff) AM_RAM_WRITE(paletteram | |
| 412 | AM_RANGE(0x1f000, 0x1ffff) AM_RAM_WRITE(paletteram | |
| 412 | 413 | |
| 413 | 414 | AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("bank1") |
| 414 | 415 | AM_RANGE(0x40000, 0xfffff) AM_ROM AM_REGION("mainprg", 0x40000 ) |
| r14896 | r14897 | |
| 473 | 474 | AM_RANGE(0x00800, 0x00fff) AM_RAM |
| 474 | 475 | AM_RANGE(0x01000, 0x0bfff) AM_RAM |
| 475 | 476 | |
| 476 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_ | |
| 477 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM AM_ | |
| 477 | 478 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM |
| 478 | 479 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE(rdx_bg_vram_w) AM_BASE_LEGACY(&bg_vram) |
| 479 | 480 | AM_RANGE(0x0d800, 0x0dfff) AM_RAM_WRITE(rdx_md_vram_w) AM_BASE_LEGACY(&md_vram) |
| r14896 | r14897 | |
| 481 | 482 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(rdx_tx_vram_w) AM_BASE_LEGACY(&tx_vram) |
| 482 | 483 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM /* Stack area */ |
| 483 | 484 | AM_RANGE(0x10000, 0x1efff) AM_RAM |
| 484 | AM_RANGE(0x1f000, 0x1ffff) AM_RAM_WRITE(paletteram | |
| 485 | AM_RANGE(0x1f000, 0x1ffff) AM_RAM_WRITE(paletteram | |
| 485 | 486 | |
| 486 | 487 | AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("bank1") |
| 487 | 488 | AM_RANGE(0x40000, 0xfffff) AM_ROM AM_REGION("mainprg", 0x40000 ) |
| r14896 | r14897 | |
|---|---|---|
| 12 | 12 | { |
| 13 | 13 | public: |
| 14 | 14 | embargo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 15 | : driver_device(mconfig, type, tag) { } | |
| 15 | : driver_device(mconfig, type, tag) , | |
| 16 | m_videoram(*this, "videoram"){ } | |
| 16 | 17 | |
| 17 | 18 | /* memory pointers */ |
| 18 | UINT8 * m_videoram; | |
| 19 | size_t m_videoram_size; | |
| 19 | required_shared_ptr<UINT8> m_videoram; | |
| 20 | 20 | |
| 21 | 21 | /* misc */ |
| 22 | 22 | UINT8 m_dial_enable_1; |
| r14896 | r14897 | |
| 41 | 41 | embargo_state *state = screen.machine().driver_data<embargo_state>(); |
| 42 | 42 | offs_t offs; |
| 43 | 43 | |
| 44 | for (offs = 0; offs < state->m_videoram | |
| 44 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 45 | 45 | { |
| 46 | 46 | int i; |
| 47 | 47 | |
| 48 | 48 | UINT8 x = offs << 3; |
| 49 | 49 | UINT8 y = offs >> 5; |
| 50 | UINT8 data = state->m_videoram[offs]; | |
| 50 | UINT8 data = state->m_videoram.target()[offs]; | |
| 51 | 51 | |
| 52 | 52 | for (i = 0; i < 8; i++) |
| 53 | 53 | { |
| r14896 | r14897 | |
| 155 | 155 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, embargo_state ) |
| 156 | 156 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 157 | 157 | AM_RANGE(0x1e00, 0x1fff) AM_RAM |
| 158 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_ | |
| 158 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_ | |
| 159 | 159 | ADDRESS_MAP_END |
| 160 | 160 | |
| 161 | 161 |
| r14896 | r14897 | |
|---|---|---|
| 222 | 222 | coin_lockout_global_w(machine(), (data & 1) ^ m_invert_coin_lockout); |
| 223 | 223 | break; |
| 224 | 224 | case 4: |
| 225 | flip_screen_set( | |
| 225 | flip_screen_set( | |
| 226 | 226 | break; |
| 227 | 227 | case 5: |
| 228 | 228 | m_port1 = data; |
| r14896 | r14897 | |
| 289 | 289 | coin_lockout_global_w(machine(), ~data & 8); |
| 290 | 290 | |
| 291 | 291 | // bit 4 = flip screen |
| 292 | flip_screen_set( | |
| 292 | flip_screen_set( | |
| 293 | 293 | |
| 294 | 294 | // bit 5 = unknown (set on startup) |
| 295 | 295 | |
| r14896 | r14897 | |
| 330 | 330 | |
| 331 | 331 | WRITE8_MEMBER(superqix_state::bootleg_flipscreen_w) |
| 332 | 332 | { |
| 333 | flip_screen_set( | |
| 333 | flip_screen_set( | |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | |
| r14896 | r14897 | |
| 572 | 572 | ADDRESS_MAP_END |
| 573 | 573 | |
| 574 | 574 | static ADDRESS_MAP_START( pbillian_port_map, AS_IO, 8, superqix_state ) |
| 575 | AM_RANGE(0x0000, 0x01ff) AM_RAM_WRITE(paletteram_BBGGRRII_w) AM_SHARE("paletteram") | |
| 575 | AM_RANGE(0x0000, 0x01ff) AM_RAM_WRITE(paletteram_BBGGRRII_byte_w) AM_SHARE("paletteram") | |
| 576 | 576 | AM_RANGE(0x0401, 0x0401) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 577 | 577 | AM_RANGE(0x0402, 0x0403) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w) |
| 578 | 578 | AM_RANGE(0x0408, 0x0408) AM_READ(pbillian_from_mcu_r) |
| r14896 | r14897 | |
| 585 | 585 | ADDRESS_MAP_END |
| 586 | 586 | |
| 587 | 587 | static ADDRESS_MAP_START( hotsmash_port_map, AS_IO, 8, superqix_state ) |
| 588 | AM_RANGE(0x0000, 0x01ff) AM_RAM_WRITE(paletteram_BBGGRRII_w) AM_SHARE("paletteram") | |
| 588 | AM_RANGE(0x0000, 0x01ff) AM_RAM_WRITE(paletteram_BBGGRRII_byte_w) AM_SHARE("paletteram") | |
| 589 | 589 | AM_RANGE(0x0401, 0x0401) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 590 | 590 | AM_RANGE(0x0402, 0x0403) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w) |
| 591 | 591 | AM_RANGE(0x0408, 0x0408) AM_READ(hotsmash_from_mcu_r) |
| r14896 | r14897 | |
| 598 | 598 | ADDRESS_MAP_END |
| 599 | 599 | |
| 600 | 600 | static ADDRESS_MAP_START( sqix_port_map, AS_IO, 8, superqix_state ) |
| 601 | AM_RANGE(0x0000, 0x00ff) AM_RAM_WRITE(paletteram_BBGGRRII_w) AM_SHARE("paletteram") | |
| 601 | AM_RANGE(0x0000, 0x00ff) AM_RAM_WRITE(paletteram_BBGGRRII_byte_w) AM_SHARE("paletteram") | |
| 602 | 602 | AM_RANGE(0x0401, 0x0401) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 603 | 603 | AM_RANGE(0x0402, 0x0403) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w) |
| 604 | 604 | AM_RANGE(0x0405, 0x0405) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| r14896 | r14897 | |
| 611 | 611 | ADDRESS_MAP_END |
| 612 | 612 | |
| 613 | 613 | static ADDRESS_MAP_START( bootleg_port_map, AS_IO, 8, superqix_state ) |
| 614 | AM_RANGE(0x0000, 0x00ff) AM_RAM_WRITE(paletteram_BBGGRRII_w) AM_SHARE("paletteram") | |
| 614 | AM_RANGE(0x0000, 0x00ff) AM_RAM_WRITE(paletteram_BBGGRRII_byte_w) AM_SHARE("paletteram") | |
| 615 | 615 | AM_RANGE(0x0401, 0x0401) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 616 | 616 | AM_RANGE(0x0402, 0x0403) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w) |
| 617 | 617 | AM_RANGE(0x0405, 0x0405) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | * |
| 102 | 102 | *************************************/ |
| 103 | 103 | |
| 104 | ||
| 104 | ||
| 105 | 105 | { |
| 106 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 107 | int temp = input_port_read(space->machine(), "IN0"); | |
| 108 | if (state->m_cpu_to_sound_ready) temp ^= 0x0080; | |
| 106 | int temp = input_port_read(machine(), "IN0"); | |
| 107 | if (m_cpu_to_sound_ready) temp ^= 0x0080; | |
| 109 | 108 | return temp; |
| 110 | 109 | } |
| 111 | 110 | |
| 112 | 111 | |
| 113 | ||
| 112 | ||
| 114 | 113 | { |
| 115 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 116 | int temp = input_port_read(space->machine(), "IN2"); | |
| 117 | if (state->m_cpu_to_sound_ready) temp ^= 0x2000; | |
| 114 | int temp = input_port_read(machine(), "IN2"); | |
| 115 | if (m_cpu_to_sound_ready) temp ^= 0x2000; | |
| 118 | 116 | return temp; |
| 119 | 117 | } |
| 120 | 118 | |
| 121 | 119 | |
| 122 | ||
| 120 | ||
| 123 | 121 | { |
| 124 | cyberbal_state *state = space->machine().driver_data<cyberbal_state>(); | |
| 125 | 122 | int temp = 0xffff; |
| 126 | if ( | |
| 123 | if ( | |
| 127 | 124 | return temp; |
| 128 | 125 | } |
| 129 | 126 | |
| r14896 | r14897 | |
| 135 | 132 | * |
| 136 | 133 | *************************************/ |
| 137 | 134 | |
| 138 | ||
| 135 | ||
| 139 | 136 | { |
| 140 | cputag_set_input_line( | |
| 137 | cputag_set_input_line( | |
| 141 | 138 | } |
| 142 | 139 | |
| 143 | 140 | |
| r14896 | r14897 | |
| 155 | 152 | AM_RANGE(0xfd0000, 0xfd1fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 156 | 153 | AM_RANGE(0xfd2000, 0xfd3fff) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 157 | 154 | AM_RANGE(0xfd4000, 0xfd5fff) AM_WRITE(watchdog_reset16_w) |
| 158 | AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE | |
| 155 | AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE | |
| 159 | 156 | AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE_LEGACY(atarigen_sound_upper_w) |
| 160 | AM_RANGE(0xfe0000, 0xfe0fff) AM_READ | |
| 157 | AM_RANGE(0xfe0000, 0xfe0fff) AM_READ | |
| 161 | 158 | AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1") |
| 162 | 159 | AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_1_w) AM_SHARE("share1") AM_BASE(m_paletteram_1) |
| 163 | 160 | AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_0_w) AM_SHARE("share2") AM_BASE(m_paletteram_0) |
| r14896 | r14897 | |
| 184 | 181 | static ADDRESS_MAP_START( extra_map, AS_PROGRAM, 16, cyberbal_state ) |
| 185 | 182 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 186 | 183 | AM_RANGE(0xfc0000, 0xfdffff) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 187 | AM_RANGE(0xfe0000, 0xfe0fff) AM_READ | |
| 184 | AM_RANGE(0xfe0000, 0xfe0fff) AM_READ | |
| 188 | 185 | AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1") |
| 189 | 186 | AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_1_w) AM_SHARE("share1") |
| 190 | 187 | AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_0_w) AM_SHARE("share2") |
| r14896 | r14897 | |
| 211 | 208 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cyberbal_state ) |
| 212 | 209 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 213 | 210 | AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 214 | AM_RANGE(0x2800, 0x2801) AM_WRITE | |
| 211 | AM_RANGE(0x2800, 0x2801) AM_WRITE | |
| 215 | 212 | AM_RANGE(0x2802, 0x2803) AM_READWRITE_LEGACY(atarigen_6502_irq_ack_r, atarigen_6502_irq_ack_w) |
| 216 | 213 | AM_RANGE(0x2804, 0x2805) AM_WRITE_LEGACY(atarigen_6502_sound_w) |
| 217 | AM_RANGE(0x2806, 0x2807) AM_WRITE | |
| 214 | AM_RANGE(0x2806, 0x2807) AM_WRITE | |
| 218 | 215 | AM_RANGE(0x2c00, 0x2c01) AM_READ_LEGACY(atarigen_6502_sound_r) |
| 219 | AM_RANGE(0x2c02, 0x2c03) AM_READ_LEGACY(cyberbal_special_port3_r) | |
| 220 | AM_RANGE(0x2c04, 0x2c05) AM_READ_LEGACY(cyberbal_sound_68k_6502_r) | |
| 221 | AM_RANGE(0x2c06, 0x2c07) AM_READ_LEGACY(cyberbal_sound_6502_stat_r) | |
| 216 | AM_RANGE(0x2c02, 0x2c03) AM_READ(cyberbal_special_port3_r) | |
| 217 | AM_RANGE(0x2c04, 0x2c05) AM_READ(cyberbal_sound_68k_6502_r) | |
| 218 | AM_RANGE(0x2c06, 0x2c07) AM_READ(cyberbal_sound_6502_stat_r) | |
| 222 | 219 | AM_RANGE(0x3000, 0x3fff) AM_ROMBANK("soundbank") |
| 223 | 220 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 224 | 221 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 233 | 230 | |
| 234 | 231 | static ADDRESS_MAP_START( sound_68k_map, AS_PROGRAM, 16, cyberbal_state ) |
| 235 | 232 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 236 | AM_RANGE(0xff8000, 0xff87ff) AM_READ_LEGACY(cyberbal_sound_68k_r) | |
| 237 | AM_RANGE(0xff8800, 0xff8fff) AM_WRITE_LEGACY(cyberbal_sound_68k_w) | |
| 238 | AM_RANGE(0xff9000, 0xff97ff) AM_WRITE_LEGACY(cyberbal_io_68k_irq_ack_w) | |
| 239 | AM_RANGE(0xff9800, 0xff9fff) AM_WRITE_LEGACY(cyberbal_sound_68k_dac_w) | |
| 233 | AM_RANGE(0xff8000, 0xff87ff) AM_READ(cyberbal_sound_68k_r) | |
| 234 | AM_RANGE(0xff8800, 0xff8fff) AM_WRITE(cyberbal_sound_68k_w) | |
| 235 | AM_RANGE(0xff9000, 0xff97ff) AM_WRITE(cyberbal_io_68k_irq_ack_w) | |
| 236 | AM_RANGE(0xff9800, 0xff9fff) AM_WRITE(cyberbal_sound_68k_dac_w) | |
| 240 | 237 | AM_RANGE(0xfff000, 0xffffff) AM_RAM |
| 241 | 238 | ADDRESS_MAP_END |
| 242 | 239 | |
| r14896 | r14897 | |
| 252 | 249 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 253 | 250 | AM_RANGE(0xfc0000, 0xfc0003) AM_READ_PORT("IN0") |
| 254 | 251 | AM_RANGE(0xfc2000, 0xfc2003) AM_READ_PORT("IN1") |
| 255 | AM_RANGE(0xfc4000, 0xfc4003) AM_READ | |
| 252 | AM_RANGE(0xfc4000, 0xfc4003) AM_READ | |
| 256 | 253 | AM_RANGE(0xfc6000, 0xfc6003) AM_READ_LEGACY(atarigen_sound_upper_r) |
| 257 | 254 | AM_RANGE(0xfc8000, 0xfc8fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 258 | 255 | AM_RANGE(0xfca000, 0xfcafff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| r14896 | r14897 | |
| 261 | 258 | AM_RANGE(0xfd4000, 0xfd4003) AM_WRITE(watchdog_reset16_w) |
| 262 | 259 | AM_RANGE(0xfd6000, 0xfd6003) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 263 | 260 | AM_RANGE(0xfd8000, 0xfd8003) AM_WRITE_LEGACY(atarigen_sound_upper_w) |
| 264 | AM_RANGE(0xfe0000, 0xfe0003) AM_READ | |
| 261 | AM_RANGE(0xfe0000, 0xfe0003) AM_READ | |
| 265 | 262 | AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 266 | 263 | AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE_LEGACY(atarigen_alpha_w) AM_BASE(m_alpha) |
| 267 | 264 | AM_RANGE(0xff3000, 0xff37ff) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w) |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | #include "sound/flt_vol.h" |
| 17 | 17 | #include "includes/lockon.h" |
| 18 | 18 | |
| 19 | #define V30_GND_ADDR ((state->m_ctrl_reg & 0x3) << 16) | |
| 20 | #define V30_OBJ_ADDR ((state->m_ctrl_reg & 0x18) << 13) | |
| 19 | #define V30_GND_ADDR ((m_ctrl_reg & 0x3) << 16) | |
| 20 | #define V30_OBJ_ADDR ((m_ctrl_reg & 0x18) << 13) | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | /************************************* |
| r14896 | r14897 | |
| 26 | 26 | * |
| 27 | 27 | *************************************/ |
| 28 | 28 | |
| 29 | static WRITE8_HANDLER( sound_vol ); | |
| 30 | static READ8_HANDLER( adc_r ); | |
| 31 | 29 | |
| 32 | 30 | |
| 31 | ||
| 32 | ||
| 33 | 33 | /************************************* |
| 34 | 34 | * |
| 35 | 35 | * Machine functions |
| r14896 | r14897 | |
| 51 | 51 | |
| 52 | 52 | *************************************/ |
| 53 | 53 | |
| 54 | ||
| 54 | ||
| 55 | 55 | { |
| 56 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 57 | state->m_ctrl_reg = data & 0xff; | |
| 56 | m_ctrl_reg = data & 0xff; | |
| 58 | 57 | |
| 59 | 58 | /* Bus mastering for shared access */ |
| 60 | device_set_input_line(state->m_ground, INPUT_LINE_HALT, data & 0x04 ? ASSERT_LINE : CLEAR_LINE); | |
| 61 | device_set_input_line(state->m_object, INPUT_LINE_HALT, data & 0x20 ? ASSERT_LINE : CLEAR_LINE); | |
| 62 | device_set_input_line(state->m_audiocpu, INPUT_LINE_HALT, data & 0x40 ? CLEAR_LINE : ASSERT_LINE); | |
| 59 | device_set_input_line(m_ground, INPUT_LINE_HALT, data & 0x04 ? ASSERT_LINE : CLEAR_LINE); | |
| 60 | device_set_input_line(m_object, INPUT_LINE_HALT, data & 0x20 ? ASSERT_LINE : CLEAR_LINE); | |
| 61 | device_set_input_line(m_audiocpu, INPUT_LINE_HALT, data & 0x40 ? CLEAR_LINE : ASSERT_LINE); | |
| 63 | 62 | } |
| 64 | 63 | |
| 65 | ||
| 64 | ||
| 66 | 65 | { |
| 67 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 68 | address_space *gndspace = state->m_ground->memory().space(AS_PROGRAM); | |
| 66 | address_space *gndspace = m_ground->memory().space(AS_PROGRAM); | |
| 69 | 67 | return gndspace->read_word(V30_GND_ADDR | offset * 2); |
| 70 | 68 | } |
| 71 | 69 | |
| 72 | ||
| 70 | ||
| 73 | 71 | { |
| 74 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 75 | address_space *gndspace = state->m_ground->memory().space(AS_PROGRAM); | |
| 72 | address_space *gndspace = m_ground->memory().space(AS_PROGRAM); | |
| 76 | 73 | |
| 77 | 74 | if (ACCESSING_BITS_0_7) |
| 78 | 75 | gndspace->write_byte(V30_GND_ADDR | (offset * 2 + 0), data); |
| r14896 | r14897 | |
| 80 | 77 | gndspace->write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8); |
| 81 | 78 | } |
| 82 | 79 | |
| 83 | ||
| 80 | ||
| 84 | 81 | { |
| 85 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 86 | address_space *objspace = state->m_object->memory().space(AS_PROGRAM); | |
| 82 | address_space *objspace = m_object->memory().space(AS_PROGRAM); | |
| 87 | 83 | return objspace->read_word(V30_OBJ_ADDR | offset * 2); |
| 88 | 84 | } |
| 89 | 85 | |
| 90 | ||
| 86 | ||
| 91 | 87 | { |
| 92 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 93 | address_space *objspace = state->m_object->memory().space(AS_PROGRAM); | |
| 88 | address_space *objspace =m_object->memory().space(AS_PROGRAM); | |
| 94 | 89 | |
| 95 | 90 | if (ACCESSING_BITS_0_7) |
| 96 | 91 | objspace->write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data); |
| r14896 | r14897 | |
| 98 | 93 | objspace->write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8); |
| 99 | 94 | } |
| 100 | 95 | |
| 101 | ||
| 96 | ||
| 102 | 97 | { |
| 103 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 104 | 98 | |
| 105 | 99 | if (offset < 0x800) |
| 106 | 100 | { |
| 107 | address_space *gndspace = state->m_ground->memory().space(AS_PROGRAM); | |
| 108 | address_space *objspace = state->m_object->memory().space(AS_PROGRAM); | |
| 101 | address_space *gndspace = m_ground->memory().space(AS_PROGRAM); | |
| 102 | address_space *objspace = m_object->memory().space(AS_PROGRAM); | |
| 109 | 103 | |
| 110 | 104 | if (ACCESSING_BITS_0_7) |
| 111 | 105 | gndspace->write_byte(V30_GND_ADDR | (offset * 2 + 0), data); |
| r14896 | r14897 | |
| 119 | 113 | } |
| 120 | 114 | } |
| 121 | 115 | |
| 122 | ||
| 116 | ||
| 123 | 117 | { |
| 124 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 125 | address_space *sndspace = state->m_audiocpu->memory().space(AS_PROGRAM); | |
| 118 | address_space *sndspace = m_audiocpu->memory().space(AS_PROGRAM); | |
| 126 | 119 | return 0xff00 | sndspace->read_byte(offset); |
| 127 | 120 | } |
| 128 | 121 | |
| 129 | ||
| 122 | ||
| 130 | 123 | { |
| 131 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 132 | address_space *sndspace = state->m_audiocpu->memory().space(AS_PROGRAM); | |
| 124 | address_space *sndspace = m_audiocpu->memory().space(AS_PROGRAM); | |
| 133 | 125 | sndspace->write_byte(offset, data); |
| 134 | 126 | } |
| 135 | 127 | |
| 136 | ||
| 128 | ||
| 137 | 129 | { |
| 138 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 139 | state->m_main_inten = 1; | |
| 130 | m_main_inten = 1; | |
| 140 | 131 | } |
| 141 | 132 | |
| 142 | ||
| 133 | ||
| 143 | 134 | { |
| 144 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 145 | watchdog_reset(space->machine()); | |
| 146 | state->m_main_inten = 0; | |
| 135 | watchdog_reset(machine()); | |
| 136 | m_main_inten = 0; | |
| 147 | 137 | } |
| 148 | 138 | |
| 149 | 139 | |
| r14896 | r14897 | |
| 160 | 150 | AM_RANGE(0x06000, 0x06001) AM_READ_PORT("DSW") |
| 161 | 151 | AM_RANGE(0x08000, 0x081ff) AM_RAM AM_BASE_SIZE(m_hud_ram, m_hudram_size) |
| 162 | 152 | AM_RANGE(0x09000, 0x09fff) AM_RAM_WRITE(lockon_char_w) AM_BASE(m_char_ram) |
| 163 | AM_RANGE(0x0a000, 0x0a001) AM_WRITE | |
| 153 | AM_RANGE(0x0a000, 0x0a001) AM_WRITE | |
| 164 | 154 | AM_RANGE(0x0b000, 0x0bfff) AM_WRITE(lockon_rotate_w) |
| 165 | 155 | AM_RANGE(0x0c000, 0x0cfff) AM_WRITE(lockon_fb_clut_w) |
| 166 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE_LEGACY(inten_w) | |
| 167 | AM_RANGE(0x0f000, 0x0f001) AM_WRITE_LEGACY(emres_w) | |
| 168 | AM_RANGE(0x10000, 0x1ffff) AM_READNOP AM_WRITE_LEGACY(tst_w) | |
| 169 | AM_RANGE(0x20000, 0x2ffff) AM_READWRITE_LEGACY(main_z80_r, main_z80_w) | |
| 170 | AM_RANGE(0x30000, 0x3ffff) AM_READWRITE_LEGACY(main_gnd_r, main_gnd_w) | |
| 171 | AM_RANGE(0x40000, 0x4ffff) AM_READWRITE_LEGACY(main_obj_r, main_obj_w) | |
| 156 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(inten_w) | |
| 157 | AM_RANGE(0x0f000, 0x0f001) AM_WRITE(emres_w) | |
| 158 | AM_RANGE(0x10000, 0x1ffff) AM_READNOP AM_WRITE(tst_w) | |
| 159 | AM_RANGE(0x20000, 0x2ffff) AM_READWRITE(main_z80_r, main_z80_w) | |
| 160 | AM_RANGE(0x30000, 0x3ffff) AM_READWRITE(main_gnd_r, main_gnd_w) | |
| 161 | AM_RANGE(0x40000, 0x4ffff) AM_READWRITE(main_obj_r, main_obj_w) | |
| 172 | 162 | AM_RANGE(0x50000, 0x5ffff) AM_MIRROR(0x80000) AM_ROM |
| 173 | 163 | AM_RANGE(0x60000, 0x6ffff) AM_MIRROR(0x80000) AM_ROM |
| 174 | 164 | AM_RANGE(0x70000, 0x7ffff) AM_MIRROR(0x80000) AM_ROM |
| r14896 | r14897 | |
| 201 | 191 | static ADDRESS_MAP_START( sound_prg, AS_PROGRAM, 8, lockon_state ) |
| 202 | 192 | ADDRESS_MAP_UNMAP_HIGH |
| 203 | 193 | AM_RANGE(0x0000, 0x6fff) AM_ROM |
| 204 | AM_RANGE(0x7000, 0x7000) AM_WRITE_LEGACY(sound_vol) | |
| 205 | AM_RANGE(0x7400, 0x7403) AM_READ_LEGACY(adc_r) AM_WRITENOP | |
| 194 | AM_RANGE(0x7000, 0x7000) AM_WRITE(sound_vol) | |
| 195 | AM_RANGE(0x7400, 0x7403) AM_READ(adc_r) AM_WRITENOP | |
| 206 | 196 | AM_RANGE(0x7800, 0x7fff) AM_MIRROR(0x8000) AM_RAM |
| 207 | 197 | ADDRESS_MAP_END |
| 208 | 198 | |
| r14896 | r14897 | |
| 338 | 328 | * |
| 339 | 329 | *************************************/ |
| 340 | 330 | |
| 341 | ||
| 331 | ||
| 342 | 332 | { |
| 343 | 333 | switch (offset) |
| 344 | 334 | { |
| 345 | case 0: return input_port_read(space->machine(), "ADC_BANK"); | |
| 346 | case 1: return input_port_read(space->machine(), "ADC_PITCH"); | |
| 347 | case 2: return input_port_read(space->machine(), "ADC_MISSILE"); | |
| 348 | case 3: return input_port_read(space->machine(), "ADC_HOVER"); | |
| 335 | case 0: return input_port_read(machine(), "ADC_BANK"); | |
| 336 | case 1: return input_port_read(machine(), "ADC_PITCH"); | |
| 337 | case 2: return input_port_read(machine(), "ADC_MISSILE"); | |
| 338 | case 3: return input_port_read(machine(), "ADC_HOVER"); | |
| 349 | 339 | default: return 0; |
| 350 | 340 | } |
| 351 | 341 | } |
| r14896 | r14897 | |
| 378 | 368 | * |
| 379 | 369 | *************************************/ |
| 380 | 370 | |
| 381 | ||
| 371 | ||
| 382 | 372 | { |
| 383 | 373 | #define LO_SHUNT 250.0 |
| 384 | 374 | #define LO_R0 5600.0 |
| r14896 | r14897 | |
| 392 | 382 | #define LO_RI 100000.0 |
| 393 | 383 | #define LO_RP 100000.0 |
| 394 | 384 | |
| 395 | lockon_state *state = space->machine().driver_data<lockon_state>(); | |
| 396 | 385 | |
| 397 | 386 | static const double gains[16] = |
| 398 | 387 | { |
| r14896 | r14897 | |
| 417 | 406 | double lgain = gains[data & 0xf]; |
| 418 | 407 | double rgain = gains[data >> 4]; |
| 419 | 408 | |
| 420 | flt_volume_set_volume(state->m_f2203_1l, lgain); | |
| 421 | flt_volume_set_volume(state->m_f2203_2l, lgain); | |
| 422 | flt_volume_set_volume(state->m_f2203_3l, lgain); | |
| 409 | flt_volume_set_volume(m_f2203_1l, lgain); | |
| 410 | flt_volume_set_volume(m_f2203_2l, lgain); | |
| 411 | flt_volume_set_volume(m_f2203_3l, lgain); | |
| 423 | 412 | |
| 424 | flt_volume_set_volume(state->m_f2203_1r, rgain); | |
| 425 | flt_volume_set_volume(state->m_f2203_2r, rgain); | |
| 426 | flt_volume_set_volume(state->m_f2203_3r, rgain); | |
| 413 | flt_volume_set_volume(m_f2203_1r, rgain); | |
| 414 | flt_volume_set_volume(m_f2203_2r, rgain); | |
| 415 | flt_volume_set_volume(m_f2203_3r, rgain); | |
| 427 | 416 | } |
| 428 | 417 | |
| 429 | 418 | static void ym2203_irq(device_t *device, int irq) |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | UINT8 vfd_ser_value; |
| 59 | 59 | int vfd_ser_count; |
| 60 | DECLARE_READ16_MEMBER(sc4_mem_r); | |
| 61 | DECLARE_WRITE16_MEMBER(sc4_mem_w); | |
| 60 | 62 | }; |
| 61 | 63 | |
| 62 | 64 | class sc4_adder4_state : public sc4_state |
| r14896 | r14897 | |
| 71 | 73 | required_device<cpu_device> m_adder4cpu; |
| 72 | 74 | }; |
| 73 | 75 | |
| 74 | ||
| 76 | ||
| 75 | 77 | { |
| 76 | sc4_state *state = space->machine().driver_data<sc4_state>(); | |
| 77 | int pc = cpu_get_pc(&space->device()); | |
| 78 | int cs = m68307_get_cs(state->m_maincpu, offset * 2); | |
| 78 | int pc = cpu_get_pc(&space.device()); | |
| 79 | int cs = m68307_get_cs(m_maincpu, offset * 2); | |
| 79 | 80 | int base = 0, end = 0, base2 = 0, end2 = 0; |
| 80 | // if (!( | |
| 81 | // if (!( | |
| 81 | 82 | |
| 82 | 83 | switch ( cs ) |
| 83 | 84 | { |
| 84 | 85 | case 1: |
| 85 | 86 | if (offset<0x100000/2) |
| 86 | return | |
| 87 | return | |
| 87 | 88 | else |
| 88 | 89 | logerror("%08x maincpu read access offset %08x mem_mask %04x cs %d\n", pc, offset*2, mem_mask, cs); |
| 89 | 90 | break; |
| r14896 | r14897 | |
| 99 | 100 | if ((offset>=base) && (offset<end)) |
| 100 | 101 | { |
| 101 | 102 | offset-=base; |
| 102 | return( | |
| 103 | return( | |
| 103 | 104 | } |
| 104 | 105 | else if ((offset>=base2) && (offset<end2)) |
| 105 | 106 | { |
| r14896 | r14897 | |
| 135 | 136 | return 0x0000; |
| 136 | 137 | |
| 137 | 138 | case 0x1244: |
| 138 | return ymz280b_r( | |
| 139 | return ymz280b_r( | |
| 139 | 140 | |
| 140 | 141 | case 0x1246: |
| 141 | return ymz280b_r( | |
| 142 | return ymz280b_r( | |
| 142 | 143 | |
| 143 | 144 | default: |
| 144 | 145 | logerror("%08x maincpu read access offset %08x mem_mask %04x cs %d (LAMPS etc.)\n", pc, offset*2, mem_mask, cs); |
| r14896 | r14897 | |
| 157 | 158 | if ((offset>=base) && (offset<end)) |
| 158 | 159 | { |
| 159 | 160 | offset-=base; |
| 160 | return duart68681_r( | |
| 161 | return duart68681_r( | |
| 161 | 162 | } |
| 162 | 163 | else |
| 163 | 164 | { |
| r14896 | r14897 | |
| 180 | 181 | return 0x0000; |
| 181 | 182 | } |
| 182 | 183 | |
| 183 | ||
| 184 | ||
| 184 | 185 | { |
| 185 | sc4_state *state = space->machine().driver_data<sc4_state>(); | |
| 186 | int pc = cpu_get_pc(&space->device()); | |
| 187 | int cs = m68307_get_cs(state->m_maincpu, offset * 2); | |
| 186 | int pc = cpu_get_pc(&space.device()); | |
| 187 | int cs = m68307_get_cs(m_maincpu, offset * 2); | |
| 188 | 188 | int base = 0, end = 0, base2 = 0, end2 = 0; |
| 189 | 189 | |
| 190 | 190 | switch ( cs ) |
| r14896 | r14897 | |
| 206 | 206 | if ((offset>=base) && (offset<end)) |
| 207 | 207 | { |
| 208 | 208 | offset-=base; |
| 209 | COMBINE_DATA(& | |
| 209 | COMBINE_DATA(& | |
| 210 | 210 | } |
| 211 | 211 | else if ((offset>=base2) && (offset<end2)) |
| 212 | 212 | { |
| r14896 | r14897 | |
| 215 | 215 | switch (offset << 1) |
| 216 | 216 | { |
| 217 | 217 | case 0x1248: |
| 218 | ymz280b_w( | |
| 218 | ymz280b_w( | |
| 219 | 219 | break; |
| 220 | 220 | |
| 221 | 221 | case 0x124a: |
| 222 | ymz280b_w( | |
| 222 | ymz280b_w( | |
| 223 | 223 | break; |
| 224 | 224 | |
| 225 | 225 | |
| r14896 | r14897 | |
| 240 | 240 | if ((offset>=base) && (offset<end)) |
| 241 | 241 | { |
| 242 | 242 | offset-=base; |
| 243 | duart68681_w( | |
| 243 | duart68681_w( | |
| 244 | 244 | } |
| 245 | 245 | else |
| 246 | 246 | { |
| r14896 | r14897 | |
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | static ADDRESS_MAP_START( sc4_map, AS_PROGRAM, 16, sc4_adder4_state ) | |
| 262 | AM_RANGE(0x0000000, 0xffffff) AM_READWRITE_LEGACY(sc4_mem_r, sc4_mem_w) | |
| 261 | static ADDRESS_MAP_START( sc4_map, AS_PROGRAM, 16, sc4_state ) | |
| 262 | AM_RANGE(0x0000000, 0xffffff) AM_READWRITE(sc4_mem_r, sc4_mem_w) | |
| 263 | 263 | ADDRESS_MAP_END |
| 264 | 264 | |
| 265 | 265 | static ADDRESS_MAP_START( sc4_adder4_map, AS_PROGRAM, 32, sc4_adder4_state ) |
| r14896 | r14897 | |
|---|---|---|
| 90 | 90 | { |
| 91 | 91 | public: |
| 92 | 92 | warpspeed_state(const machine_config &mconfig, device_type type, const char *tag) |
| 93 | : driver_device(mconfig, type, tag) { } | |
| 93 | : driver_device(mconfig, type, tag) , | |
| 94 | m_videoram(*this, "videoram"), | |
| 95 | m_workram(*this, "workram"){ } | |
| 94 | 96 | |
| 95 | UINT8 | |
| 97 | required_shared_ptr<UINT8> | |
| 96 | 98 | tilemap_t *m_text_tilemap; |
| 97 | 99 | tilemap_t *m_starfield_tilemap; |
| 98 | UINT8 | |
| 100 | required_shared_ptr<UINT8> | |
| 99 | 101 | UINT8 m_regs[0x28]; |
| 100 | 102 | DECLARE_WRITE8_MEMBER(warpspeed_hardware_w); |
| 101 | 103 | DECLARE_WRITE8_MEMBER(warpspeed_vidram_w); |
| r14896 | r14897 | |
| 110 | 112 | { |
| 111 | 113 | warpspeed_state *state = machine.driver_data<warpspeed_state>(); |
| 112 | 114 | |
| 113 | UINT8 code = state->m_videoram[tile_index] & 0x3f; | |
| 115 | UINT8 code = state->m_videoram.target()[tile_index] & 0x3f; | |
| 114 | 116 | SET_TILE_INFO(0, code, 0, 0); |
| 115 | 117 | } |
| 116 | 118 | |
| r14896 | r14897 | |
| 127 | 129 | WRITE8_MEMBER(warpspeed_state::warpspeed_vidram_w) |
| 128 | 130 | { |
| 129 | 131 | |
| 130 | m_videoram[offset] = data; | |
| 132 | m_videoram.target()[offset] = data; | |
| 131 | 133 | m_text_tilemap->mark_tile_dirty(offset); |
| 132 | 134 | } |
| 133 | 135 | |
| r14896 | r14897 | |
| 215 | 217 | |
| 216 | 218 | static ADDRESS_MAP_START( warpspeed_map, AS_PROGRAM, 8, warpspeed_state ) |
| 217 | 219 | AM_RANGE(0x0000, 0x0dff) AM_ROM |
| 218 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(warpspeed_vidram_w ) AM_BASE(m_videoram) | |
| 219 | AM_RANGE(0x1c00, 0x1cff) AM_RAM AM_BASE(m_workram) | |
| 220 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(warpspeed_vidram_w ) AM_SHARE("videoram") | |
| 221 | AM_RANGE(0x1c00, 0x1cff) AM_RAM AM_SHARE("workram") | |
| 220 | 222 | ADDRESS_MAP_END |
| 221 | 223 | |
| 222 | 224 | static ADDRESS_MAP_START ( warpspeed_io_map, AS_IO, 8, warpspeed_state ) |
| r14896 | r14897 | |
|---|---|---|
| 142 | 142 | if (ACCESSING_BITS_0_7) |
| 143 | 143 | { |
| 144 | 144 | data &= 0xff; |
| 145 | soundlatch_w(space, 0, data); | |
| 145 | soundlatch_byte_w(space, 0, data); | |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| r14896 | r14897 | |
| 153 | 153 | |
| 154 | 154 | READ16_MEMBER(gijoe_state::sound_status_r) |
| 155 | 155 | { |
| 156 | return soundlatch2_r(space, 0); | |
| 156 | return soundlatch2_byte_r(space, 0); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | static void sound_nmi( device_t *device ) |
| r14896 | r14897 | |
| 172 | 172 | AM_RANGE(0x160000, 0x160007) AM_DEVWRITE_LEGACY("k056832", k056832_b_word_w) // VSCCS (board dependent) |
| 173 | 173 | AM_RANGE(0x170000, 0x170001) AM_WRITENOP // Watchdog |
| 174 | 174 | AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_BASE(m_workram) // Main RAM. Spec. 180000-1803ff, 180400-187fff |
| 175 | AM_RANGE(0x190000, 0x190fff) AM_RAM_WRITE(paletteram | |
| 175 | AM_RANGE(0x190000, 0x190fff) AM_RAM_WRITE(paletteram | |
| 176 | 176 | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w) |
| 177 | 177 | AM_RANGE(0x1b0000, 0x1b003f) AM_DEVWRITE_LEGACY("k056832", k056832_word_w) |
| 178 | 178 | AM_RANGE(0x1c000c, 0x1c000d) AM_WRITE(sound_cmd_w) |
| r14896 | r14897 | |
| 197 | 197 | AM_RANGE(0x0000, 0xebff) AM_ROM |
| 198 | 198 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 199 | 199 | AM_RANGE(0xf800, 0xfa2f) AM_DEVREADWRITE("k054539", k054539_device, read, write) |
| 200 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(soundlatch2_w) | |
| 201 | AM_RANGE(0xfc02, 0xfc02) AM_READ(soundlatch_r) | |
| 200 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(soundlatch2_byte_w) | |
| 201 | AM_RANGE(0xfc02, 0xfc02) AM_READ(soundlatch_byte_r) | |
| 202 | 202 | ADDRESS_MAP_END |
| 203 | 203 | |
| 204 | 204 | static INPUT_PORTS_START( gijoe ) |
| r14896 | r14897 | |
|---|---|---|
| 139 | 139 | else if ((prevpc == 0x27f8) || (prevpc == 0x511a) || (prevpc == 0x5142) || (prevpc == 0x516a)) |
| 140 | 140 | { |
| 141 | 141 | /* The main CPU stuffs the byte for the soundlatch into 0xfffffd.*/ |
| 142 | state->soundlatch_w(*space,2,state->m_ram16[0x3ffc/2]); | |
| 142 | state->soundlatch_byte_w(*space,2,state->m_ram16[0x3ffc/2]); | |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| r14896 | r14897 | |
| 152 | 152 | WRITE16_MEMBER(tigeroad_state::tigeroad_soundcmd_w) |
| 153 | 153 | { |
| 154 | 154 | if (ACCESSING_BITS_8_15) |
| 155 | soundlatch_w(space,offset,data >> 8); | |
| 155 | soundlatch_byte_w(space,offset,data >> 8); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | static WRITE8_DEVICE_HANDLER( msm5205_w ) |
| r14896 | r14897 | |
| 177 | 177 | AM_RANGE(0xfec000, 0xfec7ff) AM_RAM_WRITE(tigeroad_videoram_w) AM_BASE(m_videoram) |
| 178 | 178 | AM_RANGE(0xfe8000, 0xfe8003) AM_WRITE(tigeroad_scroll_w) |
| 179 | 179 | AM_RANGE(0xfe800e, 0xfe800f) AM_WRITEONLY /* fe800e = watchdog or IRQ acknowledge */ |
| 180 | AM_RANGE(0xff8200, 0xff867f) AM_RAM_WRITE(paletteram | |
| 180 | AM_RANGE(0xff8200, 0xff867f) AM_RAM_WRITE(paletteram | |
| 181 | 181 | AM_RANGE(0xffc000, 0xffffff) AM_RAM AM_BASE(m_ram16) |
| 182 | 182 | ADDRESS_MAP_END |
| 183 | 183 | |
| r14896 | r14897 | |
| 187 | 187 | AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 188 | 188 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 189 | 189 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 190 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 190 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 191 | 191 | ADDRESS_MAP_END |
| 192 | 192 | |
| 193 | 193 | static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, tigeroad_state ) |
| 194 | 194 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 195 | AM_RANGE(0x7f, 0x7f) AM_WRITE(soundlatch2_w) | |
| 195 | AM_RANGE(0x7f, 0x7f) AM_WRITE(soundlatch2_byte_w) | |
| 196 | 196 | ADDRESS_MAP_END |
| 197 | 197 | |
| 198 | 198 | static ADDRESS_MAP_START( sample_map, AS_PROGRAM, 8, tigeroad_state ) |
| r14896 | r14897 | |
| 201 | 201 | |
| 202 | 202 | static ADDRESS_MAP_START( sample_port_map, AS_IO, 8, tigeroad_state ) |
| 203 | 203 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 204 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r) | |
| 204 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) | |
| 205 | 205 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("msm", msm5205_w) |
| 206 | 206 | ADDRESS_MAP_END |
| 207 | 207 |
| r14896 | r14897 | |
|---|---|---|
| 177 | 177 | { |
| 178 | 178 | public: |
| 179 | 179 | spaceg_state(const machine_config &mconfig, device_type type, const char *tag) |
| 180 | : driver_device(mconfig, type, tag) { } | |
| 180 | : driver_device(mconfig, type, tag) , | |
| 181 | m_colorram(*this, "colorram"), | |
| 182 | m_videoram(*this, "videoram"), | |
| 183 | m_io9400(*this, "io9400"), | |
| 184 | m_io9401(*this, "io9401"){ } | |
| 181 | 185 | |
| 182 | UINT8 * m_videoram; | |
| 183 | UINT8 * m_colorram; | |
| 184 | UINT8 * m_io9400; | |
| 185 | UINT8 * m_io9401; | |
| 186 | required_shared_ptr<UINT8> m_colorram; | |
| 187 | required_shared_ptr<UINT8> m_videoram; | |
| 188 | required_shared_ptr<UINT8> m_io9400; | |
| 189 | required_shared_ptr<UINT8> m_io9401; | |
| 186 | 190 | DECLARE_WRITE8_MEMBER(zvideoram_w); |
| 187 | 191 | DECLARE_READ8_MEMBER(spaceg_colorram_r); |
| 188 | 192 | }; |
| r14896 | r14897 | |
| 222 | 226 | |
| 223 | 227 | WRITE8_MEMBER(spaceg_state::zvideoram_w) |
| 224 | 228 | { |
| 225 | int col = m_colorram[0x400]; | |
| 229 | int col = m_colorram.target()[0x400]; | |
| 226 | 230 | int xoff = *m_io9400 >> 5 & 7; |
| 227 | 231 | UINT16 offset2 = (offset + 0x100) & 0x1fff; |
| 228 | 232 | UINT16 sdata = data << (8 - xoff); |
| 229 | UINT16 vram_data = m_videoram[offset] << 8 | (m_videoram[offset2]); | |
| 233 | UINT16 vram_data = m_videoram.target()[offset] << 8 | (m_videoram.target()[offset2]); | |
| 230 | 234 | |
| 231 | 235 | if (col > 0x0f) popmessage("color > 0x0f = %2d", col); |
| 232 | 236 | col &= 0x0f; |
| 233 | 237 | |
| 234 | switch (*m_io9401) | |
| 238 | switch (*m_io9401.target()) | |
| 235 | 239 | { |
| 236 | 240 | // draw |
| 237 | 241 | case 0: |
| r14896 | r14897 | |
| 241 | 245 | vram_data |= sdata; |
| 242 | 246 | |
| 243 | 247 | // update colorram |
| 244 | if (sdata&0xff00) m_colorram[offset] = col; | |
| 245 | if (sdata&0x00ff) m_colorram[offset2] = col; | |
| 248 | if (sdata&0xff00) m_colorram.target()[offset] = col; | |
| 249 | if (sdata&0x00ff) m_colorram.target()[offset2] = col; | |
| 246 | 250 | break; |
| 247 | 251 | |
| 248 | 252 | // erase |
| r14896 | r14897 | |
| 256 | 260 | return; |
| 257 | 261 | } |
| 258 | 262 | |
| 259 | m_videoram[offset]=vram_data>>8; | |
| 260 | m_videoram[offset2]=vram_data&0xff; | |
| 263 | m_videoram.target()[offset]=vram_data>>8; | |
| 264 | m_videoram.target()[offset2]=vram_data&0xff; | |
| 261 | 265 | } |
| 262 | 266 | |
| 263 | 267 | |
| r14896 | r14897 | |
| 267 | 271 | |
| 268 | 272 | if (offset < 0x400) |
| 269 | 273 | { |
| 270 | rgbcolor = (m_colorram[offset] << 1) | ((offset &0x100) >> 8); | |
| 274 | rgbcolor = (m_colorram.target()[offset] << 1) | ((offset &0x100) >> 8); | |
| 271 | 275 | |
| 272 | 276 | if ((offset >= 0x200) && (offset < 0x220)) /* 0xa200- 0xa21f */ |
| 273 | 277 | { |
| r14896 | r14897 | |
| 288 | 292 | if (*m_io9401 != 0x40) |
| 289 | 293 | logerror("colorram read in mode: 9401 = %02x (offset = %04x)\n", *m_io9401, offset); |
| 290 | 294 | |
| 291 | return m_colorram[offset]; | |
| 295 | return m_colorram.target()[offset]; | |
| 292 | 296 | } |
| 293 | 297 | |
| 294 | 298 | |
| r14896 | r14897 | |
| 300 | 304 | for (offs = 0; offs < 0x2000; offs++) |
| 301 | 305 | { |
| 302 | 306 | int i; |
| 303 | UINT8 data = state->m_videoram[offs]; | |
| 307 | UINT8 data = state->m_videoram.target()[offs]; | |
| 304 | 308 | int y = offs & 0xff; |
| 305 | 309 | int x = (offs >> 8) << 3; |
| 306 | 310 | |
| 307 | 311 | for (i = 0; i < 8; i++) |
| 308 | 312 | { |
| 309 | bitmap.pix16(y, x) = (data & 0x80) ? state->m_colorram[offs] : 0; | |
| 313 | bitmap.pix16(y, x) = (data & 0x80) ? state->m_colorram.target()[offs] : 0; | |
| 310 | 314 | |
| 311 | 315 | x++; |
| 312 | 316 | data <<= 1; |
| r14896 | r14897 | |
| 328 | 332 | AM_RANGE(0x3000, 0x3fff) AM_ROM |
| 329 | 333 | AM_RANGE(0x7000, 0x77ff) AM_RAM |
| 330 | 334 | |
| 331 | AM_RANGE(0xa000, 0xbfff) AM_RAM_READ(spaceg_colorram_r) AM_BASE(m_colorram) | |
| 332 | AM_RANGE(0xc000, 0xdfff) AM_RAM_WRITE(zvideoram_w) AM_BASE(m_videoram) | |
| 335 | AM_RANGE(0xa000, 0xbfff) AM_RAM_READ(spaceg_colorram_r) AM_SHARE("colorram") | |
| 336 | AM_RANGE(0xc000, 0xdfff) AM_RAM_WRITE(zvideoram_w) AM_SHARE("videoram") | |
| 333 | 337 | |
| 334 | AM_RANGE(0x9400, 0x9400) AM_WRITEONLY AM_BASE(m_io9400) /* gfx ctrl */ | |
| 335 | AM_RANGE(0x9401, 0x9401) AM_WRITEONLY AM_BASE(m_io9401) /* gfx ctrl */ | |
| 338 | AM_RANGE(0x9400, 0x9400) AM_WRITEONLY AM_SHARE("io9400") /* gfx ctrl */ | |
| 339 | AM_RANGE(0x9401, 0x9401) AM_WRITEONLY AM_SHARE("io9401") /* gfx ctrl */ | |
| 336 | 340 | /* 9402 - |
| 337 | 341 | bits 0 and 1 probably control the lamps under the player 1 and player 2 start buttons |
| 338 | 342 | bit 2 - unknown - |
| r14896 | r14897 | |
|---|---|---|
| 208 | 208 | set_led_status(device->machine(), 9,data & 0x08); |
| 209 | 209 | |
| 210 | 210 | /* bit 5 - ticket out in trivia games */ |
| 211 | ticket_dispenser_w(device->machine(). | |
| 211 | device->machine().device<ticket_dispenser_device>("ticket")->write(*device->machine().memory().first_spac | |
| 212 | 212 | |
| 213 | 213 | /* bit 6 enables NMI */ |
| 214 | 214 | state->m_nmi_mask = data & 0x40; |
| r14896 | r14897 | |
| 615 | 615 | PORT_START("IN0") |
| 616 | 616 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) |
| 617 | 617 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) |
| 618 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) /* ticket status */ | |
| 618 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) /* ticket status */ | |
| 619 | 619 | PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) |
| 620 | 620 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 621 | 621 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r14896 | r14897 | |
| 723 | 723 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00) PORT_NAME ("Start in no coins mode") |
| 724 | 724 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40) |
| 725 | 725 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00) |
| 726 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) /* ticket status */ | |
| 726 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) /* ticket status */ | |
| 727 | 727 | PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) |
| 728 | 728 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 729 | 729 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r14896 | r14897 | |
| 900 | 900 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00) PORT_NAME ("Start in no coins mode") |
| 901 | 901 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40) |
| 902 | 902 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00) |
| 903 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) /* ticket status */ | |
| 903 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) /* ticket status */ | |
| 904 | 904 | PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) |
| 905 | 905 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 906 | 906 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r14896 | r14897 | |
| 1006 | 1006 | PORT_MODIFY("IN0") |
| 1007 | 1007 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) |
| 1008 | 1008 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) |
| 1009 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) /* ticket status */ | |
| 1009 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) /* ticket status */ | |
| 1010 | 1010 | PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) |
| 1011 | 1011 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1012 | 1012 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r14896 | r14897 | |
| 1135 | 1135 | |
| 1136 | 1136 | MCFG_PPI8255_ADD( "ppi8255_0", getrivia_ppi8255_intf[0] ) |
| 1137 | 1137 | MCFG_PPI8255_ADD( "ppi8255_1", getrivia_ppi8255_intf[1] ) |
| 1138 | MCFG_TICKET_DISPENSER_ADD("ticket", 100, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 1138 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 1139 | 1139 | |
| 1140 | 1140 | /* sound hardware */ |
| 1141 | 1141 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r14896 | r14897 | |
|---|---|---|
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | |
| 511 | ||
| 511 | ||
| 512 | 512 | { |
| 513 | 513 | switch (offset) |
| 514 | 514 | { |
| r14896 | r14897 | |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | |
| 529 | ||
| 529 | ||
| 530 | 530 | { |
| 531 | 531 | if (ACCESSING_BITS_0_7) |
| 532 | int_control_w(space, offset*2+0, data); | |
| 532 | int_control_w(&space, offset*2+0, data); | |
| 533 | 533 | if (ACCESSING_BITS_8_15) |
| 534 | int_control_w(space, offset*2+1, data >> 8); | |
| 534 | int_control_w(&space, offset*2+1, data >> 8); | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | |
| 538 | ||
| 538 | ||
| 539 | 539 | { |
| 540 | 540 | switch (offset) |
| 541 | 541 | { |
| r14896 | r14897 | |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | |
| 552 | ||
| 552 | ||
| 553 | 553 | { |
| 554 | 554 | if (ACCESSING_BITS_0_7) |
| 555 | int_control_w(space, offset*4+0, data); | |
| 555 | int_control_w(&space, offset*4+0, data); | |
| 556 | 556 | if (ACCESSING_BITS_8_15) |
| 557 | int_control_w(space, offset*4+1, data >> 8); | |
| 557 | int_control_w(&space, offset*4+1, data >> 8); | |
| 558 | 558 | if (ACCESSING_BITS_16_23) |
| 559 | int_control_w(space, offset*4+2, data >> 16); | |
| 559 | int_control_w(&space, offset*4+2, data >> 16); | |
| 560 | 560 | if (ACCESSING_BITS_24_31) |
| 561 | int_control_w(space, offset*4+3, data >> 24); | |
| 561 | int_control_w(&space, offset*4+3, data >> 24); | |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | |
| r14896 | r14897 | |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | |
| 711 | ||
| 711 | ||
| 712 | 712 | { |
| 713 | return common_io_chip_r(space, 0, offset, mem_mask); | |
| 713 | return common_io_chip_r(&space, 0, offset, mem_mask); | |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | |
| 717 | ||
| 717 | ||
| 718 | 718 | { |
| 719 | common_io_chip_w(space, 0, offset, data, mem_mask); | |
| 719 | common_io_chip_w(&space, 0, offset, data, mem_mask); | |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | |
| 723 | ||
| 723 | ||
| 724 | 724 | { |
| 725 | return common_io_chip_r(space, 0, offset*2+0, mem_mask) | | |
| 726 | (common_io_chip_r(space, 0, offset*2+1, mem_mask >> 16) << 16); | |
| 725 | return common_io_chip_r(&space, 0, offset*2+0, mem_mask) | | |
| 726 | (common_io_chip_r(&space, 0, offset*2+1, mem_mask >> 16) << 16); | |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | |
| 730 | ||
| 730 | ||
| 731 | 731 | { |
| 732 | 732 | if (ACCESSING_BITS_0_15) |
| 733 | common_io_chip_w(space, 0, offset*2+0, data, mem_mask); | |
| 733 | common_io_chip_w(&space, 0, offset*2+0, data, mem_mask); | |
| 734 | 734 | if (ACCESSING_BITS_16_31) |
| 735 | common_io_chip_w(space, 0, offset*2+1, data >> 16, mem_mask >> 16); | |
| 735 | common_io_chip_w(&space, 0, offset*2+1, data >> 16, mem_mask >> 16); | |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | |
| 739 | ||
| 739 | ||
| 740 | 740 | { |
| 741 | return common_io_chip_r(space, 1, offset*2+0, mem_mask) | | |
| 742 | (common_io_chip_r(space, 1, offset*2+1, mem_mask >> 16) << 16); | |
| 741 | return common_io_chip_r(&space, 1, offset*2+0, mem_mask) | | |
| 742 | (common_io_chip_r(&space, 1, offset*2+1, mem_mask >> 16) << 16); | |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | |
| 746 | ||
| 746 | ||
| 747 | 747 | { |
| 748 | 748 | if (ACCESSING_BITS_0_15) |
| 749 | common_io_chip_w(space, 1, offset*2+0, data, mem_mask); | |
| 749 | common_io_chip_w(&space, 1, offset*2+0, data, mem_mask); | |
| 750 | 750 | if (ACCESSING_BITS_16_31) |
| 751 | common_io_chip_w(space, 1, offset*2+1, data >> 16, mem_mask >> 16); | |
| 751 | common_io_chip_w(&space, 1, offset*2+1, data >> 16, mem_mask >> 16); | |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | |
| r14896 | r14897 | |
| 759 | 759 | * |
| 760 | 760 | *************************************/ |
| 761 | 761 | |
| 762 | ||
| 762 | ||
| 763 | 763 | { |
| 764 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 765 | if (state->m_custom_io_r[0]) | |
| 766 | return (*state->m_custom_io_r[0])(space, offset, mem_mask); | |
| 764 | if (!m_custom_io_r[0].isnull()) | |
| 765 | return (m_custom_io_r[0])(space, offset, mem_mask); | |
| 767 | 766 | else |
| 768 | logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space | |
| 767 | logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space. | |
| 769 | 768 | return 0xffff; |
| 770 | 769 | } |
| 771 | 770 | |
| 772 | 771 | |
| 773 | ||
| 772 | ||
| 774 | 773 | { |
| 775 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 776 | 774 | /* only LSB matters */ |
| 777 | 775 | if (!ACCESSING_BITS_0_7) |
| 778 | 776 | return; |
| 779 | 777 | |
| 780 | if (state->m_custom_io_w[0]) | |
| 781 | (*state->m_custom_io_w[0])(space, offset, data, mem_mask); | |
| 778 | if (!m_custom_io_w[0].isnull()) | |
| 779 | (m_custom_io_w[0])(space, offset, data, mem_mask); | |
| 782 | 780 | else |
| 783 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space | |
| 781 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space. | |
| 784 | 782 | } |
| 785 | 783 | |
| 786 | 784 | |
| 787 | ||
| 785 | ||
| 788 | 786 | { |
| 789 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 790 | if (state->m_custom_io_r[0]) | |
| 791 | return (*state->m_custom_io_r[0])(space, offset*2+0, mem_mask) | | |
| 792 | ((*state->m_custom_io_r[0])(space, offset*2+1, mem_mask >> 16) << 16); | |
| 787 | if (!m_custom_io_r[0].isnull()) | |
| 788 | return (m_custom_io_r[0])(space, offset*2+0, mem_mask) | | |
| 789 | ((m_custom_io_r[0])(space, offset*2+1, mem_mask >> 16) << 16); | |
| 793 | 790 | else |
| 794 | logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space | |
| 791 | logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space. | |
| 795 | 792 | return 0xffffffff; |
| 796 | 793 | } |
| 797 | 794 | |
| 798 | 795 | |
| 799 | ||
| 796 | ||
| 800 | 797 | { |
| 801 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 802 | 798 | /* only LSB matters */ |
| 803 | 799 | |
| 804 | 800 | |
| 805 | 801 | if (ACCESSING_BITS_0_7) |
| 806 | 802 | { |
| 807 | 803 | /* harddunk uses bits 4,5 for output lamps */ |
| 808 | if (state->m_sw3_output) | |
| 809 | state->m_sw3_output(0, data & 0xff); | |
| 804 | if (m_sw3_output) | |
| 805 | m_sw3_output(0, data & 0xff); | |
| 810 | 806 | |
| 811 | if (state->m_custom_io_w[0]) | |
| 812 | (*state->m_custom_io_w[0])(space, offset*2+0, data, mem_mask); | |
| 807 | if (!m_custom_io_w[0].isnull()) | |
| 808 | (m_custom_io_w[0])(space, offset*2+0, data, mem_mask); | |
| 813 | 809 | else |
| 814 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space | |
| 810 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space. | |
| 815 | 811 | |
| 816 | 812 | } |
| 817 | 813 | if (ACCESSING_BITS_16_23) |
| 818 | 814 | { |
| 819 | if (state->m_custom_io_w[0]) | |
| 820 | (*state->m_custom_io_w[0])(space, offset*2+1, data >> 16, mem_mask >> 16); | |
| 815 | if (!m_custom_io_w[0].isnull()) | |
| 816 | (m_custom_io_w[0])(space, offset*2+1, data >> 16, mem_mask >> 16); | |
| 821 | 817 | else |
| 822 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space | |
| 818 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space. | |
| 823 | 819 | } |
| 824 | 820 | } |
| 825 | 821 | |
| 826 | 822 | |
| 827 | ||
| 823 | ||
| 828 | 824 | { |
| 829 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 830 | if (state->m_custom_io_r[1]) | |
| 831 | return (*state->m_custom_io_r[1])(space, offset*2+0, mem_mask) | | |
| 832 | ((*state->m_custom_io_r[1])(space, offset*2+1, mem_mask >> 16) << 16); | |
| 825 | if (!m_custom_io_r[1].isnull()) | |
| 826 | return (m_custom_io_r[1])(space, offset*2+0, mem_mask) | | |
| 827 | ((m_custom_io_r[1])(space, offset*2+1, mem_mask >> 16) << 16); | |
| 833 | 828 | else |
| 834 | logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space | |
| 829 | logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space. | |
| 835 | 830 | return 0xffffffff; |
| 836 | 831 | } |
| 837 | 832 | |
| 838 | 833 | |
| 839 | ||
| 834 | ||
| 840 | 835 | { |
| 841 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 842 | 836 | /* only LSB matters */ |
| 843 | 837 | if (ACCESSING_BITS_0_7) |
| 844 | 838 | { |
| 845 | if (state->m_custom_io_w[1]) | |
| 846 | (*state->m_custom_io_w[1])(space, offset*2+0, data, mem_mask); | |
| 839 | if (!m_custom_io_w[1].isnull()) | |
| 840 | (m_custom_io_w[1])(space, offset*2+0, data, mem_mask); | |
| 847 | 841 | else |
| 848 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space | |
| 842 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space. | |
| 849 | 843 | } |
| 850 | 844 | if (ACCESSING_BITS_16_23) |
| 851 | 845 | { |
| 852 | if (state->m_custom_io_w[1]) | |
| 853 | (*state->m_custom_io_w[1])(space, offset*2+1, data >> 16, mem_mask >> 16); | |
| 846 | if (!m_custom_io_w[1].isnull()) | |
| 847 | (m_custom_io_w[1])(space, offset*2+1, data >> 16, mem_mask >> 16); | |
| 854 | 848 | else |
| 855 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space | |
| 849 | logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space. | |
| 856 | 850 | } |
| 857 | 851 | } |
| 858 | 852 | |
| r14896 | r14897 | |
| 864 | 858 | * |
| 865 | 859 | *************************************/ |
| 866 | 860 | |
| 867 | ||
| 861 | ||
| 868 | 862 | { |
| 869 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 870 | 863 | UINT16 result; |
| 871 | 864 | switch (offset) |
| 872 | 865 | { |
| r14896 | r14897 | |
| 874 | 867 | case 0x12/2: |
| 875 | 868 | case 0x14/2: |
| 876 | 869 | case 0x16/2: |
| 877 | result = state->m_analog_value[offset & 3] | 0x7f; | |
| 878 | state->m_analog_value[offset & 3] <<= 1; | |
| 870 | result = m_analog_value[offset & 3] | 0x7f; | |
| 871 | m_analog_value[offset & 3] <<= 1; | |
| 879 | 872 | return result; |
| 880 | 873 | } |
| 881 | logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", cpu_get_pc(&space | |
| 874 | logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", cpu_get_pc(&space. | |
| 882 | 875 | return 0xffff; |
| 883 | 876 | } |
| 884 | 877 | |
| 885 | 878 | |
| 886 | ||
| 879 | ||
| 887 | 880 | { |
| 888 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 889 | 881 | static const char *const names[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4" }; |
| 890 | 882 | switch (offset) |
| 891 | 883 | { |
| r14896 | r14897 | |
| 893 | 885 | case 0x12/2: |
| 894 | 886 | case 0x14/2: |
| 895 | 887 | case 0x16/2: |
| 896 | | |
| 888 | | |
| 897 | 889 | return; |
| 898 | 890 | } |
| 899 | logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space | |
| 891 | logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space. | |
| 900 | 892 | } |
| 901 | 893 | |
| 902 | 894 | |
| 903 | ||
| 895 | ||
| 904 | 896 | { |
| 905 | 897 | static const char *const names[] = { "EXTRA1", "EXTRA2", "EXTRA3", "EXTRA4" }; |
| 906 | 898 | switch (offset) |
| r14896 | r14897 | |
| 909 | 901 | case 0x22/2: |
| 910 | 902 | case 0x24/2: |
| 911 | 903 | case 0x26/2: |
| 912 | return input_port_read_safe( | |
| 904 | return input_port_read_safe( | |
| 913 | 905 | } |
| 914 | 906 | |
| 915 | logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", cpu_get_pc(&space | |
| 907 | logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", cpu_get_pc(&space. | |
| 916 | 908 | return 0xffff; |
| 917 | 909 | } |
| 918 | 910 | |
| 919 | 911 | |
| 920 | ||
| 912 | ||
| 921 | 913 | { |
| 922 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 923 | 914 | static const char *const names[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4", "ANALOG5", "ANALOG6", "ANALOG7", "ANALOG8" }; |
| 924 | 915 | switch (offset) |
| 925 | 916 | { |
| r14896 | r14897 | |
| 927 | 918 | case 0x12/2: |
| 928 | 919 | case 0x14/2: |
| 929 | 920 | case 0x16/2: |
| 930 | | |
| 921 | | |
| 931 | 922 | return; |
| 932 | 923 | |
| 933 | 924 | case 0x20/2: |
| 934 | | |
| 925 | | |
| 935 | 926 | return; |
| 936 | 927 | } |
| 937 | logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space | |
| 928 | logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space. | |
| 938 | 929 | } |
| 939 | 930 | |
| 940 | 931 | |
| 941 | ||
| 932 | ||
| 942 | 933 | { |
| 943 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 944 | 934 | static const char *const names[] = { "TRACKX1", "TRACKY1", "TRACKX2", "TRACKY2", "TRACKX3", "TRACKY3" }; |
| 945 | 935 | |
| 946 | 936 | switch (offset) |
| r14896 | r14897 | |
| 951 | 941 | case 0x0c/2: |
| 952 | 942 | case 0x10/2: |
| 953 | 943 | case 0x14/2: |
| 954 | return (UINT8)(input_port_read( | |
| 944 | return (UINT8)(input_port_read( | |
| 955 | 945 | } |
| 956 | 946 | |
| 957 | logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", cpu_get_pc(&space | |
| 947 | logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", cpu_get_pc(&space. | |
| 958 | 948 | return 0xffff; |
| 959 | 949 | } |
| 960 | 950 | |
| 961 | 951 | |
| 962 | ||
| 952 | ||
| 963 | 953 | { |
| 964 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 965 | 954 | static const char *const names[] = { "TRACKX1", "TRACKY1", "TRACKX2", "TRACKY2", "TRACKX3", "TRACKY3" }; |
| 966 | 955 | |
| 967 | 956 | switch (offset) |
| r14896 | r14897 | |
| 969 | 958 | case 0x00/2: |
| 970 | 959 | case 0x08/2: |
| 971 | 960 | case 0x10/2: |
| 972 | state->m_sonic_last[offset/2 + 0] = input_port_read(space->machine(), names[offset/2 + 0]); | |
| 973 | state->m_sonic_last[offset/2 + 1] = input_port_read(space->machine(), names[offset/2 + 1]); | |
| 961 | m_sonic_last[offset/2 + 0] = input_port_read(machine(), names[offset/2 + 0]); | |
| 962 | m_sonic_last[offset/2 + 1] = input_port_read(machine(), names[offset/2 + 1]); | |
| 974 | 963 | return; |
| 975 | 964 | } |
| 976 | 965 | |
| 977 | logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space | |
| 966 | logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space. | |
| 978 | 967 | } |
| 979 | 968 | |
| 980 | 969 | |
| r14896 | r14897 | |
| 985 | 974 | * |
| 986 | 975 | *************************************/ |
| 987 | 976 | |
| 988 | ||
| 977 | ||
| 989 | 978 | { |
| 990 | // mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(&space | |
| 979 | // mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(&space. | |
| 991 | 980 | } |
| 992 | 981 | |
| 993 | ||
| 982 | ||
| 994 | 983 | { |
| 995 | return | |
| 984 | return | |
| 996 | 985 | } |
| 997 | 986 | |
| 998 | ||
| 987 | ||
| 999 | 988 | { |
| 1000 | // mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(&space | |
| 989 | // mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(&space. | |
| 1001 | 990 | } |
| 1002 | 991 | |
| 1003 | ||
| 992 | ||
| 1004 | 993 | { |
| 1005 | return | |
| 994 | return | |
| 1006 | 995 | } |
| 1007 | 996 | |
| 1008 | 997 | |
| r14896 | r14897 | |
| 1013 | 1002 | * |
| 1014 | 1003 | *************************************/ |
| 1015 | 1004 | |
| 1016 | ||
| 1005 | ||
| 1017 | 1006 | { |
| 1018 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1019 | return state->m_z80_shared_ram[offset*2+0] | (state->m_z80_shared_ram[offset*2+1] << 8); | |
| 1007 | return m_z80_shared_ram[offset*2+0] | (m_z80_shared_ram[offset*2+1] << 8); | |
| 1020 | 1008 | } |
| 1021 | 1009 | |
| 1022 | 1010 | |
| 1023 | ||
| 1011 | ||
| 1024 | 1012 | { |
| 1025 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1026 | 1013 | if (ACCESSING_BITS_0_7) |
| 1027 | | |
| 1014 | | |
| 1028 | 1015 | if (ACCESSING_BITS_8_15) |
| 1029 | | |
| 1016 | | |
| 1030 | 1017 | } |
| 1031 | 1018 | |
| 1032 | 1019 | |
| 1033 | ||
| 1020 | ||
| 1034 | 1021 | { |
| 1035 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1036 | return state->m_z80_shared_ram[offset*4+0] | (state->m_z80_shared_ram[offset*4+1] << 8) | | |
| 1037 | (state->m_z80_shared_ram[offset*4+2] << 16) | (state->m_z80_shared_ram[offset*4+3] << 24); | |
| 1022 | return m_z80_shared_ram[offset*4+0] | (m_z80_shared_ram[offset*4+1] << 8) | | |
| 1023 | (m_z80_shared_ram[offset*4+2] << 16) | (m_z80_shared_ram[offset*4+3] << 24); | |
| 1038 | 1024 | } |
| 1039 | 1025 | |
| 1040 | 1026 | |
| 1041 | ||
| 1027 | ||
| 1042 | 1028 | { |
| 1043 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1044 | 1029 | if (ACCESSING_BITS_0_7) |
| 1045 | | |
| 1030 | | |
| 1046 | 1031 | if (ACCESSING_BITS_8_15) |
| 1047 | | |
| 1032 | | |
| 1048 | 1033 | if (ACCESSING_BITS_16_23) |
| 1049 | | |
| 1034 | | |
| 1050 | 1035 | if (ACCESSING_BITS_24_31) |
| 1051 | | |
| 1036 | | |
| 1052 | 1037 | } |
| 1053 | 1038 | |
| 1054 | 1039 | |
| r14896 | r14897 | |
| 1104 | 1089 | } |
| 1105 | 1090 | |
| 1106 | 1091 | |
| 1107 | ||
| 1092 | ||
| 1108 | 1093 | { |
| 1109 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1110 | 1094 | /* odd offsets are interrupt acks */ |
| 1111 | 1095 | if (offset & 1) |
| 1112 | 1096 | { |
| 1113 | state->m_sound_irq_input &= data; | |
| 1114 | update_sound_irq_state(space->machine()); | |
| 1097 | m_sound_irq_input &= data; | |
| 1098 | update_sound_irq_state(machine()); | |
| 1115 | 1099 | } |
| 1116 | 1100 | |
| 1117 | 1101 | /* high offsets signal an IRQ to the v60 */ |
| 1118 | 1102 | if (offset & 4) |
| 1119 | signal_v60_irq( | |
| 1103 | signal_v60_irq( | |
| 1120 | 1104 | } |
| 1121 | 1105 | |
| 1122 | 1106 | |
| 1123 | ||
| 1107 | ||
| 1124 | 1108 | { |
| 1125 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1126 | state->m_sound_irq_control[offset] = data; | |
| 1127 | update_sound_irq_state(space->machine()); | |
| 1109 | m_sound_irq_control[offset] = data; | |
| 1110 | update_sound_irq_state(machine()); | |
| 1128 | 1111 | } |
| 1129 | 1112 | |
| 1130 | 1113 | |
| r14896 | r14897 | |
| 1144 | 1127 | * |
| 1145 | 1128 | *************************************/ |
| 1146 | 1129 | |
| 1147 | ||
| 1130 | ||
| 1148 | 1131 | { |
| 1149 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1150 | state->m_sound_bank = (state->m_sound_bank & ~0x3f) | (data & 0x3f); | |
| 1151 | memory_set_bankptr(space->machine(), "bank1", space->machine().region("soundcpu")->base() + 0x100000 + 0x2000 * state->m_sound_bank); | |
| 1132 | m_sound_bank = (m_sound_bank & ~0x3f) | (data & 0x3f); | |
| 1133 | memory_set_bankptr(machine(), "bank1", machine().region("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank); | |
| 1152 | 1134 | } |
| 1153 | 1135 | |
| 1154 | 1136 | |
| 1155 | ||
| 1137 | ||
| 1156 | 1138 | { |
| 1157 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1158 | state->m_sound_bank = (state->m_sound_bank & 0x3f) | ((data & 0x04) << 4) | ((data & 0x03) << 7); | |
| 1159 | memory_set_bankptr(space->machine(), "bank1", space->machine().region("soundcpu")->base() + 0x100000 + 0x2000 * state->m_sound_bank); | |
| 1139 | m_sound_bank = (m_sound_bank & 0x3f) | ((data & 0x04) << 4) | ((data & 0x03) << 7); | |
| 1140 | memory_set_bankptr(machine(), "bank1", machine().region("soundcpu")->base() + 0x100000 + 0x2000 * m_sound_bank); | |
| 1160 | 1141 | } |
| 1161 | 1142 | |
| 1162 | 1143 | |
| r14896 | r14897 | |
| 1179 | 1160 | * |
| 1180 | 1161 | *************************************/ |
| 1181 | 1162 | |
| 1182 | ||
| 1163 | ||
| 1183 | 1164 | { |
| 1184 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1185 | return state->m_sound_dummy_value; | |
| 1165 | return m_sound_dummy_value; | |
| 1186 | 1166 | } |
| 1187 | 1167 | |
| 1188 | 1168 | |
| 1189 | ||
| 1169 | ||
| 1190 | 1170 | { |
| 1191 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 1192 | state->m_sound_dummy_value = data; | |
| 1171 | m_sound_dummy_value = data; | |
| 1193 | 1172 | } |
| 1194 | 1173 | |
| 1195 | 1174 | |
| r14896 | r14897 | |
| 1209 | 1188 | AM_RANGE(0x500000, 0x50000f) AM_MIRROR(0x0ffff0) AM_READWRITE(system32_sprite_control_r, system32_sprite_control_w) |
| 1210 | 1189 | AM_RANGE(0x600000, 0x60ffff) AM_MIRROR(0x0e0000) AM_READWRITE(system32_paletteram_r, system32_paletteram_w) AM_BASE(m_system32_paletteram[0]) |
| 1211 | 1190 | AM_RANGE(0x610000, 0x61007f) AM_MIRROR(0x0eff80) AM_READWRITE(system32_mixer_r, system32_mixer_w) |
| 1212 | AM_RANGE(0x700000, 0x701fff) AM_MIRROR(0x0fe000) AM_READWRITE_LEGACY(shared_ram_16_r, shared_ram_16_w) | |
| 1213 | AM_RANGE(0xc00000, 0xc0001f) AM_MIRROR(0x0fff80) AM_READWRITE_LEGACY(io_chip_r, io_chip_w) | |
| 1214 | AM_RANGE(0xc00040, 0xc0007f) AM_MIRROR(0x0fff80) AM_READWRITE_LEGACY(io_expansion_r, io_expansion_w) | |
| 1215 | AM_RANGE(0xd00000, 0xd0000f) AM_MIRROR(0x07fff0) AM_READWRITE_LEGACY(interrupt_control_16_r, interrupt_control_16_w) | |
| 1216 | AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE_LEGACY(random_number_16_r, random_number_16_w) | |
| 1191 | AM_RANGE(0x700000, 0x701fff) AM_MIRROR(0x0fe000) AM_READWRITE(shared_ram_16_r, shared_ram_16_w) | |
| 1192 | AM_RANGE(0xc00000, 0xc0001f) AM_MIRROR(0x0fff80) AM_READWRITE(io_chip_r, io_chip_w) | |
| 1193 | AM_RANGE(0xc00040, 0xc0007f) AM_MIRROR(0x0fff80) AM_READWRITE(io_expansion_r, io_expansion_w) | |
| 1194 | AM_RANGE(0xd00000, 0xd0000f) AM_MIRROR(0x07fff0) AM_READWRITE(interrupt_control_16_r, interrupt_control_16_w) | |
| 1195 | AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE(random_number_16_r, random_number_16_w) | |
| 1217 | 1196 | AM_RANGE(0xf00000, 0xffffff) AM_ROM AM_REGION("maincpu", 0) |
| 1218 | 1197 | ADDRESS_MAP_END |
| 1219 | 1198 | |
| r14896 | r14897 | |
| 1230 | 1209 | AM_RANGE(0x610000, 0x61007f) AM_MIRROR(0x06ff80) AM_WRITE(multi32_mixer_0_w) |
| 1231 | 1210 | AM_RANGE(0x680000, 0x68ffff) AM_MIRROR(0x060000) AM_READWRITE(multi32_paletteram_1_r, multi32_paletteram_1_w) AM_BASE(m_system32_paletteram[1]) |
| 1232 | 1211 | AM_RANGE(0x690000, 0x69007f) AM_MIRROR(0x06ff80) AM_WRITE(multi32_mixer_1_w) |
| 1233 | AM_RANGE(0x700000, 0x701fff) AM_MIRROR(0x0fe000) AM_READWRITE_LEGACY(shared_ram_32_r, shared_ram_32_w) | |
| 1234 | AM_RANGE(0xc00000, 0xc0001f) AM_MIRROR(0x07ff80) AM_READWRITE_LEGACY(io_chip_0_r, io_chip_0_w) | |
| 1235 | AM_RANGE(0xc00040, 0xc0007f) AM_MIRROR(0x07ff80) AM_READWRITE_LEGACY(io_expansion_0_r, io_expansion_0_w) | |
| 1236 | AM_RANGE(0xc80000, 0xc8001f) AM_MIRROR(0x07ff80) AM_READWRITE_LEGACY(io_chip_1_r, io_chip_1_w) | |
| 1237 | AM_RANGE(0xc80040, 0xc8007f) AM_MIRROR(0x07ff80) AM_READWRITE_LEGACY(io_expansion_1_r, io_expansion_1_w) | |
| 1238 | AM_RANGE(0xd00000, 0xd0000f) AM_MIRROR(0x07fff0) AM_READWRITE_LEGACY(interrupt_control_32_r, interrupt_control_32_w) | |
| 1239 | AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE_LEGACY(random_number_32_r, random_number_32_w) | |
| 1212 | AM_RANGE(0x700000, 0x701fff) AM_MIRROR(0x0fe000) AM_READWRITE(shared_ram_32_r, shared_ram_32_w) | |
| 1213 | AM_RANGE(0xc00000, 0xc0001f) AM_MIRROR(0x07ff80) AM_READWRITE(io_chip_0_r, io_chip_0_w) | |
| 1214 | AM_RANGE(0xc00040, 0xc0007f) AM_MIRROR(0x07ff80) AM_READWRITE(io_expansion_0_r, io_expansion_0_w) | |
| 1215 | AM_RANGE(0xc80000, 0xc8001f) AM_MIRROR(0x07ff80) AM_READWRITE(io_chip_1_r, io_chip_1_w) | |
| 1216 | AM_RANGE(0xc80040, 0xc8007f) AM_MIRROR(0x07ff80) AM_READWRITE(io_expansion_1_r, io_expansion_1_w) | |
| 1217 | AM_RANGE(0xd00000, 0xd0000f) AM_MIRROR(0x07fff0) AM_READWRITE(interrupt_control_32_r, interrupt_control_32_w) | |
| 1218 | AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE(random_number_32_r, random_number_32_w) | |
| 1240 | 1219 | AM_RANGE(0xf00000, 0xffffff) AM_ROM AM_REGION("maincpu", 0) |
| 1241 | 1220 | ADDRESS_MAP_END |
| 1242 | 1221 | |
| r14896 | r14897 | |
| 1261 | 1240 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1262 | 1241 | AM_RANGE(0x80, 0x83) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym1", ym3438_r, ym3438_w) |
| 1263 | 1242 | AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym2", ym3438_r, ym3438_w) |
| 1264 | AM_RANGE(0xa0, 0xaf) AM_WRITE_LEGACY(sound_bank_lo_w) | |
| 1265 | AM_RANGE(0xb0, 0xbf) AM_WRITE_LEGACY(sound_bank_hi_w) | |
| 1266 | AM_RANGE(0xc0, 0xcf) AM_WRITE_LEGACY(sound_int_control_lo_w) | |
| 1267 | AM_RANGE(0xd0, 0xd3) AM_MIRROR(0x04) AM_WRITE_LEGACY(sound_int_control_hi_w) | |
| 1268 | AM_RANGE(0xf1, 0xf1) AM_READWRITE_LEGACY(sound_dummy_r, sound_dummy_w) | |
| 1243 | AM_RANGE(0xa0, 0xaf) AM_WRITE(sound_bank_lo_w) | |
| 1244 | AM_RANGE(0xb0, 0xbf) AM_WRITE(sound_bank_hi_w) | |
| 1245 | AM_RANGE(0xc0, 0xcf) AM_WRITE(sound_int_control_lo_w) | |
| 1246 | AM_RANGE(0xd0, 0xd3) AM_MIRROR(0x04) AM_WRITE(sound_int_control_hi_w) | |
| 1247 | AM_RANGE(0xf1, 0xf1) AM_READWRITE(sound_dummy_r, sound_dummy_w) | |
| 1269 | 1248 | ADDRESS_MAP_END |
| 1270 | 1249 | |
| 1271 | 1250 | |
| r14896 | r14897 | |
| 1280 | 1259 | ADDRESS_MAP_UNMAP_HIGH |
| 1281 | 1260 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1282 | 1261 | AM_RANGE(0x80, 0x83) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ymsnd", ym3438_r, ym3438_w) |
| 1283 | AM_RANGE(0xa0, 0xaf) AM_WRITE | |
| 1262 | AM_RANGE(0xa0, 0xaf) AM_WRITE | |
| 1284 | 1263 | AM_RANGE(0xb0, 0xbf) AM_DEVWRITE_LEGACY("sega", multipcm_bank_w) |
| 1285 | AM_RANGE(0xc0, 0xcf) AM_WRITE_LEGACY(sound_int_control_lo_w) | |
| 1286 | AM_RANGE(0xd0, 0xd3) AM_MIRROR(0x04) AM_WRITE_LEGACY(sound_int_control_hi_w) | |
| 1287 | AM_RANGE(0xf1, 0xf1) AM_READWRITE_LEGACY(sound_dummy_r, sound_dummy_w) | |
| 1264 | AM_RANGE(0xc0, 0xcf) AM_WRITE(sound_int_control_lo_w) | |
| 1265 | AM_RANGE(0xd0, 0xd3) AM_MIRROR(0x04) AM_WRITE(sound_int_control_hi_w) | |
| 1266 | AM_RANGE(0xf1, 0xf1) AM_READWRITE(sound_dummy_r, sound_dummy_w) | |
| 1288 | 1267 | ADDRESS_MAP_END |
| 1289 | 1268 | |
| 1290 | 1269 | |
| r14896 | r14897 | |
| 2139 | 2118 | // Both arescue and f1en appear to use an identical shared RAM system. |
| 2140 | 2119 | |
| 2141 | 2120 | |
| 2142 | ||
| 2121 | ||
| 2143 | 2122 | { |
| 2144 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 2145 | COMBINE_DATA(&state->m_dual_pcb_comms[offset]); | |
| 2123 | COMBINE_DATA(&m_dual_pcb_comms[offset]); | |
| 2146 | 2124 | } |
| 2147 | 2125 | |
| 2148 | ||
| 2126 | ||
| 2149 | 2127 | { |
| 2150 | segas32_state *state = space->machine().driver_data<segas32_state>(); | |
| 2151 | return state->m_dual_pcb_comms[offset]; | |
| 2128 | return m_dual_pcb_comms[offset]; | |
| 2152 | 2129 | } |
| 2153 | 2130 | |
| 2154 | 2131 | |
| r14896 | r14897 | |
| 2156 | 2133 | Probably not a dip/solder link/trace cut, but maybe |
| 2157 | 2134 | just whichever way the cables are plugged in? |
| 2158 | 2135 | Both f1en and arescue master units try to set bit 1... */ |
| 2159 | ||
| 2136 | ||
| 2160 | 2137 | { |
| 2161 | 2138 | return 0; // 0/1 master/slave |
| 2162 | 2139 | } |
| r14896 | r14897 | |
| 3834 | 3811 | * |
| 3835 | 3812 | *************************************/ |
| 3836 | 3813 | |
| 3837 | static void segas32_common_init(running_machine &machine, read16_ | |
| 3814 | static void segas32_common_init(running_machine &machine, read16_delegate | |
| 3838 | 3815 | { |
| 3839 | 3816 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 3840 | 3817 | /* reset the custom handlers and other pointers */ |
| r14896 | r14897 | |
| 4032 | 4009 | static DRIVER_INIT( alien3 ) |
| 4033 | 4010 | { |
| 4034 | 4011 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4035 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4012 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4036 | 4013 | state->m_sw1_output = alien3_sw1_output; |
| 4037 | 4014 | } |
| 4038 | 4015 | |
| 4039 | ||
| 4016 | ||
| 4040 | 4017 | { |
| 4041 | 4018 | return 0; |
| 4042 | 4019 | } |
| 4043 | 4020 | |
| 4044 | ||
| 4021 | ||
| 4045 | 4022 | { |
| 4046 | 4023 | return 0x100; // prevents master trying to synch to slave. |
| 4047 | 4024 | } |
| r14896 | r14897 | |
| 4049 | 4026 | static DRIVER_INIT( arescue ) |
| 4050 | 4027 | { |
| 4051 | 4028 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4052 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4029 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4053 | 4030 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa00000, 0xa00007, read16_delegate(FUNC(segas32_state::arescue_dsp_r),state), write16_delegate(FUNC(segas32_state::arescue_dsp_w),state)); |
| 4054 | 4031 | |
| 4055 | 4032 | state->m_dual_pcb_comms = auto_alloc_array(machine, UINT16, 0x1000/2); |
| 4056 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x810fff, FUNC(dual_pcb_comms_r), FUNC(dual_pcb_comms_w)); | |
| 4057 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x818000, 0x818003, FUNC(dual_pcb_masterslave)); | |
| 4033 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),state), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),state)); | |
| 4034 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),state)); | |
| 4058 | 4035 | |
| 4059 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x810000, 0x810001, FUNC(arescue_handshake_r)); | |
| 4060 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x81000e, 0x81000f, FUNC(arescue_slavebusy_r)); | |
| 4036 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x810000, 0x810001, read16_delegate(FUNC(segas32_state::arescue_handshake_r),state)); | |
| 4037 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x81000e, 0x81000f, read16_delegate(FUNC(segas32_state::arescue_slavebusy_r),state)); | |
| 4061 | 4038 | |
| 4062 | 4039 | state->m_sw1_output = arescue_sw1_output; |
| 4063 | 4040 | } |
| r14896 | r14897 | |
| 4065 | 4042 | |
| 4066 | 4043 | static DRIVER_INIT( arabfgt ) |
| 4067 | 4044 | { |
| 4068 | segas32_common_init(machine, extra_custom_io_r, NULL); | |
| 4069 | ||
| 4070 | /* install protection handlers */ | |
| 4071 | 4045 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4046 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::extra_custom_io_r),state), write16_delegate()); | |
| 4047 | ||
| 4048 | /* install protection handlers */ | |
| 4072 | 4049 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xa00100, 0xa0011f, read16_delegate(FUNC(segas32_state::arf_wakeup_protection_r),state)); |
| 4073 | 4050 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa00000, 0xa00fff, read16_delegate(FUNC(segas32_state::arabfgt_protection_r),state), write16_delegate(FUNC(segas32_state::arabfgt_protection_w),state)); |
| 4074 | 4051 | } |
| r14896 | r14897 | |
| 4077 | 4054 | static DRIVER_INIT( brival ) |
| 4078 | 4055 | { |
| 4079 | 4056 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4080 | segas32_common_init(machine, extra_custom_io_r, | |
| 4057 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::extra_custom_io_r),state), write16_delegate()); | |
| 4081 | 4058 | |
| 4082 | 4059 | /* install protection handlers */ |
| 4083 | 4060 | state->m_system32_protram = auto_alloc_array(machine, UINT16, 0x1000/2); |
| r14896 | r14897 | |
| 4089 | 4066 | static DRIVER_INIT( darkedge ) |
| 4090 | 4067 | { |
| 4091 | 4068 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4092 | segas32_common_init(machine, extra_custom_io_r, | |
| 4069 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::extra_custom_io_r),state), write16_delegate()); | |
| 4093 | 4070 | |
| 4094 | 4071 | /* install protection handlers */ |
| 4095 | 4072 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa00000, 0xa7ffff, read16_delegate(FUNC(segas32_state::darkedge_protection_r),state), write16_delegate(FUNC(segas32_state::darkedge_protection_w),state)); |
| r14896 | r14897 | |
| 4098 | 4075 | |
| 4099 | 4076 | static DRIVER_INIT( dbzvrvs ) |
| 4100 | 4077 | { |
| 4101 | segas32_common_init(machine, | |
| 4078 | segas32_common_init(machine, read16_delegate(), write16_delegate()); | |
| 4102 | 4079 | |
| 4103 | 4080 | /* install protection handlers */ |
| 4104 | 4081 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4105 | 4082 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa00000, 0xa7ffff, read16_delegate(FUNC(segas32_state::dbzvrvs_protection_r),state), write16_delegate(FUNC(segas32_state::dbzvrvs_protection_w),state)); |
| 4106 | 4083 | } |
| 4107 | 4084 | |
| 4108 | ||
| 4085 | ||
| 4109 | 4086 | { |
| 4110 | 4087 | // pretend that slave is following master op, enables attract mode video with sound |
| 4111 | 4088 | if (ACCESSING_BITS_0_7) |
| 4112 | space | |
| 4089 | space. | |
| 4113 | 4090 | } |
| 4114 | 4091 | |
| 4115 | 4092 | static DRIVER_INIT( f1en ) |
| 4116 | 4093 | { |
| 4117 | 4094 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4118 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4095 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4119 | 4096 | |
| 4120 | 4097 | state->m_dual_pcb_comms = auto_alloc_array(machine, UINT16, 0x1000/2); |
| 4121 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x810fff, FUNC(dual_pcb_comms_r), FUNC(dual_pcb_comms_w)); | |
| 4122 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x818000, 0x818003, FUNC(dual_pcb_masterslave)); | |
| 4098 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),state), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),state)); | |
| 4099 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),state)); | |
| 4123 | 4100 | |
| 4124 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 4101 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 4125 | 4102 | |
| 4126 | 4103 | state->m_sw1_output = radm_sw1_output; |
| 4127 | 4104 | } |
| r14896 | r14897 | |
| 4130 | 4107 | static DRIVER_INIT( f1lap ) |
| 4131 | 4108 | { |
| 4132 | 4109 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4133 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4110 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4134 | 4111 | state->m_sw1_output = f1lap_sw1_output; |
| 4135 | 4112 | } |
| 4136 | 4113 | |
| 4137 | 4114 | |
| 4138 | 4115 | static DRIVER_INIT( ga2 ) |
| 4139 | 4116 | { |
| 4140 | segas32_common_init(machine, extra_custom_io_r, NULL); | |
| 4141 | ||
| 4142 | decrypt_ga2_protrom(machine); | |
| 4143 | 4117 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4118 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::extra_custom_io_r),state), write16_delegate()); | |
| 4119 | ||
| 4120 | decrypt_ga2_protrom(machine); | |
| 4144 | 4121 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xa00000, 0xa00fff, read16_delegate(FUNC(segas32_state::ga2_dpram_r),state), write16_delegate(FUNC(segas32_state::ga2_dpram_w),state)); |
| 4145 | 4122 | } |
| 4146 | 4123 | |
| r14896 | r14897 | |
| 4148 | 4125 | static DRIVER_INIT( harddunk ) |
| 4149 | 4126 | { |
| 4150 | 4127 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4151 | segas32_common_init(machine, extra_custom_io_r, | |
| 4128 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::extra_custom_io_r),state), write16_delegate()); | |
| 4152 | 4129 | state->m_sw1_output = harddunk_sw1_output; |
| 4153 | 4130 | state->m_sw2_output = harddunk_sw2_output; |
| 4154 | 4131 | state->m_sw3_output = harddunk_sw3_output; |
| r14896 | r14897 | |
| 4157 | 4134 | |
| 4158 | 4135 | static DRIVER_INIT( holo ) |
| 4159 | 4136 | { |
| 4160 | segas32_common_init(machine, | |
| 4137 | segas32_common_init(machine, read16_delegate(), write16_delegate()); | |
| 4161 | 4138 | } |
| 4162 | 4139 | |
| 4163 | 4140 | |
| r14896 | r14897 | |
| 4167 | 4144 | /* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */ |
| 4168 | 4145 | UINT16 *pROM = (UINT16 *)machine.region("maincpu")->base(); |
| 4169 | 4146 | |
| 4170 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4147 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4171 | 4148 | |
| 4172 | 4149 | pROM[0xC15A8/2] = 0xCD70; |
| 4173 | 4150 | pROM[0xC15AA/2] = 0xD8CD; |
| r14896 | r14897 | |
| 4179 | 4156 | static DRIVER_INIT( orunners ) |
| 4180 | 4157 | { |
| 4181 | 4158 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4182 | segas32_common_init(machine, analog_custom_io_r, orunners_custom_io_w); | |
| 4159 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::orunners_custom_io_w),state)); | |
| 4183 | 4160 | state->m_sw1_output = orunners_sw1_output; |
| 4184 | 4161 | state->m_sw2_output = orunners_sw2_output; |
| 4185 | 4162 | } |
| r14896 | r14897 | |
| 4188 | 4165 | static DRIVER_INIT( radm ) |
| 4189 | 4166 | { |
| 4190 | 4167 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4191 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4168 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4192 | 4169 | state->m_sw1_output = radm_sw1_output; |
| 4193 | 4170 | state->m_sw2_output = radm_sw2_output; |
| 4194 | 4171 | } |
| r14896 | r14897 | |
| 4197 | 4174 | static DRIVER_INIT( radr ) |
| 4198 | 4175 | { |
| 4199 | 4176 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4200 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4177 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4201 | 4178 | state->m_sw1_output = radm_sw1_output; |
| 4202 | 4179 | state->m_sw2_output = radr_sw2_output; |
| 4203 | 4180 | } |
| r14896 | r14897 | |
| 4207 | 4184 | { |
| 4208 | 4185 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4209 | 4186 | multipcm_device *multipcm = machine.device<multipcm_device>("sega"); |
| 4210 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4187 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4211 | 4188 | machine.device("soundcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*multipcm, 0xb0, 0xbf, FUNC(scross_bank_w)); |
| 4212 | 4189 | |
| 4213 | 4190 | state->m_sw1_output = scross_sw1_output; |
| r14896 | r14897 | |
| 4217 | 4194 | |
| 4218 | 4195 | static DRIVER_INIT( slipstrm ) |
| 4219 | 4196 | { |
| 4220 | segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w); | |
| 4197 | segas32_state *state = machine.driver_data<segas32_state>(); | |
| 4198 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::analog_custom_io_r),state), write16_delegate(FUNC(segas32_state::analog_custom_io_w),state)); | |
| 4221 | 4199 | } |
| 4222 | 4200 | |
| 4223 | 4201 | |
| 4224 | 4202 | static DRIVER_INIT( sonic ) |
| 4225 | 4203 | { |
| 4226 | segas32_common_init(machine, sonic_custom_io_r, sonic_custom_io_w); | |
| 4204 | segas32_state *state = machine.driver_data<segas32_state>(); | |
| 4205 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::sonic_custom_io_r),state), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),state)); | |
| 4227 | 4206 | |
| 4228 | 4207 | /* install protection handlers */ |
| 4229 | segas32_state *state = machine.driver_data<segas32_state>(); | |
| 4230 | 4208 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x20E5C4, 0x20E5C5, write16_delegate(FUNC(segas32_state::sonic_level_load_protection),state)); |
| 4231 | 4209 | } |
| 4232 | 4210 | |
| 4233 | 4211 | |
| 4234 | 4212 | static DRIVER_INIT( sonicp ) |
| 4235 | 4213 | { |
| 4236 | segas32_common_init(machine, sonic_custom_io_r, sonic_custom_io_w); | |
| 4214 | segas32_state *state = machine.driver_data<segas32_state>(); | |
| 4215 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::sonic_custom_io_r),state), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),state)); | |
| 4237 | 4216 | } |
| 4238 | 4217 | |
| 4239 | 4218 | |
| 4240 | 4219 | static DRIVER_INIT( spidman ) |
| 4241 | 4220 | { |
| 4242 | segas32_common_init(machine, extra_custom_io_r, NULL); | |
| 4221 | segas32_state *state = machine.driver_data<segas32_state>(); | |
| 4222 | segas32_common_init(machine, read16_delegate(FUNC(segas32_state::extra_custom_io_r),state), write16_delegate()); | |
| 4243 | 4223 | } |
| 4244 | 4224 | |
| 4245 | 4225 | |
| 4246 | 4226 | static DRIVER_INIT( svf ) |
| 4247 | 4227 | { |
| 4248 | segas32_common_init(machine, | |
| 4228 | segas32_common_init(machine, read16_delegate(), write16_delegate()); | |
| 4249 | 4229 | } |
| 4250 | 4230 | |
| 4251 | 4231 | |
| 4252 | 4232 | static DRIVER_INIT( jleague ) |
| 4253 | 4233 | { |
| 4254 | segas32_common_init(machine, | |
| 4234 | segas32_common_init(machine, read16_delegate(), write16_delegate()); | |
| 4255 | 4235 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4256 | 4236 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x20F700, 0x20F705, write16_delegate(FUNC(segas32_state::jleague_protection_w),state)); |
| 4257 | 4237 | } |
| r14896 | r14897 | |
| 4260 | 4240 | static DRIVER_INIT( titlef ) |
| 4261 | 4241 | { |
| 4262 | 4242 | segas32_state *state = machine.driver_data<segas32_state>(); |
| 4263 | segas32_common_init(machine, | |
| 4243 | segas32_common_init(machine, read16_delegate(), write16_delegate()); | |
| 4264 | 4244 | state->m_sw1_output = titlef_sw1_output; |
| 4265 | 4245 | state->m_sw2_output = titlef_sw2_output; |
| 4266 | 4246 | } |
| r14896 | r14897 | |
|---|---|---|
| 98 | 98 | { |
| 99 | 99 | public: |
| 100 | 100 | looping_state(const machine_config &mconfig, device_type type, const char *tag) |
| 101 | : driver_device(mconfig, type, tag) { } | |
| 101 | : driver_device(mconfig, type, tag) , | |
| 102 | m_videoram(*this, "videoram"), | |
| 103 | m_colorram(*this, "colorram"), | |
| 104 | m_spriteram(*this, "spriteram"){ } | |
| 102 | 105 | |
| 103 | 106 | /* memory pointers */ |
| 104 | UINT8 * m_videoram; | |
| 105 | UINT8 * m_colorram; | |
| 106 | UINT8 * m_spriteram; | |
| 107 | required_shared_ptr<UINT8> m_videoram; | |
| 108 | required_shared_ptr<UINT8> m_colorram; | |
| 109 | required_shared_ptr<UINT8> m_spriteram; | |
| 107 | 110 | UINT8 * m_cop_io; |
| 108 | 111 | |
| 109 | 112 | /* tilemaps */ |
| r14896 | r14897 | |
| 189 | 192 | static TILE_GET_INFO( get_tile_info ) |
| 190 | 193 | { |
| 191 | 194 | looping_state *state = machine.driver_data<looping_state>(); |
| 192 | int tile_number = state->m_videoram[tile_index]; | |
| 193 | int color = state->m_colorram[(tile_index & 0x1f) * 2 + 1] & 0x07; | |
| 195 | int tile_number = state->m_videoram.target()[tile_index]; | |
| 196 | int color = state->m_colorram.target()[(tile_index & 0x1f) * 2 + 1] & 0x07; | |
| 194 | 197 | SET_TILE_INFO(0, tile_number, color, 0); |
| 195 | 198 | } |
| 196 | 199 | |
| r14896 | r14897 | |
| 214 | 217 | |
| 215 | 218 | WRITE8_MEMBER(looping_state::flip_screen_x_w) |
| 216 | 219 | { |
| 217 | flip_screen_x_set(machine(), ~data & 0x01); | |
| 218 | m_bg_tilemap->set_scrollx(0, flip_screen_get(machine()) ? 128 : 0); | |
| 220 | flip_screen_x_set(~data & 0x01); | |
| 221 | m_bg_tilemap->set_scrollx(0, flip_screen() ? 128 : 0); | |
| 219 | 222 | } |
| 220 | 223 | |
| 221 | 224 | |
| 222 | 225 | WRITE8_MEMBER(looping_state::flip_screen_y_w) |
| 223 | 226 | { |
| 224 | flip_screen_y_set(machine(), ~data & 0x01); | |
| 225 | m_bg_tilemap->set_scrollx(0, flip_screen_get(machine()) ? 128 : 0); | |
| 227 | flip_screen_y_set(~data & 0x01); | |
| 228 | m_bg_tilemap->set_scrollx(0, flip_screen() ? 128 : 0); | |
| 226 | 229 | } |
| 227 | 230 | |
| 228 | 231 | |
| 229 | 232 | WRITE8_MEMBER(looping_state::looping_videoram_w) |
| 230 | 233 | { |
| 231 | m_videoram[offset] = data; | |
| 234 | m_videoram.target()[offset] = data; | |
| 232 | 235 | m_bg_tilemap->mark_tile_dirty(offset); |
| 233 | 236 | } |
| 234 | 237 | |
| r14896 | r14897 | |
| 237 | 240 | { |
| 238 | 241 | int i; |
| 239 | 242 | |
| 240 | m_colorram[offset] = data; | |
| 243 | m_colorram.target()[offset] = data; | |
| 241 | 244 | |
| 242 | 245 | /* odd bytes are column color attribute */ |
| 243 | 246 | if (offset & 1) |
| r14896 | r14897 | |
| 266 | 269 | const UINT8 *source; |
| 267 | 270 | looping_state *state = machine.driver_data<looping_state>(); |
| 268 | 271 | |
| 269 | for (source = state->m_spriteram; source < state->m_spriteram + 0x40; source += 4) | |
| 272 | for (source = state->m_spriteram.target(); source < state->m_spriteram + 0x40; source += 4) | |
| 270 | 273 | { |
| 271 | 274 | int sx = source[3]; |
| 272 | 275 | int sy = 240 - source[0]; |
| r14896 | r14897 | |
| 275 | 278 | int code = source[1] & 0x3f; |
| 276 | 279 | int color = source[2]; |
| 277 | 280 | |
| 278 | if (flip_screen_x | |
| 281 | if (state->flip_screen_x | |
| 279 | 282 | { |
| 280 | 283 | sx = 240 - sx; |
| 281 | 284 | flipx = !flipx; |
| 282 | 285 | } |
| 283 | 286 | |
| 284 | if (flip_screen_y | |
| 287 | if (state->flip_screen_y | |
| 285 | 288 | { |
| 286 | 289 | sy = 240 - sy; |
| 287 | 290 | flipy = !flipy; |
| r14896 | r14897 | |
| 358 | 361 | |
| 359 | 362 | WRITE8_MEMBER(looping_state::looping_soundlatch_w) |
| 360 | 363 | { |
| 361 | soundlatch_w(space, offset, data); | |
| 364 | soundlatch_byte_w(space, offset, data); | |
| 362 | 365 | cputag_set_input_line_and_vector(machine(), "audiocpu", 0, ASSERT_LINE, 4); |
| 363 | 366 | } |
| 364 | 367 | |
| r14896 | r14897 | |
| 496 | 499 | static ADDRESS_MAP_START( looping_map, AS_PROGRAM, 8, looping_state ) |
| 497 | 500 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 498 | 501 | |
| 499 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(looping_videoram_w) AM_ | |
| 502 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(looping_videoram_w) AM_ | |
| 500 | 503 | |
| 501 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM_WRITE(looping_colorram_w) AM_BASE(m_colorram) | |
| 502 | AM_RANGE(0x9840, 0x987f) AM_MIRROR(0x0700) AM_RAM AM_BASE(m_spriteram) | |
| 504 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM_WRITE(looping_colorram_w) AM_SHARE("colorram") | |
| 505 | AM_RANGE(0x9840, 0x987f) AM_MIRROR(0x0700) AM_RAM AM_SHARE("spriteram") | |
| 503 | 506 | AM_RANGE(0x9880, 0x98ff) AM_MIRROR(0x0700) AM_RAM |
| 504 | 507 | |
| 505 | 508 | AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x07f8) AM_WRITE(level2_irq_set) |
| r14896 | r14897 | |
| 605 | 608 | { |
| 606 | 609 | AY8910_LEGACY_OUTPUT, |
| 607 | 610 | AY8910_DEFAULT_LOADS, |
| 608 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 611 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 609 | 612 | DEVCB_NULL, |
| 610 | 613 | DEVCB_NULL, |
| 611 | 614 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | k3_state(const machine_config &mconfig, device_type type, const char *tag) |
| 54 | 54 | : driver_device(mconfig, type, tag), |
| 55 | 55 | m_oki1(*this, "oki1"), |
| 56 | m_oki2(*this, "oki2") { } | |
| 56 | m_oki2(*this, "oki2") , | |
| 57 | m_spriteram_1(*this, "spritera1"), | |
| 58 | m_spriteram_2(*this, "spritera2"), | |
| 59 | m_bgram(*this, "bgram"){ } | |
| 57 | 60 | |
| 61 | /* devices */ | |
| 62 | required_device<okim6295_device> m_oki1; | |
| 63 | required_device<okim6295_device> m_oki2; | |
| 58 | 64 | /* memory pointers */ |
| 59 | UINT16 * m_spriteram_1; | |
| 60 | UINT16 * m_spriteram_2; | |
| 61 | UINT16 * m_bgram; | |
| 65 | required_shared_ptr<UINT16> m_spriteram_1; | |
| 66 | required_shared_ptr<UINT16> m_spriteram_2; | |
| 67 | required_shared_ptr<UINT16> m_bgram; | |
| 62 | 68 | // UINT16 * m_paletteram16; // currently this uses generic palette handling |
| 63 | 69 | |
| 64 | 70 | /* video-related */ |
| 65 | 71 | tilemap_t *m_bg_tilemap; |
| 66 | 72 | |
| 67 | /* devices */ | |
| 68 | required_device<okim6295_device> m_oki1; | |
| 69 | required_device<okim6295_device> m_oki2; | |
| 70 | 73 | DECLARE_WRITE16_MEMBER(k3_bgram_w); |
| 71 | 74 | DECLARE_WRITE16_MEMBER(k3_scrollx_w); |
| 72 | 75 | DECLARE_WRITE16_MEMBER(k3_scrolly_w); |
| r14896 | r14897 | |
| 76 | 79 | |
| 77 | 80 | WRITE16_MEMBER(k3_state::k3_bgram_w) |
| 78 | 81 | { |
| 79 | COMBINE_DATA(&m_bgram[offset]); | |
| 82 | COMBINE_DATA(&m_bgram.target()[offset]); | |
| 80 | 83 | m_bg_tilemap->mark_tile_dirty(offset); |
| 81 | 84 | } |
| 82 | 85 | |
| 83 | 86 | static TILE_GET_INFO( get_k3_bg_tile_info ) |
| 84 | 87 | { |
| 85 | 88 | k3_state *state = machine.driver_data<k3_state>(); |
| 86 | int tileno = state->m_bgram[tile_index]; | |
| 89 | int tileno = state->m_bgram.target()[tile_index]; | |
| 87 | 90 | SET_TILE_INFO(1, tileno, 0, 0); |
| 88 | 91 | } |
| 89 | 92 | |
| r14896 | r14897 | |
| 97 | 100 | { |
| 98 | 101 | k3_state *state = machine.driver_data<k3_state>(); |
| 99 | 102 | const gfx_element *gfx = machine.gfx[0]; |
| 100 | UINT16 *source = state->m_spriteram_1; | |
| 101 | UINT16 *source2 = state->m_spriteram_2; | |
| 103 | UINT16 *source = state->m_spriteram_1.target(); | |
| 104 | UINT16 *source2 = state->m_spriteram_2.target(); | |
| 102 | 105 | UINT16 *finish = source + 0x1000 / 2; |
| 103 | 106 | |
| 104 | 107 | while (source < finish) |
| r14896 | r14897 | |
| 150 | 153 | |
| 151 | 154 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM |
| 152 | 155 | AM_RANGE(0x100000, 0x10ffff) AM_RAM // Main Ram |
| 153 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") // palette | |
| 154 | AM_RANGE(0x240000, 0x240fff) AM_RAM AM_BASE(m_spriteram_1) | |
| 155 | AM_RANGE(0x280000, 0x280fff) AM_RAM AM_BASE(m_spriteram_2) | |
| 156 | AM_RANGE(0x2c0000, 0x2c0fff) AM_RAM_WRITE(k3_bgram_w) AM_BASE(m_bgram) | |
| 156 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") // palette | |
| 157 | AM_RANGE(0x240000, 0x240fff) AM_RAM AM_SHARE("spritera1") | |
| 158 | AM_RANGE(0x280000, 0x280fff) AM_RAM AM_SHARE("spritera2") | |
| 159 | AM_RANGE(0x2c0000, 0x2c0fff) AM_RAM_WRITE(k3_bgram_w) AM_SHARE("bgram") | |
| 157 | 160 | AM_RANGE(0x340000, 0x340001) AM_WRITE(k3_scrollx_w) |
| 158 | 161 | AM_RANGE(0x380000, 0x380001) AM_WRITE(k3_scrolly_w) |
| 159 | 162 | AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(k3_soundbanks_w) |
| r14896 | r14897 | |
|---|---|---|
| 254 | 254 | * |
| 255 | 255 | *************************************/ |
| 256 | 256 | |
| 257 | ||
| 257 | ||
| 258 | 258 | { |
| 259 | badlands_state *state = space->machine().driver_data<badlands_state>(); | |
| 260 | 259 | int temp = 0xfeff; |
| 261 | if ( | |
| 260 | if ( | |
| 262 | 261 | return temp; |
| 263 | 262 | } |
| 264 | 263 | |
| 265 | 264 | |
| 266 | ||
| 265 | ||
| 267 | 266 | { |
| 268 | badlands_state *state = space->machine().driver_data<badlands_state>(); | |
| 269 | return state->m_pedal_value[0]; | |
| 267 | return m_pedal_value[0]; | |
| 270 | 268 | } |
| 271 | 269 | |
| 272 | 270 | |
| 273 | ||
| 271 | ||
| 274 | 272 | { |
| 275 | badlands_state *state = space->machine().driver_data<badlands_state>(); | |
| 276 | return state->m_pedal_value[1]; | |
| 273 | return m_pedal_value[1]; | |
| 277 | 274 | } |
| 278 | 275 | |
| 279 | 276 | |
| r14896 | r14897 | |
| 284 | 281 | * |
| 285 | 282 | *************************************/ |
| 286 | 283 | |
| 287 | ||
| 284 | ||
| 288 | 285 | { |
| 289 | badlands_state *state = space->machine().driver_data<badlands_state>(); | |
| 290 | 286 | int result = 0xff; |
| 291 | 287 | |
| 292 | 288 | switch (offset & 0x206) |
| r14896 | r14897 | |
| 296 | 292 | break; |
| 297 | 293 | |
| 298 | 294 | case 0x002: /* /RDP */ |
| 299 | result = atarigen_6502_sound_r(space, offset); | |
| 295 | result = atarigen_6502_sound_r(&space, offset); | |
| 300 | 296 | break; |
| 301 | 297 | |
| 302 | 298 | case 0x004: /* /RDIO */ |
| r14896 | r14897 | |
| 310 | 306 | 0x02 = coin 2 |
| 311 | 307 | 0x01 = coin 1 |
| 312 | 308 | */ |
| 313 | result = input_port_read(space->machine(), "AUDIO"); | |
| 314 | if (!(input_port_read(space->machine(), "FE4000") & 0x0080)) result ^= 0x90; | |
| 315 | if (state->m_cpu_to_sound_ready) result ^= 0x40; | |
| 316 | if (state->m_sound_to_cpu_ready) result ^= 0x20; | |
| 309 | result = input_port_read(machine(), "AUDIO"); | |
| 310 | if (!(input_port_read(machine(), "FE4000") & 0x0080)) result ^= 0x90; | |
| 311 | if (m_cpu_to_sound_ready) result ^= 0x40; | |
| 312 | if (m_sound_to_cpu_ready) result ^= 0x20; | |
| 317 | 313 | result ^= 0x10; |
| 318 | 314 | break; |
| 319 | 315 | |
| 320 | 316 | case 0x006: /* /IRQACK */ |
| 321 | atarigen_6502_irq_ack_r(space, 0); | |
| 317 | atarigen_6502_irq_ack_r(&space, 0); | |
| 322 | 318 | break; |
| 323 | 319 | |
| 324 | 320 | case 0x200: /* /VOICE */ |
| r14896 | r14897 | |
| 333 | 329 | } |
| 334 | 330 | |
| 335 | 331 | |
| 336 | ||
| 332 | ||
| 337 | 333 | { |
| 338 | badlands_state *state = space->machine().driver_data<badlands_state>(); | |
| 339 | 334 | |
| 340 | 335 | switch (offset & 0x206) |
| 341 | 336 | { |
| r14896 | r14897 | |
| 346 | 341 | break; |
| 347 | 342 | |
| 348 | 343 | case 0x006: /* /IRQACK */ |
| 349 | atarigen_6502_irq_ack_r(space, 0); | |
| 344 | atarigen_6502_irq_ack_r(&space, 0); | |
| 350 | 345 | break; |
| 351 | 346 | |
| 352 | 347 | case 0x200: /* n/c */ |
| r14896 | r14897 | |
| 354 | 349 | break; |
| 355 | 350 | |
| 356 | 351 | case 0x202: /* /WRP */ |
| 357 | atarigen_6502_sound_w(space, offset, data); | |
| 352 | atarigen_6502_sound_w(&space, offset, data); | |
| 358 | 353 | break; |
| 359 | 354 | |
| 360 | 355 | case 0x204: /* WRIO */ |
| r14896 | r14897 | |
| 369 | 364 | */ |
| 370 | 365 | |
| 371 | 366 | /* update the bank */ |
| 372 | memcpy( | |
| 367 | memcpy( | |
| 373 | 368 | break; |
| 374 | 369 | } |
| 375 | 370 | } |
| r14896 | r14897 | |
| 384 | 379 | |
| 385 | 380 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state ) |
| 386 | 381 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 387 | AM_RANGE(0xfc0000, 0xfc1fff) AM_READ | |
| 382 | AM_RANGE(0xfc0000, 0xfc1fff) AM_READ | |
| 388 | 383 | AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 389 | 384 | AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w) |
| 390 | 385 | AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 391 | 386 | AM_RANGE(0xfe4000, 0xfe5fff) AM_READ_PORT("FE4000") |
| 392 | 387 | AM_RANGE(0xfe6000, 0xfe6001) AM_READ_PORT("FE6000") |
| 393 | 388 | AM_RANGE(0xfe6002, 0xfe6003) AM_READ_PORT("FE6002") |
| 394 | AM_RANGE(0xfe6004, 0xfe6005) AM_READ_LEGACY(pedal_0_r) | |
| 395 | AM_RANGE(0xfe6006, 0xfe6007) AM_READ_LEGACY(pedal_1_r) | |
| 389 | AM_RANGE(0xfe6004, 0xfe6005) AM_READ(pedal_0_r) | |
| 390 | AM_RANGE(0xfe6006, 0xfe6007) AM_READ(pedal_1_r) | |
| 396 | 391 | AM_RANGE(0xfe8000, 0xfe9fff) AM_WRITE_LEGACY(atarigen_sound_upper_w) |
| 397 | 392 | AM_RANGE(0xfea000, 0xfebfff) AM_READ_LEGACY(atarigen_sound_upper_r) |
| 398 | 393 | AM_RANGE(0xfec000, 0xfedfff) AM_WRITE_LEGACY(badlands_pf_bank_w) |
| r14896 | r14897 | |
| 414 | 409 | static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, badlands_state ) |
| 415 | 410 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 416 | 411 | AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 417 | AM_RANGE(0x2800, 0x2bff) AM_READWRITE | |
| 412 | AM_RANGE(0x2800, 0x2bff) AM_READWRITE | |
| 418 | 413 | AM_RANGE(0x3000, 0xffff) AM_ROM |
| 419 | 414 | ADDRESS_MAP_END |
| 420 | 415 | |
| r14896 | r14897 | |
| 632 | 627 | |
| 633 | 628 | */ |
| 634 | 629 | |
| 635 | ||
| 630 | ||
| 636 | 631 | { |
| 637 | 632 | |
| 638 | 633 | return 0xffff; |
| r14896 | r14897 | |
| 642 | 637 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 643 | 638 | |
| 644 | 639 | |
| 645 | AM_RANGE(0x400008, 0x400009) AM_READ_LEGACY(badlandsb_unk_r ) | |
| 646 | AM_RANGE(0x4000fe, 0x4000ff) AM_READ_LEGACY(badlandsb_unk_r ) | |
| 640 | AM_RANGE(0x400008, 0x400009) AM_READ(badlandsb_unk_r ) | |
| 641 | AM_RANGE(0x4000fe, 0x4000ff) AM_READ(badlandsb_unk_r ) | |
| 647 | 642 | |
| 648 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ | |
| 643 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ | |
| 649 | 644 | |
| 650 | AM_RANGE(0xfe4000, 0xfe4001) AM_READ_LEGACY(badlandsb_unk_r ) | |
| 651 | AM_RANGE(0xfe4004, 0xfe4005) AM_READ_LEGACY(badlandsb_unk_r ) | |
| 652 | AM_RANGE(0xfe4006, 0xfe4007) AM_READ_LEGACY(badlandsb_unk_r ) | |
| 645 | AM_RANGE(0xfe4000, 0xfe4001) AM_READ(badlandsb_unk_r ) | |
| 646 | AM_RANGE(0xfe4004, 0xfe4005) AM_READ(badlandsb_unk_r ) | |
| 647 | AM_RANGE(0xfe4006, 0xfe4007) AM_READ(badlandsb_unk_r ) | |
| 653 | 648 | |
| 654 | 649 | |
| 655 | 650 | AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | { |
| 46 | 46 | public: |
| 47 | 47 | astinvad_state(const machine_config &mconfig, device_type type, const char *tag) |
| 48 | : driver_device(mconfig, type, tag) { } | |
| 48 | : driver_device(mconfig, type, tag) , | |
| 49 | m_videoram(*this, "videoram"){ } | |
| 49 | 50 | |
| 50 | 51 | UINT8 * m_colorram; |
| 51 | UINT8 * m_videoram; | |
| 52 | size_t m_videoram_size; | |
| 52 | required_shared_ptr<UINT8> m_videoram; | |
| 53 | 53 | |
| 54 | 54 | emu_timer *m_int_timer; |
| 55 | 55 | UINT8 m_sound_state[2]; |
| r14896 | r14897 | |
| 111 | 111 | static VIDEO_START( spaceint ) |
| 112 | 112 | { |
| 113 | 113 | astinvad_state *state = machine.driver_data<astinvad_state>(); |
| 114 | state->m_colorram = auto_alloc_array(machine, UINT8, state->m_videoram | |
| 114 | state->m_colorram = auto_alloc_array(machine, UINT8, state->m_videoram.bytes()); | |
| 115 | 115 | |
| 116 | 116 | state->save_item(NAME(state->m_color_latch)); |
| 117 | state->save_pointer(NAME(state->m_colorram), state->m_videoram | |
| 117 | state->save_pointer(NAME(state->m_colorram), state->m_videoram.bytes()); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| r14896 | r14897 | |
| 126 | 126 | |
| 127 | 127 | WRITE8_MEMBER(astinvad_state::spaceint_videoram_w) |
| 128 | 128 | { |
| 129 | m_videoram[offset] = data; | |
| 129 | m_videoram.target()[offset] = data; | |
| 130 | 130 | m_colorram[offset] = m_color_latch; |
| 131 | 131 | } |
| 132 | 132 | |
| r14896 | r14897 | |
| 167 | 167 | for (x = cliprect.min_x & ~7; x <= cliprect.max_x; x += 8) |
| 168 | 168 | { |
| 169 | 169 | UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (state->m_screen_flip ? 0 : 4); |
| 170 | UINT8 data = state->m_videoram[(((y ^ state->m_screen_flip) + yoffs) << 5) | ((x ^ state->m_screen_flip) >> 3)]; | |
| 170 | UINT8 data = state->m_videoram.target()[(((y ^ state->m_screen_flip) + yoffs) << 5) | ((x ^ state->m_screen_flip) >> 3)]; | |
| 171 | 171 | plot_byte(screen.machine(), bitmap, y, x, data, state->m_screen_red ? 1 : color); |
| 172 | 172 | } |
| 173 | 173 | |
| r14896 | r14897 | |
| 181 | 181 | const UINT8 *color_prom = screen.machine().region("proms")->base(); |
| 182 | 182 | int offs; |
| 183 | 183 | |
| 184 | for (offs = 0; offs < state->m_videoram | |
| 184 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 185 | 185 | { |
| 186 | UINT8 data = state->m_videoram[offs]; | |
| 186 | UINT8 data = state->m_videoram.target()[offs]; | |
| 187 | 187 | UINT8 color = state->m_colorram[offs]; |
| 188 | 188 | |
| 189 | 189 | UINT8 y = ~offs; |
| r14896 | r14897 | |
| 398 | 398 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 399 | 399 | AM_RANGE(0x0000, 0x1bff) AM_ROM |
| 400 | 400 | AM_RANGE(0x1c00, 0x1fff) AM_RAM |
| 401 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_ | |
| 401 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_ | |
| 402 | 402 | ADDRESS_MAP_END |
| 403 | 403 | |
| 404 | 404 | |
| 405 | 405 | static ADDRESS_MAP_START( spaceint_map, AS_PROGRAM, 8, astinvad_state ) |
| 406 | 406 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 407 | 407 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 408 | AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(spaceint_videoram_w) AM_ | |
| 408 | AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(spaceint_videoram_w) AM_ | |
| 409 | 409 | ADDRESS_MAP_END |
| 410 | 410 | |
| 411 | 411 |
| r14896 | r14897 | |
|---|---|---|
| 134 | 134 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 135 | 135 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 136 | 136 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 137 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 137 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 138 | 138 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 139 | 139 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 140 | 140 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 70 | 70 | * |
| 71 | 71 | *************************************/ |
| 72 | 72 | |
| 73 | ||
| 73 | ||
| 74 | 74 | { |
| 75 | return atarivc_r(* | |
| 75 | return atarivc_r(* | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | ||
| 79 | ||
| 80 | 80 | { |
| 81 | atarivc_w(* | |
| 81 | atarivc_w(* | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| r14896 | r14897 | |
| 89 | 89 | * |
| 90 | 90 | *************************************/ |
| 91 | 91 | |
| 92 | ||
| 92 | ||
| 93 | 93 | { |
| 94 | offtwall_state *state = space->machine().driver_data<offtwall_state>(); | |
| 95 | int result = input_port_read(space->machine(), "260010"); | |
| 96 | if (state->m_cpu_to_sound_ready) result ^= 0x0020; | |
| 94 | int result = input_port_read(machine(), "260010"); | |
| 95 | if (m_cpu_to_sound_ready) result ^= 0x0020; | |
| 97 | 96 | return result; |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | 99 | |
| 101 | ||
| 100 | ||
| 102 | 101 | { |
| 103 | 102 | /* lower byte */ |
| 104 | 103 | if (ACCESSING_BITS_0_7) |
| 105 | 104 | { |
| 106 | 105 | /* bit 4 resets the sound CPU */ |
| 107 | cputag_set_input_line( | |
| 106 | cputag_set_input_line( | |
| 108 | 107 | if (!(data & 0x10)) atarijsa_reset(); |
| 109 | 108 | } |
| 110 | 109 | |
| r14896 | r14897 | |
| 149 | 148 | |
| 150 | 149 | |
| 151 | 150 | |
| 152 | ||
| 151 | ||
| 153 | 152 | { |
| 154 | offtwall_state *state = space->machine().driver_data<offtwall_state>(); | |
| 155 | 153 | |
| 156 | 154 | /* this is the table lookup; the bank is determined by the address that was requested */ |
| 157 | state->m_bank_offset = (offset & 3) * 0x1000; | |
| 158 | logerror("Bankswitch index %d -> %04X\n", offset, state->m_bank_offset); | |
| 155 | m_bank_offset = (offset & 3) * 0x1000; | |
| 156 | logerror("Bankswitch index %d -> %04X\n", offset, m_bank_offset); | |
| 159 | 157 | |
| 160 | return | |
| 158 | return | |
| 161 | 159 | } |
| 162 | 160 | |
| 163 | 161 | |
| 164 | ||
| 162 | ||
| 165 | 163 | { |
| 166 | offtwall_state *state = space->machine().driver_data<offtwall_state>(); | |
| 167 | 164 | |
| 168 | 165 | /* this is the banked ROM read */ |
| 169 | logerror("%06X: %04X\n", cpu_get_previouspc(&space | |
| 166 | logerror("%06X: %04X\n", cpu_get_previouspc(&space. | |
| 170 | 167 | |
| 171 | 168 | /* if the values are $3e000 or $3e002 are being read by code just below the |
| 172 | 169 | ROM bank area, we need to return the correct value to give the proper checksum */ |
| 173 | if ((offset == 0x3000 || offset == 0x3001) && cpu_get_previouspc(&space | |
| 170 | if ((offset == 0x3000 || offset == 0x3001) && cpu_get_previouspc(&space. | |
| 174 | 171 | { |
| 175 | UINT32 checksum = (space | |
| 172 | UINT32 checksum = (space. | |
| 176 | 173 | UINT32 us = 0xaaaa5555 - checksum; |
| 177 | 174 | if (offset == 0x3001) |
| 178 | 175 | return us & 0xffff; |
| r14896 | r14897 | |
| 180 | 177 | return us >> 16; |
| 181 | 178 | } |
| 182 | 179 | |
| 183 | return | |
| 180 | return | |
| 184 | 181 | } |
| 185 | 182 | |
| 186 | 183 | |
| r14896 | r14897 | |
| 203 | 200 | -------------------------------------------------------------------------*/ |
| 204 | 201 | |
| 205 | 202 | |
| 206 | ||
| 203 | ||
| 207 | 204 | { |
| 208 | offtwall_state *state = space->machine().driver_data<offtwall_state>(); | |
| 209 | int prevpc = cpu_get_previouspc(&space->device()); | |
| 205 | int prevpc = cpu_get_previouspc(&space.device()); | |
| 210 | 206 | |
| 211 | 207 | /* if this read is coming from $99f8 or $9992, it's in the sprite copy loop */ |
| 212 | 208 | if (prevpc == 0x99f8 || prevpc == 0x9992) |
| 213 | 209 | { |
| 214 | UINT16 *data = &state->m_spritecache_count[-0x100]; | |
| 215 | int oldword = state->m_spritecache_count[0]; | |
| 210 | UINT16 *data = &m_spritecache_count[-0x100]; | |
| 211 | int oldword = m_spritecache_count[0]; | |
| 216 | 212 | int count = oldword >> 8; |
| 217 | 213 | int i, width = 0; |
| 218 | 214 | |
| r14896 | r14897 | |
| 233 | 229 | } |
| 234 | 230 | |
| 235 | 231 | /* update the final count in memory */ |
| 236 | | |
| 232 | | |
| 237 | 233 | } |
| 238 | 234 | } |
| 239 | 235 | |
| 240 | 236 | /* and then read the data */ |
| 241 | return | |
| 237 | return | |
| 242 | 238 | } |
| 243 | 239 | |
| 244 | 240 | |
| r14896 | r14897 | |
| 258 | 254 | |
| 259 | 255 | |
| 260 | 256 | |
| 261 | ||
| 257 | ||
| 262 | 258 | { |
| 263 | offtwall_state *state = space->machine().driver_data<offtwall_state>(); | |
| 264 | int prevpc = cpu_get_previouspc(&space->device()); | |
| 259 | int prevpc = cpu_get_previouspc(&space.device()); | |
| 265 | 260 | if (prevpc < 0x5c5e || prevpc > 0xc432) |
| 266 | return | |
| 261 | return | |
| 267 | 262 | else |
| 268 | return | |
| 263 | return | |
| 269 | 264 | } |
| 270 | 265 | |
| 271 | 266 | |
| r14896 | r14897 | |
| 278 | 273 | |
| 279 | 274 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, offtwall_state ) |
| 280 | 275 | AM_RANGE(0x000000, 0x037fff) AM_ROM |
| 281 | AM_RANGE(0x038000, 0x03ffff) AM_READ | |
| 276 | AM_RANGE(0x038000, 0x03ffff) AM_READ | |
| 282 | 277 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 283 | 278 | AM_RANGE(0x260000, 0x260001) AM_READ_PORT("260000") |
| 284 | 279 | AM_RANGE(0x260002, 0x260003) AM_READ_PORT("260002") |
| 285 | AM_RANGE(0x260010, 0x260011) AM_READ | |
| 280 | AM_RANGE(0x260010, 0x260011) AM_READ | |
| 286 | 281 | AM_RANGE(0x260012, 0x260013) AM_READ_PORT("260012") |
| 287 | 282 | AM_RANGE(0x260020, 0x260021) AM_READ_PORT("260020") |
| 288 | 283 | AM_RANGE(0x260022, 0x260023) AM_READ_PORT("260022") |
| 289 | 284 | AM_RANGE(0x260024, 0x260025) AM_READ_PORT("260024") |
| 290 | 285 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) |
| 291 | 286 | AM_RANGE(0x260040, 0x260041) AM_WRITE_LEGACY(atarigen_sound_w) |
| 292 | AM_RANGE(0x260050, 0x260051) AM_WRITE | |
| 287 | AM_RANGE(0x260050, 0x260051) AM_WRITE | |
| 293 | 288 | AM_RANGE(0x260060, 0x260061) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 294 | 289 | AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w) |
| 295 | 290 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 296 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 291 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 297 | 292 | AM_RANGE(0x3f4000, 0x3f5eff) AM_RAM_WRITE_LEGACY(atarigen_playfield_latched_msb_w) AM_BASE(m_playfield) |
| 298 | 293 | AM_RANGE(0x3f5f00, 0x3f5f7f) AM_RAM AM_BASE(m_atarivc_eof_data) |
| 299 | 294 | AM_RANGE(0x3f5f80, 0x3f5fff) AM_READWRITE_LEGACY(atarimo_0_slipram_r, atarimo_0_slipram_w) |
| r14896 | r14897 | |
| 497 | 492 | atarijsa_init(machine, "260010", 0x0040); |
| 498 | 493 | |
| 499 | 494 | /* install son-of-slapstic workarounds */ |
| 500 | state->m_spritecache_count = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fde42, 0x3fde43, FUNC(spritecache_count_r)); | |
| 501 | state->m_bankswitch_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x037ec2, 0x037f39, FUNC(bankswitch_r)); | |
| 502 | state->m_unknown_verify_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fdf1e, 0x3fdf1f, FUNC(unknown_verify_r)); | |
| 495 | state->m_spritecache_count = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fde42, 0x3fde43, read16_delegate(FUNC(offtwall_state::spritecache_count_r),state)); | |
| 496 | state->m_bankswitch_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x037ec2, 0x037f39, read16_delegate(FUNC(offtwall_state::bankswitch_r),state)); | |
| 497 | state->m_unknown_verify_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fdf1e, 0x3fdf1f, read16_delegate(FUNC(offtwall_state::unknown_verify_r),state)); | |
| 503 | 498 | } |
| 504 | 499 | |
| 505 | 500 | |
| r14896 | r14897 | |
| 510 | 505 | atarijsa_init(machine, "260010", 0x0040); |
| 511 | 506 | |
| 512 | 507 | /* install son-of-slapstic workarounds */ |
| 513 | state->m_spritecache_count = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fde42, 0x3fde43, FUNC(spritecache_count_r)); | |
| 514 | state->m_bankswitch_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x037eca, 0x037f43, FUNC(bankswitch_r)); | |
| 515 | state->m_unknown_verify_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fdf24, 0x3fdf25, FUNC(unknown_verify_r)); | |
| 508 | state->m_spritecache_count = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fde42, 0x3fde43, read16_delegate(FUNC(offtwall_state::spritecache_count_r),state)); | |
| 509 | state->m_bankswitch_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x037eca, 0x037f43, read16_delegate(FUNC(offtwall_state::bankswitch_r),state)); | |
| 510 | state->m_unknown_verify_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3fdf24, 0x3fdf25, read16_delegate(FUNC(offtwall_state::unknown_verify_r),state)); | |
| 516 | 511 | } |
| 517 | 512 | |
| 518 | 513 |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | public: |
| 34 | 34 | esh_state(const machine_config &mconfig, device_type type, const char *tag) |
| 35 | 35 | : driver_device(mconfig, type, tag), |
| 36 | m_laserdisc(*this, "laserdisc") { } | |
| 36 | m_laserdisc(*this, "laserdisc") , | |
| 37 | m_tile_ram(*this, "tile_ram"), | |
| 38 | m_tile_control_ram(*this, "tile_control_ram"){ } | |
| 37 | 39 | |
| 38 | 40 | required_device<pioneer_ldv1000_device> m_laserdisc; |
| 39 | UINT8 *m_tile_ram; | |
| 40 | UINT8 *m_tile_control_ram; | |
| 41 | required_shared_ptr<UINT8> m_tile_ram; | |
| 42 | required_shared_ptr<UINT8> m_tile_control_ram; | |
| 41 | 43 | UINT8 m_ld_video_visible; |
| 42 | 44 | DECLARE_READ8_MEMBER(ldp_read); |
| 43 | 45 | DECLARE_WRITE8_MEMBER(ldp_write); |
| r14896 | r14897 | |
| 67 | 69 | { |
| 68 | 70 | int current_screen_character = (chary*32) + charx; |
| 69 | 71 | |
| 70 | int palIndex = (state->m_tile_control_ram[current_screen_character] & 0x0f); | |
| 71 | int tileOffs = (state->m_tile_control_ram[current_screen_character] & 0x10) >> 4; | |
| 72 | //int blinkLine = (state->m_tile_control_ram[current_screen_character] & 0x40) >> 6; | |
| 73 | //int blinkChar = (state->m_tile_control_ram[current_screen_character] & 0x80) >> 7; | |
| 72 | int palIndex = (state->m_tile_control_ram.target()[current_screen_character] & 0x0f); | |
| 73 | int tileOffs = (state->m_tile_control_ram.target()[current_screen_character] & 0x10) >> 4; | |
| 74 | //int blinkLine = (state->m_tile_control_ram.target()[current_screen_character] & 0x40) >> 6; | |
| 75 | //int blinkChar = (state->m_tile_control_ram.target()[current_screen_character] & 0x80) >> 7; | |
| 74 | 76 | |
| 75 | 77 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], |
| 76 | state->m_tile_ram[current_screen_character] + (0x100 * tileOffs), | |
| 78 | state->m_tile_ram.target()[current_screen_character] + (0x100 * tileOffs), | |
| 77 | 79 | palIndex, |
| 78 | 80 | 0, 0, charx*8, chary*8, 0); |
| 79 | 81 | } |
| r14896 | r14897 | |
| 157 | 159 | static ADDRESS_MAP_START( z80_0_mem, AS_PROGRAM, 8, esh_state ) |
| 158 | 160 | AM_RANGE(0x0000,0x3fff) AM_ROM |
| 159 | 161 | AM_RANGE(0xe000,0xe7ff) AM_RAM AM_SHARE("nvram") |
| 160 | AM_RANGE(0xf000,0xf3ff) AM_RAM AM_BASE(m_tile_ram) | |
| 161 | AM_RANGE(0xf400,0xf7ff) AM_RAM AM_BASE(m_tile_control_ram) | |
| 162 | AM_RANGE(0xf000,0xf3ff) AM_RAM AM_SHARE("tile_ram") | |
| 163 | AM_RANGE(0xf400,0xf7ff) AM_RAM AM_SHARE("tile_control_ram") | |
| 162 | 164 | ADDRESS_MAP_END |
| 163 | 165 | |
| 164 | 166 |
| r14896 | r14897 | |
|---|---|---|
| 210 | 210 | { |
| 211 | 211 | public: |
| 212 | 212 | halleys_state(const machine_config &mconfig, device_type type, const char *tag) |
| 213 | : driver_device(mconfig, type, tag) { } | |
| 213 | : driver_device(mconfig, type, tag) , | |
| 214 | m_blitter_ram(*this, "blitter_ram"), | |
| 215 | m_io_ram(*this, "io_ram"){ } | |
| 214 | 216 | |
| 215 | 217 | UINT16 *m_render_layer[MAX_LAYERS]; |
| 216 | 218 | UINT8 m_sound_fifo[MAX_SOUNDS]; |
| r14896 | r14897 | |
| 225 | 227 | UINT32 *m_alpha_table; |
| 226 | 228 | UINT8 *m_cpu1_base; |
| 227 | 229 | UINT8 *m_gfx1_base; |
| 228 | UINT8 *m_blitter_ram; | |
| 229 | UINT8 *m_io_ram; | |
| 230 | size_t m_blitter_ramsize; | |
| 231 | size_t m_io_ramsize; | |
| 230 | required_shared_ptr<UINT8> m_blitter_ram; | |
| 231 | required_shared_ptr<UINT8> m_io_ram; | |
| 232 | 232 | int m_game_id; |
| 233 | 233 | int m_blitter_busy; |
| 234 | 234 | int m_collision_count; |
| r14896 | r14897 | |
| 1027 | 1027 | |
| 1028 | 1028 | if (i==0 || i==4) return(1); |
| 1029 | 1029 | |
| 1030 | return(m_blitter_ram[offset]); | |
| 1030 | return(m_blitter_ram.target()[offset]); | |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | |
| r14896 | r14897 | |
| 1042 | 1042 | { |
| 1043 | 1043 | int i = offset & 0xf; |
| 1044 | 1044 | |
| 1045 | m_blitter_ram[offset] = data; | |
| 1045 | m_blitter_ram.target()[offset] = data; | |
| 1046 | 1046 | |
| 1047 | 1047 | if (i==0) blit(offset); |
| 1048 | 1048 | |
| r14896 | r14897 | |
| 1093 | 1093 | return(0); |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | return(m_io_ram[0x66]); | |
| 1096 | return(m_io_ram.target()[0x66]); | |
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | |
| r14896 | r14897 | |
| 1496 | 1496 | copy_fixed_xp (bitmap, state->m_render_layer[0]); |
| 1497 | 1497 | |
| 1498 | 1498 | // HALF-HACK: apply RGB filter when the following conditions are met |
| 1499 | i = state->m_io_ram[0xa0]; | |
| 1500 | j = state->m_io_ram[0xa1]; | |
| 1501 | if (state->m_io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen.machine(), bitmap, i); | |
| 1499 | i = state->m_io_ram.target()[0xa0]; | |
| 1500 | j = state->m_io_ram.target()[0xa1]; | |
| 1501 | if (state->m_io_ram.target()[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen.machine(), bitmap, i); | |
| 1502 | 1502 | return 0; |
| 1503 | 1503 | } |
| 1504 | 1504 | |
| r14896 | r14897 | |
| 1506 | 1506 | static SCREEN_UPDATE_IND16( benberob ) |
| 1507 | 1507 | { |
| 1508 | 1508 | halleys_state *state = screen.machine().driver_data<halleys_state>(); |
| 1509 | if (state->m_io_ram[0xa0] & 0x80) | |
| 1509 | if (state->m_io_ram.target()[0xa0] & 0x80) | |
| 1510 | 1510 | copy_scroll_op(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1); |
| 1511 | 1511 | else |
| 1512 | 1512 | bitmap.fill(state->m_bgcolor, cliprect); |
| r14896 | r14897 | |
| 1526 | 1526 | |
| 1527 | 1527 | READ8_MEMBER(halleys_state::debug_r) |
| 1528 | 1528 | { |
| 1529 | return(m_io_ram[offset]); | |
| 1529 | return(m_io_ram.target()[offset]); | |
| 1530 | 1530 | } |
| 1531 | 1531 | |
| 1532 | 1532 | #endif |
| r14896 | r14897 | |
| 1598 | 1598 | |
| 1599 | 1599 | WRITE8_MEMBER(halleys_state::firq_ack_w) |
| 1600 | 1600 | { |
| 1601 | m_io_ram[0x9c] = data; | |
| 1601 | m_io_ram.target()[0x9c] = data; | |
| 1602 | 1602 | |
| 1603 | 1603 | if (m_firq_level) m_firq_level--; |
| 1604 | 1604 | cputag_set_input_line(machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE); |
| r14896 | r14897 | |
| 1615 | 1615 | WRITE8_MEMBER(halleys_state::soundcommand_w) |
| 1616 | 1616 | { |
| 1617 | 1617 | |
| 1618 | m_io_ram[0x8a] = data; | |
| 1619 | soundlatch_w(space,offset,data); | |
| 1618 | m_io_ram.target()[0x8a] = data; | |
| 1619 | soundlatch_byte_w(space,offset,data); | |
| 1620 | 1620 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 1621 | 1621 | } |
| 1622 | 1622 | |
| r14896 | r14897 | |
| 1650 | 1650 | // Memory Maps |
| 1651 | 1651 | |
| 1652 | 1652 | static ADDRESS_MAP_START( halleys_map, AS_PROGRAM, 8, halleys_state ) |
| 1653 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(blitter_r, blitter_w) AM_ | |
| 1653 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(blitter_r, blitter_w) AM_ | |
| 1654 | 1654 | AM_RANGE(0x1f00, 0x1fff) AM_WRITE(bgtile_w) // background tiles?(Ben Bero Beh only) |
| 1655 | 1655 | AM_RANGE(0x1000, 0xefff) AM_ROM |
| 1656 | 1656 | AM_RANGE(0xf000, 0xfeff) AM_RAM // work ram |
| r14896 | r14897 | |
| 1668 | 1668 | AM_RANGE(0xff96, 0xff96) AM_READ_PORT("DSW2") // dipswitch 3 |
| 1669 | 1669 | AM_RANGE(0xff97, 0xff97) AM_READ_PORT("DSW3") // dipswitch 2 |
| 1670 | 1670 | AM_RANGE(0xff9c, 0xff9c) AM_WRITE(firq_ack_w) |
| 1671 | AM_RANGE(0xff00, 0xffbf) AM_RAM AM_ | |
| 1671 | AM_RANGE(0xff00, 0xffbf) AM_RAM AM_ | |
| 1672 | 1672 | |
| 1673 | 1673 | AM_RANGE(0xffc0, 0xffdf) AM_RAM_WRITE(halleys_paletteram_IIRRGGBB_w) AM_SHARE("paletteram") |
| 1674 | 1674 | AM_RANGE(0xffe0, 0xffff) AM_READ(vector_r) |
| r14896 | r14897 | |
| 1684 | 1684 | AM_RANGE(0x4803, 0x4803) AM_DEVREAD_LEGACY("ay3", ay8910_r) |
| 1685 | 1685 | AM_RANGE(0x4804, 0x4805) AM_DEVWRITE_LEGACY("ay4", ay8910_address_data_w) |
| 1686 | 1686 | AM_RANGE(0x4805, 0x4805) AM_DEVREAD_LEGACY("ay4", ay8910_r) |
| 1687 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_r) | |
| 1687 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r) | |
| 1688 | 1688 | AM_RANGE(0xe000, 0xefff) AM_ROM // space for diagnostic ROM |
| 1689 | 1689 | ADDRESS_MAP_END |
| 1690 | 1690 | |
| r14896 | r14897 | |
| 1937 | 1937 | state->m_bgcolor = get_black_pen(machine); |
| 1938 | 1938 | state->m_fftail = state->m_ffhead = state->m_ffcount = 0; |
| 1939 | 1939 | |
| 1940 | memset(state->m_io_ram, 0xff, state->m_io_ram | |
| 1940 | memset(state->m_io_ram.target(), 0xff, state->m_io_ram.bytes()); | |
| 1941 | 1941 | memset(state->m_render_layer[0], 0, SCREEN_BYTESIZE * MAX_LAYERS); |
| 1942 | 1942 | } |
| 1943 | 1943 |
| r14896 | r14897 | |
|---|---|---|
| 194 | 194 | DEVCB_NULL, |
| 195 | 195 | DEVCB_NULL, |
| 196 | 196 | DEVCB_NULL, |
| 197 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), | |
| 197 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), | |
| 198 | 198 | DEVCB_HANDLER(video_control_w), |
| 199 | 199 | DEVCB_HANDLER(tilemap_sound_w) |
| 200 | 200 | }; |
| r14896 | r14897 | |
| 433 | 433 | |
| 434 | 434 | /* assert ACK */ |
| 435 | 435 | ppi8255_set_port_c(state->m_ppi8255, 0x00); |
| 436 | return state->soundlatch_r(*space, offset); | |
| 436 | return state->soundlatch_byte_r(*space, offset); | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 |
| r14896 | r14897 | |
|---|---|---|
| 571 | 571 | /* accessing the LSB only is not mapped */ |
| 572 | 572 | if (mem_mask != 0x00ff) |
| 573 | 573 | { |
| 574 | soundlatch_w(space, 0, data >> 8); | |
| 574 | soundlatch_byte_w(space, 0, data >> 8); | |
| 575 | 575 | |
| 576 | 576 | audio_cpu_assert_nmi(machine()); |
| 577 | 577 | |
| r14896 | r14897 | |
| 585 | 585 | |
| 586 | 586 | READ8_MEMBER(neogeo_state::audio_command_r) |
| 587 | 587 | { |
| 588 | UINT8 ret = soundlatch_r(space, 0); | |
| 588 | UINT8 ret = soundlatch_byte_r(space, 0); | |
| 589 | 589 | |
| 590 | 590 | if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", cpu_get_pc(&space.device()), ret); |
| 591 | 591 |
| r14896 | r14897 | |
|---|---|---|
| 290 | 290 | { |
| 291 | 291 | segas1x_state *state = device->machine().driver_data<segas1x_state>(); |
| 292 | 292 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 293 | state->soundlatch_w(*space, offset, data); | |
| 293 | state->soundlatch_byte_w(*space, offset, data); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| r14896 | r14897 | |
| 417 | 417 | |
| 418 | 418 | /* assert ACK */ |
| 419 | 419 | ppi8255_set_port_c(state->m_ppi8255_1, 0x00); |
| 420 | return state->soundlatch_r(*space, offset); | |
| 420 | return state->soundlatch_byte_r(*space, offset); | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 |
| r14896 | r14897 | |
|---|---|---|
| 80 | 80 | { |
| 81 | 81 | public: |
| 82 | 82 | statriv2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 83 | : driver_device(mconfig, type, tag) { } | |
| 83 | : driver_device(mconfig, type, tag) , | |
| 84 | m_videoram(*this, "videoram"), | |
| 85 | m_question_offset(*this, "question_offset"){ } | |
| 84 | 86 | |
| 85 | UINT8 | |
| 87 | required_shared_ptr<UINT8> | |
| 86 | 88 | tilemap_t *m_tilemap; |
| 87 | UINT8 | |
| 89 | required_shared_ptr<UINT8> | |
| 88 | 90 | UINT8 m_question_offset_low; |
| 89 | 91 | UINT8 m_question_offset_mid; |
| 90 | 92 | UINT8 m_question_offset_high; |
| r14896 | r14897 | |
| 110 | 112 | static TILE_GET_INFO( horizontal_tile_info ) |
| 111 | 113 | { |
| 112 | 114 | statriv2_state *state = machine.driver_data<statriv2_state>(); |
| 113 | UINT8 *videoram = state->m_videoram; | |
| 115 | UINT8 *videoram = state->m_videoram.target(); | |
| 114 | 116 | int code = videoram[0x400+tile_index]; |
| 115 | 117 | int attr = videoram[tile_index] & 0x3f; |
| 116 | 118 | |
| r14896 | r14897 | |
| 120 | 122 | static TILE_GET_INFO( vertical_tile_info ) |
| 121 | 123 | { |
| 122 | 124 | statriv2_state *state = machine.driver_data<statriv2_state>(); |
| 123 | UINT8 *videoram = state->m_videoram; | |
| 125 | UINT8 *videoram = state->m_videoram.target(); | |
| 124 | 126 | int code = videoram[0x400+tile_index]; |
| 125 | 127 | int attr = videoram[tile_index] & 0x3f; |
| 126 | 128 | |
| r14896 | r14897 | |
| 168 | 170 | |
| 169 | 171 | WRITE8_MEMBER(statriv2_state::statriv2_videoram_w) |
| 170 | 172 | { |
| 171 | UINT8 *videoram = m_videoram; | |
| 173 | UINT8 *videoram = m_videoram.target(); | |
| 172 | 174 | videoram[offset] = data; |
| 173 | 175 | m_tilemap->mark_tile_dirty(offset & 0x3ff); |
| 174 | 176 | } |
| r14896 | r14897 | |
| 227 | 229 | UINT32 address; |
| 228 | 230 | |
| 229 | 231 | if (m_question_offset_high == 0xff) |
| 230 | m_question_offset[m_question_offset_low]++; | |
| 232 | m_question_offset.target()[m_question_offset_low]++; | |
| 231 | 233 | |
| 232 | address = m_question_offset[m_question_offset_low]; | |
| 233 | address |= m_question_offset[m_question_offset_mid] << 8; | |
| 234 | address = m_question_offset.target()[m_question_offset_low]; | |
| 235 | address |= m_question_offset.target()[m_question_offset_mid] << 8; | |
| 234 | 236 | if (m_question_offset_high != 0xff) |
| 235 | address |= m_question_offset[m_question_offset_high] << 16; | |
| 237 | address |= m_question_offset.target()[m_question_offset_high] << 16; | |
| 236 | 238 | |
| 237 | 239 | return (address < qromsize) ? qrom[address] : 0xff; |
| 238 | 240 | } |
| r14896 | r14897 | |
| 294 | 296 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 295 | 297 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 296 | 298 | AM_RANGE(0x4800, 0x48ff) AM_RAM AM_SHARE("nvram") |
| 297 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(statriv2_videoram_w) AM_ | |
| 299 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(statriv2_videoram_w) AM_ | |
| 298 | 300 | ADDRESS_MAP_END |
| 299 | 301 | |
| 300 | 302 | static ADDRESS_MAP_START( statriv2_io_map, AS_IO, 8, statriv2_state ) |
| 301 | 303 | AM_RANGE(0x20, 0x23) AM_DEVREADWRITE_LEGACY("ppi", ppi8255_r, ppi8255_w) |
| 302 | AM_RANGE(0x28, 0x2b) AM_READ(question_data_r) AM_WRITEONLY AM_ | |
| 304 | AM_RANGE(0x28, 0x2b) AM_READ(question_data_r) AM_WRITEONLY AM_ | |
| 303 | 305 | AM_RANGE(0xb0, 0xb1) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 304 | 306 | AM_RANGE(0xb1, 0xb1) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 305 | 307 | AM_RANGE(0xc0, 0xcf) AM_DEVREADWRITE_LEGACY("tms", tms9927_r, tms9927_w) |
| r14896 | r14897 | |
|---|---|---|
| 56 | 56 | { |
| 57 | 57 | public: |
| 58 | 58 | carrera_state(const machine_config &mconfig, device_type type, const char *tag) |
| 59 | : driver_device(mconfig, type, tag) { } | |
| 59 | : driver_device(mconfig, type, tag) , | |
| 60 | m_tileram(*this, "tileram"){ } | |
| 60 | 61 | |
| 61 | UINT8 | |
| 62 | required_shared_ptr<UINT8> m_tileram; | |
| 62 | 63 | }; |
| 63 | 64 | |
| 64 | 65 | |
| r14896 | r14897 | |
| 67 | 68 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 68 | 69 | AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 69 | 70 | AM_RANGE(0xe801, 0xe801) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 70 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_ | |
| 71 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_ | |
| 71 | 72 | ADDRESS_MAP_END |
| 72 | 73 | |
| 73 | 74 | static ADDRESS_MAP_START( io_map, AS_IO, 8, carrera_state ) |
| r14896 | r14897 | |
| 255 | 256 | { |
| 256 | 257 | for (x=0;x<64;x++) |
| 257 | 258 | { |
| 258 | int tile = state->m_tileram[count&0x7ff] | state->m_tileram[(count&0x7ff)+0x800]<<8; | |
| 259 | int tile = state->m_tileram.target()[count&0x7ff] | state->m_tileram.target()[(count&0x7ff)+0x800]<<8; | |
| 259 | 260 | |
| 260 | 261 | drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,0,0,0,x*8,y*8); |
| 261 | 262 | count++; |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | static ADDRESS_MAP_START(vectrex_map, AS_PROGRAM, 8, vectrex_state ) |
| 23 | 23 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 24 | AM_RANGE(0xc800, 0xcbff) AM_RAM AM_MIRROR(0x0400) AM_BASE(m_gce_vectorram | |
| 24 | AM_RANGE(0xc800, 0xcbff) AM_RAM AM_MIRROR(0x0400) AM_BASE_SIZE(m_gce_vectorram, | |
| 25 | 25 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(vectrex_via_r, vectrex_via_w) |
| 26 | 26 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 27 | 27 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 177 | 177 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 178 | 178 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram") |
| 179 | 179 | AM_RANGE(0xa000, 0xa000) AM_WRITE(raaspec_led_w) |
| 180 | AM_RANGE(0xc800, 0xcbff) AM_RAM AM_MIRROR(0x0400) AM_BASE(m_gce_vectorram | |
| 180 | AM_RANGE(0xc800, 0xcbff) AM_RAM AM_MIRROR(0x0400) AM_BASE_SIZE(m_gce_vectorram, | |
| 181 | 181 | AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(vectrex_via_r, vectrex_via_w) |
| 182 | 182 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 183 | 183 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 20 | 20 | WRITE16_MEMBER(ultraman_state::sound_cmd_w) |
| 21 | 21 | { |
| 22 | 22 | if (ACCESSING_BITS_0_7) |
| 23 | soundlatch_w(space, 0, data & 0xff); | |
| 23 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | WRITE16_MEMBER(ultraman_state::sound_irq_trigger_w) |
| r14896 | r14897 | |
| 34 | 34 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, ultraman_state ) |
| 35 | 35 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 36 | 36 | AM_RANGE(0x080000, 0x08ffff) AM_RAM |
| 37 | AM_RANGE(0x180000, 0x183fff) AM_RAM_WRITE(paletteram | |
| 37 | AM_RANGE(0x180000, 0x183fff) AM_RAM_WRITE(paletteram | |
| 38 | 38 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("SYSTEM") |
| 39 | 39 | AM_RANGE(0x1c0002, 0x1c0003) AM_READ_PORT("P1") |
| 40 | 40 | AM_RANGE(0x1c0004, 0x1c0005) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 57 | 57 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ultraman_state ) |
| 58 | 58 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 59 | 59 | AM_RANGE(0x8000, 0xbfff) AM_RAM |
| 60 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) /* Sound latch read */ | |
| 60 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* Sound latch read */ | |
| 61 | 61 | // AM_RANGE(0xd000, 0xd000) AM_WRITENOP /* ??? */ |
| 62 | 62 | AM_RANGE(0xe000, 0xe000) AM_DEVREADWRITE("oki", okim6295_device, read, write) /* M6295 */ |
| 63 | 63 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */ |
| r14896 | r14897 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | public: |
| 30 | 30 | d9final_state(const machine_config &mconfig, device_type type, const char *tag) |
| 31 | : driver_device(mconfig, type, tag) { } | |
| 31 | : driver_device(mconfig, type, tag) , | |
| 32 | m_lo_vram(*this, "lo_vram"), | |
| 33 | m_hi_vram(*this, "hi_vram"), | |
| 34 | m_cram(*this, "cram"){ } | |
| 32 | 35 | |
| 33 | UINT8 *m_lo_vram; | |
| 34 | UINT8 *m_hi_vram; | |
| 35 | UINT8 *m_cram; | |
| 36 | required_shared_ptr<UINT8> m_lo_vram; | |
| 37 | required_shared_ptr<UINT8> m_hi_vram; | |
| 38 | required_shared_ptr<UINT8> m_cram; | |
| 36 | 39 | tilemap_t *m_sc0_tilemap; |
| 37 | 40 | DECLARE_WRITE8_MEMBER(sc0_lovram); |
| 38 | 41 | DECLARE_WRITE8_MEMBER(sc0_hivram); |
| r14896 | r14897 | |
| 46 | 49 | static TILE_GET_INFO( get_sc0_tile_info ) |
| 47 | 50 | { |
| 48 | 51 | d9final_state *state = machine.driver_data<d9final_state>(); |
| 49 | int tile = ((state->m_hi_vram[tile_index] & 0x3f)<<8) | state->m_lo_vram[tile_index]; | |
| 50 | int color = state->m_cram[tile_index] & 0x3f; | |
| 52 | int tile = ((state->m_hi_vram.target()[tile_index] & 0x3f)<<8) | state->m_lo_vram.target()[tile_index]; | |
| 53 | int color = state->m_cram.target()[tile_index] & 0x3f; | |
| 51 | 54 | |
| 52 | 55 | SET_TILE_INFO( |
| 53 | 56 | 0, |
| r14896 | r14897 | |
| 71 | 74 | |
| 72 | 75 | WRITE8_MEMBER(d9final_state::sc0_lovram) |
| 73 | 76 | { |
| 74 | m_lo_vram[offset] = data; | |
| 77 | m_lo_vram.target()[offset] = data; | |
| 75 | 78 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 76 | 79 | } |
| 77 | 80 | |
| 78 | 81 | WRITE8_MEMBER(d9final_state::sc0_hivram) |
| 79 | 82 | { |
| 80 | m_hi_vram[offset] = data; | |
| 83 | m_hi_vram.target()[offset] = data; | |
| 81 | 84 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 82 | 85 | } |
| 83 | 86 | |
| 84 | 87 | WRITE8_MEMBER(d9final_state::sc0_cram) |
| 85 | 88 | { |
| 86 | m_cram[offset] = data; | |
| 89 | m_cram.target()[offset] = data; | |
| 87 | 90 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 88 | 91 | } |
| 89 | 92 | |
| r14896 | r14897 | |
| 109 | 112 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 110 | 113 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 111 | 114 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 112 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_SHARE("paletteram") | |
| 113 | AM_RANGE(0xcc00, 0xcfff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_SHARE("paletteram2") | |
| 114 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(sc0_lovram) AM_BASE(m_lo_vram) | |
| 115 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(sc0_hivram) AM_BASE(m_hi_vram) | |
| 116 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(sc0_cram) AM_BASE(m_cram) | |
| 115 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_lo_w) AM_SHARE("paletteram") | |
| 116 | AM_RANGE(0xcc00, 0xcfff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 117 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(sc0_lovram) AM_SHARE("lo_vram") | |
| 118 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(sc0_hivram) AM_SHARE("hi_vram") | |
| 119 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(sc0_cram) AM_SHARE("cram") | |
| 117 | 120 | AM_RANGE(0xf000, 0xf000) AM_READ(prot_latch_r) |
| 118 | 121 | ADDRESS_MAP_END |
| 119 | 122 |
| r14896 | r14897 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | WRITE8_MEMBER(blueprnt_state::blueprnt_sound_command_w) |
| 72 | 72 | { |
| 73 | soundlatch_w(space, offset, data); | |
| 73 | soundlatch_byte_w(space, offset, data); | |
| 74 | 74 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 75 | 75 | } |
| 76 | 76 | |
| r14896 | r14897 | |
| 254 | 254 | AY8910_LEGACY_OUTPUT, |
| 255 | 255 | AY8910_DEFAULT_LOADS, |
| 256 | 256 | DEVCB_NULL, |
| 257 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 257 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 258 | 258 | DEVCB_HANDLER(dipsw_w), |
| 259 | 259 | DEVCB_NULL |
| 260 | 260 | }; |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | public: |
| 51 | 51 | ttchamp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 52 | : driver_device(mconfig, type, tag) { } | |
| 52 | : driver_device(mconfig, type, tag) , | |
| 53 | m_peno_vram(*this, "peno_vram"){ } | |
| 53 | 54 | |
| 54 | UINT16 | |
| 55 | required_shared_ptr<UINT16> | |
| 55 | 56 | UINT16 m_paloff; |
| 56 | 57 | DECLARE_WRITE16_MEMBER(paloff_w); |
| 57 | 58 | DECLARE_WRITE16_MEMBER(pcup_prgbank_w); |
| r14896 | r14897 | |
| 90 | 91 | { |
| 91 | 92 | for(x=0;x<xxx;x++) |
| 92 | 93 | { |
| 93 | /*if(hotblock_port0&0x40)*/bitmap.pix16(y, x) = ((UINT8 *)state->m_peno_vram)[BYTE_XOR_LE(count)]+0x300; | |
| 94 | /*if(hotblock_port0&0x40)*/bitmap.pix16(y, x) = ((UINT8 *)state->m_peno_vram.target())[BYTE_XOR_LE(count)]+0x300; | |
| 94 | 95 | count++; |
| 95 | 96 | } |
| 96 | 97 | } |
| r14896 | r14897 | |
| 136 | 137 | |
| 137 | 138 | static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state ) |
| 138 | 139 | AM_RANGE(0x00000, 0x0ffff) AM_RAM |
| 139 | AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_ | |
| 140 | AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_ | |
| 140 | 141 | AM_RANGE(0x20000, 0x7ffff) AM_ROMBANK("bank1") // ? |
| 141 | 142 | AM_RANGE(0x80000, 0xfffff) AM_ROMBANK("bank2") // ? |
| 142 | 143 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | WRITE8_MEMBER(buggychl_state::sound_command_w) |
| 105 | 105 | { |
| 106 | soundlatch_w(space, 0, data); | |
| 106 | soundlatch_byte_w(space, 0, data); | |
| 107 | 107 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 108 | 108 | } |
| 109 | 109 | |
| r14896 | r14897 | |
| 154 | 154 | // AM_RANGE(0xd60b, 0xd60b) // other inputs, not used? |
| 155 | 155 | AM_RANGE(0xd610, 0xd610) AM_WRITE(sound_command_w) |
| 156 | 156 | AM_RANGE(0xd618, 0xd618) AM_WRITENOP /* accelerator clear */ |
| 157 | AM_RANGE(0xd700, 0xd7ff) AM_WRITE(paletteram_xxxxRRRRGGGGBBBB_be_w) AM_SHARE("paletteram") | |
| 157 | AM_RANGE(0xd700, 0xd7ff) AM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_be_w) AM_SHARE("paletteram") | |
| 158 | 158 | AM_RANGE(0xd840, 0xd85f) AM_WRITEONLY AM_BASE(m_scrollv) |
| 159 | 159 | AM_RANGE(0xdb00, 0xdbff) AM_WRITEONLY AM_BASE(m_scrollh) |
| 160 | 160 | AM_RANGE(0xdc04, 0xdc04) AM_WRITEONLY /* should be fg scroll */ |
| r14896 | r14897 | |
| 169 | 169 | AM_RANGE(0x4810, 0x481d) AM_DEVWRITE_LEGACY("msm", msm5232_w) |
| 170 | 170 | AM_RANGE(0x4820, 0x4820) AM_RAM /* VOL/BAL for the 7630 on the MSM5232 output */ |
| 171 | 171 | AM_RANGE(0x4830, 0x4830) AM_RAM /* TRBL/BASS for the 7630 on the MSM5232 output */ |
| 172 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_r) | |
| 172 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r) | |
| 173 | 173 | // AM_RANGE(0x5001, 0x5001) AM_READNOP /* is command pending? */ |
| 174 | 174 | AM_RANGE(0x5001, 0x5001) AM_WRITE(nmi_enable_w) |
| 175 | 175 | AM_RANGE(0x5002, 0x5002) AM_WRITE(nmi_disable_w) |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | AM_RANGE(0x100002, 0x100003) AM_WRITE(gotcha_lamps_w) |
| 102 | 102 | AM_RANGE(0x100004, 0x100005) AM_DEVWRITE_LEGACY("oki", gotcha_oki_bank_w) |
| 103 | 103 | AM_RANGE(0x120000, 0x12ffff) AM_RAM |
| 104 | AM_RANGE(0x140000, 0x1405ff) AM_RAM_WRITE(paletteram | |
| 104 | AM_RANGE(0x140000, 0x1405ff) AM_RAM_WRITE(paletteram | |
| 105 | 105 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 106 | 106 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("INPUTS") |
| 107 | 107 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 119 | 119 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 120 | 120 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 121 | 121 | AM_RANGE(0xc002, 0xc003) AM_DEVWRITE("oki", okim6295_device, write) // TWO addresses! |
| 122 | AM_RANGE(0xc006, 0xc006) AM_READ(soundlatch_r) | |
| 122 | AM_RANGE(0xc006, 0xc006) AM_READ(soundlatch_byte_r) | |
| 123 | 123 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 124 | 124 | ADDRESS_MAP_END |
| 125 | 125 |
| r14896 | r14897 | |
|---|---|---|
| 702 | 702 | static ADDRESS_MAP_START( dondokod_map, AS_PROGRAM, 16, taitof2_state ) |
| 703 | 703 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 704 | 704 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 705 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 705 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 706 | 706 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 707 | 707 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 708 | 708 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r14896 | r14897 | |
| 721 | 721 | AM_RANGE(0x120000, 0x12000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 722 | 722 | AM_RANGE(0x180000, 0x180fff) AM_READWRITE(cchip2_word_r, cchip2_word_w) AM_BASE(m_cchip2_ram) |
| 723 | 723 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 724 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 724 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 725 | 725 | AM_RANGE(0x400000, 0x40001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 726 | 726 | AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 727 | 727 | AM_RANGE(0x610000, 0x61ffff) AM_RAM /* unused? */ |
| r14896 | r14897 | |
| 731 | 731 | |
| 732 | 732 | static ADDRESS_MAP_START( thundfox_map, AS_PROGRAM, 16, taitof2_state ) |
| 733 | 733 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 734 | AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(paletteram | |
| 734 | AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(paletteram | |
| 735 | 735 | AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 736 | 736 | AM_RANGE(0x220000, 0x220001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 737 | 737 | AM_RANGE(0x220002, 0x220003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r14896 | r14897 | |
| 747 | 747 | static ADDRESS_MAP_START( cameltry_map, AS_PROGRAM, 16, taitof2_state ) |
| 748 | 748 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 749 | 749 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 750 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 750 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 751 | 751 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 752 | 752 | AM_RANGE(0x300018, 0x30001f) AM_READ(cameltry_paddle_r) |
| 753 | 753 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| r14896 | r14897 | |
| 776 | 776 | static ADDRESS_MAP_START( liquidk_map, AS_PROGRAM, 16, taitof2_state ) |
| 777 | 777 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 778 | 778 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 779 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 779 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 780 | 780 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 781 | 781 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 782 | 782 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| r14896 | r14897 | |
| 811 | 811 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 812 | 812 | AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w) |
| 813 | 813 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 814 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 814 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 815 | 815 | AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 816 | 816 | AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 817 | 817 | // AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* ?? */ |
| r14896 | r14897 | |
| 823 | 823 | static ADDRESS_MAP_START( gunfront_map, AS_PROGRAM, 16, taitof2_state ) |
| 824 | 824 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 825 | 825 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 826 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 826 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 827 | 827 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_wordswap_r, tc0510nio_halfword_wordswap_w) |
| 828 | 828 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 829 | 829 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r14896 | r14897 | |
| 837 | 837 | static ADDRESS_MAP_START( growl_map, AS_PROGRAM, 16, taitof2_state ) |
| 838 | 838 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 839 | 839 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 840 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 840 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 841 | 841 | AM_RANGE(0x300004, 0x300005) AM_WRITE(growl_coin_word_w) |
| 842 | 842 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("DSWA") |
| 843 | 843 | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("DSWB") |
| r14896 | r14897 | |
| 883 | 883 | AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ |
| 884 | 884 | AM_RANGE(0x430000, 0x43002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) |
| 885 | 885 | AM_RANGE(0x500000, 0x50001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* 500002 written like a watchdog?! */ |
| 886 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 886 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 887 | 887 | AM_RANGE(0x700006, 0x700007) AM_WRITE(taitof2_4p_coin_word_w) |
| 888 | 888 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSWA") |
| 889 | 889 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSWB") |
| r14896 | r14897 | |
| 900 | 900 | static ADDRESS_MAP_START( koshien_map, AS_PROGRAM, 16, taitof2_state ) |
| 901 | 901 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 902 | 902 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 903 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 903 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 904 | 904 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w) |
| 905 | 905 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 906 | 906 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r14896 | r14897 | |
| 919 | 919 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 920 | 920 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 921 | 921 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 922 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 922 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 923 | 923 | AM_RANGE(0xb00000, 0xb10fff) AM_RAM /* deliberate writes to $b10xxx, I think */ |
| 924 | 924 | AM_RANGE(0xc00000, 0xc01fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE_SIZE(m_sprite_extension, m_spriteext_size) |
| 925 | 925 | AM_RANGE(0xd00000, 0xdfffff) AM_ROM AM_REGION("extra", 0) |
| r14896 | r14897 | |
| 928 | 928 | static ADDRESS_MAP_START( ninjak_map, AS_PROGRAM, 16, taitof2_state ) |
| 929 | 929 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 930 | 930 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 931 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 931 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 932 | 932 | AM_RANGE(0x300000, 0x30000f) AM_READ(ninjak_input_r) |
| 933 | 933 | AM_RANGE(0x30000e, 0x30000f) AM_WRITE(ninjak_coin_word_w) |
| 934 | 934 | AM_RANGE(0x380000, 0x380001) AM_WRITE(watchdog_reset16_w) /* ??? */ |
| r14896 | r14897 | |
| 944 | 944 | static ADDRESS_MAP_START( solfigtr_map, AS_PROGRAM, 16, taitof2_state ) |
| 945 | 945 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 946 | 946 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 947 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 947 | AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram | |
| 948 | 948 | AM_RANGE(0x300004, 0x300005) AM_WRITE(growl_coin_word_w) /* NOT VERIFIED */ |
| 949 | 949 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("DSWA") |
| 950 | 950 | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("DSWB") |
| r14896 | r14897 | |
| 967 | 967 | AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w) |
| 968 | 968 | AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 969 | 969 | AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 970 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram | |
| 970 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram | |
| 971 | 971 | AM_RANGE(0x500000, 0x50ffff) AM_RAM |
| 972 | 972 | AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 973 | 973 | AM_RANGE(0x700000, 0x70ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| r14896 | r14897 | |
| 983 | 983 | AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE_LEGACY("tc0430grw", tc0430grw_ctrl_word_w) |
| 984 | 984 | // AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* ??? */ |
| 985 | 985 | AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE_SIZE(m_sprite_extension, m_spriteext_size) |
| 986 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 986 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 987 | 987 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 988 | 988 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 989 | 989 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 999 | 999 | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ |
| 1000 | 1000 | AM_RANGE(0x530000, 0x53002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) |
| 1001 | 1001 | AM_RANGE(0x600000, 0x60001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) |
| 1002 | AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(paletteram | |
| 1002 | AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(paletteram | |
| 1003 | 1003 | AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_wordswap_r, tc0510nio_halfword_wordswap_w) |
| 1004 | 1004 | AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 1005 | 1005 | AM_RANGE(0x900002, 0x900003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r14896 | r14897 | |
| 1011 | 1011 | AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w) |
| 1012 | 1012 | AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 1013 | 1013 | AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 1014 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram | |
| 1014 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram | |
| 1015 | 1015 | AM_RANGE(0x500000, 0x50ffff) AM_RAM |
| 1016 | 1016 | AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 1017 | 1017 | AM_RANGE(0x700000, 0x70ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| r14896 | r14897 | |
| 1024 | 1024 | AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 1025 | 1025 | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1026 | 1026 | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1027 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 1027 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 1028 | 1028 | // AM_RANGE(0x700000, 0x70000b) AM_READ_LEGACY(yesnoj_unknown_r) /* what's this? */ |
| 1029 | 1029 | AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 1030 | 1030 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| r14896 | r14897 | |
| 1046 | 1046 | // AM_RANGE(0x42000c, 0x42000f) AM_WRITENOP /* zeroed */ |
| 1047 | 1047 | AM_RANGE(0x430000, 0x43002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) |
| 1048 | 1048 | AM_RANGE(0x500000, 0x50001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* uses 500002 like a watchdog !? */ |
| 1049 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 1049 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 1050 | 1050 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSWA") |
| 1051 | 1051 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSWB") |
| 1052 | 1052 | AM_RANGE(0x700004, 0x700005) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 1062 | 1062 | AM_RANGE(0x000000, 0x2fffff) AM_ROM |
| 1063 | 1063 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tc0510nio", tc0510nio_halfword_r, tc0510nio_halfword_w) |
| 1064 | 1064 | AM_RANGE(0x400000, 0x400fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE_SIZE(m_sprite_extension, m_spriteext_size) |
| 1065 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(paletteram | |
| 1065 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(paletteram | |
| 1066 | 1066 | AM_RANGE(0x600000, 0x60ffff) AM_RAM |
| 1067 | 1067 | AM_RANGE(0x700000, 0x70001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 1068 | 1068 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 1080 | 1080 | AM_RANGE(0x300000, 0x30ffff) AM_RAM |
| 1081 | 1081 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* watchdog ? */ |
| 1082 | 1082 | AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE_SIZE(m_sprite_extension, m_spriteext_size) |
| 1083 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1083 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1084 | 1084 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1085 | 1085 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1086 | 1086 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 1096 | 1096 | AM_RANGE(0x500000, 0x500001) AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0xff00) |
| 1097 | 1097 | AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 1098 | 1098 | AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE_SIZE(m_sprite_extension, m_spriteext_size) |
| 1099 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1099 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1100 | 1100 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 1101 | 1101 | AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1102 | 1102 | AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| r14896 | r14897 | |
| 1107 | 1107 | static ADDRESS_MAP_START( qcrayon2_map, AS_PROGRAM, 16, taitof2_state ) |
| 1108 | 1108 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1109 | 1109 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 1110 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 1110 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 1111 | 1111 | AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 1112 | 1112 | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1113 | 1113 | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| r14896 | r14897 | |
| 1126 | 1126 | AM_RANGE(0x300000, 0x30ffff) AM_RAM |
| 1127 | 1127 | AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE_LEGACY("tc0430grw", tc0430grw_word_r, tc0430grw_word_w) /* ROZ tilemap */ |
| 1128 | 1128 | AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE_LEGACY("tc0430grw", tc0430grw_ctrl_word_w) |
| 1129 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1129 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1130 | 1130 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1131 | 1131 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1132 | 1132 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 1143 | 1143 | AM_RANGE(0x300000, 0x30ffff) AM_RAM |
| 1144 | 1144 | AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE_LEGACY("tc0430grw", tc0430grw_word_r, tc0430grw_word_w) /* ROZ tilemap */ |
| 1145 | 1145 | AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE_LEGACY("tc0430grw", tc0430grw_ctrl_word_w) |
| 1146 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1146 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1147 | 1147 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1148 | 1148 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1149 | 1149 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
|---|---|---|
| 135 | 135 | AM_RANGE(0x1800, 0x1807) AM_WRITE(pandoras_int_control_w) /* INT control */ |
| 136 | 136 | AM_RANGE(0x1a00, 0x1a00) AM_WRITE(pandoras_scrolly_w) /* bg scroll */ |
| 137 | 137 | AM_RANGE(0x1c00, 0x1c00) AM_WRITE(pandoras_z80_irqtrigger_w) /* cause INT on the Z80 */ |
| 138 | AM_RANGE(0x1e00, 0x1e00) AM_WRITE(soundlatch_w) /* sound command to the Z80 */ | |
| 138 | AM_RANGE(0x1e00, 0x1e00) AM_WRITE(soundlatch_byte_w) /* sound command to the Z80 */ | |
| 139 | 139 | AM_RANGE(0x2000, 0x2000) AM_WRITE(pandoras_cpub_irqtrigger_w) /* cause FIRQ on CPU B */ |
| 140 | 140 | AM_RANGE(0x2001, 0x2001) AM_WRITE(watchdog_reset_w) /* watchdog reset */ |
| 141 | 141 | AM_RANGE(0x4000, 0x5fff) AM_ROM /* space for diagnostic ROM */ |
| r14896 | r14897 | |
| 164 | 164 | static ADDRESS_MAP_START( pandoras_sound_map, AS_PROGRAM, 8, pandoras_state ) |
| 165 | 165 | AM_RANGE(0x0000, 0x1fff) AM_ROM /* ROM */ |
| 166 | 166 | AM_RANGE(0x2000, 0x23ff) AM_RAM /* RAM */ |
| 167 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 167 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 168 | 168 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) /* AY-8910 */ |
| 169 | 169 | AM_RANGE(0x6001, 0x6001) AM_DEVREAD_LEGACY("aysnd", ay8910_r) /* AY-8910 */ |
| 170 | 170 | AM_RANGE(0x6002, 0x6002) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) /* AY-8910 */ |
| 171 | 171 | AM_RANGE(0x8000, 0x8000) AM_WRITE(pandoras_i8039_irqtrigger_w) /* cause INT on the 8039 */ |
| 172 | AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch2_w) /* sound command to the 8039 */ | |
| 172 | AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch2_byte_w) /* sound command to the 8039 */ | |
| 173 | 173 | ADDRESS_MAP_END |
| 174 | 174 | |
| 175 | 175 | static ADDRESS_MAP_START( pandoras_i8039_map, AS_PROGRAM, 8, pandoras_state ) |
| r14896 | r14897 | |
| 177 | 177 | ADDRESS_MAP_END |
| 178 | 178 | |
| 179 | 179 | static ADDRESS_MAP_START( pandoras_i8039_io_map, AS_IO, 8, pandoras_state ) |
| 180 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_r) | |
| 180 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_byte_r) | |
| 181 | 181 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 182 | 182 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w) |
| 183 | 183 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 190 | 190 | * |
| 191 | 191 | *************************************/ |
| 192 | 192 | |
| 193 | ||
| 193 | ||
| 194 | 194 | { |
| 195 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 196 | state->m_scrollx_hi = (data & 0x01); | |
| 197 | state->m_scrolly_hi = ((data & 0x02) >> 1); | |
| 198 | flip_screen_set(space->machine(), ~data & 0x04); | |
| 195 | m_scrollx_hi = (data & 0x01); | |
| 196 | m_scrolly_hi = ((data & 0x02) >> 1); | |
| 197 | flip_screen_set(~data & 0x04); | |
| 199 | 198 | |
| 200 | 199 | /* bit 3 unknown */ |
| 201 | 200 | |
| 202 | 201 | if (data & 0x10) |
| 203 | state->m_dd_sub_cpu_busy = 0; | |
| 204 | else if (state->m_dd_sub_cpu_busy == 0) | |
| 205 | device_set_input_line(state->m_sub_cpu, state->m_sprite_irq, (state->m_sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 202 | m_dd_sub_cpu_busy = 0; | |
| 203 | else if (m_dd_sub_cpu_busy == 0) | |
| 204 | device_set_input_line(m_sub_cpu, m_sprite_irq, (m_sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 206 | 205 | |
| 207 | memory_set_bank( | |
| 206 | memory_set_bank( | |
| 208 | 207 | } |
| 209 | 208 | |
| 210 | 209 | |
| 211 | ||
| 210 | ||
| 212 | 211 | { |
| 213 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 214 | state->m_scrollx_hi = (data & 0x01); | |
| 215 | state->m_scrolly_hi = ((data & 0x02) >> 1); | |
| 212 | m_scrollx_hi = (data & 0x01); | |
| 213 | m_scrolly_hi = ((data & 0x02) >> 1); | |
| 216 | 214 | |
| 217 | // flip_screen_set( | |
| 215 | // flip_screen_set( | |
| 218 | 216 | |
| 219 | 217 | /* bit 3 unknown */ |
| 220 | 218 | |
| 221 | 219 | /* I don't know ... */ |
| 222 | memory_set_bank( | |
| 220 | memory_set_bank( | |
| 223 | 221 | } |
| 224 | 222 | |
| 225 | 223 | |
| 226 | ||
| 224 | ||
| 227 | 225 | { |
| 228 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 229 | // logerror("BankRead %05x %08x\n",cpu_get_pc(&space->device()),offset); | |
| 226 | // logerror("BankRead %05x %08x\n",cpu_get_pc(&space.device()),offset); | |
| 230 | 227 | |
| 231 | 228 | /* Horrible hack - the alternate TStrike set is mismatched against the MCU, |
| 232 | 229 | so just hack around the protection here. (The hacks are 'right' as I have |
| 233 | 230 | the original source code & notes to this version of TStrike to examine). |
| 234 | 231 | */ |
| 235 | if (!strcmp( | |
| 232 | if (!strcmp( | |
| 236 | 233 | { |
| 237 | 234 | /* Static protection checks at boot-up */ |
| 238 | if (cpu_get_pc(&space | |
| 235 | if (cpu_get_pc(&space. | |
| 239 | 236 | return 0; |
| 240 | if (cpu_get_pc(&space | |
| 237 | if (cpu_get_pc(&space. | |
| 241 | 238 | return 0x63; |
| 242 | 239 | |
| 243 | 240 | /* Just return whatever the code is expecting */ |
| 244 | return | |
| 241 | return | |
| 245 | 242 | } |
| 246 | 243 | |
| 247 | 244 | if (offset == 0x1401 || offset == 1) |
| 248 | return | |
| 245 | return | |
| 249 | 246 | |
| 250 | 247 | logerror("Unmapped mcu bank read %04x\n",offset); |
| 251 | 248 | return 0xff; |
| 252 | 249 | } |
| 253 | 250 | |
| 254 | 251 | |
| 255 | ||
| 252 | ||
| 256 | 253 | { |
| 257 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 258 | logerror("BankWrite %05x %08x %08x\n", cpu_get_pc(&space->device()), offset, data); | |
| 254 | logerror("BankWrite %05x %08x %08x\n", cpu_get_pc(&space.device()), offset, data); | |
| 259 | 255 | |
| 260 | 256 | if (offset == 0x1400 || offset == 0) |
| 261 | 257 | { |
| 262 | | |
| 258 | | |
| 263 | 259 | logerror("MCU PORT 1 -> %04x (from %04x)\n", BITSWAP8(data,0,1,2,3,4,5,6,7), data); |
| 264 | 260 | } |
| 265 | 261 | } |
| 266 | 262 | |
| 267 | 263 | |
| 268 | ||
| 264 | ||
| 269 | 265 | { |
| 270 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 271 | int oldbank = space->machine().memory().bank("bank1"); | |
| 266 | int oldbank = machine().memory().bank("bank1"); | |
| 272 | 267 | int newbank = (data & 0xe0) >> 5; |
| 273 | 268 | |
| 274 | state->m_scrollx_hi = (data & 0x01); | |
| 275 | state->m_scrolly_hi = ((data & 0x02) >> 1); | |
| 269 | m_scrollx_hi = (data & 0x01); | |
| 270 | m_scrolly_hi = ((data & 0x02) >> 1); | |
| 276 | 271 | |
| 277 | // flip_screen_set( | |
| 272 | // flip_screen_set( | |
| 278 | 273 | |
| 279 | 274 | /* bit 3 unknown */ |
| 280 | 275 | |
| 281 | 276 | if (data & 0x10) |
| 282 | state->m_dd_sub_cpu_busy = 0; | |
| 283 | else if (state->m_dd_sub_cpu_busy == 0) | |
| 284 | device_set_input_line(state->m_sub_cpu, state->m_sprite_irq, (state->m_sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 277 | m_dd_sub_cpu_busy = 0; | |
| 278 | else if (m_dd_sub_cpu_busy == 0) | |
| 279 | device_set_input_line(m_sub_cpu, m_sprite_irq, (m_sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 285 | 280 | |
| 286 | memory_set_bank( | |
| 281 | memory_set_bank( | |
| 287 | 282 | if (newbank == 4 && oldbank != 4) |
| 288 | space | |
| 283 | space. | |
| 289 | 284 | else if (newbank != 4 && oldbank == 4) |
| 290 | space | |
| 285 | space. | |
| 291 | 286 | } |
| 292 | 287 | |
| 293 | 288 | |
| r14896 | r14897 | |
| 298 | 293 | * |
| 299 | 294 | *************************************/ |
| 300 | 295 | |
| 301 | ||
| 296 | ||
| 302 | 297 | { |
| 303 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 304 | 298 | switch (offset) |
| 305 | 299 | { |
| 306 | 300 | case 0: /* 380b - NMI ack */ |
| 307 | device_set_input_line( | |
| 301 | device_set_input_line( | |
| 308 | 302 | break; |
| 309 | 303 | |
| 310 | 304 | case 1: /* 380c - FIRQ ack */ |
| 311 | device_set_input_line( | |
| 305 | device_set_input_line( | |
| 312 | 306 | break; |
| 313 | 307 | |
| 314 | 308 | case 2: /* 380d - IRQ ack */ |
| 315 | device_set_input_line( | |
| 309 | device_set_input_line( | |
| 316 | 310 | break; |
| 317 | 311 | |
| 318 | 312 | case 3: /* 380e - SND irq */ |
| 319 | state->soundlatch_w(*space, 0, data); | |
| 320 | device_set_input_line(state->m_snd_cpu, state->m_sound_irq, (state->m_sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 313 | soundlatch_byte_w(*&space, 0, data); | |
| 314 | device_set_input_line(m_snd_cpu, m_sound_irq, (m_sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE); | |
| 321 | 315 | break; |
| 322 | 316 | |
| 323 | 317 | case 4: /* 380f - ? */ |
| r14896 | r14897 | |
| 327 | 321 | } |
| 328 | 322 | |
| 329 | 323 | |
| 330 | ||
| 324 | ||
| 331 | 325 | { |
| 332 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 333 | device_set_input_line(state->m_sub_cpu, state->m_sprite_irq, CLEAR_LINE ); | |
| 326 | device_set_input_line(m_sub_cpu, m_sprite_irq, CLEAR_LINE ); | |
| 334 | 327 | } |
| 335 | 328 | |
| 336 | 329 | |
| 337 | ||
| 330 | ||
| 338 | 331 | { |
| 339 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 340 | device_set_input_line(state->m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); | |
| 332 | device_set_input_line(m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); | |
| 341 | 333 | } |
| 342 | 334 | |
| 343 | 335 | |
| r14896 | r14897 | |
| 361 | 353 | } |
| 362 | 354 | |
| 363 | 355 | |
| 364 | ||
| 356 | ||
| 365 | 357 | { |
| 366 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 367 | logerror("McuWrite %05x %08x %08x\n",cpu_get_pc(&space->device()), offset, data); | |
| 368 | state->m_darktowr_mcu_ports[offset] = data; | |
| 358 | logerror("McuWrite %05x %08x %08x\n",cpu_get_pc(&space.device()), offset, data); | |
| 359 | m_darktowr_mcu_ports[offset] = data; | |
| 369 | 360 | } |
| 370 | 361 | |
| 371 | 362 | |
| 372 | ||
| 363 | ||
| 373 | 364 | { |
| 374 | logerror("%04x: read %d\n", cpu_get_pc(&space | |
| 365 | logerror("%04x: read %d\n", cpu_get_pc(&space. | |
| 375 | 366 | return 0; |
| 376 | 367 | } |
| 377 | 368 | |
| 378 | 369 | |
| 379 | ||
| 370 | ||
| 380 | 371 | { |
| 381 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 382 | 372 | |
| 383 | 373 | /* I don't know why port 0x17 is used.. Doesn't seem to be a standard MCU port */ |
| 384 | 374 | if (offset == 0x17) |
| r14896 | r14897 | |
| 388 | 378 | it's quite obvious from the Double Dragon 2 code, below). */ |
| 389 | 379 | if (data & 3) |
| 390 | 380 | { |
| 391 | device_set_input_line(state->m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); | |
| 392 | device_set_input_line(state->m_sub_cpu, state->m_sprite_irq, CLEAR_LINE); | |
| 381 | device_set_input_line(m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); | |
| 382 | device_set_input_line(m_sub_cpu, m_sprite_irq, CLEAR_LINE); | |
| 393 | 383 | } |
| 394 | 384 | } |
| 395 | 385 | } |
| r14896 | r14897 | |
| 402 | 392 | * |
| 403 | 393 | *************************************/ |
| 404 | 394 | |
| 405 | ||
| 395 | ||
| 406 | 396 | { |
| 407 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 408 | 397 | |
| 409 | 398 | /* Double Dragon crash fix - see notes above */ |
| 410 | if (offset == 0x49 && cpu_get_pc(&space | |
| 399 | if (offset == 0x49 && cpu_get_pc(&space. | |
| 411 | 400 | return 0x1; |
| 412 | 401 | |
| 413 | return | |
| 402 | return | |
| 414 | 403 | } |
| 415 | 404 | |
| 416 | 405 | |
| 417 | ||
| 406 | ||
| 418 | 407 | { |
| 419 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 420 | 408 | |
| 421 | if (&space->device() == state->m_sub_cpu && offset == 0) | |
| 422 | state->m_dd_sub_cpu_busy = 1; | |
| 409 | if (&space.device() == m_sub_cpu && offset == 0) | |
| 410 | m_dd_sub_cpu_busy = 1; | |
| 423 | 411 | |
| 424 | | |
| 412 | | |
| 425 | 413 | } |
| 426 | 414 | |
| 427 | 415 | |
| r14896 | r14897 | |
| 432 | 420 | * |
| 433 | 421 | *************************************/ |
| 434 | 422 | |
| 435 | ||
| 423 | ||
| 436 | 424 | { |
| 437 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 438 | device_t *adpcm = (offset & 1) ? state->m_adpcm_2 : state->m_adpcm_1; | |
| 439 | int chip = (adpcm == state->m_adpcm_1) ? 0 : 1; | |
| 425 | device_t *adpcm = (offset & 1) ? m_adpcm_2 : m_adpcm_1; | |
| 426 | int chip = (adpcm == m_adpcm_1) ? 0 : 1; | |
| 440 | 427 | |
| 441 | 428 | switch (offset / 2) |
| 442 | 429 | { |
| 443 | 430 | case 3: |
| 444 | | |
| 431 | | |
| 445 | 432 | msm5205_reset_w(adpcm, 1); |
| 446 | 433 | break; |
| 447 | 434 | |
| 448 | 435 | case 2: |
| 449 | | |
| 436 | | |
| 450 | 437 | break; |
| 451 | 438 | |
| 452 | 439 | case 1: |
| 453 | | |
| 440 | | |
| 454 | 441 | break; |
| 455 | 442 | |
| 456 | 443 | case 0: |
| 457 | | |
| 444 | | |
| 458 | 445 | msm5205_reset_w(adpcm, 0); |
| 459 | 446 | break; |
| 460 | 447 | } |
| r14896 | r14897 | |
| 486 | 473 | } |
| 487 | 474 | |
| 488 | 475 | |
| 489 | ||
| 476 | ||
| 490 | 477 | { |
| 491 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 492 | return state->m_adpcm_idle[0] + (state->m_adpcm_idle[1] << 1); | |
| 478 | return m_adpcm_idle[0] + (m_adpcm_idle[1] << 1); | |
| 493 | 479 | } |
| 494 | 480 | |
| 495 | 481 | |
| r14896 | r14897 | |
| 502 | 488 | |
| 503 | 489 | static ADDRESS_MAP_START( ddragon_map, AS_PROGRAM, 8, ddragon_state ) |
| 504 | 490 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(m_rambase) |
| 505 | AM_RANGE(0x1000, 0x11ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 506 | AM_RANGE(0x1200, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 491 | AM_RANGE(0x1000, 0x11ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 492 | AM_RANGE(0x1200, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 507 | 493 | AM_RANGE(0x1400, 0x17ff) AM_RAM |
| 508 | 494 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(ddragon_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 509 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE | |
| 495 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE | |
| 510 | 496 | AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(ddragon_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 511 | 497 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("P1") |
| 512 | 498 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("P2") |
| 513 | 499 | AM_RANGE(0x3802, 0x3802) AM_READ_PORT("EXTRA") |
| 514 | 500 | AM_RANGE(0x3803, 0x3803) AM_READ_PORT("DSW0") |
| 515 | 501 | AM_RANGE(0x3804, 0x3804) AM_READ_PORT("DSW1") |
| 516 | AM_RANGE(0x3808, 0x3808) AM_WRITE | |
| 502 | AM_RANGE(0x3808, 0x3808) AM_WRITE | |
| 517 | 503 | AM_RANGE(0x3809, 0x3809) AM_WRITEONLY AM_BASE(m_scrollx_lo) |
| 518 | 504 | AM_RANGE(0x380a, 0x380a) AM_WRITEONLY AM_BASE(m_scrolly_lo) |
| 519 | AM_RANGE(0x380b, 0x380f) AM_WRITE | |
| 505 | AM_RANGE(0x380b, 0x380f) AM_WRITE | |
| 520 | 506 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 521 | 507 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 522 | 508 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 525 | 511 | static ADDRESS_MAP_START( dd2_map, AS_PROGRAM, 8, ddragon_state ) |
| 526 | 512 | AM_RANGE(0x0000, 0x17ff) AM_RAM |
| 527 | 513 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(ddragon_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 528 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE | |
| 514 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE | |
| 529 | 515 | AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(ddragon_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 530 | 516 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("P1") |
| 531 | 517 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("P2") |
| 532 | 518 | AM_RANGE(0x3802, 0x3802) AM_READ_PORT("EXTRA") |
| 533 | 519 | AM_RANGE(0x3803, 0x3803) AM_READ_PORT("DSW0") |
| 534 | 520 | AM_RANGE(0x3804, 0x3804) AM_READ_PORT("DSW1") |
| 535 | AM_RANGE(0x3808, 0x3808) AM_WRITE | |
| 521 | AM_RANGE(0x3808, 0x3808) AM_WRITE | |
| 536 | 522 | AM_RANGE(0x3809, 0x3809) AM_WRITEONLY AM_BASE(m_scrollx_lo) |
| 537 | 523 | AM_RANGE(0x380a, 0x380a) AM_WRITEONLY AM_BASE(m_scrolly_lo) |
| 538 | AM_RANGE(0x380b, 0x380f) AM_WRITE_LEGACY(ddragon_interrupt_w) | |
| 539 | AM_RANGE(0x3c00, 0x3dff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 540 | AM_RANGE(0x3e00, 0x3fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 524 | AM_RANGE(0x380b, 0x380f) AM_WRITE(ddragon_interrupt_w) | |
| 525 | AM_RANGE(0x3c00, 0x3dff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 526 | AM_RANGE(0x3e00, 0x3fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 541 | 527 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 542 | 528 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 543 | 529 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 551 | 537 | *************************************/ |
| 552 | 538 | |
| 553 | 539 | static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, ddragon_state ) |
| 554 | AM_RANGE(0x0000, 0x001f) AM_READWRITE | |
| 540 | AM_RANGE(0x0000, 0x001f) AM_READWRITE | |
| 555 | 541 | AM_RANGE(0x001f, 0x0fff) AM_RAM |
| 556 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE | |
| 542 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE | |
| 557 | 543 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 558 | 544 | ADDRESS_MAP_END |
| 559 | 545 | |
| 560 | 546 | |
| 561 | 547 | static ADDRESS_MAP_START( ddragonba_sub_map, AS_PROGRAM, 8, ddragon_state ) |
| 562 | 548 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 563 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE | |
| 549 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE | |
| 564 | 550 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 565 | 551 | ADDRESS_MAP_END |
| 566 | 552 | |
| 567 | 553 | |
| 568 | 554 | static ADDRESS_MAP_START( dd2_sub_map, AS_PROGRAM, 8, ddragon_state ) |
| 569 | 555 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 570 | AM_RANGE(0xc000, 0xc3ff) AM_READWRITE_LEGACY(ddragon_spriteram_r, ddragon_spriteram_w) | |
| 571 | AM_RANGE(0xd000, 0xd000) AM_WRITE_LEGACY(ddragon2_sub_irq_ack_w) | |
| 572 | AM_RANGE(0xe000, 0xe000) AM_WRITE_LEGACY(ddragon2_sub_irq_w) | |
| 556 | AM_RANGE(0xc000, 0xc3ff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w) | |
| 557 | AM_RANGE(0xd000, 0xd000) AM_WRITE(ddragon2_sub_irq_ack_w) | |
| 558 | AM_RANGE(0xe000, 0xe000) AM_WRITE(ddragon2_sub_irq_w) | |
| 573 | 559 | ADDRESS_MAP_END |
| 574 | 560 | |
| 575 | 561 | /* might not be 100% accurate, check bits written */ |
| 576 | ||
| 562 | ||
| 577 | 563 | { |
| 578 | ddragon_state *state = space->machine().driver_data<ddragon_state>(); | |
| 579 | device_set_input_line(state->m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); | |
| 580 | device_set_input_line(state->m_sub_cpu, state->m_sprite_irq, CLEAR_LINE ); | |
| 564 | device_set_input_line(m_maincpu, M6809_IRQ_LINE, ASSERT_LINE); | |
| 565 | device_set_input_line(m_sub_cpu, m_sprite_irq, CLEAR_LINE ); | |
| 581 | 566 | } |
| 582 | 567 | |
| 583 | 568 | static ADDRESS_MAP_START( ddragonba_sub_portmap, AS_IO, 8, ddragon_state ) |
| 584 | AM_RANGE(0x0000, 0xffff) AM_WRITE | |
| 569 | AM_RANGE(0x0000, 0xffff) AM_WRITE | |
| 585 | 570 | ADDRESS_MAP_END |
| 586 | 571 | |
| 587 | 572 | |
| r14896 | r14897 | |
| 594 | 579 | |
| 595 | 580 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ddragon_state ) |
| 596 | 581 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 597 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_r) | |
| 598 | AM_RANGE(0x1800, 0x1800) AM_READ_LEGACY(dd_adpcm_status_r) | |
| 582 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r) | |
| 583 | AM_RANGE(0x1800, 0x1800) AM_READ(dd_adpcm_status_r) | |
| 599 | 584 | AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE_LEGACY("fmsnd", ym2151_r, ym2151_w) |
| 600 | AM_RANGE(0x3800, 0x3807) AM_WRITE | |
| 585 | AM_RANGE(0x3800, 0x3807) AM_WRITE | |
| 601 | 586 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 602 | 587 | ADDRESS_MAP_END |
| 603 | 588 | |
| r14896 | r14897 | |
| 607 | 592 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 608 | 593 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("fmsnd", ym2151_r, ym2151_w) |
| 609 | 594 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 610 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r) | |
| 595 | AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_byte_r) | |
| 611 | 596 | ADDRESS_MAP_END |
| 612 | 597 | |
| 613 | 598 | |
| r14896 | r14897 | |
| 620 | 605 | |
| 621 | 606 | static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, ddragon_state ) |
| 622 | 607 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 623 | AM_RANGE(0x0000, 0x0007) AM_RAM_WRITE | |
| 608 | AM_RANGE(0x0000, 0x0007) AM_RAM_WRITE | |
| 624 | 609 | AM_RANGE(0x0008, 0x007f) AM_RAM |
| 625 | 610 | AM_RANGE(0x0080, 0x07ff) AM_ROM |
| 626 | 611 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 2022 | 2007 | state->m_sound_irq = M6809_IRQ_LINE; |
| 2023 | 2008 | state->m_ym_irq = M6809_FIRQ_LINE; |
| 2024 | 2009 | state->m_technos_video_hw = 0; |
| 2025 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2010 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2026 | 2011 | } |
| 2027 | 2012 | |
| 2028 | 2013 | |
| r14896 | r14897 | |
| 2035 | 2020 | state->m_sound_irq = M6809_IRQ_LINE; |
| 2036 | 2021 | state->m_ym_irq = M6809_FIRQ_LINE; |
| 2037 | 2022 | state->m_technos_video_hw = 0; |
| 2038 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2023 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2039 | 2024 | |
| 2040 | 2025 | /* the program rom has a simple bitswap encryption */ |
| 2041 | 2026 | rom = machine.region("maincpu")->base(); |
| r14896 | r14897 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | public: |
| 66 | 66 | acommand_state(const machine_config &mconfig, device_type type, const char *tag) |
| 67 | : driver_device(mconfig, type, tag) { } | |
| 67 | : driver_device(mconfig, type, tag) , | |
| 68 | m_ac_bgvram(*this, "ac_bgvram"), | |
| 69 | m_ac_txvram(*this, "ac_txvram"), | |
| 70 | m_spriteram(*this, "spriteram"), | |
| 71 | m_ac_devram(*this, "ac_devram"){ } | |
| 68 | 72 | |
| 73 | required_shared_ptr<UINT16> m_ac_bgvram; | |
| 74 | required_shared_ptr<UINT16> m_ac_txvram; | |
| 75 | required_shared_ptr<UINT16> m_spriteram; | |
| 76 | required_shared_ptr<UINT16> m_ac_devram; | |
| 69 | 77 | tilemap_t *m_tx_tilemap; |
| 70 | 78 | tilemap_t *m_bg_tilemap; |
| 71 | UINT16 *m_ac_txvram; | |
| 72 | UINT16 *m_ac_bgvram; | |
| 73 | 79 | UINT16 *m_ac_vregs; |
| 74 | 80 | UINT16 m_led0; |
| 75 | 81 | UINT16 m_led1; |
| 76 | UINT16 *m_ac_devram; | |
| 77 | 82 | UINT16 m_ufo_sw1; |
| 78 | 83 | UINT16 m_ufo_sw2; |
| 79 | UINT16 *m_spriteram; | |
| 80 | size_t m_spriteram_size; | |
| 81 | 84 | DECLARE_WRITE16_MEMBER(ac_bgvram_w); |
| 82 | 85 | DECLARE_WRITE16_MEMBER(ac_txvram_w); |
| 83 | 86 | DECLARE_WRITE16_MEMBER(ac_bgscroll_w); |
| r14896 | r14897 | |
| 98 | 101 | static TILE_GET_INFO( ac_get_bg_tile_info ) |
| 99 | 102 | { |
| 100 | 103 | acommand_state *state = machine.driver_data<acommand_state>(); |
| 101 | int code = state->m_ac_bgvram[tile_index]; | |
| 104 | int code = state->m_ac_bgvram.target()[tile_index]; | |
| 102 | 105 | SET_TILE_INFO( |
| 103 | 106 | 1, |
| 104 | 107 | code & 0xfff, |
| r14896 | r14897 | |
| 109 | 112 | static TILE_GET_INFO( ac_get_tx_tile_info ) |
| 110 | 113 | { |
| 111 | 114 | acommand_state *state = machine.driver_data<acommand_state>(); |
| 112 | int code = state->m_ac_txvram[tile_index]; | |
| 115 | int code = state->m_ac_txvram.target()[tile_index]; | |
| 113 | 116 | SET_TILE_INFO( |
| 114 | 117 | 0, |
| 115 | 118 | code & 0xfff, |
| r14896 | r14897 | |
| 120 | 123 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int pri_mask) |
| 121 | 124 | { |
| 122 | 125 | acommand_state *state = machine.driver_data<acommand_state>(); |
| 123 | UINT16 *spriteram16 = state->m_spriteram; | |
| 126 | UINT16 *spriteram16 = state->m_spriteram.target(); | |
| 124 | 127 | int offs; |
| 125 | 128 | |
| 126 | for (offs = 0;offs < state->m_spriteram | |
| 129 | for (offs = 0;offs < state->m_spriteram.bytes()/2;offs += 8) | |
| 127 | 130 | { |
| 128 | 131 | if (!(spriteram16[offs+0] & 0x1000)) |
| 129 | 132 | { |
| r14896 | r14897 | |
| 140 | 143 | int xx,yy,x; |
| 141 | 144 | int delta = 16; |
| 142 | 145 | |
| 143 | flipx ^= flip_screen_get(machine); | |
| 144 | flipy ^= flip_screen_get(machine); | |
| 146 | flipx ^= state->flip_screen(); | |
| 147 | flipy ^= state->flip_screen(); | |
| 145 | 148 | |
| 146 | 149 | if ((pri&pri_mask)!=priority) continue; |
| 147 | 150 | |
| 148 | if (flip_screen | |
| 151 | if (state->flip_screen | |
| 149 | 152 | { |
| 150 | 153 | sx = 368 - sx; |
| 151 | 154 | sy = 240 - sy; |
| r14896 | r14897 | |
| 266 | 269 | |
| 267 | 270 | WRITE16_MEMBER(acommand_state::ac_bgvram_w) |
| 268 | 271 | { |
| 269 | COMBINE_DATA(&m_ac_bgvram[offset]); | |
| 272 | COMBINE_DATA(&m_ac_bgvram.target()[offset]); | |
| 270 | 273 | m_bg_tilemap->mark_tile_dirty(offset); |
| 271 | 274 | } |
| 272 | 275 | |
| 273 | 276 | WRITE16_MEMBER(acommand_state::ac_txvram_w) |
| 274 | 277 | { |
| 275 | COMBINE_DATA(&m_ac_txvram[offset]); | |
| 278 | COMBINE_DATA(&m_ac_txvram.target()[offset]); | |
| 276 | 279 | m_tx_tilemap->mark_tile_dirty(offset); |
| 277 | 280 | } |
| 278 | 281 | |
| r14896 | r14897 | |
| 342 | 345 | */ |
| 343 | 346 | //22dc8 |
| 344 | 347 | { |
| 345 | m_ufo_sw1 = m_ac_devram[offset] & 3; | |
| 346 | if(m_ac_devram[offset] & 0x10) | |
| 348 | m_ufo_sw1 = m_ac_devram.target()[offset] & 3; | |
| 349 | if(m_ac_devram.target()[offset] & 0x10) | |
| 347 | 350 | m_ufo_sw1|= 0x10; |
| 348 | if(m_ac_devram[offset] & 0x40) | |
| 351 | if(m_ac_devram.target()[offset] & 0x40) | |
| 349 | 352 | m_ufo_sw1|= 0x20; |
| 350 | if(m_ac_devram[offset] & 0x100) | |
| 353 | if(m_ac_devram.target()[offset] & 0x100) | |
| 351 | 354 | m_ufo_sw1|=0x100; |
| 352 | if(m_ac_devram[offset] & 0x400) | |
| 355 | if(m_ac_devram.target()[offset] & 0x400) | |
| 353 | 356 | m_ufo_sw1|=0x200; |
| 354 | if(m_ac_devram[offset] & 0x1000) | |
| 357 | if(m_ac_devram.target()[offset] & 0x1000) | |
| 355 | 358 | m_ufo_sw1|=0x1000; |
| 356 | if(m_ac_devram[offset] & 0x4000) | |
| 359 | if(m_ac_devram.target()[offset] & 0x4000) | |
| 357 | 360 | m_ufo_sw1|=0x2000; |
| 358 | // if(m_ac_devram[0x0048/2] & 0x0001) | |
| 361 | // if(m_ac_devram.target()[0x0048/2] & 0x0001) | |
| 359 | 362 | // m_ufo_sw1|=0x0040; |
| 360 | // if(m_ac_devram[0x0048/2] & 0x0004) | |
| 363 | // if(m_ac_devram.target()[0x0048/2] & 0x0004) | |
| 361 | 364 | // m_ufo_sw1|=0x0400; |
| 362 | // if(m_ac_devram[0x0048/2] & 0x0100) | |
| 365 | // if(m_ac_devram.target()[0x0048/2] & 0x0100) | |
| 363 | 366 | // m_ufo_sw1|=0x4000; |
| 364 | 367 | return m_ufo_sw1; |
| 365 | 368 | } |
| r14896 | r14897 | |
| 372 | 375 | */ |
| 373 | 376 | { |
| 374 | 377 | m_ufo_sw2 = 0; |
| 375 | if(m_ac_devram[offset] & 0x01) | |
| 378 | if(m_ac_devram.target()[offset] & 0x01) | |
| 376 | 379 | m_ufo_sw2|= 1; |
| 377 | if(m_ac_devram[offset] & 0x04) | |
| 380 | if(m_ac_devram.target()[offset] & 0x04) | |
| 378 | 381 | m_ufo_sw2|= 2; |
| 379 | if(m_ac_devram[offset] & 0x10) | |
| 382 | if(m_ac_devram.target()[offset] & 0x10) | |
| 380 | 383 | m_ufo_sw2|=0x10; |
| 381 | if(m_ac_devram[offset] & 0x40) | |
| 384 | if(m_ac_devram.target()[offset] & 0x40) | |
| 382 | 385 | m_ufo_sw2|=0x20; |
| 383 | 386 | return m_ufo_sw2; |
| 384 | 387 | } |
| 385 | 388 | case 0x0048/2: |
| 386 | return m_ac_devram[offset]; | |
| 389 | return m_ac_devram.target()[offset]; | |
| 387 | 390 | case 0x005c/2: |
| 388 | 391 | /* |
| 389 | 392 | xxxx xxxx ---- ---- DIPSW4 |
| r14896 | r14897 | |
| 391 | 394 | */ |
| 392 | 395 | return input_port_read(machine(), "IN1"); |
| 393 | 396 | } |
| 394 | return m_ac_devram[offset]; | |
| 397 | return m_ac_devram.target()[offset]; | |
| 395 | 398 | } |
| 396 | 399 | |
| 397 | 400 | WRITE16_MEMBER(acommand_state::ac_devices_w) |
| 398 | 401 | { |
| 399 | COMBINE_DATA(&m_ac_devram[offset]); | |
| 402 | COMBINE_DATA(&m_ac_devram.target()[offset]); | |
| 400 | 403 | switch(offset) |
| 401 | 404 | { |
| 402 | 405 | case 0x00/2: |
| r14896 | r14897 | |
| 434 | 437 | case 0x48/2: |
| 435 | 438 | break; |
| 436 | 439 | case 0x50/2: |
| 437 | m_led0 = m_ac_devram[offset]; | |
| 440 | m_led0 = m_ac_devram.target()[offset]; | |
| 438 | 441 | //popmessage("%04x",m_led0); |
| 439 | 442 | break; |
| 440 | 443 | case 0x54/2: |
| 441 | m_led1 = m_ac_devram[offset]; | |
| 444 | m_led1 = m_ac_devram.target()[offset]; | |
| 442 | 445 | //popmessage("%04x",m_led0); |
| 443 | 446 | break; |
| 444 | 447 | } |
| r14896 | r14897 | |
| 456 | 459 | AM_RANGE(0x082000, 0x082005) AM_WRITE(ac_bgscroll_w) |
| 457 | 460 | AM_RANGE(0x082100, 0x082105) AM_WRITE(ac_txscroll_w) |
| 458 | 461 | AM_RANGE(0x082208, 0x082209) AM_WRITE(ac_unk2_w) |
| 459 | AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_WRITE(ac_bgvram_w) AM_BASE(m_ac_bgvram) | |
| 460 | AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(ac_txvram_w) AM_BASE(m_ac_txvram) | |
| 461 | AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") | |
| 462 | AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_WRITE(ac_bgvram_w) AM_SHARE("ac_bgvram") | |
| 463 | AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(ac_txvram_w) AM_SHARE("ac_txvram") | |
| 464 | AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") | |
| 462 | 465 | AM_RANGE(0x0f0000, 0x0f7fff) AM_RAM |
| 463 | AM_RANGE(0x0f8000, 0x0f8fff) AM_RAM AM_ | |
| 466 | AM_RANGE(0x0f8000, 0x0f8fff) AM_RAM AM_ | |
| 464 | 467 | AM_RANGE(0x0f9000, 0x0fffff) AM_RAM |
| 465 | AM_RANGE(0x100000, 0x1000ff) AM_READ(ac_devices_r) AM_WRITE(ac_devices_w) AM_ | |
| 468 | AM_RANGE(0x100000, 0x1000ff) AM_READ(ac_devices_r) AM_WRITE(ac_devices_w) AM_ | |
| 466 | 469 | ADDRESS_MAP_END |
| 467 | 470 | |
| 468 | 471 | static INPUT_PORTS_START( acommand ) |
| r14896 | r14897 | |
|---|---|---|
| 174 | 174 | AM_RANGE(0x180000, 0x1807ff) AM_DEVREADWRITE_LEGACY("k053244", k053245_word_r, k053245_word_w) |
| 175 | 175 | AM_RANGE(0x180800, 0x180fff) AM_RAM // extra RAM, or mirror for the above? |
| 176 | 176 | AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("k053244", k053244_word_r, k053244_word_w) |
| 177 | AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(paletteram | |
| 177 | AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(paletteram | |
| 178 | 178 | AM_RANGE(0x300000, 0x30001f) AM_DEVREADWRITE_LEGACY("k053244", k053244_lsb_r, k053244_lsb_w) |
| 179 | 179 | AM_RANGE(0x380000, 0x380001) AM_READ_PORT("IN0") |
| 180 | 180 | AM_RANGE(0x380002, 0x380003) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
|---|---|---|
| 959 | 959 | { |
| 960 | 960 | public: |
| 961 | 961 | goldnpkr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 962 | : driver_device(mconfig, type, tag) { } | |
| 962 | : driver_device(mconfig, type, tag) , | |
| 963 | m_videoram(*this, "videoram"), | |
| 964 | m_colorram(*this, "colorram"){ } | |
| 963 | 965 | |
| 964 | UINT8 *m_videoram; | |
| 965 | UINT8 *m_colorram; | |
| 966 | required_shared_ptr<UINT8> m_videoram; | |
| 967 | required_shared_ptr<UINT8> m_colorram; | |
| 966 | 968 | tilemap_t *m_bg_tilemap; |
| 967 | 969 | UINT8 m_mux_data; |
| 968 | 970 | UINT8 m_pia0_PA_data; |
| r14896 | r14897 | |
| 978 | 980 | |
| 979 | 981 | WRITE8_MEMBER(goldnpkr_state::goldnpkr_videoram_w) |
| 980 | 982 | { |
| 981 | m_videoram[offset] = data; | |
| 983 | m_videoram.target()[offset] = data; | |
| 982 | 984 | m_bg_tilemap->mark_tile_dirty(offset); |
| 983 | 985 | } |
| 984 | 986 | |
| 985 | 987 | WRITE8_MEMBER(goldnpkr_state::goldnpkr_colorram_w) |
| 986 | 988 | { |
| 987 | m_colorram[offset] = data; | |
| 989 | m_colorram.target()[offset] = data; | |
| 988 | 990 | m_bg_tilemap->mark_tile_dirty(offset); |
| 989 | 991 | } |
| 990 | 992 | |
| r14896 | r14897 | |
| 999 | 1001 | xx-- ---- unused. |
| 1000 | 1002 | */ |
| 1001 | 1003 | |
| 1002 | int attr = state->m_colorram[tile_index]; | |
| 1003 | int code = ((attr & 1) << 8) | state->m_videoram[tile_index]; | |
| 1004 | int attr = state->m_colorram.target()[tile_index]; | |
| 1005 | int code = ((attr & 1) << 8) | state->m_videoram.target()[tile_index]; | |
| 1004 | 1006 | int bank = (attr & 0x02) >> 1; /* bit 1 switch the gfx banks */ |
| 1005 | 1007 | int color = (attr & 0x3c) >> 2; /* bits 2-3-4-5 for color */ |
| 1006 | 1008 | |
| r14896 | r14897 | |
| 1018 | 1020 | xx-- --xx tiles bank. |
| 1019 | 1021 | */ |
| 1020 | 1022 | |
| 1021 | int attr = state->m_colorram[tile_index]; | |
| 1022 | int code = ((attr & 1) << 8) | state->m_videoram[tile_index]; | |
| 1023 | int attr = state->m_colorram.target()[tile_index]; | |
| 1024 | int code = ((attr & 1) << 8) | state->m_videoram.target()[tile_index]; | |
| 1023 | 1025 | int bank = (attr & 0x03) + ((attr & 0xc0) >> 4); /* bits 0, 1, 6 & 7 switch the gfx banks */ |
| 1024 | 1026 | int color = (attr & 0x3c) >> 2; /* bits 2-3-4-5 for color */ |
| 1025 | 1027 | |
| r14896 | r14897 | |
| 1345 | 1347 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 1346 | 1348 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1347 | 1349 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1348 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1349 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1350 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1351 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1350 | 1352 | AM_RANGE(0x2000, 0x7fff) AM_ROM /* superdbl uses 0x2000..0x3fff address space */ |
| 1351 | 1353 | ADDRESS_MAP_END |
| 1352 | 1354 | |
| r14896 | r14897 | |
| 1357 | 1359 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 1358 | 1360 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1359 | 1361 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1360 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1361 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1362 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1363 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1362 | 1364 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 1363 | 1365 | ADDRESS_MAP_END |
| 1364 | 1366 | |
| r14896 | r14897 | |
| 1369 | 1371 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 1370 | 1372 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1371 | 1373 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1372 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1373 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1374 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1375 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1374 | 1376 | AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW2") |
| 1375 | 1377 | // AM_RANGE(0x2108, 0x210b) AM_NOP /* unknown 40-pin device */ |
| 1376 | 1378 | AM_RANGE(0x2800, 0x2fff) AM_RAM |
| r14896 | r14897 | |
| 1394 | 1396 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") /* battery backed RAM */ |
| 1395 | 1397 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1396 | 1398 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1397 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1398 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1399 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1400 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1399 | 1401 | AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW2") |
| 1400 | 1402 | AM_RANGE(0x2100, 0x2100) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 1401 | 1403 | AM_RANGE(0x2101, 0x2101) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| r14896 | r14897 | |
| 1409 | 1411 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 1410 | 1412 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1411 | 1413 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1412 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1413 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1414 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1415 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1414 | 1416 | AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW2") |
| 1415 | 1417 | AM_RANGE(0x2200, 0x27ff) AM_ROM /* for VK set */ |
| 1416 | 1418 | AM_RANGE(0x2800, 0x2fff) AM_RAM /* for VK set */ |
| r14896 | r14897 | |
| 1430 | 1432 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 1431 | 1433 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1432 | 1434 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1433 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1434 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1435 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1436 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1435 | 1437 | AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW2") |
| 1436 | 1438 | AM_RANGE(0x2200, 0x27ff) AM_ROM /* for VK hardware */ |
| 1437 | 1439 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("nvram") /* Dallas ds1210 + battery backed RAM */ |
| r14896 | r14897 | |
| 1449 | 1451 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") /* battery backed RAM */ |
| 1450 | 1452 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1451 | 1453 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1452 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1453 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1454 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1455 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1454 | 1456 | AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW2") |
| 1455 | 1457 | AM_RANGE(0x2100, 0x2100) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 1456 | 1458 | AM_RANGE(0x2101, 0x2101) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| r14896 | r14897 | |
| 1484 | 1486 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 1485 | 1487 | AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 1486 | 1488 | AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 1487 | AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_BASE(m_videoram) | |
| 1488 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_BASE(m_colorram) | |
| 1489 | AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(goldnpkr_videoram_w) AM_SHARE("videoram") | |
| 1490 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(goldnpkr_colorram_w) AM_SHARE("colorram") | |
| 1489 | 1491 | AM_RANGE(0x2000, 0x3fff) AM_ROM |
| 1490 | 1492 | ADDRESS_MAP_END |
| 1491 | 1493 |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | { |
| 141 | 141 | public: |
| 142 | 142 | ppmast93_state(const machine_config &mconfig, device_type type, const char *tag) |
| 143 | : driver_device(mconfig, type, tag) { } | |
| 143 | : driver_device(mconfig, type, tag) , | |
| 144 | m_bgram(*this, "bgram"), | |
| 145 | m_fgram(*this, "fgram"){ } | |
| 144 | 146 | |
| 145 | 147 | tilemap_t *m_fg_tilemap; |
| 146 | 148 | tilemap_t *m_bg_tilemap; |
| 147 | UINT8 *m_fgram; | |
| 148 | UINT8 *m_bgram; | |
| 149 | required_shared_ptr<UINT8> m_bgram; | |
| 150 | required_shared_ptr<UINT8> m_fgram; | |
| 149 | 151 | DECLARE_WRITE8_MEMBER(ppmast93_fgram_w); |
| 150 | 152 | DECLARE_WRITE8_MEMBER(ppmast93_bgram_w); |
| 151 | 153 | DECLARE_WRITE8_MEMBER(ppmast93_port4_w); |
| r14896 | r14897 | |
| 157 | 159 | |
| 158 | 160 | WRITE8_MEMBER(ppmast93_state::ppmast93_fgram_w) |
| 159 | 161 | { |
| 160 | m_fgram[offset] = data; | |
| 162 | m_fgram.target()[offset] = data; | |
| 161 | 163 | m_fg_tilemap->mark_tile_dirty(offset/2); |
| 162 | 164 | } |
| 163 | 165 | |
| 164 | 166 | WRITE8_MEMBER(ppmast93_state::ppmast93_bgram_w) |
| 165 | 167 | { |
| 166 | m_bgram[offset] = data; | |
| 168 | m_bgram.target()[offset] = data; | |
| 167 | 169 | m_bg_tilemap->mark_tile_dirty(offset/2); |
| 168 | 170 | } |
| 169 | 171 | |
| r14896 | r14897 | |
| 182 | 184 | static ADDRESS_MAP_START( ppmast93_cpu1_map, AS_PROGRAM, 8, ppmast93_state ) |
| 183 | 185 | AM_RANGE(0x0000, 0x7fff) AM_ROM AM_WRITENOP AM_REGION("maincpu", 0x10000) |
| 184 | 186 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 185 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ppmast93_bgram_w) AM_ | |
| 187 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ppmast93_bgram_w) AM_ | |
| 186 | 188 | AM_RANGE(0xd800, 0xdfff) AM_WRITENOP |
| 187 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(ppmast93_fgram_w) AM_ | |
| 189 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(ppmast93_fgram_w) AM_ | |
| 188 | 190 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 189 | 191 | ADDRESS_MAP_END |
| 190 | 192 | |
| r14896 | r14897 | |
| 196 | 198 | AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW1") |
| 197 | 199 | AM_RANGE(0x08, 0x08) AM_READ_PORT("DSW2") |
| 198 | 200 | |
| 199 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_w) | |
| 201 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_byte_w) | |
| 200 | 202 | AM_RANGE(0x04, 0x04) AM_WRITE(ppmast93_port4_w) |
| 201 | 203 | ADDRESS_MAP_END |
| 202 | 204 | |
| 203 | 205 | static ADDRESS_MAP_START( ppmast93_cpu2_map, AS_PROGRAM, 8, ppmast93_state ) |
| 204 | 206 | AM_RANGE(0x0000, 0xfbff) AM_ROM AM_REGION("sub", 0x10000) |
| 205 | AM_RANGE(0xfc00, 0xfc00) AM_READ(soundlatch_r) | |
| 207 | AM_RANGE(0xfc00, 0xfc00) AM_READ(soundlatch_byte_r) | |
| 206 | 208 | AM_RANGE(0xfd00, 0xffff) AM_RAM |
| 207 | 209 | ADDRESS_MAP_END |
| 208 | 210 | |
| r14896 | r14897 | |
| 323 | 325 | static TILE_GET_INFO( get_ppmast93_bg_tile_info ) |
| 324 | 326 | { |
| 325 | 327 | ppmast93_state *state = machine.driver_data<ppmast93_state>(); |
| 326 | int code = (state->m_bgram[tile_index*2+1] << 8) | state->m_bgram[tile_index*2]; | |
| 328 | int code = (state->m_bgram.target()[tile_index*2+1] << 8) | state->m_bgram.target()[tile_index*2]; | |
| 327 | 329 | SET_TILE_INFO( |
| 328 | 330 | 0, |
| 329 | 331 | code & 0x0fff, |
| r14896 | r14897 | |
| 334 | 336 | static TILE_GET_INFO( get_ppmast93_fg_tile_info ) |
| 335 | 337 | { |
| 336 | 338 | ppmast93_state *state = machine.driver_data<ppmast93_state>(); |
| 337 | int code = (state->m_fgram[tile_index*2+1] << 8) | state->m_fgram[tile_index*2]; | |
| 339 | int code = (state->m_fgram.target()[tile_index*2+1] << 8) | state->m_fgram.target()[tile_index*2]; | |
| 338 | 340 | SET_TILE_INFO( |
| 339 | 341 | 0, |
| 340 | 342 | (code & 0x0fff)+0x1000, |
| r14896 | r14897 | |
|---|---|---|
| 158 | 158 | if ((data & 0x00ff0000) == 0) |
| 159 | 159 | { |
| 160 | 160 | data &= 0xff; |
| 161 | soundlatch_w(space, 0, data); | |
| 161 | soundlatch_byte_w(space, 0, data); | |
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | WRITE16_MEMBER(moo_state::sound_cmd2_w) |
| 166 | 166 | { |
| 167 | 167 | if ((data & 0x00ff0000) == 0) |
| 168 | soundlatch2_w(space, 0, data & 0xff); | |
| 168 | soundlatch2_byte_w(space, 0, data & 0xff); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | WRITE16_MEMBER(moo_state::sound_irq_w) |
| r14896 | r14897 | |
| 175 | 175 | |
| 176 | 176 | READ16_MEMBER(moo_state::sound_status_r) |
| 177 | 177 | { |
| 178 | return soundlatch3_r(space, 0); | |
| 178 | return soundlatch3_byte_r(space, 0); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | WRITE8_MEMBER(moo_state::sound_bankswitch_w) |
| r14896 | r14897 | |
| 280 | 280 | AM_RANGE(0x1a0000, 0x1a1fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) /* Graphic planes */ |
| 281 | 281 | AM_RANGE(0x1a2000, 0x1a3fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) /* Graphic planes mirror */ |
| 282 | 282 | AM_RANGE(0x1b0000, 0x1b1fff) AM_DEVREAD_LEGACY("k056832", k056832_rom_word_r) /* Passthrough to tile roms */ |
| 283 | AM_RANGE(0x1c0000, 0x1c1fff) AM_RAM_WRITE(paletteram | |
| 283 | AM_RANGE(0x1c0000, 0x1c1fff) AM_RAM_WRITE(paletteram | |
| 284 | 284 | #if MOO_DEBUG |
| 285 | 285 | AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD_LEGACY("k056832", k056832_word_r) |
| 286 | 286 | AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD_LEGACY("k053246", k053246_reg_word_r) |
| r14896 | r14897 | |
| 313 | 313 | AM_RANGE(0x1a0000, 0x1a1fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) /* Graphic planes */ |
| 314 | 314 | AM_RANGE(0x1a2000, 0x1a3fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) /* Graphic planes mirror */ |
| 315 | 315 | AM_RANGE(0x1b0000, 0x1b1fff) AM_DEVREAD_LEGACY("k056832", k056832_rom_word_r) /* Passthrough to tile roms */ |
| 316 | AM_RANGE(0x1c0000, 0x1c1fff) AM_RAM_WRITE(paletteram | |
| 316 | AM_RANGE(0x1c0000, 0x1c1fff) AM_RAM_WRITE(paletteram | |
| 317 | 317 | ADDRESS_MAP_END |
| 318 | 318 | |
| 319 | 319 | static ADDRESS_MAP_START( bucky_map, AS_PROGRAM, 16, moo_state ) |
| r14896 | r14897 | |
| 344 | 344 | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) /* Graphic planes mirror */ |
| 345 | 345 | AM_RANGE(0x184000, 0x187fff) AM_RAM /* extra tile RAM? */ |
| 346 | 346 | AM_RANGE(0x190000, 0x191fff) AM_DEVREAD_LEGACY("k056832", k056832_rom_word_r) /* Passthrough to tile roms */ |
| 347 | AM_RANGE(0x1b0000, 0x1b3fff) AM_RAM_WRITE(paletteram | |
| 347 | AM_RANGE(0x1b0000, 0x1b3fff) AM_RAM_WRITE(paletteram | |
| 348 | 348 | AM_RANGE(0x200000, 0x23ffff) AM_ROM /* data */ |
| 349 | 349 | #if MOO_DEBUG |
| 350 | 350 | AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD_LEGACY("k056832", k056832_word_r) |
| r14896 | r14897 | |
| 361 | 361 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 362 | 362 | AM_RANGE(0xe000, 0xe22f) AM_DEVREADWRITE("k054539", k054539_device, read, write) |
| 363 | 363 | AM_RANGE(0xec00, 0xec01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) |
| 364 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_w) | |
| 365 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 366 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 364 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_byte_w) | |
| 365 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r) | |
| 366 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_byte_r) | |
| 367 | 367 | AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w) |
| 368 | 368 | ADDRESS_MAP_END |
| 369 | 369 |
| r14896 | r14897 | |
|---|---|---|
| 29 | 29 | public: |
| 30 | 30 | segald_state(const machine_config &mconfig, device_type type, const char *tag) |
| 31 | 31 | : driver_device(mconfig, type, tag), |
| 32 | m_laserdisc(*this, "laserdisc") { } | |
| 32 | m_laserdisc(*this, "laserdisc") , | |
| 33 | m_obj_RAM(*this, "obj_RAM"), | |
| 34 | m_out_RAM(*this, "out_RAM"), | |
| 35 | m_color_RAM(*this, "color_RAM"), | |
| 36 | m_fix_RAM(*this, "fix_RAM"){ } | |
| 33 | 37 | |
| 34 | 38 | UINT8 m_nmi_enable; |
| 35 | 39 | |
| 36 | UINT8* m_obj_RAM; | |
| 37 | UINT8* m_color_RAM; | |
| 38 | UINT8* m_fix_RAM; | |
| 39 | UINT8* m_out_RAM; | |
| 40 | required_device<pioneer_ldv1000_device> m_laserdisc; | |
| 41 | required_shared_ptr<UINT8> m_obj_RAM; | |
| 42 | required_shared_ptr<UINT8> m_out_RAM; | |
| 43 | required_shared_ptr<UINT8> m_color_RAM; | |
| 44 | required_shared_ptr<UINT8> m_fix_RAM; | |
| 40 | 45 | |
| 41 | required_device<pioneer_ldv1000_device> m_laserdisc; | |
| 42 | 46 | UINT8 m_ldv1000_input_latch; |
| 43 | 47 | UINT8 m_ldv1000_output_latch; |
| 44 | 48 | |
| r14896 | r14897 | |
| 65 | 69 | for (characterY = 0; characterY < 32; characterY++) |
| 66 | 70 | { |
| 67 | 71 | int current_screen_character = (characterY*32) + characterX; |
| 68 | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_fix_RAM[current_screen_character], | |
| 72 | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_fix_RAM.target()[current_screen_character], | |
| 69 | 73 | 1, 0, 0, characterX*8, characterY*8, 0); |
| 70 | 74 | } |
| 71 | 75 | } |
| r14896 | r14897 | |
| 91 | 95 | for (spr_number = 0; spr_number < 32; spr_number++) |
| 92 | 96 | { |
| 93 | 97 | spr_base = 0x10 * spr_number; |
| 94 | sy = state->m_obj_RAM[spr_base + SPR_Y_TOP]; | |
| 95 | sx = state->m_obj_RAM[spr_base + SPR_X_LO]; | |
| 98 | sy = state->m_obj_RAM.target()[spr_base + SPR_Y_TOP]; | |
| 99 | sx = state->m_obj_RAM.target()[spr_base + SPR_X_LO]; | |
| 96 | 100 | |
| 97 | 101 | if (sx != 0 || sy != 0) |
| 98 | 102 | logerror("Hey! A sprite's not at 0,0 : %d %d", sx, sy); |
| r14896 | r14897 | |
| 128 | 132 | READ8_MEMBER(segald_state::astron_OUT_read) |
| 129 | 133 | { |
| 130 | 134 | |
| 131 | logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", m_out_RAM[offset], offset, cpu_get_pc(&space.device())); | |
| 132 | return m_out_RAM[offset]; | |
| 135 | logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", m_out_RAM.target()[offset], offset, cpu_get_pc(&space.device())); | |
| 136 | return m_out_RAM.target()[offset]; | |
| 133 | 137 | } |
| 134 | 138 | |
| 135 | 139 | READ8_MEMBER(segald_state::astron_OBJ_read) |
| 136 | 140 | { |
| 137 | 141 | |
| 138 | logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", m_obj_RAM[offset], offset, cpu_get_pc(&space.device())); | |
| 139 | return m_obj_RAM[offset]; | |
| 142 | logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", m_obj_RAM.target()[offset], offset, cpu_get_pc(&space.device())); | |
| 143 | return m_obj_RAM.target()[offset]; | |
| 140 | 144 | } |
| 141 | 145 | |
| 142 | 146 | READ8_MEMBER(segald_state::astron_COLOR_read) |
| 143 | 147 | { |
| 144 | 148 | |
| 145 | logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", m_color_RAM[offset], offset, cpu_get_pc(&space.device())); | |
| 146 | return m_color_RAM[offset]; | |
| 149 | logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", m_color_RAM.target()[offset], offset, cpu_get_pc(&space.device())); | |
| 150 | return m_color_RAM.target()[offset]; | |
| 147 | 151 | } |
| 148 | 152 | |
| 149 | 153 | |
| r14896 | r14897 | |
| 193 | 197 | break; |
| 194 | 198 | } |
| 195 | 199 | |
| 196 | m_out_RAM[offset] = data; | |
| 200 | m_out_RAM.target()[offset] = data; | |
| 197 | 201 | } |
| 198 | 202 | |
| 199 | 203 | WRITE8_MEMBER(segald_state::astron_OBJ_write) |
| 200 | 204 | { |
| 201 | 205 | |
| 202 | m_obj_RAM[offset] = data; | |
| 206 | m_obj_RAM.target()[offset] = data; | |
| 203 | 207 | logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device())); |
| 204 | 208 | } |
| 205 | 209 | |
| r14896 | r14897 | |
| 210 | 214 | const UINT8 palIndex = offset >> 1; |
| 211 | 215 | |
| 212 | 216 | /* Combine */ |
| 213 | m_color_RAM[offset] = data; | |
| 217 | m_color_RAM.target()[offset] = data; | |
| 214 | 218 | |
| 215 | 219 | /* Easy access */ |
| 216 | highBits = m_color_RAM[(palIndex<<1)+1] & 0x0f; | |
| 217 | lowBits = m_color_RAM[(palIndex<<1)]; | |
| 220 | highBits = m_color_RAM.target()[(palIndex<<1)+1] & 0x0f; | |
| 221 | lowBits = m_color_RAM.target()[(palIndex<<1)]; | |
| 218 | 222 | |
| 219 | 223 | /* 4-bit RGB */ |
| 220 | 224 | r = (lowBits & 0x0f); |
| r14896 | r14897 | |
| 229 | 233 | WRITE8_MEMBER(segald_state::astron_FIX_write) |
| 230 | 234 | { |
| 231 | 235 | |
| 232 | m_fix_RAM[offset] = data; | |
| 236 | m_fix_RAM.target()[offset] = data; | |
| 233 | 237 | /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device())); */ |
| 234 | 238 | } |
| 235 | 239 | |
| r14896 | r14897 | |
| 247 | 251 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 248 | 252 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 249 | 253 | |
| 250 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(astron_OBJ_read, astron_OBJ_write) AM_ | |
| 254 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(astron_OBJ_read, astron_OBJ_write) AM_ | |
| 251 | 255 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(astron_DISC_read, astron_DISC_write) /* DISC interface according to schematics */ |
| 252 | 256 | AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA") /* SW bank 2 (DIPs) */ |
| 253 | 257 | AM_RANGE(0xd001, 0xd001) AM_READ_PORT("DSWB") /* SW bank 3 (DIPs) */ |
| 254 | 258 | AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN0") /* SW bank 0 (IO) */ |
| 255 | 259 | AM_RANGE(0xd003, 0xd003) AM_READ_PORT("IN1") /* SW bank 1 (IO) */ |
| 256 | AM_RANGE(0xd800, 0xd803) AM_READWRITE(astron_OUT_read, astron_OUT_write) AM_BASE(m_out_RAM) /* OUT according to schematics (output port) */ | |
| 257 | AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(astron_COLOR_read, astron_COLOR_write) AM_BASE(m_color_RAM) /* COLOR according to the schematics */ | |
| 258 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(astron_FIX_write) AM_BASE(m_fix_RAM) /* FIX according to schematics (characters) */ | |
| 260 | AM_RANGE(0xd800, 0xd803) AM_READWRITE(astron_OUT_read, astron_OUT_write) AM_SHARE("out_RAM") /* OUT according to schematics (output port) */ | |
| 261 | AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(astron_COLOR_read, astron_COLOR_write) AM_SHARE("color_RAM") /* COLOR according to the schematics */ | |
| 262 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(astron_FIX_write) AM_SHARE("fix_RAM") /* FIX according to schematics (characters) */ | |
| 259 | 263 | AM_RANGE(0xf800, 0xffff) AM_RAM /* RAM according to schematics */ |
| 260 | 264 | ADDRESS_MAP_END |
| 261 | 265 |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | public: |
| 35 | 35 | tickee_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | : driver_device(mconfig, type, tag) { } | |
| 36 | : driver_device(mconfig, type, tag) , | |
| 37 | m_vram(*this, "vram"), | |
| 38 | m_control(*this, "control"){ } | |
| 37 | 39 | |
| 38 | UINT16 *m_control; | |
| 39 | UINT16 *m_vram; | |
| 40 | required_shared_ptr<UINT16> m_vram; | |
| 41 | required_shared_ptr<UINT16> m_control; | |
| 40 | 42 | emu_timer *m_setup_gun_timer; |
| 41 | 43 | int m_beamxadd; |
| 42 | 44 | int m_beamyadd; |
| r14896 | r14897 | |
| 111 | 113 | state->m_setup_gun_timer->adjust(machine.primary_screen->time_until_pos(0)); |
| 112 | 114 | |
| 113 | 115 | /* only do work if the palette is flashed */ |
| 114 | if (state->m_control) | |
| 115 | if (!state->m_control[2]) | |
| 116 | if (state->m_control.target()) | |
| 117 | if (!state->m_control.target()[2]) | |
| 116 | 118 | return; |
| 117 | 119 | |
| 118 | 120 | /* generate interrupts for player 1's gun */ |
| r14896 | r14897 | |
| 153 | 155 | static void scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params) |
| 154 | 156 | { |
| 155 | 157 | tickee_state *state = screen.machine().driver_data<tickee_state>(); |
| 156 | UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00]; | |
| 158 | UINT16 *src = &state->m_vram.target()[(params->rowaddr << 8) & 0x3ff00]; | |
| 157 | 159 | UINT32 *dest = &bitmap.pix32(scanline); |
| 158 | 160 | const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); |
| 159 | 161 | int coladdr = params->coladdr << 1; |
| 160 | 162 | int x; |
| 161 | 163 | |
| 162 | 164 | /* blank palette: fill with pen 255 */ |
| 163 | if (state->m_control[2]) | |
| 165 | if (state->m_control.target()[2]) | |
| 164 | 166 | { |
| 165 | 167 | for (x = params->heblnk; x < params->hsblnk; x++) |
| 166 | 168 | dest[x] = pens[0xff]; |
| r14896 | r14897 | |
| 179 | 181 | static void rapidfir_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params) |
| 180 | 182 | { |
| 181 | 183 | tickee_state *state = screen.machine().driver_data<tickee_state>(); |
| 182 | UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00]; | |
| 184 | UINT16 *src = &state->m_vram.target()[(params->rowaddr << 8) & 0x3ff00]; | |
| 183 | 185 | UINT32 *dest = &bitmap.pix32(scanline); |
| 184 | 186 | const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); |
| 185 | 187 | int coladdr = params->coladdr << 1; |
| r14896 | r14897 | |
| 238 | 240 | { |
| 239 | 241 | if (!(data & 0xff00)) mem_mask &= 0x00ff; |
| 240 | 242 | if (!(data & 0x00ff)) mem_mask &= 0xff00; |
| 241 | COMBINE_DATA(&m_vram[offset]); | |
| 243 | COMBINE_DATA(&m_vram.target()[offset]); | |
| 242 | 244 | } |
| 243 | 245 | |
| 244 | 246 | |
| 245 | 247 | READ16_MEMBER(tickee_state::rapidfir_transparent_r) |
| 246 | 248 | { |
| 247 | return m_vram[offset]; | |
| 249 | return m_vram.target()[offset]; | |
| 248 | 250 | } |
| 249 | 251 | |
| 250 | 252 | |
| r14896 | r14897 | |
| 252 | 254 | { |
| 253 | 255 | tickee_state *state = space->machine().driver_data<tickee_state>(); |
| 254 | 256 | if (address < 0x800000) |
| 255 | memcpy(shiftreg, &state->m_vram[TOWORD(address)], TOBYTE(0x2000)); | |
| 257 | memcpy(shiftreg, &state->m_vram.target()[TOWORD(address)], TOBYTE(0x2000)); | |
| 256 | 258 | } |
| 257 | 259 | |
| 258 | 260 | |
| r14896 | r14897 | |
| 260 | 262 | { |
| 261 | 263 | tickee_state *state = space->machine().driver_data<tickee_state>(); |
| 262 | 264 | if (address < 0x800000) |
| 263 | memcpy(&state->m_vram[TOWORD(address)], shiftreg, TOBYTE(0x2000)); | |
| 265 | memcpy(&state->m_vram.target()[TOWORD(address)], shiftreg, TOBYTE(0x2000)); | |
| 264 | 266 | } |
| 265 | 267 | |
| 266 | 268 | |
| r14896 | r14897 | |
| 273 | 275 | |
| 274 | 276 | WRITE16_MEMBER(tickee_state::tickee_control_w) |
| 275 | 277 | { |
| 276 | UINT16 olddata = m_control[offset]; | |
| 278 | UINT16 olddata = m_control.target()[offset]; | |
| 277 | 279 | |
| 278 | 280 | /* offsets: |
| 279 | 281 | |
| r14896 | r14897 | |
| 282 | 284 | 6 = lamps? (changing all the time) |
| 283 | 285 | */ |
| 284 | 286 | |
| 285 | COMBINE_DATA(&m_control[offset]); | |
| 287 | COMBINE_DATA(&m_control.target()[offset]); | |
| 286 | 288 | |
| 287 | 289 | if (offset == 3) |
| 288 | 290 | { |
| 289 | ticket_dispenser_w(machine().device("ticket1"), 0, (data & 8) << 4); | |
| 290 | ticket_dispenser_w(machine().device("ticket2"), 0, (data & 4) << 5); | |
| 291 | machine().device<ticket_dispenser_device>("ticket1")->write(space, 0, (data & 8) << 4); | |
| 292 | machine().device<ticket_dispenser_device>("ticket2")->write(space, 0, (data & 4) << 5); | |
| 291 | 293 | } |
| 292 | 294 | |
| 293 | if (olddata != m_control[offset]) | |
| 294 | logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", cpu_get_pc(&space.device()), offset, m_control[offset], olddata); | |
| 295 | if (olddata != m_control.target()[offset]) | |
| 296 | logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", cpu_get_pc(&space.device()), offset, m_control.target()[offset], olddata); | |
| 295 | 297 | } |
| 296 | 298 | |
| 297 | 299 | |
| r14896 | r14897 | |
| 381 | 383 | *************************************/ |
| 382 | 384 | |
| 383 | 385 | static ADDRESS_MAP_START( tickee_map, AS_PROGRAM, 16, tickee_state ) |
| 384 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 386 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 385 | 387 | AM_RANGE(0x02000000, 0x02ffffff) AM_ROM AM_REGION("user1", 0) |
| 386 | 388 | AM_RANGE(0x04000000, 0x04003fff) AM_RAM AM_SHARE("nvram") |
| 387 | 389 | AM_RANGE(0x04100000, 0x041000ff) AM_DEVREADWRITE8_LEGACY("tlc34076", tlc34076_r, tlc34076_w, 0x00ff) |
| r14896 | r14897 | |
| 389 | 391 | AM_RANGE(0x04200000, 0x0420001f) AM_DEVWRITE8_LEGACY("ym1", ay8910_address_data_w, 0x00ff) |
| 390 | 392 | AM_RANGE(0x04200100, 0x0420010f) AM_DEVREAD8_LEGACY("ym2", ay8910_r, 0x00ff) |
| 391 | 393 | AM_RANGE(0x04200100, 0x0420011f) AM_DEVWRITE8_LEGACY("ym2", ay8910_address_data_w, 0x00ff) |
| 392 | AM_RANGE(0x04400000, 0x0440007f) AM_WRITE(tickee_control_w) AM_ | |
| 394 | AM_RANGE(0x04400000, 0x0440007f) AM_WRITE(tickee_control_w) AM_ | |
| 393 | 395 | AM_RANGE(0x04400040, 0x0440004f) AM_READ_PORT("IN2") |
| 394 | 396 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w) |
| 395 | 397 | AM_RANGE(0xc0000240, 0xc000025f) AM_WRITENOP /* seems to be a bug in their code */ |
| r14896 | r14897 | |
| 399 | 401 | |
| 400 | 402 | /* addreses in the 04x range shifted slightly...*/ |
| 401 | 403 | static ADDRESS_MAP_START( ghoshunt_map, AS_PROGRAM, 16, tickee_state ) |
| 402 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 404 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 403 | 405 | AM_RANGE(0x02000000, 0x02ffffff) AM_ROM AM_REGION("user1", 0) |
| 404 | 406 | AM_RANGE(0x04100000, 0x04103fff) AM_RAM AM_SHARE("nvram") |
| 405 | 407 | AM_RANGE(0x04200000, 0x042000ff) AM_DEVREADWRITE8_LEGACY("tlc34076", tlc34076_r, tlc34076_w, 0x00ff) |
| r14896 | r14897 | |
| 407 | 409 | AM_RANGE(0x04300000, 0x0430001f) AM_DEVWRITE8_LEGACY("ym1", ay8910_address_data_w, 0x00ff) |
| 408 | 410 | AM_RANGE(0x04300100, 0x0430010f) AM_DEVREAD8_LEGACY("ym2", ay8910_r, 0x00ff) |
| 409 | 411 | AM_RANGE(0x04300100, 0x0430011f) AM_DEVWRITE8_LEGACY("ym2", ay8910_address_data_w, 0x00ff) |
| 410 | AM_RANGE(0x04500000, 0x0450007f) AM_WRITE(tickee_control_w) AM_ | |
| 412 | AM_RANGE(0x04500000, 0x0450007f) AM_WRITE(tickee_control_w) AM_ | |
| 411 | 413 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w) |
| 412 | 414 | AM_RANGE(0xc0000240, 0xc000025f) AM_WRITENOP /* seems to be a bug in their code */ |
| 413 | 415 | AM_RANGE(0xff000000, 0xffffffff) AM_ROM AM_REGION("user1", 0) |
| r14896 | r14897 | |
| 415 | 417 | |
| 416 | 418 | |
| 417 | 419 | static ADDRESS_MAP_START( mouseatk_map, AS_PROGRAM, 16, tickee_state ) |
| 418 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 420 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 419 | 421 | AM_RANGE(0x02000000, 0x02ffffff) AM_ROM AM_REGION("user1", 0) |
| 420 | 422 | AM_RANGE(0x04000000, 0x04003fff) AM_RAM AM_SHARE("nvram") |
| 421 | 423 | AM_RANGE(0x04100000, 0x041000ff) AM_DEVREADWRITE8_LEGACY("tlc34076", tlc34076_r, tlc34076_w, 0x00ff) |
| 422 | 424 | AM_RANGE(0x04200000, 0x0420000f) AM_DEVREAD8_LEGACY("ym", ay8910_r, 0x00ff) |
| 423 | 425 | AM_RANGE(0x04200000, 0x0420000f) AM_DEVWRITE8_LEGACY("ym", ay8910_address_data_w, 0x00ff) |
| 424 | 426 | AM_RANGE(0x04200100, 0x0420010f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 425 | AM_RANGE(0x04400000, 0x0440007f) AM_WRITE(tickee_control_w) AM_ | |
| 427 | AM_RANGE(0x04400000, 0x0440007f) AM_WRITE(tickee_control_w) AM_ | |
| 426 | 428 | AM_RANGE(0x04400040, 0x0440004f) AM_READ_PORT("IN2") // ? |
| 427 | 429 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w) |
| 428 | 430 | AM_RANGE(0xc0000240, 0xc000025f) AM_WRITENOP /* seems to be a bug in their code */ |
| r14896 | r14897 | |
| 432 | 434 | |
| 433 | 435 | /* newer hardware */ |
| 434 | 436 | static ADDRESS_MAP_START( rapidfir_map, AS_PROGRAM, 16, tickee_state ) |
| 435 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_ | |
| 437 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_ | |
| 436 | 438 | AM_RANGE(0x02000000, 0x027fffff) AM_READWRITE(rapidfir_transparent_r, rapidfir_transparent_w) |
| 437 | 439 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w) |
| 438 | 440 | AM_RANGE(0xfc000000, 0xfc00000f) AM_READ(rapidfir_gun1_r) |
| r14896 | r14897 | |
| 488 | 490 | |
| 489 | 491 | PORT_START("IN0") |
| 490 | 492 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 491 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket2", ticket_dispenser_line_r) /* right ticket status */ | |
| 492 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket1", ticket_dispenser_line_r) /* left ticket status */ | |
| 493 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket2", ticket_dispenser_device, line_r) /* right ticket status */ | |
| 494 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket1", ticket_dispenser_device, line_r) /* left ticket status */ | |
| 493 | 495 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 494 | 496 | |
| 495 | 497 | PORT_START("IN1") |
| r14896 | r14897 | |
| 546 | 548 | |
| 547 | 549 | PORT_START("IN0") |
| 548 | 550 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 549 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket2", ticket_dispenser_line_r) /* right ticket status */ | |
| 550 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket1", ticket_dispenser_line_r) /* left ticket status */ | |
| 551 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket2", ticket_dispenser_device, line_r) /* right ticket status */ | |
| 552 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket1", ticket_dispenser_device, line_r) /* left ticket status */ | |
| 551 | 553 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 552 | 554 | PORT_BIT( 0xd8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 553 | 555 | |
| r14896 | r14897 | |
| 562 | 564 | |
| 563 | 565 | PORT_START("IN2") |
| 564 | 566 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 565 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket2", ticket_dispenser_line_r) /* right ticket status */ | |
| 566 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket1", ticket_dispenser_line_r) /* left ticket status */ | |
| 567 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket2", ticket_dispenser_device, line_r) /* right ticket status */ | |
| 568 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket1", ticket_dispenser_device, line_r) /* left ticket status */ | |
| 567 | 569 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 568 | 570 | PORT_BIT( 0xd8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 569 | 571 | |
| r14896 | r14897 | |
| 607 | 609 | |
| 608 | 610 | PORT_START("IN0") |
| 609 | 611 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 610 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket2", ticket_dispenser_line_r) /* right ticket status */ | |
| 611 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket1", ticket_dispenser_line_r) /* left ticket status */ | |
| 612 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket2", ticket_dispenser_device, line_r) /* right ticket status */ | |
| 613 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket1", ticket_dispenser_device, line_r) /* left ticket status */ | |
| 612 | 614 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 613 | 615 | |
| 614 | 616 | PORT_START("IN1") |
| r14896 | r14897 | |
| 767 | 769 | MCFG_MACHINE_RESET(tickee) |
| 768 | 770 | MCFG_NVRAM_ADD_1FILL("nvram") |
| 769 | 771 | |
| 770 | MCFG_TICKET_DISPENSER_ADD("ticket1", 100, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 771 | MCFG_TICKET_DISPENSER_ADD("ticket2", 100, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 772 | MCFG_TICKET_DISPENSER_ADD("ticket1", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 773 | MCFG_TICKET_DISPENSER_ADD("ticket2", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 772 | 774 | |
| 773 | 775 | /* video hardware */ |
| 774 | 776 | MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) |
| r14896 | r14897 | |
| 837 | 839 | MCFG_MACHINE_RESET(tickee) |
| 838 | 840 | MCFG_NVRAM_ADD_1FILL("nvram") |
| 839 | 841 | |
| 840 | MCFG_TICKET_DISPENSER_ADD("ticket1", 100, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 841 | MCFG_TICKET_DISPENSER_ADD("ticket2", 100, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 842 | MCFG_TICKET_DISPENSER_ADD("ticket1", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 843 | MCFG_TICKET_DISPENSER_ADD("ticket2", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 842 | 844 | |
| 843 | 845 | /* video hardware */ |
| 844 | 846 | MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | WRITE8_MEMBER(suprloco_state::suprloco_soundport_w) |
| 21 | 21 | { |
| 22 | soundlatch_w(space, 0, data); | |
| 22 | soundlatch_byte_w(space, 0, data); | |
| 23 | 23 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 24 | 24 | /* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */ |
| 25 | 25 | device_spin_until_time(&space.device(), attotime::from_usec(50)); |
| r14896 | r14897 | |
| 47 | 47 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 48 | 48 | AM_RANGE(0xa000, 0xa003) AM_DEVWRITE_LEGACY("sn1", sn76496_w) |
| 49 | 49 | AM_RANGE(0xc000, 0xc003) AM_DEVWRITE_LEGACY("sn2", sn76496_w) |
| 50 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 50 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 51 | 51 | ADDRESS_MAP_END |
| 52 | 52 | |
| 53 | 53 |
| r14896 | r14897 | |
|---|---|---|
| 411 | 411 | AM_RANGE(0xc0, 0xc0) AM_READ(cmd1_r) |
| 412 | 412 | AM_RANGE(0xc1, 0xc1) AM_READ(cmd2_r) |
| 413 | 413 | AM_RANGE(0xc2, 0xc2) AM_READ(cmd_stat8_r) |
| 414 | AM_RANGE(0xe1, 0xe1) AM_WRITE_LEGACY(st0016_rom_bank_w) | |
| 415 | AM_RANGE(0xe7, 0xe7) AM_WRITE_LEGACY(st0016_rom_bank_w) | |
| 414 | AM_RANGE(0xe1, 0xe1) AM_WRITE(st0016_rom_bank_w) | |
| 415 | AM_RANGE(0xe7, 0xe7) AM_WRITE(st0016_rom_bank_w) | |
| 416 | 416 | AM_RANGE(0xf0, 0xf0) AM_READ(st0016_dma_r) |
| 417 | 417 | ADDRESS_MAP_END |
| 418 | 418 |
| r14896 | r14897 | |
|---|---|---|
| 297 | 297 | WRITE16_MEMBER(m92_state::m92_soundlatch_w) |
| 298 | 298 | { |
| 299 | 299 | cputag_set_input_line(machine(), "soundcpu", NEC_INPUT_LINE_INTP1, ASSERT_LINE); |
| 300 | soundlatch_w(space, 0, data & 0xff); | |
| 300 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | READ16_MEMBER(m92_state::m92_sound_status_r) |
| r14896 | r14897 | |
| 309 | 309 | READ16_MEMBER(m92_state::m92_soundlatch_r) |
| 310 | 310 | { |
| 311 | 311 | cputag_set_input_line(machine(), "soundcpu", NEC_INPUT_LINE_INTP1, CLEAR_LINE); |
| 312 | return soundlatch_r(space, offset) | 0xff00; | |
| 312 | return soundlatch_byte_r(space, offset) | 0xff00; | |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | WRITE16_MEMBER(m92_state::m92_sound_irq_ack_w) |
| r14896 | r14897 | |
|---|---|---|
| 126 | 126 | AM_RANGE(0xec00, 0xec00) AM_WRITE(ec00_w) |
| 127 | 127 | AM_RANGE(0xed00, 0xed00) AM_WRITE(ed00_w) |
| 128 | 128 | AM_RANGE(0xee00, 0xee00) AM_WRITE(ee00_w) // related to protection ? - doesn't seem to have any effect |
| 129 | AM_RANGE(0xef00, 0xef00) AM_WRITE(soundlatch_w) | |
| 129 | AM_RANGE(0xef00, 0xef00) AM_WRITE(soundlatch_byte_w) | |
| 130 | 130 | ADDRESS_MAP_END |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, fcombat_state ) |
| 134 | 134 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 135 | 135 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 136 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 136 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 137 | 137 | AM_RANGE(0x8001, 0x8001) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 138 | 138 | AM_RANGE(0x8002, 0x8003) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w) |
| 139 | 139 | AM_RANGE(0xa001, 0xa001) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | 21 | destroyr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | : driver_device(mconfig, type, tag) { } | |
| 22 | : driver_device(mconfig, type, tag) , | |
| 23 | m_alpha_num_ram(*this, "alpha_nuram"), | |
| 24 | m_major_obj_ram(*this, "major_obj_ram"), | |
| 25 | m_minor_obj_ram(*this, "minor_obj_ram"){ } | |
| 23 | 26 | |
| 24 | 27 | /* memory pointers */ |
| 25 | UINT8 * m_major_obj_ram; | |
| 26 | UINT8 * m_minor_obj_ram; | |
| 27 | UINT8 * m_alpha_num_ram; | |
| 28 | required_shared_ptr<UINT8> m_alpha_num_ram; | |
| 29 | required_shared_ptr<UINT8> m_major_obj_ram; | |
| 30 | required_shared_ptr<UINT8> m_minor_obj_ram; | |
| 28 | 31 | |
| 29 | 32 | /* video-related */ |
| 30 | 33 | int m_cursor; |
| r14896 | r14897 | |
| 58 | 61 | /* draw major objects */ |
| 59 | 62 | for (i = 0; i < 16; i++) |
| 60 | 63 | { |
| 61 | int attr = state->m_major_obj_ram[2 * i + 0] ^ 0xff; | |
| 62 | int horz = state->m_major_obj_ram[2 * i + 1]; | |
| 64 | int attr = state->m_major_obj_ram.target()[2 * i + 0] ^ 0xff; | |
| 65 | int horz = state->m_major_obj_ram.target()[2 * i + 1]; | |
| 63 | 66 | |
| 64 | 67 | int num = attr & 3; |
| 65 | 68 | int scan = attr & 4; |
| r14896 | r14897 | |
| 84 | 87 | { |
| 85 | 88 | for (j = 0; j < 32; j++) |
| 86 | 89 | { |
| 87 | int num = state->m_alpha_num_ram[32 * i + j]; | |
| 90 | int num = state->m_alpha_num_ram.target()[32 * i + j]; | |
| 88 | 91 | |
| 89 | 92 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0); |
| 90 | 93 | } |
| r14896 | r14897 | |
| 93 | 96 | /* draw minor objects */ |
| 94 | 97 | for (i = 0; i < 2; i++) |
| 95 | 98 | { |
| 96 | int num = i << 4 | (state->m_minor_obj_ram[i + 0] & 0xf); | |
| 97 | int horz = 256 - state->m_minor_obj_ram[i + 2]; | |
| 98 | int vert = 256 - state->m_minor_obj_ram[i + 4]; | |
| 99 | int num = i << 4 | (state->m_minor_obj_ram.target()[i + 0] & 0xf); | |
| 100 | int horz = 256 - state->m_minor_obj_ram.target()[i + 2]; | |
| 101 | int vert = 256 - state->m_minor_obj_ram.target()[i + 4]; | |
| 99 | 102 | |
| 100 | 103 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], num, 0, 0, 0, horz, vert, 0); |
| 101 | 104 | } |
| r14896 | r14897 | |
| 262 | 265 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0xf00) AM_RAM |
| 263 | 266 | AM_RANGE(0x1000, 0x1fff) AM_READWRITE(destroyr_input_r, destroyr_output_w) |
| 264 | 267 | AM_RANGE(0x2000, 0x2fff) AM_READ_PORT("IN2") |
| 265 | AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0xf00) AM_WRITEONLY AM_BASE(m_alpha_num_ram) | |
| 266 | AM_RANGE(0x4000, 0x401f) AM_MIRROR(0xfe0) AM_WRITEONLY AM_BASE(m_major_obj_ram) | |
| 268 | AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0xf00) AM_WRITEONLY AM_SHARE("alpha_nuram") | |
| 269 | AM_RANGE(0x4000, 0x401f) AM_MIRROR(0xfe0) AM_WRITEONLY AM_SHARE("major_obj_ram") | |
| 267 | 270 | AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xff8) AM_WRITE(destroyr_cursor_load_w) |
| 268 | 271 | AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xff8) AM_WRITE(destroyr_interrupt_ack_w) |
| 269 | AM_RANGE(0x5002, 0x5007) AM_MIRROR(0xff8) AM_WRITEONLY AM_ | |
| 272 | AM_RANGE(0x5002, 0x5007) AM_MIRROR(0xff8) AM_WRITEONLY AM_ | |
| 270 | 273 | AM_RANGE(0x6000, 0x6fff) AM_READ(destroyr_scanline_r) |
| 271 | 274 | AM_RANGE(0x7000, 0x7fff) AM_ROM |
| 272 | 275 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 88 | 88 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 89 | 89 | AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 90 | 90 | AM_RANGE(0xd800, 0xd800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 91 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 91 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 92 | 92 | AM_RANGE(0xe800, 0xe800) AM_DEVWRITE_LEGACY("oki", oki_bankswitch_w) |
| 93 | 93 | ADDRESS_MAP_END |
| 94 | 94 | |
| r14896 | r14897 | |
| 109 | 109 | |
| 110 | 110 | WRITE16_MEMBER(wwfwfest_state::wwfwfest_flipscreen_w) |
| 111 | 111 | { |
| 112 | flip_screen_set( | |
| 112 | flip_screen_set( | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /*- Palette Reads/Writes -*/ |
| r14896 | r14897 | |
| 123 | 123 | WRITE16_MEMBER(wwfwfest_state::wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w) |
| 124 | 124 | { |
| 125 | 125 | offset = (offset & 0x000f) | (offset & 0x7fc0) >> 2; |
| 126 | paletteram | |
| 126 | paletteram | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /*- Priority Control -*/ |
| r14896 | r14897 | |
| 163 | 163 | |
| 164 | 164 | WRITE16_MEMBER(wwfwfest_state::wwfwfest_soundwrite) |
| 165 | 165 | { |
| 166 | soundlatch_w(space,1,data & 0xff); | |
| 166 | soundlatch_byte_w(space,1,data & 0xff); | |
| 167 | 167 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE ); |
| 168 | 168 | } |
| 169 | 169 |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | { |
| 69 | 69 | public: |
| 70 | 70 | feversoc_state(const machine_config &mconfig, device_type type, const char *tag) |
| 71 | : driver_device(mconfig, type, tag) { } | |
| 71 | : driver_device(mconfig, type, tag) , | |
| 72 | m_spriteram(*this, "spriteram"){ } | |
| 72 | 73 | |
| 73 | 74 | UINT16 m_x; |
| 74 | UINT32 | |
| 75 | required_shared_ptr<UINT32> | |
| 75 | 76 | DECLARE_WRITE32_MEMBER(fs_paletteram_w); |
| 76 | 77 | DECLARE_READ32_MEMBER(in0_r); |
| 77 | 78 | DECLARE_WRITE32_MEMBER(output_w); |
| r14896 | r14897 | |
| 88 | 89 | static SCREEN_UPDATE_IND16( feversoc ) |
| 89 | 90 | { |
| 90 | 91 | feversoc_state *state = screen.machine().driver_data<feversoc_state>(); |
| 91 | UINT32 *spriteram32 = state->m_spriteram; | |
| 92 | UINT32 *spriteram32 = state->m_spriteram.target(); | |
| 92 | 93 | int offs,spr_offs,colour,sx,sy,h,w,dx,dy; |
| 93 | 94 | |
| 94 | 95 | bitmap.fill(screen.machine().pens[0], cliprect); //black pen |
| r14896 | r14897 | |
| 165 | 166 | static ADDRESS_MAP_START( feversoc_map, AS_PROGRAM, 32, feversoc_state ) |
| 166 | 167 | AM_RANGE(0x00000000, 0x0003ffff) AM_ROM |
| 167 | 168 | AM_RANGE(0x02000000, 0x0203dfff) AM_RAM //work ram |
| 168 | AM_RANGE(0x0203e000, 0x0203ffff) AM_RAM AM_ | |
| 169 | AM_RANGE(0x0203e000, 0x0203ffff) AM_RAM AM_ | |
| 169 | 170 | AM_RANGE(0x06000000, 0x06000003) AM_WRITE(output_w) |
| 170 | 171 | AM_RANGE(0x06000004, 0x06000007) AM_WRITENOP //??? |
| 171 | 172 | AM_RANGE(0x06000008, 0x0600000b) AM_READ(in0_r) |
| r14896 | r14897 | |
|---|---|---|
| 113 | 113 | UINT8 m_supergm3_prg_bank; |
| 114 | 114 | UINT8 m_supergm3_chr_bank; |
| 115 | 115 | DECLARE_CUSTOM_INPUT_MEMBER(multigam_inputs_r); |
| 116 | DECLARE_WRITE8_MEMBER(multigam_nt_w); | |
| 117 | DECLARE_READ8_MEMBER(multigam_nt_r); | |
| 118 | DECLARE_WRITE8_MEMBER(sprite_dma_w); | |
| 119 | DECLARE_READ8_MEMBER(multigam_IN0_r); | |
| 120 | DECLARE_WRITE8_MEMBER(multigam_IN0_w); | |
| 121 | DECLARE_READ8_MEMBER(multigam_IN1_r); | |
| 122 | DECLARE_WRITE8_MEMBER(multigam_switch_prg_rom); | |
| 123 | DECLARE_WRITE8_MEMBER(multigam_switch_gfx_rom); | |
| 124 | DECLARE_WRITE8_MEMBER(multigam_mapper2_w); | |
| 125 | DECLARE_WRITE8_MEMBER(multigam3_mmc3_rom_switch_w); | |
| 126 | DECLARE_WRITE8_MEMBER(multigm3_mapper2_w); | |
| 127 | DECLARE_WRITE8_MEMBER(multigm3_switch_gfx_rom); | |
| 128 | DECLARE_WRITE8_MEMBER(multigm3_switch_prg_rom); | |
| 129 | DECLARE_WRITE8_MEMBER(multigam3_mapper02_rom_switch_w); | |
| 130 | DECLARE_WRITE8_MEMBER(mmc1_rom_switch_w); | |
| 131 | DECLARE_WRITE8_MEMBER(supergm3_prg_bank_w); | |
| 132 | DECLARE_WRITE8_MEMBER(supergm3_chr_bank_w); | |
| 133 | void set_mirroring(int mirroring); | |
| 116 | 134 | }; |
| 117 | 135 | |
| 118 | 136 | |
| r14896 | r14897 | |
| 123 | 141 | *******************************************************/ |
| 124 | 142 | |
| 125 | 143 | |
| 126 | ||
| 144 | ||
| 127 | 145 | { |
| 128 | 146 | switch(mirroring) |
| 129 | 147 | { |
| 130 | 148 | case PPU_MIRROR_LOW: |
| 131 | | |
| 149 | | |
| 132 | 150 | break; |
| 133 | 151 | case PPU_MIRROR_HIGH: |
| 134 | | |
| 152 | | |
| 135 | 153 | break; |
| 136 | 154 | case PPU_MIRROR_HORZ: |
| 137 | state->m_nt_page[0] = state->m_nt_ram; | |
| 138 | state->m_nt_page[1] = state->m_nt_ram; | |
| 139 | state->m_nt_page[2] = state->m_nt_ram + 0x400; | |
| 140 | state->m_nt_page[3] = state->m_nt_ram + 0x400; | |
| 155 | m_nt_page[0] = m_nt_ram; | |
| 156 | m_nt_page[1] = m_nt_ram; | |
| 157 | m_nt_page[2] = m_nt_ram + 0x400; | |
| 158 | m_nt_page[3] = m_nt_ram + 0x400; | |
| 141 | 159 | break; |
| 142 | 160 | case PPU_MIRROR_VERT: |
| 143 | state->m_nt_page[0] = state->m_nt_ram; | |
| 144 | state->m_nt_page[1] = state->m_nt_ram + 0x400; | |
| 145 | state->m_nt_page[2] = state->m_nt_ram; | |
| 146 | state->m_nt_page[3] = state->m_nt_ram + 0x400; | |
| 161 | m_nt_page[0] = m_nt_ram; | |
| 162 | m_nt_page[1] = m_nt_ram + 0x400; | |
| 163 | m_nt_page[2] = m_nt_ram; | |
| 164 | m_nt_page[3] = m_nt_ram + 0x400; | |
| 147 | 165 | break; |
| 148 | 166 | case PPU_MIRROR_NONE: |
| 149 | 167 | default: |
| 150 | state->m_nt_page[0] = state->m_nt_ram; | |
| 151 | state->m_nt_page[1] = state->m_nt_ram + 0x400; | |
| 152 | state->m_nt_page[2] = state->m_nt_ram + 0x800; | |
| 153 | state->m_nt_page[3] = state->m_nt_ram + 0xc00; | |
| 168 | m_nt_page[0] = m_nt_ram; | |
| 169 | m_nt_page[1] = m_nt_ram + 0x400; | |
| 170 | m_nt_page[2] = m_nt_ram + 0x800; | |
| 171 | m_nt_page[3] = m_nt_ram + 0xc00; | |
| 154 | 172 | break; |
| 155 | 173 | } |
| 156 | 174 | } |
| 157 | 175 | |
| 158 | ||
| 176 | ||
| 159 | 177 | { |
| 160 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 161 | 178 | int page = ((offset & 0xc00) >> 10); |
| 162 | | |
| 179 | | |
| 163 | 180 | } |
| 164 | 181 | |
| 165 | 182 | |
| 166 | ||
| 183 | ||
| 167 | 184 | { |
| 168 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 169 | 185 | int page = ((offset & 0xc00) >> 10); |
| 170 | return | |
| 186 | return | |
| 171 | 187 | } |
| 172 | 188 | |
| 173 | 189 | static const char * const banknames[] = { "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8", "bank9" }; |
| r14896 | r14897 | |
| 203 | 219 | |
| 204 | 220 | *******************************************************/ |
| 205 | 221 | |
| 206 | ||
| 222 | ||
| 207 | 223 | { |
| 208 | 224 | int source = (data & 7); |
| 209 | ppu2c0x_device *ppu = space->machine().device<ppu2c0x_device>("ppu"); | |
| 210 | ppu->spriteram_dma(space, source); | |
| 225 | ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu"); | |
| 226 | ppu->spriteram_dma(&space, source); | |
| 211 | 227 | } |
| 212 | 228 | |
| 213 | 229 | static READ8_DEVICE_HANDLER( psg_4015_r ) |
| r14896 | r14897 | |
| 232 | 248 | *******************************************************/ |
| 233 | 249 | |
| 234 | 250 | |
| 235 | ||
| 251 | ||
| 236 | 252 | { |
| 237 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 238 | return ((state->m_in_0 >> state->m_in_0_shift++) & 0x01) | 0x40; | |
| 253 | return ((m_in_0 >> m_in_0_shift++) & 0x01) | 0x40; | |
| 239 | 254 | } |
| 240 | 255 | |
| 241 | ||
| 256 | ||
| 242 | 257 | { |
| 243 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 244 | 258 | if (data & 0x01) |
| 245 | 259 | { |
| 246 | 260 | return; |
| 247 | 261 | } |
| 248 | 262 | |
| 249 | state->m_in_0_shift = 0; | |
| 250 | state->m_in_1_shift = 0; | |
| 263 | m_in_0_shift = 0; | |
| 264 | m_in_1_shift = 0; | |
| 251 | 265 | |
| 252 | state->m_in_0 = input_port_read(space->machine(), "P1"); | |
| 253 | state->m_in_1 = input_port_read(space->machine(), "P2"); | |
| 266 | m_in_0 = input_port_read(machine(), "P1"); | |
| 267 | m_in_1 = input_port_read(machine(), "P2"); | |
| 254 | 268 | |
| 255 | state->m_in_dsw_shift = 0; | |
| 256 | state->m_in_dsw = input_port_read_safe(space->machine(), "DSW", 0); | |
| 269 | m_in_dsw_shift = 0; | |
| 270 | m_in_dsw = input_port_read_safe(machine(), "DSW", 0); | |
| 257 | 271 | } |
| 258 | 272 | |
| 259 | ||
| 273 | ||
| 260 | 274 | { |
| 261 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 262 | return ((state->m_in_1 >> state->m_in_1_shift++) & 0x01) | 0x40; | |
| 275 | return ((m_in_1 >> m_in_1_shift++) & 0x01) | 0x40; | |
| 263 | 276 | } |
| 264 | 277 | |
| 265 | 278 | CUSTOM_INPUT_MEMBER(multigam_state::multigam_inputs_r) |
| r14896 | r14897 | |
| 277 | 290 | *******************************************************/ |
| 278 | 291 | |
| 279 | 292 | |
| 280 | ||
| 293 | ||
| 281 | 294 | { |
| 282 | 295 | /* switch PRG rom */ |
| 283 | UINT8* dst = space->machine().region("maincpu")->base(); | |
| 284 | UINT8* src = space->machine().region("user1")->base(); | |
| 296 | UINT8* dst = machine().region("maincpu")->base(); | |
| 297 | UINT8* src = machine().region("user1")->base(); | |
| 285 | 298 | |
| 286 | 299 | if (data & 0x80) |
| 287 | 300 | { |
| r14896 | r14897 | |
| 298 | 311 | } |
| 299 | 312 | }; |
| 300 | 313 | |
| 301 | ||
| 314 | ||
| 302 | 315 | { |
| 303 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 304 | memory_set_bankptr(space->machine(), "bank1", space->machine().region("gfx1")->base() + (0x2000 * (data & 0x3f))); | |
| 305 | set_mirroring(state, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 306 | state->m_game_gfx_bank = data; | |
| 316 | memory_set_bankptr(machine(), "bank1", machine().region("gfx1")->base() + (0x2000 * (data & 0x3f))); | |
| 317 | set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 318 | m_game_gfx_bank = data; | |
| 307 | 319 | }; |
| 308 | 320 | |
| 309 | 321 | |
| 310 | ||
| 322 | ||
| 311 | 323 | { |
| 312 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 313 | if (state->m_game_gfx_bank & 0x80) | |
| 324 | if (m_game_gfx_bank & 0x80) | |
| 314 | 325 | { |
| 315 | memory_set_bankptr( | |
| 326 | memory_set_bankptr( | |
| 316 | 327 | } |
| 317 | 328 | else |
| 318 | 329 | { |
| r14896 | r14897 | |
| 331 | 342 | AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */ |
| 332 | 343 | AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_device, read, write) |
| 333 | 344 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE_LEGACY("nes", nes_psg_r, nes_psg_w) /* PSG primary registers */ |
| 334 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 345 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 335 | 346 | AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE_LEGACY("nes", psg_4015_r, psg_4015_w) /* PSG status / first control register */ |
| 336 | AM_RANGE(0x4016, 0x4016) AM_READWRITE_LEGACY(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 337 | AM_RANGE(0x4017, 0x4017) AM_READ_LEGACY(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 347 | AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 348 | AM_RANGE(0x4017, 0x4017) AM_READ(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 338 | 349 | AM_RANGE(0x5002, 0x5002) AM_WRITENOP |
| 339 | 350 | AM_RANGE(0x5000, 0x5ffe) AM_ROM |
| 340 | 351 | AM_RANGE(0x5fff, 0x5fff) AM_READ_PORT("IN0") |
| 341 | 352 | AM_RANGE(0x6000, 0x7fff) AM_ROM |
| 342 | AM_RANGE(0x6fff, 0x6fff) AM_WRITE_LEGACY(multigam_switch_prg_rom) | |
| 343 | AM_RANGE(0x7fff, 0x7fff) AM_WRITE_LEGACY(multigam_switch_gfx_rom) | |
| 344 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE_LEGACY(multigam_mapper2_w) | |
| 353 | AM_RANGE(0x6fff, 0x6fff) AM_WRITE(multigam_switch_prg_rom) | |
| 354 | AM_RANGE(0x7fff, 0x7fff) AM_WRITE(multigam_switch_gfx_rom) | |
| 355 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE(multigam_mapper2_w) | |
| 345 | 356 | ADDRESS_MAP_END |
| 346 | 357 | |
| 347 | 358 | static ADDRESS_MAP_START( multigmt_map, AS_PROGRAM, 8, multigam_state ) |
| 348 | 359 | AM_RANGE(0x0000, 0x07ff) AM_RAM /* NES RAM */ |
| 349 | 360 | AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */ |
| 350 | AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(multigam_switch_prg_rom) | |
| 351 | AM_RANGE(0x3fff, 0x3fff) AM_WRITE_LEGACY(multigam_switch_gfx_rom) | |
| 361 | AM_RANGE(0x3000, 0x3000) AM_WRITE(multigam_switch_prg_rom) | |
| 362 | AM_RANGE(0x3fff, 0x3fff) AM_WRITE(multigam_switch_gfx_rom) | |
| 352 | 363 | AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_device, read, write) |
| 353 | 364 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE_LEGACY("nes", nes_psg_r, nes_psg_w) /* PSG primary registers */ |
| 354 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 365 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 355 | 366 | AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE_LEGACY("nes", psg_4015_r, psg_4015_w) /* PSG status / first control register */ |
| 356 | AM_RANGE(0x4016, 0x4016) AM_READWRITE_LEGACY(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 357 | AM_RANGE(0x4017, 0x4017) AM_READ_LEGACY(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 367 | AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 368 | AM_RANGE(0x4017, 0x4017) AM_READ(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 358 | 369 | AM_RANGE(0x5002, 0x5002) AM_WRITENOP |
| 359 | 370 | AM_RANGE(0x5000, 0x5ffe) AM_ROM |
| 360 | 371 | AM_RANGE(0x5fff, 0x5fff) AM_READ_PORT("IN0") |
| 361 | 372 | AM_RANGE(0x6000, 0x7fff) AM_ROM |
| 362 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE | |
| 373 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE | |
| 363 | 374 | ADDRESS_MAP_END |
| 364 | 375 | |
| 365 | 376 | /****************************************************** |
| r14896 | r14897 | |
| 382 | 393 | } |
| 383 | 394 | } |
| 384 | 395 | |
| 385 | ||
| 396 | ||
| 386 | 397 | { |
| 387 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 388 | ppu2c0x_device *ppu = space->machine().device<ppu2c0x_device>("ppu"); | |
| 398 | ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu"); | |
| 389 | 399 | |
| 390 | 400 | /* basically, a MMC3 mapper from the nes */ |
| 391 | int bankmask = | |
| 401 | int bankmask = | |
| 392 | 402 | |
| 393 | 403 | switch(offset & 0x7001) |
| 394 | 404 | { |
| 395 | 405 | case 0x0000: |
| 396 | | |
| 406 | | |
| 397 | 407 | |
| 398 | if ( | |
| 408 | if ( | |
| 399 | 409 | { |
| 400 | 410 | int bank; |
| 401 | UINT8 *prg = | |
| 411 | UINT8 *prg = | |
| 402 | 412 | |
| 403 | 413 | /* reset the banks */ |
| 404 | if ( | |
| 414 | if ( | |
| 405 | 415 | { |
| 406 | 416 | /* high bank */ |
| 407 | bank = ( | |
| 417 | bank = ( | |
| 408 | 418 | |
| 409 | memcpy(&prg[0x0c000], &state->m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 410 | memcpy(&prg[0x08000], &state->m_multigam3_mmc3_prg_base[state->m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 419 | memcpy(&prg[0x0c000], &m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 420 | memcpy(&prg[0x08000], &m_multigam3_mmc3_prg_base[m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 411 | 421 | } |
| 412 | 422 | else |
| 413 | 423 | { |
| 414 | 424 | /* low bank */ |
| 415 | bank = ( | |
| 425 | bank = ( | |
| 416 | 426 | |
| 417 | memcpy(&prg[0x08000], &state->m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 418 | memcpy(&prg[0x0c000], &state->m_multigam3_mmc3_prg_base[state->m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 427 | memcpy(&prg[0x08000], &m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 428 | memcpy(&prg[0x0c000], &m_multigam3_mmc3_prg_base[m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 419 | 429 | } |
| 420 | 430 | |
| 421 | 431 | /* mid bank */ |
| 422 | bank = (state->m_multigam3_mmc3_banks[1] & bankmask) * 0x2000; | |
| 423 | memcpy(&prg[0x0a000], &state->m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 432 | bank = (m_multigam3_mmc3_banks[1] & bankmask) * 0x2000; | |
| 433 | memcpy(&prg[0x0a000], &m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 424 | 434 | |
| 425 | | |
| 435 | | |
| 426 | 436 | } |
| 427 | 437 | break; |
| 428 | 438 | |
| 429 | 439 | case 0x0001: |
| 430 | 440 | { |
| 431 | UINT8 cmd = state->m_multigam3_mmc3_command & 0x07; | |
| 432 | int page = (state->m_multigam3_mmc3_command & 0x80) >> 5; | |
| 441 | UINT8 cmd = m_multigam3_mmc3_command & 0x07; | |
| 442 | int page = (m_multigam3_mmc3_command & 0x80) >> 5; | |
| 433 | 443 | int bank; |
| 434 | 444 | |
| 435 | 445 | switch (cmd) |
| r14896 | r14897 | |
| 438 | 448 | case 1: /* char banking */ |
| 439 | 449 | data &= 0xfe; |
| 440 | 450 | page ^= (cmd << 1); |
| 441 | set_videorom_bank( | |
| 451 | set_videorom_bank( | |
| 442 | 452 | break; |
| 443 | 453 | |
| 444 | 454 | case 2: /* char banking */ |
| r14896 | r14897 | |
| 446 | 456 | case 4: /* char banking */ |
| 447 | 457 | case 5: /* char banking */ |
| 448 | 458 | page ^= cmd + 2; |
| 449 | set_videorom_bank( | |
| 459 | set_videorom_bank( | |
| 450 | 460 | break; |
| 451 | 461 | |
| 452 | 462 | case 6: /* program banking */ |
| 453 | 463 | { |
| 454 | UINT8 *prg = space->machine().region("maincpu")->base(); | |
| 455 | if (state->m_multigam3_mmc3_command & 0x40) | |
| 464 | UINT8 *prg = machine().region("maincpu")->base(); | |
| 465 | if (m_multigam3_mmc3_command & 0x40) | |
| 456 | 466 | { |
| 457 | 467 | /* high bank */ |
| 458 | state->m_multigam3_mmc3_banks[0] = data & bankmask; | |
| 459 | bank = (state->m_multigam3_mmc3_banks[0]) * 0x2000; | |
| 468 | m_multigam3_mmc3_banks[0] = data & bankmask; | |
| 469 | bank = (m_multigam3_mmc3_banks[0]) * 0x2000; | |
| 460 | 470 | |
| 461 | memcpy(&prg[0x0c000], &state->m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 462 | memcpy(&prg[0x08000], &state->m_multigam3_mmc3_prg_base[state->m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 471 | memcpy(&prg[0x0c000], &m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 472 | memcpy(&prg[0x08000], &m_multigam3_mmc3_prg_base[m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 463 | 473 | } |
| 464 | 474 | else |
| 465 | 475 | { |
| 466 | 476 | /* low bank */ |
| 467 | state->m_multigam3_mmc3_banks[0] = data & bankmask; | |
| 468 | bank = (state->m_multigam3_mmc3_banks[0]) * 0x2000; | |
| 477 | m_multigam3_mmc3_banks[0] = data & bankmask; | |
| 478 | bank = (m_multigam3_mmc3_banks[0]) * 0x2000; | |
| 469 | 479 | |
| 470 | memcpy(&prg[0x08000], &state->m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 471 | memcpy(&prg[0x0c000], &state->m_multigam3_mmc3_prg_base[state->m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 480 | memcpy(&prg[0x08000], &m_multigam3_mmc3_prg_base[bank], 0x2000); | |
| 481 | memcpy(&prg[0x0c000], &m_multigam3_mmc3_prg_base[m_multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 472 | 482 | } |
| 473 | 483 | } |
| 474 | 484 | break; |
| r14896 | r14897 | |
| 476 | 486 | case 7: /* program banking */ |
| 477 | 487 | { |
| 478 | 488 | /* mid bank */ |
| 479 | UINT8 *prg = | |
| 489 | UINT8 *prg = | |
| 480 | 490 | |
| 481 | state->m_multigam3_mmc3_banks[1] = data & bankmask; | |
| 482 | bank = state->m_multigam3_mmc3_banks[1] * 0x2000; | |
| 491 | m_multigam3_mmc3_banks[1] = data & bankmask; | |
| 492 | bank = m_multigam3_mmc3_banks[1] * 0x2000; | |
| 483 | 493 | |
| 484 | memcpy(&prg[0x0a000], & | |
| 494 | memcpy(&prg[0x0a000], & | |
| 485 | 495 | } |
| 486 | 496 | break; |
| 487 | 497 | } |
| r14896 | r14897 | |
| 489 | 499 | break; |
| 490 | 500 | |
| 491 | 501 | case 0x2000: /* mirroring */ |
| 492 | if (! | |
| 502 | if (! | |
| 493 | 503 | { |
| 494 | 504 | if (data & 0x40) |
| 495 | set_mirroring( | |
| 505 | set_mirroring( | |
| 496 | 506 | else |
| 497 | set_mirroring( | |
| 507 | set_mirroring( | |
| 498 | 508 | } |
| 499 | 509 | break; |
| 500 | 510 | |
| 501 | 511 | case 0x2001: /* enable ram at $6000 */ |
| 502 | 512 | if (data & 0x80) |
| 503 | 513 | { |
| 504 | memory_set_bankptr( | |
| 514 | memory_set_bankptr( | |
| 505 | 515 | } |
| 506 | 516 | else |
| 507 | 517 | { |
| 508 | memory_set_bankptr( | |
| 518 | memory_set_bankptr( | |
| 509 | 519 | } |
| 510 | 520 | if (data & 0x40) |
| 511 | 521 | { |
| r14896 | r14897 | |
| 514 | 524 | break; |
| 515 | 525 | |
| 516 | 526 | case 0x4000: /* scanline counter */ |
| 517 | | |
| 527 | | |
| 518 | 528 | break; |
| 519 | 529 | |
| 520 | 530 | case 0x4001: /* scanline latch */ |
| 521 | | |
| 531 | | |
| 522 | 532 | break; |
| 523 | 533 | |
| 524 | 534 | case 0x6000: /* disable irqs */ |
| r14896 | r14897 | |
| 543 | 553 | memcpy(&dst[0x8000], prg_base + (prg_size - 0x4000), 0x4000); |
| 544 | 554 | memcpy(&dst[0xc000], prg_base + (prg_size - 0x4000), 0x4000); |
| 545 | 555 | |
| 546 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 556 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 547 | 557 | |
| 548 | 558 | state->m_multigam3_mmc3_banks[0] = 0x1e; |
| 549 | 559 | state->m_multigam3_mmc3_banks[1] = 0x1f; |
| r14896 | r14897 | |
| 556 | 566 | state->m_multigam3_mmc3_prg_size = prg_size; |
| 557 | 567 | }; |
| 558 | 568 | |
| 559 | ||
| 569 | ||
| 560 | 570 | { |
| 561 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 562 | if (state->m_game_gfx_bank & 0x80) | |
| 571 | if (m_game_gfx_bank & 0x80) | |
| 563 | 572 | { |
| 564 | set_videorom_bank( | |
| 573 | set_videorom_bank( | |
| 565 | 574 | } |
| 566 | 575 | else |
| 567 | 576 | { |
| r14896 | r14897 | |
| 569 | 578 | } |
| 570 | 579 | }; |
| 571 | 580 | |
| 572 | ||
| 581 | ||
| 573 | 582 | { |
| 574 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 575 | set_videorom_bank(space->machine(), 0, 8, data & 0x3f, 8); | |
| 576 | set_mirroring(state, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 577 | state->m_game_gfx_bank = data; | |
| 583 | set_videorom_bank(machine(), 0, 8, data & 0x3f, 8); | |
| 584 | set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 585 | m_game_gfx_bank = data; | |
| 578 | 586 | }; |
| 579 | 587 | |
| 580 | ||
| 588 | ||
| 581 | 589 | { |
| 582 | 590 | /* switch PRG rom */ |
| 583 | UINT8* dst = space->machine().region("maincpu")->base(); | |
| 584 | UINT8* src = space->machine().region("user1")->base(); | |
| 591 | UINT8* dst = machine().region("maincpu")->base(); | |
| 592 | UINT8* src = machine().region("user1")->base(); | |
| 585 | 593 | |
| 586 | 594 | if (data == 0xa8) |
| 587 | 595 | { |
| 588 | multigam_init_mmc3( | |
| 596 | multigam_init_mmc3( | |
| 589 | 597 | return; |
| 590 | 598 | } |
| 591 | 599 | else |
| 592 | 600 | { |
| 593 | space->install_legacy_write_handler(0x8000, 0xffff, FUNC(multigm3_mapper2_w) ); | |
| 594 | memory_set_bankptr(space->machine(), "bank10", space->machine().region("maincpu")->base() + 0x6000); | |
| 601 | space.install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigm3_mapper2_w),this) ); | |
| 602 | memory_set_bankptr(machine(), "bank10", machine().region("maincpu")->base() + 0x6000); | |
| 595 | 603 | } |
| 596 | 604 | |
| 597 | 605 | if (data & 0x80) |
| r14896 | r14897 | |
| 620 | 628 | AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */ |
| 621 | 629 | AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_device, read, write) |
| 622 | 630 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE_LEGACY("nes", nes_psg_r, nes_psg_w) /* PSG primary registers */ |
| 623 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 631 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 624 | 632 | AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE_LEGACY("nes", psg_4015_r, psg_4015_w) /* PSG status / first control register */ |
| 625 | AM_RANGE(0x4016, 0x4016) AM_READWRITE_LEGACY(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 626 | AM_RANGE(0x4017, 0x4017) AM_READ_LEGACY(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 627 | AM_RANGE(0x5001, 0x5001) AM_WRITE_LEGACY(multigm3_switch_prg_rom) | |
| 633 | AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 634 | AM_RANGE(0x4017, 0x4017) AM_READ(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 635 | AM_RANGE(0x5001, 0x5001) AM_WRITE(multigm3_switch_prg_rom) | |
| 628 | 636 | AM_RANGE(0x5002, 0x5002) AM_WRITENOP |
| 629 | AM_RANGE(0x5003, 0x5003) AM_WRITE | |
| 637 | AM_RANGE(0x5003, 0x5003) AM_WRITE | |
| 630 | 638 | AM_RANGE(0x5000, 0x5ffe) AM_ROM |
| 631 | 639 | AM_RANGE(0x5fff, 0x5fff) AM_READ_PORT("IN0") |
| 632 | 640 | AM_RANGE(0x6000, 0x7fff) AM_RAMBANK("bank10") |
| 633 | 641 | AM_RANGE(0x6fff, 0x6fff) AM_WRITENOP /* 0x00 in attract mode, 0xff during play */ |
| 634 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE | |
| 642 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE | |
| 635 | 643 | ADDRESS_MAP_END |
| 636 | 644 | |
| 637 | 645 | /****************************************************** |
| r14896 | r14897 | |
| 641 | 649 | *******************************************************/ |
| 642 | 650 | |
| 643 | 651 | |
| 644 | ||
| 652 | ||
| 645 | 653 | { |
| 646 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 647 | UINT8* mem = space->machine().region("maincpu")->base(); | |
| 648 | int bankmask = (state->m_mapper02_prg_size/0x4000) - 1; | |
| 649 | memcpy(mem + 0x8000, state->m_mapper02_prg_base + 0x4000*(data & bankmask), 0x4000); | |
| 654 | UINT8* mem = machine().region("maincpu")->base(); | |
| 655 | int bankmask = (m_mapper02_prg_size/0x4000) - 1; | |
| 656 | memcpy(mem + 0x8000, m_mapper02_prg_base + 0x4000*(data & bankmask), 0x4000); | |
| 650 | 657 | } |
| 651 | 658 | |
| 652 | 659 | static void multigam_init_mapper02(running_machine &machine, UINT8* prg_base, int prg_size) |
| r14896 | r14897 | |
| 655 | 662 | ppu2c0x_device *ppu = machine.device<ppu2c0x_device>("ppu"); |
| 656 | 663 | UINT8* mem = machine.region("maincpu")->base(); |
| 657 | 664 | memcpy(mem + 0x8000, prg_base + prg_size - 0x8000, 0x8000); |
| 658 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 665 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 659 | 666 | |
| 660 | 667 | state->m_mapper02_prg_base = prg_base; |
| 661 | 668 | state->m_mapper02_prg_size = prg_size; |
| r14896 | r14897 | |
| 675 | 682 | state->m_mmc1_reg_write_enable = 1; |
| 676 | 683 | } |
| 677 | 684 | |
| 678 | ||
| 685 | ||
| 679 | 686 | { |
| 680 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 681 | 687 | /* basically, a MMC1 mapper from the nes */ |
| 682 | 688 | |
| 683 | if ( | |
| 689 | if ( | |
| 684 | 690 | { |
| 685 | 691 | return; |
| 686 | 692 | } |
| 687 | 693 | else |
| 688 | 694 | { |
| 689 | state->m_mmc1_reg_write_enable = 0; | |
| 690 | space->machine().scheduler().synchronize(FUNC(mmc1_resync_callback)); | |
| 695 | m_mmc1_reg_write_enable = 0; | |
| 696 | machine().scheduler().synchronize(FUNC(mmc1_resync_callback)); | |
| 691 | 697 | } |
| 692 | 698 | |
| 693 | 699 | int reg = (offset >> 13); |
| r14896 | r14897 | |
| 695 | 701 | /* reset mapper */ |
| 696 | 702 | if (data & 0x80) |
| 697 | 703 | { |
| 698 | | |
| 704 | | |
| 699 | 705 | |
| 700 | state->m_size16k = 1; | |
| 701 | state->m_switchlow = 1; | |
| 702 | state->m_vrom4k = 0; | |
| 706 | m_size16k = 1; | |
| 707 | m_switchlow = 1; | |
| 708 | m_vrom4k = 0; | |
| 703 | 709 | |
| 704 | 710 | return; |
| 705 | 711 | } |
| 706 | 712 | |
| 707 | 713 | /* see if we need to clock in data */ |
| 708 | if ( | |
| 714 | if ( | |
| 709 | 715 | { |
| 710 | state->m_mmc1_shiftreg >>= 1; | |
| 711 | state->m_mmc1_shiftreg |= (data & 1) << 4; | |
| 712 | state->m_mmc1_shiftcount++; | |
| 716 | m_mmc1_shiftreg >>= 1; | |
| 717 | m_mmc1_shiftreg |= (data & 1) << 4; | |
| 718 | m_mmc1_shiftcount++; | |
| 713 | 719 | } |
| 714 | 720 | |
| 715 | 721 | /* are we done shifting? */ |
| 716 | if ( | |
| 722 | if ( | |
| 717 | 723 | { |
| 718 | 724 | /* reset count */ |
| 719 | | |
| 725 | | |
| 720 | 726 | |
| 721 | 727 | /* apply data to registers */ |
| 722 | 728 | switch (reg) |
| r14896 | r14897 | |
| 725 | 731 | { |
| 726 | 732 | int _mirroring; |
| 727 | 733 | |
| 728 | state->m_vrom4k = state->m_mmc1_shiftreg & 0x10; | |
| 729 | state->m_size16k = state->m_mmc1_shiftreg & 0x08; | |
| 730 | state->m_switchlow = state->m_mmc1_shiftreg & 0x04; | |
| 734 | m_vrom4k = m_mmc1_shiftreg & 0x10; | |
| 735 | m_size16k = m_mmc1_shiftreg & 0x08; | |
| 736 | m_switchlow = m_mmc1_shiftreg & 0x04; | |
| 731 | 737 | |
| 732 | switch ( | |
| 738 | switch ( | |
| 733 | 739 | { |
| 734 | 740 | case 0: |
| 735 | 741 | _mirroring = PPU_MIRROR_LOW; |
| r14896 | r14897 | |
| 750 | 756 | } |
| 751 | 757 | |
| 752 | 758 | /* apply mirroring */ |
| 753 | set_mirroring( | |
| 759 | set_mirroring( | |
| 754 | 760 | } |
| 755 | 761 | break; |
| 756 | 762 | |
| 757 | 763 | case 1: /* video rom banking - bank 0 - 4k or 8k */ |
| 758 | if (state->m_mmc1_chr_bank_base == 0) | |
| 759 | set_videoram_bank(space->machine(), 0, (state->m_vrom4k) ? 4 : 8, (state->m_mmc1_shiftreg & 0x1f), 4); | |
| 764 | if (m_mmc1_chr_bank_base == 0) | |
| 765 | set_videoram_bank(machine(), 0, (m_vrom4k) ? 4 : 8, (m_mmc1_shiftreg & 0x1f), 4); | |
| 760 | 766 | else |
| 761 | set_videorom_bank( | |
| 767 | set_videorom_bank( | |
| 762 | 768 | break; |
| 763 | 769 | |
| 764 | 770 | case 2: /* video rom banking - bank 1 - 4k only */ |
| 765 | if ( | |
| 771 | if ( | |
| 766 | 772 | { |
| 767 | if (state->m_mmc1_chr_bank_base == 0) | |
| 768 | set_videoram_bank(space->machine(), 0, (state->m_vrom4k) ? 4 : 8, (state->m_mmc1_shiftreg & 0x1f), 4); | |
| 773 | if (m_mmc1_chr_bank_base == 0) | |
| 774 | set_videoram_bank(machine(), 0, (m_vrom4k) ? 4 : 8, (m_mmc1_shiftreg & 0x1f), 4); | |
| 769 | 775 | else |
| 770 | set_videorom_bank( | |
| 776 | set_videorom_bank( | |
| 771 | 777 | } |
| 772 | 778 | break; |
| 773 | 779 | |
| 774 | 780 | case 3: /* program banking */ |
| 775 | 781 | { |
| 776 | int bank = (state->m_mmc1_shiftreg & state->m_mmc1_rom_mask) * 0x4000; | |
| 777 | UINT8 *prg = space->machine().region("maincpu")->base(); | |
| 782 | int bank = (m_mmc1_shiftreg & m_mmc1_rom_mask) * 0x4000; | |
| 783 | UINT8 *prg = machine().region("maincpu")->base(); | |
| 778 | 784 | |
| 779 | if (! | |
| 785 | if (! | |
| 780 | 786 | { |
| 781 | bank = (( | |
| 787 | bank = (( | |
| 782 | 788 | /* switch 32k */ |
| 783 | memcpy(&prg[0x08000], | |
| 789 | memcpy(&prg[0x08000], | |
| 784 | 790 | } |
| 785 | 791 | else |
| 786 | 792 | { |
| 787 | 793 | /* switch 16k */ |
| 788 | if ( | |
| 794 | if ( | |
| 789 | 795 | { |
| 790 | 796 | /* low */ |
| 791 | memcpy(&prg[0x08000], state->m_mmc1_prg_base + bank, 0x4000); | |
| 792 | memcpy(&prg[0x0c000], state->m_mmc1_prg_base + (0x0f & state->m_mmc1_rom_mask) * 0x4000, 0x4000); | |
| 797 | memcpy(&prg[0x08000], m_mmc1_prg_base + bank, 0x4000); | |
| 798 | memcpy(&prg[0x0c000], m_mmc1_prg_base + (0x0f & m_mmc1_rom_mask) * 0x4000, 0x4000); | |
| 793 | 799 | } |
| 794 | 800 | else |
| 795 | 801 | { |
| 796 | 802 | /* high */ |
| 797 | memcpy(&prg[0x08000], state->m_mmc1_prg_base + (0x00 & state->m_mmc1_rom_mask) * 0x4000, 0x4000); | |
| 798 | memcpy(&prg[0x0c000], state->m_mmc1_prg_base + bank, 0x4000); | |
| 803 | memcpy(&prg[0x08000], m_mmc1_prg_base + (0x00 & m_mmc1_rom_mask) * 0x4000, 0x4000); | |
| 804 | memcpy(&prg[0x0c000], m_mmc1_prg_base + bank, 0x4000); | |
| 799 | 805 | } |
| 800 | 806 | } |
| 801 | 807 | } |
| r14896 | r14897 | |
| 812 | 818 | |
| 813 | 819 | memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000); |
| 814 | 820 | |
| 815 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 821 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 816 | 822 | |
| 817 | 823 | state->m_mmc1_reg_write_enable = 1; |
| 818 | 824 | state->m_mmc1_rom_mask = (prg_size / 0x4000) - 1; |
| r14896 | r14897 | |
| 862 | 868 | memory_set_bankptr(machine, "bank1", state->m_vram); |
| 863 | 869 | |
| 864 | 870 | if (state->m_supergm3_chr_bank == 0x40) |
| 865 | set_mirroring( | |
| 871 | state->set_mirroring( | |
| 866 | 872 | } |
| 867 | 873 | else |
| 868 | 874 | { |
| r14896 | r14897 | |
| 912 | 918 | } |
| 913 | 919 | } |
| 914 | 920 | |
| 915 | ||
| 921 | ||
| 916 | 922 | { |
| 917 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 918 | state->m_supergm3_prg_bank = data; | |
| 923 | m_supergm3_prg_bank = data; | |
| 919 | 924 | } |
| 920 | 925 | |
| 921 | ||
| 926 | ||
| 922 | 927 | { |
| 923 | multigam_state *state = space->machine().driver_data<multigam_state>(); | |
| 924 | state->m_supergm3_chr_bank = data; | |
| 925 | supergm3_set_bank(space->machine()); | |
| 928 | m_supergm3_chr_bank = data; | |
| 929 | supergm3_set_bank(machine()); | |
| 926 | 930 | } |
| 927 | 931 | |
| 928 | 932 | /****************************************************** |
| r14896 | r14897 | |
| 936 | 940 | AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */ |
| 937 | 941 | AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_device, read, write) |
| 938 | 942 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE_LEGACY("nes", nes_psg_r, nes_psg_w) /* PSG primary registers */ |
| 939 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 943 | AM_RANGE(0x4014, 0x4014) AM_WRITE | |
| 940 | 944 | AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE_LEGACY("nes", psg_4015_r, psg_4015_w) /* PSG status / first control register */ |
| 941 | AM_RANGE(0x4016, 0x4016) AM_READWRITE_LEGACY(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 942 | AM_RANGE(0x4017, 0x4017) AM_READ_LEGACY(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 945 | AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r, multigam_IN0_w) /* IN0 - input port 1 */ | |
| 946 | AM_RANGE(0x4017, 0x4017) AM_READ(multigam_IN1_r) AM_DEVWRITE_LEGACY("nes", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ | |
| 943 | 947 | AM_RANGE(0x4fff, 0x4fff) AM_READ_PORT("IN0") |
| 944 | 948 | AM_RANGE(0x5000, 0x5fff) AM_ROM |
| 945 | 949 | AM_RANGE(0x5000, 0x5000) AM_WRITENOP |
| 946 | AM_RANGE(0x5001, 0x5001) AM_WRITE_LEGACY(supergm3_prg_bank_w) | |
| 947 | AM_RANGE(0x5002, 0x5002) AM_WRITE_LEGACY(supergm3_chr_bank_w) | |
| 950 | AM_RANGE(0x5001, 0x5001) AM_WRITE(supergm3_prg_bank_w) | |
| 951 | AM_RANGE(0x5002, 0x5002) AM_WRITE(supergm3_chr_bank_w) | |
| 948 | 952 | AM_RANGE(0x5fff, 0x5fff) AM_WRITENOP |
| 949 | 953 | AM_RANGE(0x6000, 0x7fff) AM_RAMBANK("bank10") |
| 950 | 954 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
| 1120 | 1124 | { |
| 1121 | 1125 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 1122 | 1126 | /* reset the ppu */ |
| 1123 | multigm3_switch_prg_rom(space, 0, 0x01 ); | |
| 1127 | multigam_state *state = machine.driver_data<multigam_state>(); | |
| 1128 | state->multigm3_switch_prg_rom(*space, 0, 0x01 ); | |
| 1124 | 1129 | }; |
| 1125 | 1130 | |
| 1126 | 1131 | static MACHINE_START( multigam ) |
| r14896 | r14897 | |
| 1132 | 1137 | state->m_nt_page[2] = state->m_nt_ram + 0x800; |
| 1133 | 1138 | state->m_nt_page[3] = state->m_nt_ram + 0xc00; |
| 1134 | 1139 | |
| 1135 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_ | |
| 1140 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_ | |
| 1136 | 1141 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1"); |
| 1137 | 1142 | memory_set_bankptr(machine, "bank1", machine.region("gfx1")->base()); |
| 1138 | 1143 | } |
| r14896 | r14897 | |
| 1146 | 1151 | state->m_nt_page[2] = state->m_nt_ram + 0x800; |
| 1147 | 1152 | state->m_nt_page[3] = state->m_nt_ram + 0xc00; |
| 1148 | 1153 | |
| 1149 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_ | |
| 1154 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_ | |
| 1150 | 1155 | |
| 1151 | 1156 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank2"); |
| 1152 | 1157 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0400, 0x07ff, "bank3"); |
| r14896 | r14897 | |
| 1169 | 1174 | state->m_nt_page[2] = state->m_nt_ram + 0x800; |
| 1170 | 1175 | state->m_nt_page[3] = state->m_nt_ram + 0xc00; |
| 1171 | 1176 | |
| 1172 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_ | |
| 1177 | machine.device("ppu")->memory().space(AS_PROGRAM)->install_ | |
| 1173 | 1178 | |
| 1174 | 1179 | state->m_vram = auto_alloc_array(machine, UINT8, 0x2000); |
| 1175 | 1180 | state->m_multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000); |
| r14896 | r14897 | |
| 1347 | 1352 | |
| 1348 | 1353 | static DRIVER_INIT( multigam ) |
| 1349 | 1354 | { |
| 1355 | multigam_state *state = machine.driver_data<multigam_state>(); | |
| 1350 | 1356 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 1351 | multigam_switch_prg_rom(space, 0x0, 0x01); | |
| 1357 | state->multigam_switch_prg_rom(*space, 0x0, 0x01); | |
| 1352 | 1358 | } |
| 1353 | 1359 | |
| 1354 | 1360 | static void multigm3_decrypt(UINT8* mem, int memsize, const UINT8* decode_nibble) |
| r14896 | r14897 | |
| 1372 | 1378 | |
| 1373 | 1379 | state->m_multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000); |
| 1374 | 1380 | |
| 1375 | multigam_switch_prg_rom(space, 0x0, 0x01); | |
| 1381 | state->multigam_switch_prg_rom(*space, 0x0, 0x01); | |
| 1376 | 1382 | } |
| 1377 | 1383 | |
| 1378 | 1384 | static DRIVER_INIT(multigmt) |
| r14896 | r14897 | |
| 1413 | 1419 | } |
| 1414 | 1420 | |
| 1415 | 1421 | auto_free(machine, buf); |
| 1416 | ||
| 1417 | multigam_switch_prg_rom(space, 0x0, 0x01); | |
| 1422 | multigam_state *state = machine.driver_data<multigam_state>(); | |
| 1423 | state->multigam_switch_prg_rom(*space, 0x0, 0x01); | |
| 1418 | 1424 | }; |
| 1419 | 1425 | |
| 1420 | 1426 | GAME( 1992, multigam, 0, multigam, multigam, multigam, ROT0, "<unknown>", "Multi Game (set 1)", 0 ) |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | if (ACCESSING_BITS_0_7) |
| 80 | 80 | { |
| 81 | soundlatch_w(space,0,data & 0xff); | |
| 81 | soundlatch_byte_w(space,0,data & 0xff); | |
| 82 | 82 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 83 | 83 | // device_spin_until_time(&space.device(), attotime::from_usec(50)); // Allow the other CPU to reply |
| 84 | 84 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters |
| r14896 | r14897 | |
| 93 | 93 | AM_RANGE(0x504000, 0x505fff) AM_RAM_WRITE(fuuki16_vram_2_w) AM_BASE(m_vram[2]) // |
| 94 | 94 | AM_RANGE(0x506000, 0x507fff) AM_RAM_WRITE(fuuki16_vram_3_w) AM_BASE(m_vram[3]) // |
| 95 | 95 | AM_RANGE(0x600000, 0x601fff) AM_MIRROR(0x008000) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites, mirrored? |
| 96 | AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(paletteram | |
| 96 | AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(paletteram | |
| 97 | 97 | AM_RANGE(0x800000, 0x800001) AM_READ_PORT("SYSTEM") |
| 98 | 98 | AM_RANGE(0x810000, 0x810001) AM_READ_PORT("P1_P2") |
| 99 | 99 | AM_RANGE(0x880000, 0x880001) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 140 | 140 | static ADDRESS_MAP_START( fuuki16_sound_io_map, AS_IO, 8, fuuki16_state ) |
| 141 | 141 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 142 | 142 | AM_RANGE(0x00, 0x00) AM_WRITE(fuuki16_sound_rombank_w) // ROM Bank |
| 143 | AM_RANGE(0x11, 0x11) AM_READ(soundlatch_r) AM_WRITENOP // From Main CPU / ? To Main CPU ? | |
| 143 | AM_RANGE(0x11, 0x11) AM_READ(soundlatch_byte_r) AM_WRITENOP // From Main CPU / ? To Main CPU ? | |
| 144 | 144 | AM_RANGE(0x20, 0x20) AM_DEVWRITE_LEGACY("oki", fuuki16_oki_banking_w) // Oki Banking |
| 145 | 145 | AM_RANGE(0x30, 0x30) AM_WRITENOP // ? In the NMI routine |
| 146 | 146 | AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2") |
| 58 | 58 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1") |
| 59 | 59 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2") |
| 60 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) | |
| 60 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) | |
| 61 | 61 | AM_RANGE(0xc802, 0xc803) AM_RAM AM_BASE(m_scroll_low) |
| 62 | 62 | AM_RANGE(0xc804, 0xc804) AM_WRITE(vulgus_c804_w) |
| 63 | 63 | AM_RANGE(0xc805, 0xc805) AM_WRITE(vulgus_palette_bank_w) |
| r14896 | r14897 | |
| 72 | 72 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 73 | 73 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 74 | 74 | AM_RANGE(0x4000, 0x47ff) AM_WRITEONLY |
| 75 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 75 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 76 | 76 | AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 77 | 77 | AM_RANGE(0xc000, 0xc001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 78 | 78 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 282 | 282 | AM_RANGE(0x104000, 0x10400b) AM_WRITE(sderby_scroll_w) |
| 283 | 283 | AM_RANGE(0x10400c, 0x10400d) AM_WRITENOP /* ??? - check code at 0x000456 (executed once at startup) */ |
| 284 | 284 | AM_RANGE(0x10400e, 0x10400f) AM_WRITENOP /* ??? - check code at 0x000524 (executed once at startup) */ |
| 285 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(m_spriteram | |
| 285 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 286 | 286 | AM_RANGE(0x308000, 0x30800d) AM_READ(sderby_input_r) |
| 287 | 287 | AM_RANGE(0x308008, 0x308009) AM_WRITE(sderby_out_w) /* output port */ |
| 288 | 288 | AM_RANGE(0x30800e, 0x30800f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 289 | AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram | |
| 289 | AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram | |
| 290 | 290 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* unknown... write 0x01 in game, and 0x00 on reset */ |
| 291 | 291 | AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_SHARE("nvram") |
| 292 | 292 | AM_RANGE(0xffc000, 0xffffff) AM_RAM |
| r14896 | r14897 | |
| 301 | 301 | AM_RANGE(0x104000, 0x10400b) AM_WRITE(sderby_scroll_w) |
| 302 | 302 | AM_RANGE(0x10400c, 0x10400d) AM_WRITENOP /* ??? - check code at 0x000456 (executed once at startup) */ |
| 303 | 303 | AM_RANGE(0x10400e, 0x10400f) AM_WRITENOP /* ??? - check code at 0x000524 (executed once at startup) */ |
| 304 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(m_spriteram | |
| 304 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 305 | 305 | AM_RANGE(0x308000, 0x30800d) AM_READ(sderby_input_r) |
| 306 | 306 | AM_RANGE(0x308008, 0x308009) AM_WRITE(sderby_out_w) /* output port */ |
| 307 | 307 | AM_RANGE(0x30800e, 0x30800f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 308 | AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram | |
| 308 | AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram | |
| 309 | 309 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* unknown... write 0x01 in game, and 0x00 on reset */ |
| 310 | 310 | AM_RANGE(0xe00000, 0xe007ff) AM_RAM AM_SHARE("nvram") |
| 311 | 311 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| r14896 | r14897 | |
| 324 | 324 | AM_RANGE(0x308000, 0x30800d) AM_READ(sderby_input_r) |
| 325 | 325 | AM_RANGE(0x308008, 0x308009) AM_WRITE(scmatto_out_w) /* output port */ |
| 326 | 326 | AM_RANGE(0x30800e, 0x30800f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 327 | AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram | |
| 327 | AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram | |
| 328 | 328 | AM_RANGE(0xd00000, 0xd001ff) AM_RAM |
| 329 | AM_RANGE(0x800000, 0x800fff) AM_RAM AM_BASE(m_spriteram | |
| 329 | AM_RANGE(0x800000, 0x800fff) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 330 | 330 | AM_RANGE(0x801000, 0x80100d) AM_WRITENOP /* unknown */ |
| 331 | 331 | AM_RANGE(0x8f0000, 0x8f07ff) AM_RAM AM_SHARE("nvram") /* 16K Dallas DS1220Y-200 NVRAM */ |
| 332 | 332 | AM_RANGE(0x8fc000, 0x8fffff) AM_RAM |
| r14896 | r14897 | |
| 334 | 334 | |
| 335 | 335 | static ADDRESS_MAP_START( roulette_map, AS_PROGRAM, 16, sderby_state ) |
| 336 | 336 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 337 | AM_RANGE(0x440000, 0x440fff) AM_WRITEONLY AM_BASE(m_spriteram | |
| 337 | AM_RANGE(0x440000, 0x440fff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, | |
| 338 | 338 | AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(sderby_videoram_w) AM_BASE(m_videoram) /* bg */ |
| 339 | 339 | AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(sderby_md_videoram_w) AM_BASE(m_md_videoram) /* mid */ |
| 340 | 340 | AM_RANGE(0x502000, 0x503fff) AM_RAM_WRITE(sderby_fg_videoram_w) AM_BASE(m_fg_videoram) /* fg */ |
| r14896 | r14897 | |
| 346 | 346 | AM_RANGE(0x70800a, 0x70800b) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 347 | 347 | AM_RANGE(0x70800c, 0x70800d) AM_WRITENOP /* watchdog?? (0x0003) */ |
| 348 | 348 | AM_RANGE(0x70800e, 0x70800f) AM_READWRITE(rprot_r, rprot_w) /* MCU communication */ |
| 349 | AM_RANGE(0x780000, 0x780fff) AM_WRITE(paletteram | |
| 349 | AM_RANGE(0x780000, 0x780fff) AM_WRITE(paletteram | |
| 350 | 350 | |
| 351 | 351 | AM_RANGE(0xff0000, 0xff07ff) AM_RAM AM_SHARE("nvram") |
| 352 | 352 | AM_RANGE(0xffc000, 0xffffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 94 | 94 | { |
| 95 | 95 | public: |
| 96 | 96 | vcombat_state(const machine_config &mconfig, device_type type, const char *tag) |
| 97 | : driver_device(mconfig, type, tag) { } | |
| 97 | : driver_device(mconfig, type, tag) , | |
| 98 | m_vid_0_shared_RAM(*this, "vid_0_shared_RAM"), | |
| 99 | m_vid_1_shared_RAM(*this, "vid_1_shared_RAM"), | |
| 100 | m_framebuffer_ctrl(*this, "framebuffer_ctrl"){ } | |
| 98 | 101 | |
| 99 | 102 | UINT16* m_m68k_framebuffer[2]; |
| 100 | 103 | UINT16* m_i860_framebuffer[2][2]; |
| 101 | UINT16* m_framebuffer_ctrl; | |
| 102 | UINT16* m_vid_0_shared_RAM; | |
| 103 | UINT16* m_vid_1_shared_RAM; | |
| 104 | required_shared_ptr<UINT16> m_vid_0_shared_RAM; | |
| 105 | required_shared_ptr<UINT16> m_vid_1_shared_RAM; | |
| 106 | required_shared_ptr<UINT16> m_framebuffer_ctrl; | |
| 104 | 107 | int m_crtc_select; |
| 105 | 108 | DECLARE_WRITE16_MEMBER(main_video_write); |
| 106 | 109 | DECLARE_READ16_MEMBER(control_1_r); |
| r14896 | r14897 | |
| 329 | 332 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 330 | 333 | AM_RANGE(0x300000, 0x30ffff) AM_WRITE(main_video_write) |
| 331 | 334 | |
| 332 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_ | |
| 335 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_ | |
| 333 | 336 | AM_RANGE(0x440000, 0x440003) AM_RAM AM_SHARE("share6") /* M0->P0 i860 #1 com 1 */ |
| 334 | 337 | AM_RANGE(0x480000, 0x480003) AM_RAM AM_SHARE("share7") /* M0<-P0 i860 #1 com 2 */ |
| 335 | 338 | AM_RANGE(0x4c0000, 0x4c0003) AM_WRITE(wiggle_i860p0_pins_w) /* i860 #1 stop/start/reset */ |
| 336 | 339 | |
| 337 | AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_ | |
| 340 | AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_ | |
| 338 | 341 | AM_RANGE(0x540000, 0x540003) AM_RAM AM_SHARE("share8") /* M0->P1 i860 #2 com 1 */ |
| 339 | 342 | AM_RANGE(0x580000, 0x580003) AM_RAM AM_SHARE("share9") /* M0<-P1 i860 #2 com 2 */ |
| 340 | 343 | AM_RANGE(0x5c0000, 0x5c0003) AM_WRITE(wiggle_i860p1_pins_w) /* i860 #2 stop/start/reset */ |
| r14896 | r14897 | |
| 345 | 348 | AM_RANGE(0x60001c, 0x60001d) AM_NOP |
| 346 | 349 | |
| 347 | 350 | AM_RANGE(0x60000c, 0x60000d) AM_WRITE(crtc_w) |
| 348 | AM_RANGE(0x600010, 0x600011) AM_RAM AM_ | |
| 351 | AM_RANGE(0x600010, 0x600011) AM_RAM AM_ | |
| 349 | 352 | AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("nvram") |
| 350 | 353 | AM_RANGE(0x701000, 0x701001) AM_READ(main_irqiack_r) |
| 351 | 354 | AM_RANGE(0x702000, 0x702001) AM_READ(control_3_r) |
| r14896 | r14897 | |
| 415 | 418 | vcombat_state *state = machine.driver_data<vcombat_state>(); |
| 416 | 419 | if (address >= 0xfffc0000 && address <= 0xffffffff) |
| 417 | 420 | { |
| 418 | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_0_shared_RAM); | |
| 421 | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_0_shared_RAM.target()); | |
| 419 | 422 | return ~0; |
| 420 | 423 | } |
| 421 | 424 | return address; |
| r14896 | r14897 | |
| 426 | 429 | vcombat_state *state = machine.driver_data<vcombat_state>(); |
| 427 | 430 | if (address >= 0xfffc0000 && address <= 0xffffffff) |
| 428 | 431 | { |
| 429 | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_1_shared_RAM); | |
| 432 | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_1_shared_RAM.target()); | |
| 430 | 433 | return ~0; |
| 431 | 434 | } |
| 432 | 435 | return address; |
| r14896 | r14897 | |
|---|---|---|
| 109 | 109 | { |
| 110 | 110 | if (ACCESSING_BITS_0_7) |
| 111 | 111 | { |
| 112 | soundlatch_w(space, 0, data & 0xff); | |
| 112 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 113 | 113 | cputag_set_input_line_and_vector(machine(), "audiocpu", 0, HOLD_LINE, 0xff); /* RST 38h */ |
| 114 | 114 | } |
| 115 | 115 | } |
| r14896 | r14897 | |
| 118 | 118 | |
| 119 | 119 | static ADDRESS_MAP_START( shangha3_map, AS_PROGRAM, 16, shangha3_state ) |
| 120 | 120 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 121 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram | |
| 121 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram | |
| 122 | 122 | AM_RANGE(0x200000, 0x200001) AM_READ_PORT("INPUTS") |
| 123 | 123 | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM") |
| 124 | 124 | AM_RANGE(0x200008, 0x200009) AM_WRITE(shangha3_blitter_go_w) |
| r14896 | r14897 | |
| 136 | 136 | |
| 137 | 137 | static ADDRESS_MAP_START( heberpop_map, AS_PROGRAM, 16, shangha3_state ) |
| 138 | 138 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 139 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram | |
| 139 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram | |
| 140 | 140 | AM_RANGE(0x200000, 0x200001) AM_READ_PORT("INPUTS") |
| 141 | 141 | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM") |
| 142 | 142 | AM_RANGE(0x200004, 0x200005) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 159 | 159 | AM_RANGE(0x10000a, 0x10000b) AM_WRITENOP /* irq ack? */ |
| 160 | 160 | AM_RANGE(0x10000c, 0x10000d) AM_WRITE(blocken_coinctrl_w) |
| 161 | 161 | AM_RANGE(0x10000e, 0x10000f) AM_WRITE(heberpop_sound_command_w) |
| 162 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 162 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 163 | 163 | AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_BASE_SIZE(m_ram, m_ram_size) /* gfx & work ram */ |
| 164 | 164 | AM_RANGE(0x340000, 0x340001) AM_WRITE(shangha3_flipscreen_w) |
| 165 | 165 | AM_RANGE(0x360000, 0x360001) AM_WRITE(shangha3_gfxlist_addr_w) |
| r14896 | r14897 | |
| 176 | 176 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 177 | 177 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym3438_r, ym3438_w) |
| 178 | 178 | AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 179 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) | |
| 179 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) | |
| 180 | 180 | ADDRESS_MAP_END |
| 181 | 181 | |
| 182 | 182 |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | WRITE8_MEMBER(vastar_state::flip_screen_w) |
| 94 | 94 | { |
| 95 | flip_screen_set( | |
| 95 | flip_screen_set( | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | WRITE8_MEMBER(vastar_state::nmi_mask_w) |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | public: |
| 23 | 23 | pkscram_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | : driver_device(mconfig, type, tag) { } | |
| 24 | : driver_device(mconfig, type, tag) , | |
| 25 | m_pkscramble_fgtilemap_ram(*this, "pkscramble_fgtilemap_ram"), | |
| 26 | m_pkscramble_mdtilemap_ram(*this, "pkscramble_mdtilemap_ram"), | |
| 27 | m_pkscramble_bgtilemap_ram(*this, "pkscramble_bgtilemap_ram"){ } | |
| 25 | 28 | |
| 26 | 29 | UINT16 m_out; |
| 27 | 30 | UINT8 m_interrupt_line_active; |
| 28 | UINT16* m_pkscramble_fgtilemap_ram; | |
| 29 | UINT16* m_pkscramble_mdtilemap_ram; | |
| 30 | UINT16* m_pkscramble_bgtilemap_ram; | |
| 31 | required_shared_ptr<UINT16> m_pkscramble_fgtilemap_ram; | |
| 32 | required_shared_ptr<UINT16> m_pkscramble_mdtilemap_ram; | |
| 33 | required_shared_ptr<UINT16> m_pkscramble_bgtilemap_ram; | |
| 31 | 34 | tilemap_t *m_fg_tilemap; |
| 32 | 35 | tilemap_t *m_md_tilemap; |
| 33 | 36 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 43 | 46 | |
| 44 | 47 | WRITE16_MEMBER(pkscram_state::pkscramble_fgtilemap_w) |
| 45 | 48 | { |
| 46 | COMBINE_DATA(&m_pkscramble_fgtilemap_ram[offset]); | |
| 49 | COMBINE_DATA(&m_pkscramble_fgtilemap_ram.target()[offset]); | |
| 47 | 50 | m_fg_tilemap->mark_tile_dirty(offset >> 1); |
| 48 | 51 | } |
| 49 | 52 | |
| 50 | 53 | WRITE16_MEMBER(pkscram_state::pkscramble_mdtilemap_w) |
| 51 | 54 | { |
| 52 | COMBINE_DATA(&m_pkscramble_mdtilemap_ram[offset]); | |
| 55 | COMBINE_DATA(&m_pkscramble_mdtilemap_ram.target()[offset]); | |
| 53 | 56 | m_md_tilemap->mark_tile_dirty(offset >> 1); |
| 54 | 57 | } |
| 55 | 58 | |
| 56 | 59 | WRITE16_MEMBER(pkscram_state::pkscramble_bgtilemap_w) |
| 57 | 60 | { |
| 58 | COMBINE_DATA(&m_pkscramble_bgtilemap_ram[offset]); | |
| 61 | COMBINE_DATA(&m_pkscramble_bgtilemap_ram.target()[offset]); | |
| 59 | 62 | m_bg_tilemap->mark_tile_dirty(offset >> 1); |
| 60 | 63 | } |
| 61 | 64 | |
| r14896 | r14897 | |
| 99 | 102 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 100 | 103 | AM_RANGE(0x040000, 0x0400ff) AM_RAM AM_SHARE("nvram") |
| 101 | 104 | AM_RANGE(0x041000, 0x043fff) AM_RAM // main ram |
| 102 | AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(pkscramble_fgtilemap_w) AM_BASE(m_pkscramble_fgtilemap_ram) // fg tilemap | |
| 103 | AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(pkscramble_mdtilemap_w) AM_BASE(m_pkscramble_mdtilemap_ram) // md tilemap (just a copy of fg?) | |
| 104 | AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_BASE(m_pkscramble_bgtilemap_ram) // bg tilemap | |
| 105 | AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(pkscramble_fgtilemap_w) AM_SHARE("pkscramble_fgtilemap_ram") // fg tilemap | |
| 106 | AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(pkscramble_mdtilemap_w) AM_SHARE("pkscramble_mdtilemap_ram") // md tilemap (just a copy of fg?) | |
| 107 | AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_SHARE("pkscramble_bgtilemap_ram") // bg tilemap | |
| 105 | 108 | AM_RANGE(0x047000, 0x047fff) AM_RAM // unused |
| 106 | AM_RANGE(0x048000, 0x048fff) AM_RAM_WRITE(paletteram | |
| 109 | AM_RANGE(0x048000, 0x048fff) AM_RAM_WRITE(paletteram | |
| 107 | 110 | AM_RANGE(0x049000, 0x049001) AM_READ_PORT("DSW") |
| 108 | 111 | AM_RANGE(0x049004, 0x049005) AM_READ_PORT("INPUTS") |
| 109 | 112 | AM_RANGE(0x049008, 0x049009) AM_WRITE(pkscramble_output_w) |
| r14896 | r14897 | |
| 184 | 187 | static TILE_GET_INFO( get_bg_tile_info ) |
| 185 | 188 | { |
| 186 | 189 | pkscram_state *state = machine.driver_data<pkscram_state>(); |
| 187 | int tile = state->m_pkscramble_bgtilemap_ram[tile_index*2]; | |
| 188 | int color = state->m_pkscramble_bgtilemap_ram[tile_index*2 + 1] & 0x7f; | |
| 190 | int tile = state->m_pkscramble_bgtilemap_ram.target()[tile_index*2]; | |
| 191 | int color = state->m_pkscramble_bgtilemap_ram.target()[tile_index*2 + 1] & 0x7f; | |
| 189 | 192 | |
| 190 | 193 | SET_TILE_INFO(0,tile,color,0); |
| 191 | 194 | } |
| r14896 | r14897 | |
| 193 | 196 | static TILE_GET_INFO( get_md_tile_info ) |
| 194 | 197 | { |
| 195 | 198 | pkscram_state *state = machine.driver_data<pkscram_state>(); |
| 196 | int tile = state->m_pkscramble_mdtilemap_ram[tile_index*2]; | |
| 197 | int color = state->m_pkscramble_mdtilemap_ram[tile_index*2 + 1] & 0x7f; | |
| 199 | int tile = state->m_pkscramble_mdtilemap_ram.target()[tile_index*2]; | |
| 200 | int color = state->m_pkscramble_mdtilemap_ram.target()[tile_index*2 + 1] & 0x7f; | |
| 198 | 201 | |
| 199 | 202 | SET_TILE_INFO(0,tile,color,0); |
| 200 | 203 | } |
| r14896 | r14897 | |
| 202 | 205 | static TILE_GET_INFO( get_fg_tile_info ) |
| 203 | 206 | { |
| 204 | 207 | pkscram_state *state = machine.driver_data<pkscram_state>(); |
| 205 | int tile = state->m_pkscramble_fgtilemap_ram[tile_index*2]; | |
| 206 | int color = state->m_pkscramble_fgtilemap_ram[tile_index*2 + 1] & 0x7f; | |
| 208 | int tile = state->m_pkscramble_fgtilemap_ram.target()[tile_index*2]; | |
| 209 | int color = state->m_pkscramble_fgtilemap_ram.target()[tile_index*2 + 1] & 0x7f; | |
| 207 | 210 | |
| 208 | 211 | SET_TILE_INFO(0,tile,color,0); |
| 209 | 212 | } |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | public: |
| 33 | 33 | _39in1_state(const machine_config &mconfig, device_type type, const char *tag) |
| 34 | : driver_device(mconfig, type, tag) { } | |
| 34 | : driver_device(mconfig, type, tag) , | |
| 35 | m_ram(*this, "ram"){ } | |
| 35 | 36 | |
| 36 | 37 | UINT32 m_seed; |
| 37 | 38 | UINT32 m_magic; |
| 38 | 39 | UINT32 m_state; |
| 39 | 40 | |
| 40 | UINT32 | |
| 41 | required_shared_ptr<UINT32> m_ram; | |
| 41 | 42 | |
| 42 | 43 | PXA255_DMA_Regs m_dma_regs; |
| 43 | 44 | PXA255_I2S_Regs m_i2s_regs; |
| r14896 | r14897 | |
| 1476 | 1477 | AM_RANGE(0x40d00000, 0x40d00017) AM_READWRITE(pxa255_intc_r, pxa255_intc_w ) |
| 1477 | 1478 | AM_RANGE(0x40e00000, 0x40e0006b) AM_READWRITE(pxa255_gpio_r, pxa255_gpio_w ) |
| 1478 | 1479 | AM_RANGE(0x44000000, 0x4400021f) AM_READWRITE(pxa255_lcd_r, pxa255_lcd_w ) |
| 1479 | AM_RANGE(0xa0000000, 0xa07fffff) AM_RAM AM_ | |
| 1480 | AM_RANGE(0xa0000000, 0xa07fffff) AM_RAM AM_ | |
| 1480 | 1481 | ADDRESS_MAP_END |
| 1481 | 1482 | |
| 1482 | 1483 | static INPUT_PORTS_START( 39in1 ) |
| r14896 | r14897 | |
|---|---|---|
| 330 | 330 | public: |
| 331 | 331 | fortecar_state(const machine_config &mconfig, device_type type, const char *tag) |
| 332 | 332 | : driver_device(mconfig, type, tag), |
| 333 | m_maincpu(*this,"maincpu") | |
| 334 | { } | |
| 333 | m_maincpu(*this,"maincpu"), | |
| 334 | m_vram(*this, "vram"){ } | |
| 335 | 335 | |
| 336 | UINT8 *m_vram; | |
| 337 | size_t m_vram_size; | |
| 338 | ||
| 339 | 336 | required_device<cpu_device> m_maincpu; |
| 337 | required_shared_ptr<UINT8> m_vram; | |
| 340 | 338 | }; |
| 341 | 339 | |
| 342 | 340 | |
| r14896 | r14897 | |
| 356 | 354 | { |
| 357 | 355 | int tile,color,bpp; |
| 358 | 356 | |
| 359 | tile = (state->m_vram[(count*4)+1] | (state->m_vram[(count*4)+2]<<8)) & 0xfff; | |
| 360 | color = state->m_vram[(count*4)+3] & 0x1f; | |
| 361 | bpp = (state->m_vram[(count*4)+3] & 0x20) >> 5; | |
| 357 | tile = (state->m_vram.target()[(count*4)+1] | (state->m_vram.target()[(count*4)+2]<<8)) & 0xfff; | |
| 358 | color = state->m_vram.target()[(count*4)+3] & 0x1f; | |
| 359 | bpp = (state->m_vram.target()[(count*4)+3] & 0x20) >> 5; | |
| 362 | 360 | |
| 363 | 361 | if(bpp) |
| 364 | 362 | color&=0x3; |
| r14896 | r14897 | |
| 562 | 560 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 563 | 561 | AM_RANGE(0xc000, 0xc7ff) AM_ROM |
| 564 | 562 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("nvram") |
| 565 | AM_RANGE(0xd800, 0xffff) AM_RAM AM_ | |
| 563 | AM_RANGE(0xd800, 0xffff) AM_RAM AM_ | |
| 566 | 564 | ADDRESS_MAP_END |
| 567 | 565 | |
| 568 | 566 | static ADDRESS_MAP_START( fortecar_ports, AS_IO, 8, fortecar_state ) |
| r14896 | r14897 | |
| 674 | 672 | int i; |
| 675 | 673 | |
| 676 | 674 | /* apparently there's a random fill in there (checked thru trojan TODO: extract proper algorythm) */ |
| 677 | for(i=0;i<state->m_vram_size;i++) | |
| 678 | state->m_vram[i] = machine.rand(); | |
| 675 | for(i=0;i<state->m_vram.bytes();i++) | |
| 676 | state->m_vram.target()[i] = machine.rand(); | |
| 679 | 677 | } |
| 680 | 678 | |
| 681 | 679 |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | public: |
| 34 | 34 | superwng_state(const machine_config &mconfig, device_type type, const char *tag) |
| 35 | : driver_device(mconfig, type, tag) { } | |
| 35 | : driver_device(mconfig, type, tag) , | |
| 36 | m_videoram_bg(*this, "videorabg"), | |
| 37 | m_videoram_fg(*this, "videorafg"), | |
| 38 | m_colorram_bg(*this, "colorrabg"), | |
| 39 | m_colorram_fg(*this, "colorrafg"){ } | |
| 36 | 40 | |
| 37 | UINT8 * m_videoram_bg; | |
| 38 | UINT8 * m_colorram_bg; | |
| 39 | UINT8 * m_videoram_fg; | |
| 40 | UINT8 * m_colorram_fg; | |
| 41 | required_shared_ptr<UINT8> m_videoram_bg; | |
| 42 | required_shared_ptr<UINT8> m_videoram_fg; | |
| 43 | required_shared_ptr<UINT8> m_colorram_bg; | |
| 44 | required_shared_ptr<UINT8> m_colorram_fg; | |
| 41 | 45 | |
| 42 | 46 | int m_tile_bank; |
| 43 | 47 | |
| r14896 | r14897 | |
| 68 | 72 | static TILE_GET_INFO( get_bg_tile_info ) |
| 69 | 73 | { |
| 70 | 74 | superwng_state *state = machine.driver_data<superwng_state>(); |
| 71 | int code = state->m_videoram_bg[tile_index]; | |
| 72 | int attr = state->m_colorram_bg[tile_index]; | |
| 75 | int code = state->m_videoram_bg.target()[tile_index]; | |
| 76 | int attr = state->m_colorram_bg.target()[tile_index]; | |
| 73 | 77 | |
| 74 | 78 | code= (code&0x7f) | ((attr&0x40)<<1) | ((code&0x80)<<1); |
| 75 | 79 | code|=state->m_tile_bank?0x200:0; |
| r14896 | r14897 | |
| 83 | 87 | static TILE_GET_INFO( get_fg_tile_info ) |
| 84 | 88 | { |
| 85 | 89 | superwng_state *state = machine.driver_data<superwng_state>(); |
| 86 | int code = state->m_videoram_fg[tile_index]; | |
| 87 | int attr = state->m_colorram_fg[tile_index]; | |
| 90 | int code = state->m_videoram_fg.target()[tile_index]; | |
| 91 | int attr = state->m_colorram_fg.target()[tile_index]; | |
| 88 | 92 | |
| 89 | 93 | code= (code&0x7f) | ((attr&0x40)<<1) | ((code&0x80)<<1); |
| 90 | 94 | |
| r14896 | r14897 | |
| 98 | 102 | |
| 99 | 103 | WRITE8_MEMBER(superwng_state::superwng_flip_screen_x_w) |
| 100 | 104 | { |
| 101 | flip_screen_x_set( | |
| 105 | flip_screen_x_set( | |
| 102 | 106 | } |
| 103 | 107 | |
| 104 | 108 | WRITE8_MEMBER(superwng_state::superwng_flip_screen_y_w) |
| 105 | 109 | { |
| 106 | flip_screen_y_set( | |
| 110 | flip_screen_y_set( | |
| 107 | 111 | } |
| 108 | 112 | |
| 109 | 113 | static VIDEO_START( superwng ) |
| r14896 | r14897 | |
| 118 | 122 | static SCREEN_UPDATE_IND16( superwng ) |
| 119 | 123 | { |
| 120 | 124 | superwng_state *state = screen.machine().driver_data<superwng_state>(); |
| 121 | int flip=flip_screen | |
| 125 | int flip=state->flip_screen | |
| 122 | 126 | |
| 123 | 127 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 124 | 128 | rectangle tmp=cliprect; |
| r14896 | r14897 | |
| 139 | 143 | |
| 140 | 144 | for(int i=0x3e; i>=0; i-=2) |
| 141 | 145 | { |
| 142 | int code=(state->m_videoram_bg[i]>>2)+0x40; | |
| 143 | int sx=256-state->m_videoram_bg[i+1]-8; | |
| 144 | int sy = state->m_colorram_bg[i]+8; | |
| 145 | int attr = state->m_colorram_bg[i+1]; | |
| 146 | int code=(state->m_videoram_bg.target()[i]>>2)+0x40; | |
| 147 | int sx=256-state->m_videoram_bg.target()[i+1]-8; | |
| 148 | int sy = state->m_colorram_bg.target()[i]+8; | |
| 149 | int attr = state->m_colorram_bg.target()[i+1]; | |
| 146 | 150 | |
| 147 | 151 | if (flip) |
| 148 | 152 | { |
| r14896 | r14897 | |
| 150 | 154 | sx-=8; |
| 151 | 155 | } |
| 152 | 156 | |
| 153 | if(state->m_videoram_bg[i+1] | state->m_colorram_bg[i]) | |
| 157 | if(state->m_videoram_bg.target()[i+1] | state->m_colorram_bg.target()[i]) | |
| 154 | 158 | { |
| 155 | 159 | |
| 156 | 160 | drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[1], |
| r14896 | r14897 | |
| 242 | 246 | |
| 243 | 247 | WRITE8_MEMBER(superwng_state::superwng_bg_vram_w) |
| 244 | 248 | { |
| 245 | m_videoram_bg[offset] = data; | |
| 249 | m_videoram_bg.target()[offset] = data; | |
| 246 | 250 | m_bg_tilemap->mark_tile_dirty(offset); |
| 247 | 251 | } |
| 248 | 252 | |
| 249 | 253 | WRITE8_MEMBER(superwng_state::superwng_bg_cram_w) |
| 250 | 254 | { |
| 251 | m_colorram_bg[offset] = data; | |
| 255 | m_colorram_bg.target()[offset] = data; | |
| 252 | 256 | m_bg_tilemap->mark_tile_dirty(offset); |
| 253 | 257 | } |
| 254 | 258 | |
| 255 | 259 | WRITE8_MEMBER(superwng_state::superwng_fg_vram_w) |
| 256 | 260 | { |
| 257 | m_videoram_fg[offset] = data; | |
| 261 | m_videoram_fg.target()[offset] = data; | |
| 258 | 262 | m_fg_tilemap->mark_tile_dirty(offset); |
| 259 | 263 | } |
| 260 | 264 | |
| 261 | 265 | WRITE8_MEMBER(superwng_state::superwng_fg_cram_w) |
| 262 | 266 | { |
| 263 | m_colorram_fg[offset] = data; | |
| 267 | m_colorram_fg.target()[offset] = data; | |
| 264 | 268 | m_fg_tilemap->mark_tile_dirty(offset); |
| 265 | 269 | } |
| 266 | 270 | |
| r14896 | r14897 | |
| 273 | 277 | |
| 274 | 278 | WRITE8_MEMBER(superwng_state::superwng_flip_screen_w) |
| 275 | 279 | { |
| 276 | flip_screen_set( | |
| 280 | flip_screen_set( | |
| 277 | 281 | m_bg_tilemap->mark_all_dirty(); |
| 278 | 282 | m_fg_tilemap->mark_all_dirty(); |
| 279 | 283 | } |
| r14896 | r14897 | |
| 291 | 295 | static ADDRESS_MAP_START( superwng_map, AS_PROGRAM, 8, superwng_state ) |
| 292 | 296 | AM_RANGE(0x0000, 0x6fff) AM_ROM |
| 293 | 297 | AM_RANGE(0x7000, 0x7fff) AM_RAM |
| 294 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(superwng_bg_vram_w) AM_BASE(m_videoram_bg) | |
| 295 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(superwng_fg_vram_w) AM_BASE(m_videoram_fg) | |
| 296 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(superwng_bg_cram_w) AM_BASE(m_colorram_bg) | |
| 297 | AM_RANGE(0x8c00, 0x8fff) AM_RAM_WRITE(superwng_fg_cram_w) AM_BASE(m_colorram_fg) | |
| 298 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(superwng_bg_vram_w) AM_SHARE("videorabg") | |
| 299 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(superwng_fg_vram_w) AM_SHARE("videorafg") | |
| 300 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(superwng_bg_cram_w) AM_SHARE("colorrabg") | |
| 301 | AM_RANGE(0x8c00, 0x8fff) AM_RAM_WRITE(superwng_fg_cram_w) AM_SHARE("colorrafg") | |
| 298 | 302 | AM_RANGE(0x9800, 0x99ff) AM_RAM //collision map |
| 299 | 303 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("P1") |
| 300 | 304 | AM_RANGE(0xa000, 0xa000) AM_WRITENOP //unknown |
| r14896 | r14897 | |
|---|---|---|
| 79 | 79 | { |
| 80 | 80 | public: |
| 81 | 81 | cyclemb_state(const machine_config &mconfig, device_type type, const char *tag) |
| 82 | : driver_device(mconfig, type, tag) { } | |
| 82 | : driver_device(mconfig, type, tag) , | |
| 83 | m_vram(*this, "vram"), | |
| 84 | m_cram(*this, "cram"), | |
| 85 | m_obj1_ram(*this, "obj1_ram"), | |
| 86 | m_obj2_ram(*this, "obj2_ram"), | |
| 87 | m_obj3_ram(*this, "obj3_ram"){ } | |
| 83 | 88 | |
| 84 | UINT8 *m_vram; | |
| 85 | UINT8 *m_cram; | |
| 86 | UINT8 *m_obj1_ram; | |
| 87 | UINT8 *m_obj2_ram; | |
| 88 | UINT8 *m_obj3_ram; | |
| 89 | required_shared_ptr<UINT8> m_vram; | |
| 90 | required_shared_ptr<UINT8> m_cram; | |
| 91 | required_shared_ptr<UINT8> m_obj1_ram; | |
| 92 | required_shared_ptr<UINT8> m_obj2_ram; | |
| 93 | required_shared_ptr<UINT8> m_obj3_ram; | |
| 89 | 94 | DECLARE_WRITE8_MEMBER(cyclemb_bankswitch_w); |
| 90 | 95 | DECLARE_READ8_MEMBER(mcu_status_r); |
| 91 | 96 | DECLARE_WRITE8_MEMBER(sound_cmd_w); |
| r14896 | r14897 | |
| 130 | 135 | cyclemb_state *state = screen.machine().driver_data<cyclemb_state>(); |
| 131 | 136 | int x,y,count; |
| 132 | 137 | const gfx_element *gfx = screen.machine().gfx[0]; |
| 133 | UINT8 flip_screen = flip_screen | |
| 138 | UINT8 flip_screen = state->flip_screen | |
| 134 | 139 | |
| 135 | 140 | count = 0; |
| 136 | 141 | |
| r14896 | r14897 | |
| 138 | 143 | { |
| 139 | 144 | for (x=0;x<64;x++) |
| 140 | 145 | { |
| 141 | int attr = state->m_cram[count]; | |
| 142 | int tile = (state->m_vram[count]) | ((attr & 3)<<8); | |
| 146 | int attr = state->m_cram.target()[count]; | |
| 147 | int tile = (state->m_vram.target()[count]) | ((attr & 3)<<8); | |
| 143 | 148 | int color = ((attr & 0xf8) >> 3) ^ 0x1f; |
| 144 | 149 | int odd_line = y & 1 ? 0x40 : 0x00; |
| 145 | 150 | // int sx_offs = flip_screen ? 512 : 0 |
| 146 | int scrollx = ((state->m_vram[(y/2)+odd_line]) + (state->m_cram[(y/2)+odd_line]<<8) + 48) & 0x1ff; | |
| 151 | int scrollx = ((state->m_vram.target()[(y/2)+odd_line]) + (state->m_cram.target()[(y/2)+odd_line]<<8) + 48) & 0x1ff; | |
| 147 | 152 | |
| 148 | 153 | if(flip_screen) |
| 149 | 154 | { |
| r14896 | r14897 | |
| 188 | 193 | |
| 189 | 194 | for(i=0;i<0x40;i+=2) |
| 190 | 195 | { |
| 191 | y = 0xf1 - state->m_obj2_ram[i]; | |
| 192 | x = state->m_obj2_ram[i+1] - 56; | |
| 193 | spr_offs = (state->m_obj1_ram[i+0]); | |
| 194 | col = (state->m_obj1_ram[i+1] & 0x3f); | |
| 195 | region = ((state->m_obj3_ram[i] & 0x10) >> 4) + 1; | |
| 196 | y = 0xf1 - state->m_obj2_ram.target()[i]; | |
| 197 | x = state->m_obj2_ram.target()[i+1] - 56; | |
| 198 | spr_offs = (state->m_obj1_ram.target()[i+0]); | |
| 199 | col = (state->m_obj1_ram.target()[i+1] & 0x3f); | |
| 200 | region = ((state->m_obj3_ram.target()[i] & 0x10) >> 4) + 1; | |
| 196 | 201 | if(region == 2) |
| 197 | 202 | { |
| 198 | 203 | spr_offs >>= 2; |
| 199 | spr_offs += ((state->m_obj3_ram[i+0] & 3) << 5); | |
| 204 | spr_offs += ((state->m_obj3_ram.target()[i+0] & 3) << 5); | |
| 200 | 205 | y-=16; |
| 201 | 206 | } |
| 202 | 207 | |
| 203 | if(state->m_obj3_ram[i+1] & 1) | |
| 208 | if(state->m_obj3_ram.target()[i+1] & 1) | |
| 204 | 209 | x+=256; |
| 205 | //if(state->m_obj3_ram[i+1] & 2) | |
| 210 | //if(state->m_obj3_ram.target()[i+1] & 2) | |
| 206 | 211 | // x-=256; |
| 207 | fx = (state->m_obj3_ram[i+0] & 4) >> 2; | |
| 208 | fy = (state->m_obj3_ram[i+0] & 8) >> 3; | |
| 212 | fx = (state->m_obj3_ram.target()[i+0] & 4) >> 2; | |
| 213 | fy = (state->m_obj3_ram.target()[i+0] & 8) >> 3; | |
| 209 | 214 | |
| 210 | 215 | if(flip_screen) |
| 211 | 216 | { |
| r14896 | r14897 | |
| 227 | 232 | #if 0 |
| 228 | 233 | WRITE8_MEMBER(cyclemb_state::sound_cmd_w) |
| 229 | 234 | { |
| 230 | soundlatch_w(space, 0, data & 0xff); | |
| 235 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 231 | 236 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 232 | 237 | } |
| 233 | 238 | #endif |
| r14896 | r14897 | |
| 241 | 246 | |
| 242 | 247 | WRITE8_MEMBER(cyclemb_state::sound_cmd_w)//actually ciom |
| 243 | 248 | { |
| 244 | soundlatch_w(space, 0, data & 0xff); | |
| 249 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 245 | 250 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 246 | 251 | } |
| 247 | 252 | #endif |
| 248 | 253 | |
| 249 | 254 | WRITE8_MEMBER(cyclemb_state::cyclemb_flip_w) |
| 250 | 255 | { |
| 251 | flip_screen_set( | |
| 256 | flip_screen_set( | |
| 252 | 257 | |
| 253 | 258 | // a bunch of other things are setted here |
| 254 | 259 | } |
| r14896 | r14897 | |
| 256 | 261 | static ADDRESS_MAP_START( cyclemb_map, AS_PROGRAM, 8, cyclemb_state ) |
| 257 | 262 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 258 | 263 | AM_RANGE(0x8000, 0x8fff) AM_ROMBANK("bank1") |
| 259 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_BASE(m_vram) | |
| 260 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_BASE(m_cram) | |
| 261 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(m_obj1_ram) //ORAM1 (only a000-a3ff tested) | |
| 262 | AM_RANGE(0xa800, 0xafff) AM_RAM AM_BASE(m_obj2_ram) //ORAM2 (only a800-abff tested) | |
| 263 | AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_BASE(m_obj3_ram) //ORAM3 (only b000-b3ff tested) | |
| 264 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_SHARE("vram") | |
| 265 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_SHARE("cram") | |
| 266 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE("obj1_ram") //ORAM1 (only a000-a3ff tested) | |
| 267 | AM_RANGE(0xa800, 0xafff) AM_RAM AM_SHARE("obj2_ram") //ORAM2 (only a800-abff tested) | |
| 268 | AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_SHARE("obj3_ram") //ORAM3 (only b000-b3ff tested) | |
| 264 | 269 | AM_RANGE(0xb800, 0xbfff) AM_RAM //WRAM |
| 265 | 270 | ADDRESS_MAP_END |
| 266 | 271 | |
| r14896 | r14897 | |
| 280 | 285 | static ADDRESS_MAP_START( cyclemb_sound_io, AS_IO, 8, cyclemb_state ) |
| 281 | 286 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 282 | 287 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_address_data_w) |
| 283 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_r) AM_WRITE(soundlatch2_w) | |
| 288 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r) AM_WRITE(soundlatch2_byte_w) | |
| 284 | 289 | ADDRESS_MAP_END |
| 285 | 290 | |
| 286 | 291 | static MACHINE_RESET( cyclemb ) |
| r14896 | r14897 | |
|---|---|---|
| 447 | 447 | { |
| 448 | 448 | public: |
| 449 | 449 | bingor_state(const machine_config &mconfig, device_type type, const char *tag) |
| 450 | : driver_device(mconfig, type, tag) { } | |
| 450 | : driver_device(mconfig, type, tag) , | |
| 451 | m_blit_ram(*this, "blit_ram"){ } | |
| 451 | 452 | |
| 452 | UINT16 | |
| 453 | required_shared_ptr<UINT16> | |
| 453 | 454 | DECLARE_READ16_MEMBER(test_r); |
| 454 | 455 | DECLARE_READ8_MEMBER(test8_r); |
| 455 | 456 | }; |
| r14896 | r14897 | |
| 474 | 475 | { |
| 475 | 476 | UINT32 color; |
| 476 | 477 | |
| 477 | color = (state->m_blit_ram[count] & 0xf000)>>12; | |
| 478 | color = (state->m_blit_ram.target()[count] & 0xf000)>>12; | |
| 478 | 479 | |
| 479 | 480 | if(cliprect.contains(x+3, y)) |
| 480 | 481 | bitmap.pix32(y, x+3) = screen.machine().pens[color]; |
| 481 | 482 | |
| 482 | color = (state->m_blit_ram[count] & 0x0f00)>>8; | |
| 483 | color = (state->m_blit_ram.target()[count] & 0x0f00)>>8; | |
| 483 | 484 | |
| 484 | 485 | if(cliprect.contains(x+2, y)) |
| 485 | 486 | bitmap.pix32(y, x+2) = screen.machine().pens[color]; |
| 486 | 487 | |
| 487 | color = (state->m_blit_ram[count] & 0x00f0)>>4; | |
| 488 | color = (state->m_blit_ram.target()[count] & 0x00f0)>>4; | |
| 488 | 489 | |
| 489 | 490 | if(cliprect.contains(x+1, y)) |
| 490 | 491 | bitmap.pix32(y, x+1) = screen.machine().pens[color]; |
| 491 | 492 | |
| 492 | color = (state->m_blit_ram[count] & 0x000f)>>0; | |
| 493 | color = (state->m_blit_ram.target()[count] & 0x000f)>>0; | |
| 493 | 494 | |
| 494 | 495 | if(cliprect.contains(x+0, y)) |
| 495 | 496 | bitmap.pix32(y, x+0) = screen.machine().pens[color]; |
| r14896 | r14897 | |
| 511 | 512 | static ADDRESS_MAP_START( bingor_map, AS_PROGRAM, 16, bingor_state ) |
| 512 | 513 | AM_RANGE(0x00000, 0x0ffff) AM_RAM |
| 513 | 514 | AM_RANGE(0x90000, 0x9ffff) AM_ROM AM_REGION("gfx", 0) |
| 514 | AM_RANGE(0xa0300, 0xa031f) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBIIII_word_w) AM_SHARE("paletteram") //wrong | |
| 515 | AM_RANGE(0xa0000, 0xaffff) AM_RAM AM_BASE(m_blit_ram) | |
| 515 | AM_RANGE(0xa0300, 0xa031f) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBIIII_word_w) AM_SHARE("paletteram") //wrong | |
| 516 | AM_RANGE(0xa0000, 0xaffff) AM_RAM AM_SHARE("blit_ram") | |
| 516 | 517 | AM_RANGE(0xe0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0) |
| 517 | 518 | ADDRESS_MAP_END |
| 518 | 519 |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | public: |
| 62 | 62 | beaminv_state(const machine_config &mconfig, device_type type, const char *tag) |
| 63 | : driver_device(mconfig, type, tag) { } | |
| 63 | : driver_device(mconfig, type, tag) , | |
| 64 | m_videoram(*this, "videoram"){ } | |
| 64 | 65 | |
| 65 | 66 | /* memory pointers */ |
| 66 | UINT8 * m_videoram; | |
| 67 | size_t m_videoram_size; | |
| 67 | required_shared_ptr<UINT8> m_videoram; | |
| 68 | 68 | |
| 69 | 69 | /* misc */ |
| 70 | 70 | emu_timer *m_interrupt_timer; |
| r14896 | r14897 | |
| 173 | 173 | beaminv_state *state = screen.machine().driver_data<beaminv_state>(); |
| 174 | 174 | offs_t offs; |
| 175 | 175 | |
| 176 | for (offs = 0; offs < state->m_videoram | |
| 176 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 177 | 177 | { |
| 178 | 178 | int i; |
| 179 | 179 | |
| 180 | 180 | UINT8 y = offs; |
| 181 | 181 | UINT8 x = offs >> 8 << 3; |
| 182 | UINT8 data = state->m_videoram[offs]; | |
| 182 | UINT8 data = state->m_videoram.target()[offs]; | |
| 183 | 183 | |
| 184 | 184 | for (i = 0; i < 8; i++) |
| 185 | 185 | { |
| r14896 | r14897 | |
| 239 | 239 | AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_READ_PORT("INPUTS") |
| 240 | 240 | AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_READ(controller_r) |
| 241 | 241 | AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_READ(v128_r) |
| 242 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 242 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 243 | 243 | ADDRESS_MAP_END |
| 244 | 244 | |
| 245 | 245 |
| r14896 | r14897 | |
|---|---|---|
| 308 | 308 | * |
| 309 | 309 | *************************************/ |
| 310 | 310 | |
| 311 | ||
| 311 | ||
| 312 | 312 | { |
| 313 | 313 | /* This is a kludge; according to the wiring diagram, the player 2 */ |
| 314 | 314 | /* controls are hooked up as documented below. If you go into test */ |
| r14896 | r14897 | |
| 316 | 316 | /* game in cocktail mode, they don't work at all. So we fake-mux */ |
| 317 | 317 | /* the controls through player 1's ports */ |
| 318 | 318 | if (mcr_cocktail_flip) |
| 319 | return input_port_read( | |
| 319 | return input_port_read( | |
| 320 | 320 | else |
| 321 | return ((input_port_read( | |
| 321 | return ((input_port_read( | |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | |
| 325 | ||
| 325 | ||
| 326 | 326 | { |
| 327 | 327 | /* same deal as above */ |
| 328 | 328 | if (mcr_cocktail_flip) |
| 329 | return input_port_read( | |
| 329 | return input_port_read( | |
| 330 | 330 | else |
| 331 | return (input_port_read( | |
| 331 | return (input_port_read( | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | |
| r14896 | r14897 | |
| 339 | 339 | * |
| 340 | 340 | *************************************/ |
| 341 | 341 | |
| 342 | ||
| 342 | ||
| 343 | 343 | { |
| 344 | return (input_port_read( | |
| 344 | return (input_port_read( | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | |
| r14896 | r14897 | |
| 352 | 352 | * |
| 353 | 353 | *************************************/ |
| 354 | 354 | |
| 355 | ||
| 355 | ||
| 356 | 356 | { |
| 357 | 357 | input_mux = data & 1; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
| 361 | ||
| 361 | ||
| 362 | 362 | { |
| 363 | 363 | if (!input_mux) |
| 364 | return input_port_read( | |
| 364 | return input_port_read( | |
| 365 | 365 | else |
| 366 | return input_port_read( | |
| 366 | return input_port_read( | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | |
| 370 | ||
| 370 | ||
| 371 | 371 | { |
| 372 | 372 | if (!input_mux) |
| 373 | return input_port_read( | |
| 373 | return input_port_read( | |
| 374 | 374 | else |
| 375 | return input_port_read( | |
| 375 | return input_port_read( | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| r14896 | r14897 | |
| 383 | 383 | * |
| 384 | 384 | *************************************/ |
| 385 | 385 | |
| 386 | ||
| 386 | ||
| 387 | 387 | { |
| 388 | int dial = input_port_read( | |
| 388 | int dial = input_port_read( | |
| 389 | 389 | return ((dial & 0x80) >> 1) | ((dial & 0x70) >> 4); |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
| 393 | ||
| 393 | ||
| 394 | 394 | { |
| 395 | 395 | /* |
| 396 | 396 | bit 2 = ship control |
| r14896 | r14897 | |
| 407 | 407 | * |
| 408 | 408 | *************************************/ |
| 409 | 409 | |
| 410 | ||
| 410 | ||
| 411 | 411 | { |
| 412 | samples_device *samples = | |
| 412 | samples_device *samples = | |
| 413 | 413 | |
| 414 | 414 | /* if we're not playing the sample yet, start it */ |
| 415 | 415 | if (!samples->playing(0)) |
| r14896 | r14897 | |
| 427 | 427 | * |
| 428 | 428 | *************************************/ |
| 429 | 429 | |
| 430 | ||
| 430 | ||
| 431 | 431 | { |
| 432 | samples_device *samples = | |
| 432 | samples_device *samples = | |
| 433 | 433 | |
| 434 | 434 | for (int i = 0; i < 2; i++) |
| 435 | 435 | { |
| r14896 | r14897 | |
| 453 | 453 | * |
| 454 | 454 | *************************************/ |
| 455 | 455 | |
| 456 | ||
| 456 | ||
| 457 | 457 | { |
| 458 | 458 | /* |
| 459 | 459 | Flasher Control: |
| r14896 | r14897 | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | |
| 537 | ||
| 537 | ||
| 538 | 538 | { |
| 539 | 539 | /* bit 7 = J3-2 on IPU board = TXDA on SIO */ |
| 540 | 540 | UINT8 val = 0x80; |
| r14896 | r14897 | |
| 548 | 548 | nflfoot_serial_in_active = FALSE; |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | if (cpu_get_pc(&space->device()) != 0x107) | |
| 552 | logerror("%04X:ip2_r = %02X\n", cpu_get_pc(&space->device()), val); | |
| 551 | if (cpu_get_pc(&space.device()) != 0x107) | |
| 552 | logerror("%04X:ip2_r = %02X\n", cpu_get_pc(&space.device()), val); | |
| 553 | 553 | return val; |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | |
| 557 | ||
| 557 | ||
| 558 | 558 | { |
| 559 | device_t *sio = | |
| 559 | device_t *sio = | |
| 560 | 560 | |
| 561 | 561 | /* bit 7 = J3-7 on IPU board = /RXDA on SIO */ |
| 562 | logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(&space | |
| 562 | logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(&space. | |
| 563 | 563 | |
| 564 | 564 | /* look for a non-zero start bit to go active */ |
| 565 | 565 | if (!nflfoot_serial_out_active && (data & 0x80)) |
| r14896 | r14897 | |
| 606 | 606 | * |
| 607 | 607 | *************************************/ |
| 608 | 608 | |
| 609 | ||
| 609 | ||
| 610 | 610 | { |
| 611 | return input_port_read(space->machine(), "SSIO.IP1") | | |
| 612 | (input_port_read(space->machine(), input_mux ? "SSIO.IP1.ALT2" : "SSIO.IP1.ALT1") << 2); | |
| 611 | return input_port_read(machine(), "SSIO.IP1") | | |
| 612 | (input_port_read(machine(), input_mux ? "SSIO.IP1.ALT2" : "SSIO.IP1.ALT1") << 2); | |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | |
| 616 | ||
| 616 | ||
| 617 | 617 | { |
| 618 | return input_port_read(space->machine(), "SSIO.IP2") | | |
| 619 | (input_port_read(space->machine(), input_mux ? "SSIO.IP2.ALT2" : "SSIO.IP2.ALT1") << 2); | |
| 618 | return input_port_read(machine(), "SSIO.IP2") | | |
| 619 | (input_port_read(machine(), input_mux ? "SSIO.IP2.ALT2" : "SSIO.IP2.ALT1") << 2); | |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | |
| 623 | ||
| 623 | ||
| 624 | 624 | { |
| 625 | 625 | if (data & 0x40) input_mux = 1; |
| 626 | 626 | if (data & 0x80) input_mux = 0; |
| r14896 | r14897 | |
| 641 | 641 | AM_RANGE(0x0000, 0x6fff) AM_ROM |
| 642 | 642 | AM_RANGE(0x7000, 0x77ff) AM_MIRROR(0x0800) AM_RAM AM_SHARE("nvram") |
| 643 | 643 | AM_RANGE(0xf000, 0xf1ff) AM_MIRROR(0x0200) AM_RAM AM_SHARE("spriteram") |
| 644 | AM_RANGE(0xf400, 0xf41f) AM_MIRROR(0x03e0) AM_WRITE(paletteram_xxxxRRRRBBBBGGGG_split1_w) AM_SHARE("paletteram") | |
| 645 | AM_RANGE(0xf800, 0xf81f) AM_MIRROR(0x03e0) AM_WRITE(paletteram_xxxxRRRRBBBBGGGG_split2_w) AM_SHARE("paletteram2") | |
| 644 | AM_RANGE(0xf400, 0xf41f) AM_MIRROR(0x03e0) AM_WRITE(paletteram_xxxxRRRRBBBBGGGG_byte_split_lo_w) AM_SHARE("paletteram") | |
| 645 | AM_RANGE(0xf800, 0xf81f) AM_MIRROR(0x03e0) AM_WRITE(paletteram_xxxxRRRRBBBBGGGG_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 646 | 646 | AM_RANGE(0xfc00, 0xffff) AM_RAM_WRITE(mcr_90009_videoram_w) AM_BASE(m_videoram) |
| 647 | 647 | ADDRESS_MAP_END |
| 648 | 648 | |
| r14896 | r14897 | |
| 2584 | 2584 | mcr_init(machine, 90009, 91399, 90908); |
| 2585 | 2585 | mcr_sound_init(machine, MCR_SSIO); |
| 2586 | 2586 | |
| 2587 | ssio_set_custom_input(0, 0x1c, solarfox_ip0_r); | |
| 2588 | ssio_set_custom_input(1, 0xff, solarfox_ip1_r); | |
| 2587 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2588 | ssio_set_custom_input(0, 0x1c, read8_delegate(FUNC(mcr_state::solarfox_ip0_r),state)); | |
| 2589 | ssio_set_custom_input(1, 0xff, read8_delegate(FUNC(mcr_state::solarfox_ip1_r),state)); | |
| 2589 | 2590 | |
| 2590 | 2591 | mcr12_sprite_xoffs = 16; |
| 2591 | 2592 | } |
| r14896 | r14897 | |
| 2596 | 2597 | mcr_init(machine, 90009, 91399, 90908); |
| 2597 | 2598 | mcr_sound_init(machine, MCR_SSIO); |
| 2598 | 2599 | |
| 2599 | ssio_set_custom_input(1, 0xf0, kick_ip1_r); | |
| 2600 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2601 | ssio_set_custom_input(1, 0xf0, read8_delegate(FUNC(mcr_state::kick_ip1_r),state)); | |
| 2600 | 2602 | |
| 2601 | 2603 | mcr12_sprite_xoffs_flip = 16; |
| 2602 | 2604 | } |
| r14896 | r14897 | |
| 2614 | 2616 | mcr_init(machine, 90010, 91399, 90913); |
| 2615 | 2617 | mcr_sound_init(machine, MCR_SSIO); |
| 2616 | 2618 | |
| 2617 | ssio_set_custom_input(1, 0xff, wacko_ip1_r); | |
| 2618 | ssio_set_custom_input(2, 0xff, wacko_ip2_r); | |
| 2619 | ssio_set_custom_output(4, 0x01, wacko_op4_w); | |
| 2619 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2620 | ssio_set_custom_input(1, 0xff, read8_delegate(FUNC(mcr_state::wacko_ip1_r),state)); | |
| 2621 | ssio_set_custom_input(2, 0xff, read8_delegate(FUNC(mcr_state::wacko_ip2_r),state)); | |
| 2622 | ssio_set_custom_output(4, 0x01, write8_delegate(FUNC(mcr_state::wacko_op4_w),state)); | |
| 2620 | 2623 | } |
| 2621 | 2624 | |
| 2622 | 2625 | |
| r14896 | r14897 | |
| 2625 | 2628 | mcr_init(machine, 90010, 91399, 90913); |
| 2626 | 2629 | mcr_sound_init(machine, MCR_SSIO); |
| 2627 | 2630 | |
| 2628 | ssio_set_custom_output(4, 0xff, twotiger_op4_w); | |
| 2629 | 2631 | mcr_state *state = machine.driver_data<mcr_state>(); |
| 2632 | ssio_set_custom_output(4, 0xff, write8_delegate(FUNC(mcr_state::twotiger_op4_w),state)); | |
| 2630 | 2633 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xe800, 0xefff, 0, 0x1000, read8_delegate(FUNC(mcr_state::twotiger_videoram_r),state), write8_delegate(FUNC(mcr_state::twotiger_videoram_w),state)); |
| 2631 | 2634 | } |
| 2632 | 2635 | |
| r14896 | r14897 | |
| 2636 | 2639 | mcr_init(machine, 90010, 91399, 91483); |
| 2637 | 2640 | mcr_sound_init(machine, MCR_SSIO); |
| 2638 | 2641 | |
| 2639 | ssio_set_custom_input(1, 0x47, kroozr_ip1_r); | |
| 2640 | ssio_set_custom_output(4, 0x34, kroozr_op4_w); | |
| 2642 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2643 | ssio_set_custom_input(1, 0x47, read8_delegate(FUNC(mcr_state::kroozr_ip1_r),state)); | |
| 2644 | ssio_set_custom_output(4, 0x34, write8_delegate(FUNC(mcr_state::kroozr_op4_w),state)); | |
| 2641 | 2645 | } |
| 2642 | 2646 | |
| 2643 | 2647 | |
| r14896 | r14897 | |
| 2646 | 2650 | mcr_init(machine, 91475, 91464, 90913); |
| 2647 | 2651 | mcr_sound_init(machine, MCR_SSIO); |
| 2648 | 2652 | |
| 2649 | ssio_set_custom_output(4, 0x01, journey_op4_w); | |
| 2653 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2654 | ssio_set_custom_output(4, 0x01, write8_delegate(FUNC(mcr_state::journey_op4_w),state)); | |
| 2650 | 2655 | } |
| 2651 | 2656 | |
| 2652 | 2657 | |
| r14896 | r14897 | |
| 2662 | 2667 | mcr_init(machine, 91490, 91464, 91657); |
| 2663 | 2668 | mcr_sound_init(machine, MCR_SSIO | MCR_SQUAWK_N_TALK); |
| 2664 | 2669 | |
| 2665 | ssio_set_custom_output(4, 0xff, dotron_op4_w); | |
| 2670 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2671 | ssio_set_custom_output(4, 0xff, write8_delegate(FUNC(mcr_state::dotron_op4_w),state)); | |
| 2666 | 2672 | } |
| 2667 | 2673 | |
| 2668 | 2674 | |
| r14896 | r14897 | |
| 2671 | 2677 | mcr_init(machine, 91490, 91464, 91657); |
| 2672 | 2678 | mcr_sound_init(machine, MCR_SSIO | MCR_SQUAWK_N_TALK); |
| 2673 | 2679 | |
| 2674 | ssio_set_custom_input(2, 0x80, nflfoot_ip2_r); | |
| 2675 | ssio_set_custom_output(4, 0xff, nflfoot_op4_w); | |
| 2680 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2681 | ssio_set_custom_input(2, 0x80, read8_delegate(FUNC(mcr_state::nflfoot_ip2_r),state)); | |
| 2682 | ssio_set_custom_output(4, 0xff, write8_delegate(FUNC(mcr_state::nflfoot_op4_w),state)); | |
| 2676 | 2683 | |
| 2677 | 2684 | nflfoot_serial_out_active = FALSE; |
| 2678 | 2685 | nflfoot_serial_in_active = FALSE; |
| r14896 | r14897 | |
| 2691 | 2698 | mcr_init(machine, 91490, 91464, 90913); |
| 2692 | 2699 | mcr_sound_init(machine, MCR_SSIO | MCR_TURBO_CHIP_SQUEAK); |
| 2693 | 2700 | |
| 2694 | ssio_set_custom_input(1, 0xfc, demoderb_ip1_r); | |
| 2695 | ssio_set_custom_input(2, 0xfc, demoderb_ip2_r); | |
| 2696 | ssio_set_custom_output(4, 0xff, demoderb_op4_w); | |
| 2701 | mcr_state *state = machine.driver_data<mcr_state>(); | |
| 2702 | ssio_set_custom_input(1, 0xfc, read8_delegate(FUNC(mcr_state::demoderb_ip1_r),state)); | |
| 2703 | ssio_set_custom_input(2, 0xfc, read8_delegate(FUNC(mcr_state::demoderb_ip2_r),state)); | |
| 2704 | ssio_set_custom_output(4, 0xff, write8_delegate(FUNC(mcr_state::demoderb_op4_w),state)); | |
| 2697 | 2705 | |
| 2698 | 2706 | /* the SSIO Z80 doesn't have any program to execute */ |
| 2699 | 2707 | machine.device<cpu_device>("tcscpu")->suspend(SUSPEND_REASON_DISABLE, 1); |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | WRITE8_MEMBER(matmania_state::matmania_sh_command_w) |
| 48 | 48 | { |
| 49 | soundlatch_w(space, offset, data); | |
| 49 | soundlatch_byte_w(space, offset, data); | |
| 50 | 50 | device_set_input_line(m_audiocpu, M6502_IRQ_LINE, HOLD_LINE); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | WRITE8_MEMBER(matmania_state::maniach_sh_command_w) |
| 54 | 54 | { |
| 55 | soundlatch_w(space, offset, data); | |
| 55 | soundlatch_byte_w(space, offset, data); | |
| 56 | 56 | device_set_input_line(m_audiocpu, M6809_IRQ_LINE, HOLD_LINE); |
| 57 | 57 | } |
| 58 | 58 | |
| r14896 | r14897 | |
| 105 | 105 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w) |
| 106 | 106 | AM_RANGE(0x2002, 0x2003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w) |
| 107 | 107 | AM_RANGE(0x2004, 0x2004) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 108 | AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_r) | |
| 108 | AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r) | |
| 109 | 109 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 110 | 110 | ADDRESS_MAP_END |
| 111 | 111 | |
| r14896 | r14897 | |
| 113 | 113 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 114 | 114 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ymsnd", ym3526_w) |
| 115 | 115 | AM_RANGE(0x2002, 0x2002) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 116 | AM_RANGE(0x2004, 0x2004) AM_READ(soundlatch_r) | |
| 116 | AM_RANGE(0x2004, 0x2004) AM_READ(soundlatch_byte_r) | |
| 117 | 117 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 118 | 118 | ADDRESS_MAP_END |
| 119 | 119 |
| r14896 | r14897 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | static MACHINE_RESET( clshroad ) |
| 26 | 26 | { |
| 27 | flip_screen_set(machine, 0); | |
| 27 | clshroad_state *state = machine.driver_data<clshroad_state>(); | |
| 28 | state->flip_screen_set(0); | |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 |
| r14896 | r14897 | |
|---|---|---|
| 130 | 130 | if (ACCESSING_BITS_0_7) |
| 131 | 131 | { |
| 132 | 132 | input_port_write(machine(), "EEPROMOUT", data, 0xff); |
| 133 | ticket_dispenser_ | |
| 133 | machine().device<ticket_dispenser_ | |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| r14896 | r14897 | |
| 143 | 143 | /* write the latch and set the IRQ */ |
| 144 | 144 | m_soundlatch_full = 1; |
| 145 | 145 | device_set_input_line(m_audiocpu, 0, ASSERT_LINE); |
| 146 | soundlatch_w(space, 0, data & 0xff); | |
| 146 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| r14896 | r14897 | |
| 161 | 161 | /* read the latch and clear the IRQ */ |
| 162 | 162 | m_soundlatch_full = 0; |
| 163 | 163 | device_set_input_line(m_audiocpu, 0, CLEAR_LINE); |
| 164 | return soundlatch_r(space, 0); | |
| 164 | return soundlatch_byte_r(space, 0); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
| r14896 | r14897 | |
| 270 | 270 | |
| 271 | 271 | PORT_START("240000") |
| 272 | 272 | PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ |
| 273 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 273 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 274 | 274 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* sound->main buffer status (0=empty) */ |
| 275 | 275 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dcheese_state,sound_latch_state_r, NULL) |
| 276 | 276 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r14896 | r14897 | |
| 319 | 319 | |
| 320 | 320 | PORT_START("240000") |
| 321 | 321 | PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ |
| 322 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 322 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 323 | 323 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* sound->main buffer status (0=empty) */ |
| 324 | 324 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dcheese_state,sound_latch_state_r, NULL) |
| 325 | 325 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r14896 | r14897 | |
| 366 | 366 | |
| 367 | 367 | PORT_START("240000") |
| 368 | 368 | PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ |
| 369 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 369 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 370 | 370 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* sound->main buffer status (0=empty) */ |
| 371 | 371 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dcheese_state,sound_latch_state_r, NULL) |
| 372 | 372 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r14896 | r14897 | |
| 419 | 419 | MCFG_MACHINE_START(dcheese) |
| 420 | 420 | |
| 421 | 421 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 422 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 422 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 423 | 423 | |
| 424 | 424 | /* video hardware */ |
| 425 | 425 | MCFG_SCREEN_ADD("screen", RASTER) |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | if (data & 0x20) |
| 51 | 51 | { |
| 52 | 52 | space.install_read_bank(0x1800, 0x1fff, "bank5"); |
| 53 | space.install_write_handler(0x1800, 0x1fff, write8_delegate(FUNC(driver_device::paletteram_xBBBBBGGGGGRRRRR_be_w),this)); | |
| 53 | space.install_write_handler(0x1800, 0x1fff, write8_delegate(FUNC(driver_device::paletteram_xBBBBBGGGGGRRRRR_byte_be_w),this)); | |
| 54 | 54 | memory_set_bankptr(machine(), "bank5", m_generic_paletteram_8); |
| 55 | 55 | |
| 56 | 56 | if (m_k051316_readroms) |
| r14896 | r14897 | |
| 131 | 131 | |
| 132 | 132 | WRITE8_MEMBER(chqflag_state::chqflag_sh_irqtrigger_w) |
| 133 | 133 | { |
| 134 | soundlatch2_w(space, 0, data); | |
| 134 | soundlatch2_byte_w(space, 0, data); | |
| 135 | 135 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 136 | 136 | } |
| 137 | 137 | |
| r14896 | r14897 | |
| 145 | 145 | AM_RANGE(0x2000, 0x2007) AM_DEVREADWRITE_LEGACY("k051960", k051937_r, k051937_w) /* Sprite control registers */ |
| 146 | 146 | AM_RANGE(0x2400, 0x27ff) AM_DEVREADWRITE_LEGACY("k051960", k051960_r, k051960_w) /* Sprite RAM */ |
| 147 | 147 | AM_RANGE(0x2800, 0x2fff) AM_READ_BANK("bank3") AM_DEVWRITE_LEGACY("k051316_2", k051316_w) /* 051316 zoom/rotation (chip 2) */ |
| 148 | AM_RANGE(0x3000, 0x3000) AM_WRITE(soundlatch_w) /* sound code # */ | |
| 148 | AM_RANGE(0x3000, 0x3000) AM_WRITE(soundlatch_byte_w) /* sound code # */ | |
| 149 | 149 | AM_RANGE(0x3001, 0x3001) AM_WRITE(chqflag_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 150 | 150 | AM_RANGE(0x3002, 0x3002) AM_WRITE(chqflag_bankswitch_w) /* bankswitch control */ |
| 151 | 151 | AM_RANGE(0x3003, 0x3003) AM_WRITE(chqflag_vreg_w) /* enable K051316 ROM reading */ |
| r14896 | r14897 | |
| 187 | 187 | AM_RANGE(0xa01c, 0xa01c) AM_DEVWRITE_LEGACY("k007232_2", k007232_extvolume_w) /* extra volume, goes to the 007232 w/ A11 */ |
| 188 | 188 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) /* 007232 (chip 2) */ |
| 189 | 189 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */ |
| 190 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 191 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch2_r) /* engine sound volume */ | |
| 190 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 191 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch2_byte_r) /* engine sound volume */ | |
| 192 | 192 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ??? */ |
| 193 | 193 | ADDRESS_MAP_END |
| 194 | 194 |
| r14896 | r14897 | |
|---|---|---|
| 160 | 160 | /* bit 3 is zeroed on startup, maybe reset sound CPU */ |
| 161 | 161 | |
| 162 | 162 | /* bit 4 flips screen */ |
| 163 | flip_screen_set( | |
| 163 | flip_screen_set( | |
| 164 | 164 | |
| 165 | 165 | /* other bits unknown */ |
| 166 | 166 | } |
| r14896 | r14897 | |
|---|---|---|
| 121 | 121 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE_LEGACY(seibucrtc_sc1vram_w) AM_BASE_LEGACY(&seibucrtc_sc1vram) |
| 122 | 122 | AM_RANGE(0x0d000, 0x0d7ff) AM_RAM_WRITE_LEGACY(seibucrtc_sc2vram_w) AM_BASE_LEGACY(&seibucrtc_sc2vram) |
| 123 | 123 | AM_RANGE(0x0d800, 0x0e7ff) AM_RAM_WRITE_LEGACY(seibucrtc_sc3vram_w) AM_BASE_LEGACY(&seibucrtc_sc3vram) |
| 124 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(paletteram | |
| 124 | AM_RANGE(0x0e800, 0x0f7ff) AM_RAM_WRITE(paletteram | |
| 125 | 125 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM AM_SHARE("spriteram") |
| 126 | 126 | AM_RANGE(0xc0000, 0xfffff) AM_ROM |
| 127 | 127 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | WRITE8_MEMBER(dooyong_state::flip_screen_w) |
| 100 | 100 | { |
| 101 | flip_screen_set( | |
| 101 | flip_screen_set( | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | static MACHINE_RESET( sound_ym2203 ) |
| r14896 | r14897 | |
| 125 | 125 | AM_RANGE(0xc011, 0xc011) AM_READ_PORT("P1") |
| 126 | 126 | AM_RANGE(0xc011, 0xc011) AM_WRITE(lastday_bankswitch_w) |
| 127 | 127 | AM_RANGE(0xc012, 0xc012) AM_READ_PORT("P2") |
| 128 | AM_RANGE(0xc012, 0xc012) AM_WRITE(soundlatch_w) | |
| 128 | AM_RANGE(0xc012, 0xc012) AM_WRITE(soundlatch_byte_w) | |
| 129 | 129 | AM_RANGE(0xc013, 0xc013) AM_READ_PORT("DSWA") |
| 130 | 130 | AM_RANGE(0xc014, 0xc014) AM_READ_PORT("DSWB") |
| 131 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 131 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 132 | 132 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_BASE(m_txvideoram) |
| 133 | 133 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 134 | 134 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("spriteram") |
| r14896 | r14897 | |
| 146 | 146 | AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P2") |
| 147 | 147 | AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM") |
| 148 | 148 | AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */ |
| 149 | AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_w) | |
| 149 | AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w) | |
| 150 | 150 | AM_RANGE(0xf018, 0xf01f) AM_WRITE(dooyong_bgscroll8_w) |
| 151 | 151 | AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w) |
| 152 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 152 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 153 | 153 | ADDRESS_MAP_END |
| 154 | 154 | |
| 155 | 155 | static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_state ) |
| r14896 | r14897 | |
| 165 | 165 | AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P1") |
| 166 | 166 | AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM") |
| 167 | 167 | AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */ |
| 168 | AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_w) | |
| 168 | AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w) | |
| 169 | 169 | AM_RANGE(0xf018, 0xf01f) AM_WRITE(dooyong_bgscroll8_w) |
| 170 | 170 | AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w) |
| 171 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 171 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 172 | 172 | ADDRESS_MAP_END |
| 173 | 173 | |
| 174 | 174 | static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_state ) |
| r14896 | r14897 | |
| 181 | 181 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("P2") |
| 182 | 182 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM") |
| 183 | 183 | AM_RANGE(0xc008, 0xc008) AM_WRITE(lastday_bankswitch_w) |
| 184 | AM_RANGE(0xc010, 0xc010) AM_WRITE(soundlatch_w) | |
| 184 | AM_RANGE(0xc010, 0xc010) AM_WRITE(soundlatch_byte_w) | |
| 185 | 185 | AM_RANGE(0xc018, 0xc01f) AM_WRITE(dooyong_fg2scroll8_w) |
| 186 | 186 | AM_RANGE(0xc040, 0xc047) AM_WRITE(dooyong_bgscroll8_w) |
| 187 | 187 | AM_RANGE(0xc048, 0xc04f) AM_WRITE(dooyong_fgscroll8_w) |
| 188 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 188 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 189 | 189 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_BASE(m_txvideoram) |
| 190 | 190 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("spriteram") |
| 191 | 191 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| r14896 | r14897 | |
| 203 | 203 | AM_RANGE(0xe006, 0xe006) AM_READ_PORT("DSWA") |
| 204 | 204 | AM_RANGE(0xe008, 0xe008) AM_READ_PORT("DSWB") |
| 205 | 205 | AM_RANGE(0xe010, 0xe010) AM_WRITE(flytiger_ctrl_w) /* coin counter, flip screen */ |
| 206 | AM_RANGE(0xe020, 0xe020) AM_WRITE(soundlatch_w) | |
| 206 | AM_RANGE(0xe020, 0xe020) AM_WRITE(soundlatch_byte_w) | |
| 207 | 207 | AM_RANGE(0xe030, 0xe037) AM_WRITE(dooyong_bgscroll8_w) |
| 208 | 208 | AM_RANGE(0xe040, 0xe047) AM_WRITE(dooyong_fgscroll8_w) |
| 209 | 209 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_flytiger_w) AM_BASE(m_paletteram_flytiger) |
| r14896 | r14897 | |
| 216 | 216 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 217 | 217 | AM_RANGE(0xd000, 0xd3ff) AM_RAM /* what is this? looks like a palette? scratchpad RAM maybe? */ |
| 218 | 218 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_BASE(m_txvideoram) |
| 219 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 219 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 220 | 220 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSWA") |
| 221 | 221 | AM_RANGE(0xf800, 0xf800) AM_WRITE(primella_ctrl_w) /* bank switch, flip screen etc */ |
| 222 | 222 | AM_RANGE(0xf810, 0xf810) AM_READ_PORT("DSWB") |
| 223 | AM_RANGE(0xf810, 0xf810) AM_WRITE(soundlatch_w) | |
| 223 | AM_RANGE(0xf810, 0xf810) AM_WRITE(soundlatch_byte_w) | |
| 224 | 224 | AM_RANGE(0xf820, 0xf820) AM_READ_PORT("P1") |
| 225 | 225 | AM_RANGE(0xf830, 0xf830) AM_READ_PORT("P2") |
| 226 | 226 | AM_RANGE(0xf840, 0xf840) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 239 | 239 | AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("SYSTEM") |
| 240 | 240 | AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE(dooyong_bgscroll16_w) |
| 241 | 241 | AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w) |
| 242 | AM_RANGE(0x0c8000, 0x0c8fff) AM_WRITE(paletteram | |
| 242 | AM_RANGE(0x0c8000, 0x0c8fff) AM_WRITE(paletteram | |
| 243 | 243 | AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w) |
| 244 | 244 | AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(rshark_ctrl_w) /* flip screen + unknown stuff */ |
| 245 | 245 | AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE(dooyong_fgscroll16_w) |
| r14896 | r14897 | |
| 257 | 257 | AM_RANGE(0x080006, 0x080007) AM_READ_PORT("SYSTEM") |
| 258 | 258 | AM_RANGE(0x084000, 0x08400f) AM_WRITE(dooyong_bgscroll16_w) |
| 259 | 259 | AM_RANGE(0x084010, 0x08401f) AM_WRITE(dooyong_bg2scroll16_w) |
| 260 | AM_RANGE(0x088000, 0x088fff) AM_WRITE(paletteram | |
| 260 | AM_RANGE(0x088000, 0x088fff) AM_WRITE(paletteram | |
| 261 | 261 | AM_RANGE(0x080012, 0x080013) AM_WRITE(soundlatch_word_w) |
| 262 | 262 | AM_RANGE(0x080014, 0x080015) AM_WRITE(rshark_ctrl_w) /* flip screen + unknown stuff */ |
| 263 | 263 | AM_RANGE(0x08c000, 0x08c00f) AM_WRITE(dooyong_fgscroll16_w) |
| r14896 | r14897 | |
| 278 | 278 | AM_RANGE(0x0c0018, 0x0c001b) AM_WRITENOP // ? |
| 279 | 279 | AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE(dooyong_bgscroll16_w) |
| 280 | 280 | AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w) // not used atm |
| 281 | AM_RANGE(0x0c8000, 0x0c8fff) AM_WRITE(paletteram | |
| 281 | AM_RANGE(0x0c8000, 0x0c8fff) AM_WRITE(paletteram | |
| 282 | 282 | AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE(dooyong_fgscroll16_w) // not used atm |
| 283 | 283 | AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE(dooyong_fg2scroll16_w) // not used atm |
| 284 | 284 | AM_RANGE(0x0dc000, 0x0dc01f) AM_RAM // registers of some kind? |
| r14896 | r14897 | |
| 287 | 287 | static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_state ) |
| 288 | 288 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 289 | 289 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 290 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) | |
| 290 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) | |
| 291 | 291 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 292 | 292 | AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 293 | 293 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 295 | 295 | static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_state ) |
| 296 | 296 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 297 | 297 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 298 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 298 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 299 | 299 | AM_RANGE(0xf802, 0xf803) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 300 | 300 | AM_RANGE(0xf804, 0xf805) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 301 | 301 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 303 | 303 | static ADDRESS_MAP_START( bluehawk_sound_map, AS_PROGRAM, 8, dooyong_state ) |
| 304 | 304 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 305 | 305 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 306 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 306 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 307 | 307 | AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 308 | 308 | AM_RANGE(0xf80a, 0xf80a) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 309 | 309 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | WRITE8_MEMBER(brkthru_state::brkthru_soundlatch_w) |
| 94 | 94 | { |
| 95 | soundlatch_w(space, offset, data); | |
| 95 | soundlatch_byte_w(space, offset, data); | |
| 96 | 96 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 97 | 97 | } |
| 98 | 98 | |
| r14896 | r14897 | |
| 151 | 151 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, brkthru_state ) |
| 152 | 152 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 153 | 153 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ym2", ym3526_w) |
| 154 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r) | |
| 154 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r) | |
| 155 | 155 | AM_RANGE(0x6000, 0x6001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 156 | 156 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 157 | 157 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | public: |
| 63 | 63 | rbmk_state(const machine_config &mconfig, device_type type, const char *tag) |
| 64 | : driver_device(mconfig, type, tag) { } | |
| 64 | : driver_device(mconfig, type, tag) , | |
| 65 | m_gms_vidram2(*this, "gms_vidram2"), | |
| 66 | m_gms_vidram(*this, "gms_vidram"){ } | |
| 65 | 67 | |
| 66 | UINT16 *m_gms_vidram; | |
| 67 | UINT16 *m_gms_vidram2; | |
| 68 | required_shared_ptr<UINT16> m_gms_vidram2; | |
| 69 | required_shared_ptr<UINT16> m_gms_vidram; | |
| 68 | 70 | UINT16 m_tilebank; |
| 69 | 71 | UINT8 m_mux_data; |
| 70 | 72 | DECLARE_READ16_MEMBER(gms_read); |
| r14896 | r14897 | |
| 114 | 116 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 115 | 117 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 116 | 118 | AM_RANGE(0x500000, 0x50ffff) AM_RAM |
| 117 | AM_RANGE(0x940000, 0x940fff) AM_RAM AM_ | |
| 119 | AM_RANGE(0x940000, 0x940fff) AM_RAM AM_ | |
| 118 | 120 | AM_RANGE(0x980300, 0x983fff) AM_RAM // 0x2048 words ???, byte access |
| 119 | AM_RANGE(0x900000, 0x900fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 120 | AM_RANGE(0x9c0000, 0x9c0fff) AM_RAM AM_BASE(m_gms_vidram) | |
| 121 | AM_RANGE(0x900000, 0x900fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 122 | AM_RANGE(0x9c0000, 0x9c0fff) AM_RAM AM_SHARE("gms_vidram") | |
| 121 | 123 | AM_RANGE(0xb00000, 0xb00001) AM_DEVWRITE_LEGACY("eeprom", eeprom_w) |
| 122 | 124 | AM_RANGE(0xC00000, 0xC00001) AM_READ_PORT("IN0") AM_WRITE(gms_write1) |
| 123 | 125 | AM_RANGE(0xC08000, 0xC08001) AM_READ_PORT("IN1") AM_WRITE(gms_write2) |
| r14896 | r14897 | |
| 502 | 504 | { |
| 503 | 505 | for (x=0;x<64;x++) |
| 504 | 506 | { |
| 505 | int tile = state->m_gms_vidram2[count+0x600]; | |
| 507 | int tile = state->m_gms_vidram2.target()[count+0x600]; | |
| 506 | 508 | drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],(tile&0xfff)+((state->m_tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32); |
| 507 | 509 | count++; |
| 508 | 510 | } |
| r14896 | r14897 | |
| 514 | 516 | { |
| 515 | 517 | for (x=0;x<64;x++) |
| 516 | 518 | { |
| 517 | int tile = state->m_gms_vidram[count]; | |
| 519 | int tile = state->m_gms_vidram.target()[count]; | |
| 518 | 520 | drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],(tile&0xfff)+((state->m_tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0); |
| 519 | 521 | count++; |
| 520 | 522 | } |
| r14896 | r14897 | |
|---|---|---|
| 158 | 158 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_colorram_w) AM_BASE(m_colorram) |
| 159 | 159 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_videoram_w) AM_BASE(m_videoram) |
| 160 | 160 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_BASE(m_attributesram) |
| 161 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram | |
| 161 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 162 | 162 | AM_RANGE(0x9860, 0x98ff) AM_RAM |
| 163 | 163 | AM_RANGE(0xa000, 0xa000) AM_READ(thepit_input_port_0_r) AM_WRITENOP // Not hooked up according to the schematics |
| 164 | 164 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 169 | 169 | AM_RANGE(0xb004, 0xb005) AM_WRITENOP // Unused, but initialized |
| 170 | 170 | AM_RANGE(0xb006, 0xb006) AM_WRITE(thepit_flip_screen_x_w) |
| 171 | 171 | AM_RANGE(0xb007, 0xb007) AM_WRITE(thepit_flip_screen_y_w) |
| 172 | AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_w) | |
| 172 | AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) | |
| 173 | 173 | ADDRESS_MAP_END |
| 174 | 174 | |
| 175 | 175 | static ADDRESS_MAP_START( intrepid_main_map, AS_PROGRAM, 8, thepit_state ) |
| r14896 | r14897 | |
| 179 | 179 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(thepit_videoram_w) AM_BASE(m_videoram) |
| 180 | 180 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(thepit_colorram_w) AM_BASE(m_colorram) |
| 181 | 181 | AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_BASE(m_attributesram) |
| 182 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram | |
| 182 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 183 | 183 | AM_RANGE(0x9860, 0x98ff) AM_RAM |
| 184 | 184 | AM_RANGE(0xa000, 0xa000) AM_READ(thepit_input_port_0_r) |
| 185 | 185 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 191 | 191 | AM_RANGE(0xb005, 0xb005) AM_WRITE(intrepid_graphics_bank_w) |
| 192 | 192 | AM_RANGE(0xb006, 0xb006) AM_WRITE(thepit_flip_screen_x_w) |
| 193 | 193 | AM_RANGE(0xb007, 0xb007) AM_WRITE(thepit_flip_screen_y_w) |
| 194 | AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_w) | |
| 194 | AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) | |
| 195 | 195 | ADDRESS_MAP_END |
| 196 | 196 | |
| 197 | 197 | |
| r14896 | r14897 | |
| 203 | 203 | |
| 204 | 204 | static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, thepit_state ) |
| 205 | 205 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 206 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_w) | |
| 206 | AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_clear_byte_w) | |
| 207 | 207 | AM_RANGE(0x8c, 0x8d) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 208 | 208 | AM_RANGE(0x8d, 0x8d) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| 209 | 209 | AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| r14896 | r14897 | |
| 629 | 629 | { |
| 630 | 630 | AY8910_LEGACY_OUTPUT, |
| 631 | 631 | AY8910_DEFAULT_LOADS, |
| 632 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 632 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 633 | 633 | DEVCB_NULL, |
| 634 | 634 | DEVCB_NULL, |
| 635 | 635 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | { |
| 70 | 70 | public: |
| 71 | 71 | trvmadns_state(const machine_config &mconfig, device_type type, const char *tag) |
| 72 | : driver_device(mconfig, type, tag) { } | |
| 72 | : driver_device(mconfig, type, tag) , | |
| 73 | m_gfxram(*this, "gfxram"), | |
| 74 | m_tileram(*this, "tileram"){ } | |
| 73 | 75 | |
| 74 | 76 | tilemap_t *m_bg_tilemap; |
| 75 | UINT8 *m_gfxram; | |
| 76 | UINT8 *m_tileram; | |
| 77 | required_shared_ptr<UINT8> m_gfxram; | |
| 78 | required_shared_ptr<UINT8> m_tileram; | |
| 77 | 79 | int m_old_data; |
| 78 | 80 | DECLARE_WRITE8_MEMBER(trvmadns_banking_w); |
| 79 | 81 | DECLARE_WRITE8_MEMBER(trvmadns_gfxram_w); |
| r14896 | r14897 | |
| 158 | 160 | |
| 159 | 161 | WRITE8_MEMBER(trvmadns_state::trvmadns_gfxram_w) |
| 160 | 162 | { |
| 161 | m_gfxram[offset] = data; | |
| 163 | m_gfxram.target()[offset] = data; | |
| 162 | 164 | gfx_element_mark_dirty(machine().gfx[0], offset/16); |
| 163 | 165 | } |
| 164 | 166 | |
| r14896 | r14897 | |
| 206 | 208 | |
| 207 | 209 | } |
| 208 | 210 | |
| 209 | m_tileram[offset] = data; | |
| 211 | m_tileram.target()[offset] = data; | |
| 210 | 212 | m_bg_tilemap->mark_tile_dirty(offset >> 1); |
| 211 | 213 | } |
| 212 | 214 | |
| r14896 | r14897 | |
| 215 | 217 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 216 | 218 | AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("bank1") |
| 217 | 219 | AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("bank2") |
| 218 | AM_RANGE(0x6000, 0x7fff) AM_WRITE(trvmadns_gfxram_w) AM_ | |
| 220 | AM_RANGE(0x6000, 0x7fff) AM_WRITE(trvmadns_gfxram_w) AM_ | |
| 219 | 221 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 220 | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(trvmadns_tileram_w) AM_ | |
| 222 | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(trvmadns_tileram_w) AM_ | |
| 221 | 223 | AM_RANGE(0xc000, 0xc01f) AM_RAM_WRITE(trvmadns_palette_w) AM_SHARE("paletteram") |
| 222 | 224 | AM_RANGE(0xe000, 0xe000) AM_WRITE(w2)//NOP |
| 223 | 225 | AM_RANGE(0xe004, 0xe004) AM_WRITE(w3)//NOP |
| r14896 | r14897 | |
| 262 | 264 | trvmadns_state *state = machine.driver_data<trvmadns_state>(); |
| 263 | 265 | int tile,attr,color,flag; |
| 264 | 266 | |
| 265 | attr = state->m_tileram[tile_index*2 + 0]; | |
| 266 | tile = state->m_tileram[tile_index*2 + 1] + ((attr & 0x01) << 8); | |
| 267 | attr = state->m_tileram.target()[tile_index*2 + 0]; | |
| 268 | tile = state->m_tileram.target()[tile_index*2 + 1] + ((attr & 0x01) << 8); | |
| 267 | 269 | color = (attr & 0x18) >> 3; |
| 268 | 270 | flag = TILE_FLIPXY((attr & 0x06) >> 1); |
| 269 | 271 | |
| r14896 | r14897 | |
| 285 | 287 | |
| 286 | 288 | // fg_tilemap->set_transparent_pen(1); |
| 287 | 289 | |
| 288 | gfx_element_set_source(machine.gfx[0], state->m_gfxram); | |
| 290 | gfx_element_set_source(machine.gfx[0], state->m_gfxram.target()); | |
| 289 | 291 | } |
| 290 | 292 | |
| 291 | 293 | static SCREEN_UPDATE_IND16( trvmadns ) |
| r14896 | r14897 | |
| 302 | 304 | { |
| 303 | 305 | for (x=0;x<32;x++) |
| 304 | 306 | { |
| 305 | int attr = state->m_tileram[count*2+0]; | |
| 306 | int tile = state->m_tileram[count*2+1] | ((attr & 0x01) << 8); | |
| 307 | int attr = state->m_tileram.target()[count*2+0]; | |
| 308 | int tile = state->m_tileram.target()[count*2+1] | ((attr & 0x01) << 8); | |
| 307 | 309 | int color = (attr & 0x18) >> 3; |
| 308 | 310 | int flipx = attr & 4; |
| 309 | 311 | int flipy = attr & 2; |
| r14896 | r14897 | |
| 320 | 322 | { |
| 321 | 323 | for (x=0;x<32;x++) |
| 322 | 324 | { |
| 323 | int attr = state->m_tileram[count*2+0]; | |
| 324 | int tile = state->m_tileram[count*2+1] | ((attr & 0x01) << 8); | |
| 325 | int attr = state->m_tileram.target()[count*2+0]; | |
| 326 | int tile = state->m_tileram.target()[count*2+1] | ((attr & 0x01) << 8); | |
| 325 | 327 | int color = (attr & 0x18) >> 3; |
| 326 | 328 | int flipx = attr & 4; |
| 327 | 329 | int flipy = attr & 2; |
| r14896 | r14897 | |
|---|---|---|
| 224 | 224 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, rpunch_state ) |
| 225 | 225 | ADDRESS_MAP_GLOBAL_MASK(0xfffff) |
| 226 | 226 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 227 | AM_RANGE(0x040000, 0x04ffff) AM_RAM AM_BASE(m_bitmapram | |
| 227 | AM_RANGE(0x040000, 0x04ffff) AM_RAM AM_BASE_SIZE(m_bitmapram, | |
| 228 | 228 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_BASE(m_spriteram) |
| 229 | 229 | AM_RANGE(0x080000, 0x083fff) AM_RAM_WRITE(rpunch_videoram_w) AM_BASE(m_videoram) |
| 230 | AM_RANGE(0x0a0000, 0x0a07ff) AM_RAM_WRITE(paletteram | |
| 230 | AM_RANGE(0x0a0000, 0x0a07ff) AM_RAM_WRITE(paletteram | |
| 231 | 231 | AM_RANGE(0x0c0000, 0x0c0007) AM_WRITE(rpunch_scrollreg_w) |
| 232 | 232 | AM_RANGE(0x0c0008, 0x0c0009) AM_WRITE(rpunch_crtc_data_w) |
| 233 | 233 | AM_RANGE(0x0c000c, 0x0c000d) AM_WRITE(rpunch_videoreg_w) |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | { |
| 46 | 46 | public: |
| 47 | 47 | albazg_state(const machine_config &mconfig, device_type type, const char *tag) |
| 48 | : driver_device(mconfig, type, tag) { } | |
| 48 | : driver_device(mconfig, type, tag) , | |
| 49 | m_cus_ram(*this, "cus_ram"), | |
| 50 | m_videoram(*this, "videoram"), | |
| 51 | m_colorram(*this, "colorram"){ } | |
| 49 | 52 | |
| 50 | 53 | /* memory pointers */ |
| 51 | UINT8 * m_cus_ram; | |
| 52 | UINT8 * m_videoram; | |
| 53 | UINT8 * m_colorram; | |
| 54 | required_shared_ptr<UINT8> m_cus_ram; | |
| 55 | required_shared_ptr<UINT8> m_videoram; | |
| 56 | required_shared_ptr<UINT8> m_colorram; | |
| 54 | 57 | // UINT8 * m_paletteram; // currently this uses generic palette handling |
| 55 | 58 | // UINT8 * m_paletteram_2; // currently this uses generic palette handling |
| 56 | 59 | |
| r14896 | r14897 | |
| 71 | 74 | static TILE_GET_INFO( y_get_bg_tile_info ) |
| 72 | 75 | { |
| 73 | 76 | albazg_state *state = machine.driver_data<albazg_state>(); |
| 74 | int code = state->m_videoram[tile_index]; | |
| 75 | int color = state->m_colorram[tile_index]; | |
| 77 | int code = state->m_videoram.target()[tile_index]; | |
| 78 | int color = state->m_colorram.target()[tile_index]; | |
| 76 | 79 | |
| 77 | 80 | SET_TILE_INFO( |
| 78 | 81 | 0, |
| r14896 | r14897 | |
| 115 | 118 | |
| 116 | 119 | WRITE8_MEMBER(albazg_state::yumefuda_vram_w) |
| 117 | 120 | { |
| 118 | m_videoram[offset] = data; | |
| 121 | m_videoram.target()[offset] = data; | |
| 119 | 122 | m_bg_tilemap->mark_tile_dirty(offset); |
| 120 | 123 | } |
| 121 | 124 | |
| 122 | 125 | WRITE8_MEMBER(albazg_state::yumefuda_cram_w) |
| 123 | 126 | { |
| 124 | m_colorram[offset] = data; | |
| 127 | m_colorram.target()[offset] = data; | |
| 125 | 128 | m_bg_tilemap->mark_tile_dirty(offset); |
| 126 | 129 | } |
| 127 | 130 | |
| r14896 | r14897 | |
| 129 | 132 | READ8_MEMBER(albazg_state::custom_ram_r) |
| 130 | 133 | { |
| 131 | 134 | // logerror("Custom RAM read at %02x PC = %x\n", offset + 0xaf80, cpu_get_pc(&space.device())); |
| 132 | return m_cus_ram[offset];// ^ 0x55; | |
| 135 | return m_cus_ram.target()[offset];// ^ 0x55; | |
| 133 | 136 | } |
| 134 | 137 | |
| 135 | 138 | WRITE8_MEMBER(albazg_state::custom_ram_w) |
| 136 | 139 | { |
| 137 | 140 | // logerror("Custom RAM write at %02x : %02x PC = %x\n", offset + 0xaf80, data, cpu_get_pc(&space.device())); |
| 138 | 141 | if(m_prot_lock) |
| 139 | m_cus_ram[offset] = data; | |
| 142 | m_cus_ram.target()[offset] = data; | |
| 140 | 143 | } |
| 141 | 144 | |
| 142 | 145 | /*this might be used as NVRAM commands btw*/ |
| r14896 | r14897 | |
| 183 | 186 | |
| 184 | 187 | static WRITE8_DEVICE_HANDLER( yumefuda_output_w ) |
| 185 | 188 | { |
| 189 | albazg_state *state = device->machine().driver_data<albazg_state>(); | |
| 186 | 190 | coin_counter_w(device->machine(), 0, ~data & 4); |
| 187 | 191 | coin_counter_w(device->machine(), 1, ~data & 2); |
| 188 | 192 | coin_lockout_global_w(device->machine(), data & 1); |
| 189 | 193 | //data & 0x10 hopper-c (active LOW) |
| 190 | 194 | //data & 0x08 divider (active HIGH) |
| 191 | flip_screen_set( | |
| 195 | state->flip_screen_set( | |
| 192 | 196 | } |
| 193 | 197 | |
| 194 | 198 | static const ay8910_interface ay8910_config = |
| r14896 | r14897 | |
| 232 | 236 | AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") |
| 233 | 237 | AM_RANGE(0xa7fc, 0xa7fc) AM_WRITE(prot_lock_w) |
| 234 | 238 | AM_RANGE(0xa7ff, 0xa7ff) AM_WRITE_PORT("EEPROMOUT") |
| 235 | AM_RANGE(0xaf80, 0xafff) AM_READWRITE(custom_ram_r, custom_ram_w) AM_BASE(m_cus_ram) | |
| 236 | AM_RANGE(0xb000, 0xb07f) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_split1_w) AM_SHARE("paletteram") | |
| 237 | AM_RANGE(0xb080, 0xb0ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_split2_w) AM_SHARE("paletteram2") | |
| 238 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(yumefuda_vram_w) AM_BASE(m_videoram) | |
| 239 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(yumefuda_cram_w) AM_BASE(m_colorram) | |
| 239 | AM_RANGE(0xaf80, 0xafff) AM_READWRITE(custom_ram_r, custom_ram_w) AM_SHARE("cus_ram") | |
| 240 | AM_RANGE(0xb000, 0xb07f) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_split_lo_w) AM_SHARE("paletteram") | |
| 241 | AM_RANGE(0xb080, 0xb0ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 242 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(yumefuda_vram_w) AM_SHARE("videoram") | |
| 243 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(yumefuda_cram_w) AM_SHARE("colorram") | |
| 240 | 244 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 241 | 245 | ADDRESS_MAP_END |
| 242 | 246 |
| r14896 | r14897 | |
|---|---|---|
| 89 | 89 | #else |
| 90 | 90 | WRITE16_MEMBER(bingoc_state::main_sound_latch_w) |
| 91 | 91 | { |
| 92 | soundlatch_w(space,0,data&0xff); | |
| 92 | soundlatch_byte_w(space,0,data&0xff); | |
| 93 | 93 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 94 | 94 | } |
| 95 | 95 | #endif |
| r14896 | r14897 | |
| 127 | 127 | AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY("upd", bingoc_play_w) |
| 128 | 128 | AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("upd", upd7759_port_w) |
| 129 | 129 | #if !SOUND_TEST |
| 130 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) //soundlatch | |
| 130 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) //soundlatch | |
| 131 | 131 | #else |
| 132 | 132 | AM_RANGE(0xc0, 0xc0) AM_READ(sound_test_r) |
| 133 | 133 | #endif |
| r14896 | r14897 | |
|---|---|---|
| 17 | 17 | { |
| 18 | 18 | public: |
| 19 | 19 | sstrangr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 20 | : driver_device(mconfig, type, tag) { } | |
| 20 | : driver_device(mconfig, type, tag) , | |
| 21 | m_ram(*this, "ram"){ } | |
| 21 | 22 | |
| 22 | UINT8 | |
| 23 | required_shared_ptr<UINT8> | |
| 23 | 24 | UINT8 m_flip_screen; |
| 24 | 25 | UINT8 *m_proms; |
| 25 | 26 | DECLARE_WRITE8_MEMBER(port_w); |
| r14896 | r14897 | |
| 44 | 45 | |
| 45 | 46 | UINT8 x = offs << 3; |
| 46 | 47 | int y = offs >> 5; |
| 47 | UINT8 data = state->m_ram[offs]; | |
| 48 | UINT8 data = state->m_ram.target()[offs]; | |
| 48 | 49 | |
| 49 | 50 | for (i = 0; i < 8; i++) |
| 50 | 51 | { |
| r14896 | r14897 | |
| 102 | 103 | |
| 103 | 104 | offs_t color_address = (offs >> 9 << 5) | (offs & 0x1f); |
| 104 | 105 | |
| 105 | UINT8 data = state->m_ram[offs]; | |
| 106 | UINT8 data = state->m_ram.target()[offs]; | |
| 106 | 107 | UINT8 fore_color = color_map_base[color_address] & 0x07; |
| 107 | 108 | |
| 108 | 109 | for (i = 0; i < 8; i++) |
| r14896 | r14897 | |
| 141 | 142 | static ADDRESS_MAP_START( sstrangr_map, AS_PROGRAM, 8, sstrangr_state ) |
| 142 | 143 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 143 | 144 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 144 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_ | |
| 145 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_ | |
| 145 | 146 | AM_RANGE(0x6000, 0x63ff) AM_ROM |
| 146 | 147 | ADDRESS_MAP_END |
| 147 | 148 |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | { |
| 26 | 26 | public: |
| 27 | 27 | backfire_state(const machine_config &mconfig, device_type type, const char *tag) |
| 28 | : driver_device(mconfig, type, tag) { } | |
| 28 | : driver_device(mconfig, type, tag) , | |
| 29 | m_mainram(*this, "mainram"), | |
| 30 | m_left_priority(*this, "left_priority"), | |
| 31 | m_right_priority(*this, "right_priority"){ } | |
| 29 | 32 | |
| 30 | 33 | /* memory pointers */ |
| 31 | 34 | UINT16 * m_spriteram_1; |
| 32 | 35 | UINT16 * m_spriteram_2; |
| 33 | UINT32 * m_mainram; | |
| 34 | UINT32 * m_left_priority; | |
| 35 | UINT32 * m_right_priority; | |
| 36 | required_shared_ptr<UINT32> m_mainram; | |
| 37 | required_shared_ptr<UINT32> m_left_priority; | |
| 38 | required_shared_ptr<UINT32> m_right_priority; | |
| 36 | 39 | |
| 37 | 40 | /* video related */ |
| 38 | 41 | bitmap_ind16 *m_left; |
| r14896 | r14897 | |
| 106 | 109 | backfire_state *state = screen.machine().driver_data<backfire_state>(); |
| 107 | 110 | |
| 108 | 111 | //FIXME: flip_screen_x should not be written! |
| 109 | flip_screen_set_no_update( | |
| 112 | state->flip_screen_set_no_update( | |
| 110 | 113 | |
| 111 | 114 | /* screen 1 uses pf1 as the forground and pf3 as the background */ |
| 112 | 115 | /* screen 2 uses pf2 as the foreground and pf4 as the background */ |
| r14896 | r14897 | |
| 116 | 119 | screen.machine().priority_bitmap.fill(0); |
| 117 | 120 | bitmap.fill(0x100, cliprect); |
| 118 | 121 | |
| 119 | if (state->m_left_priority[0] == 0) | |
| 122 | if (state->m_left_priority.target()[0] == 0) | |
| 120 | 123 | { |
| 121 | 124 | deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); |
| 122 | 125 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 123 | 126 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram_1, 0x800); |
| 124 | 127 | } |
| 125 | else if (state->m_left_priority[0] == 2) | |
| 128 | else if (state->m_left_priority.target()[0] == 2) | |
| 126 | 129 | { |
| 127 | 130 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 128 | 131 | deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 129 | 132 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram_1, 0x800); |
| 130 | 133 | } |
| 131 | 134 | else |
| 132 | popmessage( "unknown left priority %08x", state->m_left_priority[0]); | |
| 135 | popmessage( "unknown left priority %08x", state->m_left_priority.target()[0]); | |
| 133 | 136 | |
| 134 | 137 | return 0; |
| 135 | 138 | } |
| r14896 | r14897 | |
| 139 | 142 | backfire_state *state = screen.machine().driver_data<backfire_state>(); |
| 140 | 143 | |
| 141 | 144 | //FIXME: flip_screen_x should not be written! |
| 142 | flip_screen_set_no_update( | |
| 145 | state->flip_screen_set_no_update( | |
| 143 | 146 | |
| 144 | 147 | /* screen 1 uses pf1 as the forground and pf3 as the background */ |
| 145 | 148 | /* screen 2 uses pf2 as the foreground and pf4 as the background */ |
| r14896 | r14897 | |
| 149 | 152 | screen.machine().priority_bitmap.fill(0); |
| 150 | 153 | bitmap.fill(0x500, cliprect); |
| 151 | 154 | |
| 152 | if (state->m_right_priority[0] == 0) | |
| 155 | if (state->m_right_priority.target()[0] == 0) | |
| 153 | 156 | { |
| 154 | 157 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); |
| 155 | 158 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 156 | 159 | screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram_2, 0x800); |
| 157 | 160 | } |
| 158 | else if (state->m_right_priority[0] == 2) | |
| 161 | else if (state->m_right_priority.target()[0] == 2) | |
| 159 | 162 | { |
| 160 | 163 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 161 | 164 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 162 | 165 | screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram_2, 0x800); |
| 163 | 166 | } |
| 164 | 167 | else |
| 165 | popmessage( "unknown right priority %08x", state->m_right_priority[0]); | |
| 168 | popmessage( "unknown right priority %08x", state->m_right_priority.target()[0]); | |
| 166 | 169 | |
| 167 | 170 | return 0; |
| 168 | 171 | } |
| r14896 | r14897 | |
| 286 | 289 | AM_RANGE(0x150000, 0x150fff) AM_READWRITE(backfire_pf3_rowscroll_r, backfire_pf3_rowscroll_w) |
| 287 | 290 | AM_RANGE(0x154000, 0x154fff) AM_READWRITE(backfire_pf4_rowscroll_r, backfire_pf4_rowscroll_w) |
| 288 | 291 | AM_RANGE(0x160000, 0x161fff) AM_WRITE(backfire_nonbuffered_palette_w) AM_SHARE("paletteram") |
| 289 | AM_RANGE(0x170000, 0x177fff) AM_RAM AM_ | |
| 292 | AM_RANGE(0x170000, 0x177fff) AM_RAM AM_ | |
| 290 | 293 | |
| 291 | 294 | // AM_RANGE(0x180010, 0x180013) AM_RAM AM_BASE_LEGACY(&backfire_180010) // always 180010 ? |
| 292 | 295 | // AM_RANGE(0x188010, 0x188013) AM_RAM AM_BASE_LEGACY(&backfire_188010) // always 188010 ? |
| r14896 | r14897 | |
| 297 | 300 | AM_RANGE(0x194000, 0x194003) AM_READ(backfire_control2_r) |
| 298 | 301 | AM_RANGE(0x1a4000, 0x1a4003) AM_DEVWRITE_LEGACY("eeprom", backfire_eeprom_w) |
| 299 | 302 | |
| 300 | AM_RANGE(0x1a8000, 0x1a8003) AM_RAM AM_BASE(m_left_priority) | |
| 301 | AM_RANGE(0x1ac000, 0x1ac003) AM_RAM AM_BASE(m_right_priority) | |
| 303 | AM_RANGE(0x1a8000, 0x1a8003) AM_RAM AM_SHARE("left_priority") | |
| 304 | AM_RANGE(0x1ac000, 0x1ac003) AM_RAM AM_SHARE("right_priority") | |
| 302 | 305 | // AM_RANGE(0x1b0000, 0x1b0003) AM_WRITENOP // always 1b0000 |
| 303 | 306 | |
| 304 | 307 | /* when set to pentometer in test mode */ |
| r14896 | r14897 | |
| 696 | 699 | if (cpu_get_pc(&space.device() )== 0xce44) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfire |
| 697 | 700 | if (cpu_get_pc(&space.device()) == 0xcee4) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfirea |
| 698 | 701 | |
| 699 | return m_mainram[0x18/4]; | |
| 702 | return m_mainram.target()[0x18/4]; | |
| 700 | 703 | } |
| 701 | 704 | |
| 702 | 705 |
| r14896 | r14897 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | WRITE8_MEMBER(sidepckt_state::sound_cpu_command_w) |
| 135 | 135 | { |
| 136 | soundlatch_w(space, offset, data); | |
| 136 | soundlatch_byte_w(space, offset, data); | |
| 137 | 137 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 138 | 138 | } |
| 139 | 139 | |
| r14896 | r14897 | |
| 226 | 226 | |
| 227 | 227 | static ADDRESS_MAP_START( sidepckt_map, AS_PROGRAM, 8, sidepckt_state ) |
| 228 | 228 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 229 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(sidepckt_videoram_w) AM_BASE(m_videoram | |
| 229 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(sidepckt_videoram_w) AM_BASE_SIZE(m_videoram, | |
| 230 | 230 | AM_RANGE(0x1400, 0x17ff) AM_RAM // ??? |
| 231 | 231 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(sidepckt_colorram_w) AM_BASE(m_colorram) |
| 232 | 232 | AM_RANGE(0x1c00, 0x1fff) AM_RAM // ??? |
| 233 | AM_RANGE(0x2000, 0x20ff) AM_RAM AM_BASE(m_spriteram | |
| 233 | AM_RANGE(0x2000, 0x20ff) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 234 | 234 | AM_RANGE(0x2100, 0x24ff) AM_RAM // ??? |
| 235 | 235 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("P1") |
| 236 | 236 | AM_RANGE(0x3001, 0x3001) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 247 | 247 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 248 | 248 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 249 | 249 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ym2", ym3526_w) |
| 250 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 250 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 251 | 251 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 252 | 252 | ADDRESS_MAP_END |
| 253 | 253 |
| r14896 | r14897 | |
|---|---|---|
| 160 | 160 | AM_RANGE(0x4340, 0x435f) AM_READ_PORT("DSW0") |
| 161 | 161 | AM_RANGE(0x4360, 0x437f) AM_READ_PORT("DSW1") |
| 162 | 162 | AM_RANGE(0x4380, 0x439f) AM_READ(starwars_adc_r) /* a-d control result */ |
| 163 | AM_RANGE(0x4400, 0x4400) AM_READWRITE_LEGACY(starwars_main_read_r, starwars_main_wr_w) | |
| 164 | AM_RANGE(0x4401, 0x4401) AM_READ_LEGACY(starwars_main_ready_flag_r) | |
| 163 | AM_RANGE(0x4400, 0x4400) AM_READWRITE(starwars_main_read_r, starwars_main_wr_w) | |
| 164 | AM_RANGE(0x4401, 0x4401) AM_READ(starwars_main_ready_flag_r) | |
| 165 | 165 | AM_RANGE(0x4500, 0x45ff) AM_DEVREADWRITE("x2212", x2212_device, read, write) |
| 166 | 166 | AM_RANGE(0x4600, 0x461f) AM_WRITE_LEGACY(avgdvg_go_w) |
| 167 | 167 | AM_RANGE(0x4620, 0x463f) AM_WRITE_LEGACY(avgdvg_reset_w) |
| r14896 | r14897 | |
| 170 | 170 | AM_RANGE(0x4680, 0x469f) AM_READNOP AM_WRITE(starwars_out_w) |
| 171 | 171 | AM_RANGE(0x46a0, 0x46bf) AM_WRITE(starwars_nstore_w) |
| 172 | 172 | AM_RANGE(0x46c0, 0x46c2) AM_WRITE(starwars_adc_select_w) |
| 173 | AM_RANGE(0x46e0, 0x46e0) AM_WRITE | |
| 173 | AM_RANGE(0x46e0, 0x46e0) AM_WRITE | |
| 174 | 174 | AM_RANGE(0x4700, 0x4707) AM_WRITE(starwars_math_w) |
| 175 | 175 | AM_RANGE(0x4700, 0x4700) AM_READ(starwars_div_reh_r) |
| 176 | 176 | AM_RANGE(0x4701, 0x4701) AM_READ(starwars_div_rel_r) |
| r14896 | r14897 | |
| 190 | 190 | *************************************/ |
| 191 | 191 | |
| 192 | 192 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, starwars_state ) |
| 193 | AM_RANGE(0x0000, 0x07ff) AM_WRITE_LEGACY(starwars_sout_w) | |
| 194 | AM_RANGE(0x0800, 0x0fff) AM_READ_LEGACY(starwars_sin_r) /* SIN Read */ | |
| 193 | AM_RANGE(0x0000, 0x07ff) AM_WRITE(starwars_sout_w) | |
| 194 | AM_RANGE(0x0800, 0x0fff) AM_READ(starwars_sin_r) /* SIN Read */ | |
| 195 | 195 | AM_RANGE(0x1000, 0x107f) AM_RAM /* 6532 ram */ |
| 196 | 196 | AM_RANGE(0x1080, 0x109f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 197 | 197 | AM_RANGE(0x1800, 0x183f) AM_WRITE_LEGACY(quad_pokey_w) |
| r14896 | r14897 | |
|---|---|---|
| 200 | 200 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSW0") |
| 201 | 201 | AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1") |
| 202 | 202 | AM_RANGE(0xc000, 0xc000) AM_WRITE(exerion_videoreg_w) |
| 203 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) | |
| 203 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) | |
| 204 | 204 | AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 205 | 205 | AM_RANGE(0xd800, 0xd801) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 206 | 206 | AM_RANGE(0xd802, 0xd802) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| r14896 | r14897 | |
| 217 | 217 | static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, exerion_state ) |
| 218 | 218 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 219 | 219 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 220 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 220 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 221 | 221 | AM_RANGE(0x8000, 0x800c) AM_WRITE(exerion_video_latch_w) |
| 222 | 222 | AM_RANGE(0xa000, 0xa000) AM_READ(exerion_video_timing_r) |
| 223 | 223 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | AM_RANGE(0x20000, 0x21fff) AM_RAM |
| 93 | 93 | AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 94 | 94 | AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 95 | AM_RANGE(0x24000, 0x241ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 95 | AM_RANGE(0x24000, 0x241ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 96 | 96 | ADDRESS_MAP_END |
| 97 | 97 | |
| 98 | 98 | static ADDRESS_MAP_START( gfire2_map, AS_PROGRAM, 8, mosaic_state ) |
| r14896 | r14897 | |
| 100 | 100 | AM_RANGE(0x10000, 0x17fff) AM_RAM |
| 101 | 101 | AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 102 | 102 | AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 103 | AM_RANGE(0x24000, 0x241ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 103 | AM_RANGE(0x24000, 0x241ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 104 | 104 | ADDRESS_MAP_END |
| 105 | 105 | |
| 106 | 106 | static ADDRESS_MAP_START( mosaic_io_map, AS_IO, 8, mosaic_state ) |
| r14896 | r14897 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | // driver_device overrides |
| 79 | 79 | // virtual void video_start(); |
| 80 | public: | |
| 81 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 82 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 83 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 84 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 80 | 85 | }; |
| 81 | 86 | |
| 82 | 87 | // Intel 82439TX System Controller (MXTC) |
| r14896 | r14897 | |
| 258 | 263 | ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask); |
| 259 | 264 | } |
| 260 | 265 | |
| 261 | ||
| 266 | ||
| 262 | 267 | { |
| 263 | savquest_state *state = space->machine().driver_data<savquest_state>(); | |
| 264 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 268 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 265 | 269 | |
| 266 | 270 | switch(offset % 8) { |
| 267 | 271 | case 1: |
| 268 | data = | |
| 272 | data = | |
| 269 | 273 | break; |
| 270 | 274 | case 2: |
| 271 | data = | |
| 275 | data = | |
| 272 | 276 | break; |
| 273 | 277 | case 3: |
| 274 | data = | |
| 278 | data = | |
| 275 | 279 | break; |
| 276 | 280 | case 7: |
| 277 | data = | |
| 281 | data = | |
| 278 | 282 | break; |
| 279 | 283 | } |
| 280 | 284 | return data; |
| 281 | 285 | } |
| 282 | 286 | |
| 283 | 287 | |
| 284 | ||
| 288 | ||
| 285 | 289 | { |
| 286 | savquest_state *state = space->machine().driver_data<savquest_state>(); | |
| 287 | state->m_at_pages[offset % 0x10] = data; | |
| 290 | m_at_pages[offset % 0x10] = data; | |
| 288 | 291 | |
| 289 | 292 | switch(offset % 8) { |
| 290 | 293 | case 1: |
| 291 | | |
| 294 | | |
| 292 | 295 | break; |
| 293 | 296 | case 2: |
| 294 | | |
| 297 | | |
| 295 | 298 | break; |
| 296 | 299 | case 3: |
| 297 | | |
| 300 | | |
| 298 | 301 | break; |
| 299 | 302 | case 7: |
| 300 | | |
| 303 | | |
| 301 | 304 | break; |
| 302 | 305 | } |
| 303 | 306 | } |
| 304 | 307 | |
| 305 | static READ32_HANDLER(at_page32_r) | |
| 306 | { | |
| 307 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 308 | } | |
| 309 | 308 | |
| 310 | ||
| 311 | static WRITE32_HANDLER(at_page32_w) | |
| 312 | { | |
| 313 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 314 | } | |
| 315 | ||
| 316 | 309 | static READ8_DEVICE_HANDLER(at_dma8237_2_r) |
| 317 | 310 | { |
| 318 | 311 | return i8237_r(device, offset / 2); |
| r14896 | r14897 | |
| 345 | 338 | } |
| 346 | 339 | |
| 347 | 340 | |
| 348 | ||
| 341 | ||
| 349 | 342 | { |
| 350 | savquest_state *state = space->machine().driver_data<savquest_state>(); | |
| 351 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 343 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 352 | 344 | & 0xFF0000; |
| 353 | 345 | |
| 354 | return space | |
| 346 | return space. | |
| 355 | 347 | } |
| 356 | 348 | |
| 357 | 349 | |
| 358 | ||
| 350 | ||
| 359 | 351 | { |
| 360 | savquest_state *state = space->machine().driver_data<savquest_state>(); | |
| 361 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 352 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 362 | 353 | & 0xFF0000; |
| 363 | 354 | |
| 364 | space | |
| 355 | space. | |
| 365 | 356 | } |
| 366 | 357 | |
| 367 | 358 | static void set_dma_channel(device_t *device, int channel, int state) |
| r14896 | r14897 | |
| 379 | 370 | { |
| 380 | 371 | DEVCB_LINE(pc_dma_hrq_changed), |
| 381 | 372 | DEVCB_NULL, |
| 382 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 383 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 373 | DEVCB_DRIVER_MEMBER(savquest_state, pc_dma_read_byte), | |
| 374 | DEVCB_DRIVER_MEMBER(savquest_state, pc_dma_write_byte), | |
| 384 | 375 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 385 | 376 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 386 | 377 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 415 | 406 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 416 | 407 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 417 | 408 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) /* todo: nvram (CMOS Setup Save)*/ |
| 418 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 409 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 419 | 410 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 420 | 411 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 421 | 412 | AM_RANGE(0x00e8, 0x00ef) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 142 | 142 | segas1x_state *state = machine.driver_data<segas1x_state>(); |
| 143 | 143 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 144 | 144 | |
| 145 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 145 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 146 | 146 | device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, PULSE_LINE); |
| 147 | 147 | } |
| 148 | 148 | |
| r14896 | r14897 | |
| 634 | 634 | AM_RANGE(0x80, 0x83) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym1", ym3438_r, ym3438_w) |
| 635 | 635 | AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym2", ym3438_r, ym3438_w) |
| 636 | 636 | AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1f) AM_WRITE_LEGACY(soundbank_w) |
| 637 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_READ(soundlatch_r) AM_WRITE_LEGACY(mcu_data_w) | |
| 637 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_READ(soundlatch_byte_r) AM_WRITE_LEGACY(mcu_data_w) | |
| 638 | 638 | ADDRESS_MAP_END |
| 639 | 639 | |
| 640 | 640 |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | { |
| 41 | 41 | public: |
| 42 | 42 | astrocorp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 43 | : driver_device(mconfig, type, tag) { } | |
| 43 | : driver_device(mconfig, type, tag) , | |
| 44 | m_spriteram(*this, "spriteram"), | |
| 45 | m_paletteram(*this, "paletteram"){ } | |
| 44 | 46 | |
| 45 | 47 | /* memory pointers */ |
| 46 | UINT16 * m_spriteram; | |
| 47 | UINT16 * m_paletteram; | |
| 48 | size_t m_spriteram_size; | |
| 48 | required_shared_ptr<UINT16> m_spriteram; | |
| 49 | required_shared_ptr<UINT16> m_paletteram; | |
| 49 | 50 | |
| 50 | 51 | /* video-related */ |
| 51 | 52 | bitmap_ind16 m_bitmap; |
| r14896 | r14897 | |
| 100 | 101 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 101 | 102 | { |
| 102 | 103 | astrocorp_state *state = machine.driver_data<astrocorp_state>(); |
| 103 | UINT16 *source = state->m_spriteram; | |
| 104 | UINT16 *finish = state->m_spriteram + state->m_spriteram_size / 2; | |
| 104 | UINT16 *source = state->m_spriteram.target(); | |
| 105 | UINT16 *finish = state->m_spriteram.target() + state->m_spriteram.bytes() / 2; | |
| 105 | 106 | |
| 106 | 107 | for ( ; source < finish; source += 8 / 2 ) |
| 107 | 108 | { |
| r14896 | r14897 | |
| 243 | 244 | coin_counter_w(machine(), 0, (data & 0x0001)); // key in | |
| 244 | 245 | coin_counter_w(machine(), 0, (data & 0x0002)); // coin in |- manual shows 1 in- and 1 out- counter |
| 245 | 246 | coin_counter_w(machine(), 1, (data & 0x0004)); // key out | |
| 246 | ticket_dispenser_ | |
| 247 | machine().device<ticket_dispenser_ | |
| 247 | 248 | // (data & 0x0010) // hopper? |
| 248 | 249 | set_led_status(machine(), 0, (data & 0x0020)); // error lamp (coin/hopper jam: "call attendant") |
| 249 | ticket_dispenser_ | |
| 250 | machine().device<ticket_dispenser_ | |
| 250 | 251 | } |
| 251 | 252 | if (ACCESSING_BITS_8_15) |
| 252 | 253 | { |
| r14896 | r14897 | |
| 278 | 279 | // 5-6-5 Palette: BBBBB-GGGGGG-RRRRR |
| 279 | 280 | WRITE16_MEMBER(astrocorp_state::astrocorp_palette_w) |
| 280 | 281 | { |
| 281 | COMBINE_DATA(&m_paletteram[offset]); | |
| 282 | COMBINE_DATA(&m_paletteram.target()[offset]); | |
| 282 | 283 | palette_set_color_rgb(machine(), offset, |
| 283 | pal5bit((m_paletteram[offset] >> 0) & 0x1f), | |
| 284 | pal6bit((m_paletteram[offset] >> 5) & 0x3f), | |
| 285 | pal5bit((m_paletteram[offset] >> 11) & 0x1f) | |
| 284 | pal5bit((m_paletteram.target()[offset] >> 0) & 0x1f), | |
| 285 | pal6bit((m_paletteram.target()[offset] >> 5) & 0x3f), | |
| 286 | pal5bit((m_paletteram.target()[offset] >> 11) & 0x1f) | |
| 286 | 287 | ); |
| 287 | 288 | } |
| 288 | 289 | |
| 289 | 290 | static ADDRESS_MAP_START( showhand_map, AS_PROGRAM, 16, astrocorp_state ) |
| 290 | 291 | AM_RANGE( 0x000000, 0x01ffff ) AM_ROM |
| 291 | AM_RANGE( 0x050000, 0x050fff ) AM_RAM AM_ | |
| 292 | AM_RANGE( 0x050000, 0x050fff ) AM_RAM AM_ | |
| 292 | 293 | AM_RANGE( 0x052000, 0x052001 ) AM_WRITE(astrocorp_draw_sprites_w) |
| 293 | 294 | AM_RANGE( 0x054000, 0x054001 ) AM_READ_PORT("INPUTS") |
| 294 | 295 | AM_RANGE( 0x058000, 0x058001 ) AM_WRITE(astrocorp_eeprom_w) |
| 295 | 296 | AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE(showhand_outputs_w) |
| 296 | 297 | AM_RANGE( 0x05e000, 0x05e001 ) AM_READ_PORT("EEPROMIN") |
| 297 | AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 298 | AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 298 | 299 | AM_RANGE( 0x070000, 0x073fff ) AM_RAM AM_SHARE("nvram") // battery |
| 299 | 300 | AM_RANGE( 0x080000, 0x080001 ) AM_DEVWRITE_LEGACY("oki", astrocorp_sound_bank_w) |
| 300 | 301 | AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE(astrocorp_screen_enable_w) |
| r14896 | r14897 | |
| 303 | 304 | |
| 304 | 305 | static ADDRESS_MAP_START( showhanc_map, AS_PROGRAM, 16, astrocorp_state ) |
| 305 | 306 | AM_RANGE( 0x000000, 0x01ffff ) AM_ROM |
| 306 | AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 307 | AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 307 | 308 | AM_RANGE( 0x070000, 0x070001 ) AM_DEVWRITE_LEGACY("oki", astrocorp_sound_bank_w) |
| 308 | AM_RANGE( 0x080000, 0x080fff ) AM_RAM AM_ | |
| 309 | AM_RANGE( 0x080000, 0x080fff ) AM_RAM AM_ | |
| 309 | 310 | AM_RANGE( 0x082000, 0x082001 ) AM_WRITE(astrocorp_draw_sprites_w) |
| 310 | 311 | AM_RANGE( 0x084000, 0x084001 ) AM_READ_PORT("INPUTS") |
| 311 | 312 | AM_RANGE( 0x088000, 0x088001 ) AM_WRITE(astrocorp_eeprom_w) |
| r14896 | r14897 | |
| 318 | 319 | |
| 319 | 320 | static ADDRESS_MAP_START( skilldrp_map, AS_PROGRAM, 16, astrocorp_state ) |
| 320 | 321 | AM_RANGE( 0x000000, 0x03ffff ) AM_ROM |
| 321 | AM_RANGE( 0x200000, 0x200fff ) AM_RAM AM_ | |
| 322 | AM_RANGE( 0x200000, 0x200fff ) AM_RAM AM_ | |
| 322 | 323 | AM_RANGE( 0x202000, 0x202001 ) AM_WRITE(astrocorp_draw_sprites_w) |
| 323 | 324 | AM_RANGE( 0x204000, 0x204001 ) AM_READ_PORT("INPUTS") |
| 324 | 325 | AM_RANGE( 0x208000, 0x208001 ) AM_WRITE(astrocorp_eeprom_w) |
| 325 | 326 | AM_RANGE( 0x20a000, 0x20a001 ) AM_WRITE(skilldrp_outputs_w) |
| 326 | 327 | AM_RANGE( 0x20e000, 0x20e001 ) AM_READ_PORT("EEPROMIN") |
| 327 | AM_RANGE( 0x380000, 0x3801ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 328 | AM_RANGE( 0x380000, 0x3801ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 328 | 329 | AM_RANGE( 0x400000, 0x400001 ) AM_WRITE(astrocorp_screen_enable_w) |
| 329 | 330 | AM_RANGE( 0x500000, 0x507fff ) AM_RAM AM_SHARE("nvram") // battery |
| 330 | 331 | AM_RANGE( 0x580000, 0x580001 ) AM_DEVWRITE_LEGACY("oki", skilldrp_sound_bank_w) |
| r14896 | r14897 | |
| 334 | 335 | static ADDRESS_MAP_START( speeddrp_map, AS_PROGRAM, 16, astrocorp_state ) |
| 335 | 336 | AM_RANGE( 0x000000, 0x01ffff ) AM_ROM |
| 336 | 337 | AM_RANGE( 0x280000, 0x283fff ) AM_RAM AM_SHARE("nvram") // battery |
| 337 | AM_RANGE( 0x380000, 0x380fff ) AM_RAM AM_ | |
| 338 | AM_RANGE( 0x380000, 0x380fff ) AM_RAM AM_ | |
| 338 | 339 | AM_RANGE( 0x382000, 0x382001 ) AM_WRITE(astrocorp_draw_sprites_w) |
| 339 | 340 | AM_RANGE( 0x384000, 0x384001 ) AM_READ_PORT("INPUTS") |
| 340 | 341 | AM_RANGE( 0x388000, 0x388001 ) AM_WRITE(astrocorp_eeprom_w) |
| 341 | 342 | AM_RANGE( 0x38a000, 0x38a001 ) AM_WRITE(skilldrp_outputs_w) |
| 342 | 343 | AM_RANGE( 0x38e000, 0x38e001 ) AM_READ_PORT("EEPROMIN") |
| 343 | AM_RANGE( 0x480000, 0x4801ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 344 | AM_RANGE( 0x480000, 0x4801ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_ | |
| 344 | 345 | AM_RANGE( 0x500000, 0x500001 ) AM_WRITE(astrocorp_screen_enable_w) |
| 345 | 346 | AM_RANGE( 0x580000, 0x580001 ) AM_DEVWRITE_LEGACY("oki", skilldrp_sound_bank_w) |
| 346 | 347 | AM_RANGE( 0x600000, 0x600001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| r14896 | r14897 | |
| 422 | 423 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 423 | 424 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 424 | 425 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Bet") |
| 425 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) // ticket sw | |
| 426 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) // ticket sw | |
| 426 | 427 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) |
| 427 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r) // hopper sw | |
| 428 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sw | |
| 428 | 429 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) |
| 429 | 430 | |
| 430 | 431 | PORT_START( "EEPROMIN" ) |
| r14896 | r14897 | |
| 522 | 523 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 523 | 524 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 524 | 525 | |
| 525 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 526 | MCFG_TICKET_DISPENSER_ADD("hopper", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 526 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 527 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) | |
| 527 | 528 | |
| 528 | 529 | /* video hardware */ |
| 529 | 530 | MCFG_SCREEN_ADD("screen", RASTER) |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | public: |
| 24 | 24 | ltcasino_state(const machine_config &mconfig, device_type type, const char *tag) |
| 25 | : driver_device(mconfig, type, tag) { } | |
| 25 | : driver_device(mconfig, type, tag) , | |
| 26 | m_tile_num_ram(*this, "tile_nuram"), | |
| 27 | m_tile_atr_ram(*this, "tile_atr_ram"){ } | |
| 26 | 28 | |
| 27 | UINT8 *m_tile_num_ram; | |
| 28 | UINT8 *m_tile_atr_ram; | |
| 29 | required_shared_ptr<UINT8> m_tile_num_ram; | |
| 30 | required_shared_ptr<UINT8> m_tile_atr_ram; | |
| 29 | 31 | tilemap_t *m_tilemap; |
| 30 | 32 | DECLARE_WRITE8_MEMBER(ltcasino_tile_num_w); |
| 31 | 33 | DECLARE_WRITE8_MEMBER(ltcasino_tile_atr_w); |
| r14896 | r14897 | |
| 39 | 41 | ltcasino_state *state = machine.driver_data<ltcasino_state>(); |
| 40 | 42 | int tileno, colour; |
| 41 | 43 | |
| 42 | tileno = state->m_tile_num_ram[tile_index]; | |
| 43 | colour = state->m_tile_atr_ram[tile_index]; | |
| 44 | tileno = state->m_tile_num_ram.target()[tile_index]; | |
| 45 | colour = state->m_tile_atr_ram.target()[tile_index]; | |
| 44 | 46 | |
| 45 | 47 | tileno += (colour & 0x80) << 1; |
| 46 | 48 | |
| r14896 | r14897 | |
| 56 | 58 | |
| 57 | 59 | WRITE8_MEMBER(ltcasino_state::ltcasino_tile_num_w) |
| 58 | 60 | { |
| 59 | m_tile_num_ram[offset] = data; | |
| 61 | m_tile_num_ram.target()[offset] = data; | |
| 60 | 62 | m_tilemap->mark_tile_dirty(offset); |
| 61 | 63 | } |
| 62 | 64 | |
| 63 | 65 | WRITE8_MEMBER(ltcasino_state::ltcasino_tile_atr_w) |
| 64 | 66 | { |
| 65 | m_tile_atr_ram[offset] = data; | |
| 67 | m_tile_atr_ram.target()[offset] = data; | |
| 66 | 68 | m_tilemap->mark_tile_dirty(offset); |
| 67 | 69 | } |
| 68 | 70 | |
| r14896 | r14897 | |
| 70 | 72 | static ADDRESS_MAP_START( ltcasino_map, AS_PROGRAM, 8, ltcasino_state ) |
| 71 | 73 | AM_RANGE(0x0000, 0x7fff) AM_RAM |
| 72 | 74 | AM_RANGE(0x8000, 0xcfff) AM_ROM |
| 73 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ltcasino_tile_num_w) AM_ | |
| 75 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ltcasino_tile_num_w) AM_ | |
| 74 | 76 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 75 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(ltcasino_tile_atr_w) AM_ | |
| 77 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(ltcasino_tile_atr_w) AM_ | |
| 76 | 78 | AM_RANGE(0xe800, 0xebff) AM_RAM |
| 77 | 79 | |
| 78 | 80 | AM_RANGE(0xec00, 0xec00) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | public: |
| 70 | 70 | meijinsn_state(const machine_config &mconfig, device_type type, const char *tag) |
| 71 | 71 | : driver_device(mconfig, type, tag), |
| 72 | m_maincpu(*this,"maincpu") | |
| 73 | { } | |
| 72 | m_maincpu(*this,"maincpu"), | |
| 73 | m_videoram(*this, "videoram"), | |
| 74 | m_shared_ram(*this, "shared_ram"){ } | |
| 74 | 75 | |
| 76 | required_device<cpu_device> m_maincpu; | |
| 75 | 77 | /* memory pointers */ |
| 76 | UINT16 * m_shared_ram; | |
| 77 | UINT16 * m_videoram; | |
| 78 | required_shared_ptr<UINT16> m_videoram; | |
| 79 | required_shared_ptr<UINT16> m_shared_ram; | |
| 78 | 80 | |
| 79 | 81 | /* video-related */ |
| 80 | 82 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 88 | 90 | UINT8 m_coinvalue; |
| 89 | 91 | int m_mcu_latch; |
| 90 | 92 | |
| 91 | required_device<cpu_device> m_maincpu; | |
| 92 | 93 | DECLARE_WRITE16_MEMBER(sound_w); |
| 93 | 94 | DECLARE_READ16_MEMBER(alpha_mcu_r); |
| 94 | 95 | }; |
| r14896 | r14897 | |
| 98 | 99 | WRITE16_MEMBER(meijinsn_state::sound_w) |
| 99 | 100 | { |
| 100 | 101 | if (ACCESSING_BITS_0_7) |
| 101 | soundlatch_w(space, 0, data & 0xff); | |
| 102 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 102 | 103 | } |
| 103 | 104 | |
| 104 | 105 | READ16_MEMBER(meijinsn_state::alpha_mcu_r) |
| r14896 | r14897 | |
| 106 | 107 | static const UINT8 coinage1[2][2] = {{1,1}, {1,2}}; |
| 107 | 108 | static const UINT8 coinage2[2][2] = {{1,5}, {2,1}}; |
| 108 | 109 | |
| 109 | int source = m_shared_ram[offset]; | |
| 110 | int source = m_shared_ram.target()[offset]; | |
| 110 | 111 | |
| 111 | 112 | switch (offset) |
| 112 | 113 | { |
| 113 | 114 | case 0: /* Dipswitch 2 */ |
| 114 | m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "DSW"); | |
| 115 | m_shared_ram.target()[0] = (source & 0xff00) | input_port_read(machine(), "DSW"); | |
| 115 | 116 | return 0; |
| 116 | 117 | |
| 117 | 118 | case 0x22: /* Coin value */ |
| 118 | m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff); | |
| 119 | m_shared_ram.target()[0x22] = (source & 0xff00) | (m_credits & 0x00ff); | |
| 119 | 120 | return 0; |
| 120 | 121 | |
| 121 | 122 | case 0x29: /* Query microcontroller for coin insert */ |
| r14896 | r14897 | |
| 127 | 128 | |
| 128 | 129 | if ((input_port_read(machine(), "COINS") & 0x1) == 0 && !m_mcu_latch) |
| 129 | 130 | { |
| 130 | m_shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA | |
| 131 | m_shared_ram[0x22] = (source & 0xff00) | 0x00; | |
| 131 | m_shared_ram.target()[0x29] = (source & 0xff00) | 0x22; // coinA | |
| 132 | m_shared_ram.target()[0x22] = (source & 0xff00) | 0x00; | |
| 132 | 133 | m_mcu_latch = 1; |
| 133 | 134 | |
| 134 | 135 | m_coinvalue = (~input_port_read(machine(), "DSW")>>3) & 1; |
| r14896 | r14897 | |
| 144 | 145 | } |
| 145 | 146 | else if ((input_port_read(machine(), "COINS") & 0x2) == 0 && !m_mcu_latch) |
| 146 | 147 | { |
| 147 | m_shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA | |
| 148 | m_shared_ram[0x22] = (source & 0xff00) | 0x00; | |
| 148 | m_shared_ram.target()[0x29] = (source & 0xff00) | 0x22; // coinA | |
| 149 | m_shared_ram.target()[0x22] = (source & 0xff00) | 0x00; | |
| 149 | 150 | m_mcu_latch = 1; |
| 150 | 151 | |
| 151 | 152 | m_coinvalue = (~input_port_read(machine(), "DSW") >> 3) & 1; |
| r14896 | r14897 | |
| 161 | 162 | } |
| 162 | 163 | else |
| 163 | 164 | { |
| 164 | m_shared_ram[0x29] = (source & 0xff00) | 0x22; | |
| 165 | m_shared_ram.target()[0x29] = (source & 0xff00) | 0x22; | |
| 165 | 166 | } |
| 166 | 167 | return 0; |
| 167 | 168 | } |
| r14896 | r14897 | |
| 173 | 174 | static ADDRESS_MAP_START( meijinsn_map, AS_PROGRAM, 16, meijinsn_state ) |
| 174 | 175 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 175 | 176 | AM_RANGE(0x080e00, 0x080fff) AM_READ(alpha_mcu_r) AM_WRITENOP |
| 176 | AM_RANGE(0x100000, 0x107fff) AM_RAM AM_ | |
| 177 | AM_RANGE(0x100000, 0x107fff) AM_RAM AM_ | |
| 177 | 178 | AM_RANGE(0x180000, 0x180dff) AM_RAM |
| 178 | AM_RANGE(0x180e00, 0x180fff) AM_RAM AM_ | |
| 179 | AM_RANGE(0x180e00, 0x180fff) AM_RAM AM_ | |
| 179 | 180 | AM_RANGE(0x181000, 0x181fff) AM_RAM |
| 180 | 181 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("P2") |
| 181 | 182 | AM_RANGE(0x1a0000, 0x1a0001) AM_READ_PORT("P1") AM_WRITE(sound_w) |
| r14896 | r14897 | |
| 190 | 191 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 191 | 192 | AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 192 | 193 | AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 193 | AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_clear_w) | |
| 194 | AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_clear_byte_w) | |
| 194 | 195 | AM_RANGE(0x06, 0x06) AM_WRITENOP |
| 195 | 196 | ADDRESS_MAP_END |
| 196 | 197 | |
| r14896 | r14897 | |
| 296 | 297 | sx = offs >> 8; |
| 297 | 298 | sy = offs & 0xff; |
| 298 | 299 | |
| 299 | data1 = state->m_videoram[offs] >> 8; | |
| 300 | data2 = state->m_videoram[offs] & 0xff; | |
| 300 | data1 = state->m_videoram.target()[offs] >> 8; | |
| 301 | data2 = state->m_videoram.target()[offs] & 0xff; | |
| 301 | 302 | |
| 302 | 303 | for (x = 0; x < 4; x++) |
| 303 | 304 | { |
| r14896 | r14897 | |
| 326 | 327 | { |
| 327 | 328 | AY8910_LEGACY_OUTPUT, |
| 328 | 329 | AY8910_DEFAULT_LOADS, |
| 329 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r) | |
| 330 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r) | |
| 330 | 331 | }; |
| 331 | 332 | |
| 332 | 333 | static MACHINE_START( meijinsn ) |
| r14896 | r14897 | |
|---|---|---|
| 268 | 268 | m_hPosition(0x0000), |
| 269 | 269 | m_maincpu(*this, "maincpu"), |
| 270 | 270 | m_subcpu(*this,"sub"), |
| 271 | m_soundcpu(*this,"soundcpu") | |
| 272 | { } | |
| 271 | m_soundcpu(*this,"soundcpu"), | |
| 272 | m_h1_vram(*this, "h1_vram"), | |
| 273 | m_h1_charram(*this, "h1_charram"), | |
| 274 | m_framebuffer_vram(*this, "framebuffer_vram"), | |
| 275 | m_txt_vram(*this, "txt_vram"), | |
| 276 | m_sysh1_txt_blit(*this, "sysh1_txt_blit"), | |
| 277 | m_sysh1_workram_h(*this, "sysh1_workrah"), | |
| 278 | m_h1_unk(*this, "h1_unk"){ } | |
| 273 | 279 | |
| 274 | UINT32* m_sysh1_workram_h; | |
| 275 | UINT32* m_framebuffer_vram; | |
| 276 | UINT32* m_h1_unk; | |
| 277 | UINT32* m_h1_charram; | |
| 278 | UINT32* m_h1_vram; | |
| 279 | UINT32* m_sysh1_txt_blit; | |
| 280 | UINT32* m_txt_vram; | |
| 281 | bitmap_rgb32 m_temp_bitmap_sprites; | |
| 282 | UINT32 m_test_offs; | |
| 283 | int m_color; | |
| 284 | UINT8 m_vblank; | |
| 285 | ||
| 286 | 280 | // Blitter state |
| 287 | 281 | UINT16 m_textBytesToWrite; |
| 288 | 282 | INT16 m_blitterSerialCount; |
| r14896 | r14897 | |
| 293 | 287 | UINT16 m_hCellCount; |
| 294 | 288 | UINT16 m_vPosition; |
| 295 | 289 | UINT16 m_hPosition; |
| 296 | ||
| 290 | ||
| 297 | 291 | required_device<cpu_device> m_maincpu; |
| 298 | 292 | required_device<cpu_device> m_subcpu; |
| 299 | 293 | required_device<cpu_device> m_soundcpu; |
| 294 | ||
| 295 | required_shared_ptr<UINT32> m_h1_vram; | |
| 296 | required_shared_ptr<UINT32> m_h1_charram; | |
| 297 | required_shared_ptr<UINT32> m_framebuffer_vram; | |
| 298 | required_shared_ptr<UINT32> m_txt_vram; | |
| 299 | required_shared_ptr<UINT32> m_sysh1_txt_blit; | |
| 300 | required_shared_ptr<UINT32> m_sysh1_workram_h; | |
| 301 | required_shared_ptr<UINT32> m_h1_unk; | |
| 302 | bitmap_rgb32 m_temp_bitmap_sprites; | |
| 303 | UINT32 m_test_offs; | |
| 304 | int m_color; | |
| 305 | UINT8 m_vblank; | |
| 306 | ||
| 307 | ||
| 308 | ||
| 300 | 309 | DECLARE_READ32_MEMBER(sysh1_unk_r); |
| 301 | 310 | DECLARE_WRITE32_MEMBER(sysh1_unk_w); |
| 302 | 311 | DECLARE_READ32_MEMBER(sysh1_ioga_r); |
| r14896 | r14897 | |
| 366 | 375 | { |
| 367 | 376 | int tile; |
| 368 | 377 | |
| 369 | tile = (state->m_h1_vram[count] & 0x0fff0000) >> 16; | |
| 378 | tile = (state->m_h1_vram.target()[count] & 0x0fff0000) >> 16; | |
| 370 | 379 | drawgfx_opaque(bitmap,cliprect,gfx,tile,state->m_color,0,0,(x+0)*16,y*16); |
| 371 | 380 | |
| 372 | tile = (state->m_h1_vram[count] & 0x00000fff) >> 0; | |
| 381 | tile = (state->m_h1_vram.target()[count] & 0x00000fff) >> 0; | |
| 373 | 382 | drawgfx_opaque(bitmap,cliprect,gfx,tile,state->m_color,0,0,(x+1)*16,y*16); |
| 374 | 383 | |
| 375 | 384 | count++; |
| r14896 | r14897 | |
| 395 | 404 | |
| 396 | 405 | m_vblank^=1; |
| 397 | 406 | |
| 398 | return (m_h1_unk[offset] & 0xfdffffff) | (m_vblank<<25); | |
| 407 | return (m_h1_unk.target()[offset] & 0xfdffffff) | (m_vblank<<25); | |
| 399 | 408 | } |
| 400 | 409 | case 0x14/4: |
| 401 | return m_h1_unk[offset]; | |
| 410 | return m_h1_unk.target()[offset]; | |
| 402 | 411 | //case 0x20/4: |
| 403 | 412 | } |
| 404 | 413 | |
| 405 | return 0xffffffff;//m_h1_unk[offset]; | |
| 414 | return 0xffffffff;//m_h1_unk.target()[offset]; | |
| 406 | 415 | } |
| 407 | 416 | |
| 408 | 417 | WRITE32_MEMBER(coolridr_state::sysh1_unk_w) |
| 409 | 418 | { |
| 410 | COMBINE_DATA(&m_h1_unk[offset]); | |
| 419 | COMBINE_DATA(&m_h1_unk.target()[offset]); | |
| 411 | 420 | } |
| 412 | 421 | |
| 413 | 422 | /* According to Guru, this is actually the same I/O chip of Sega Model 2 HW */ |
| r14896 | r14897 | |
| 429 | 438 | WRITE32_MEMBER(coolridr_state::sysh1_txt_blit_w) |
| 430 | 439 | { |
| 431 | 440 | |
| 432 | COMBINE_DATA(&m_sysh1_txt_blit[offset]); | |
| 441 | COMBINE_DATA(&m_sysh1_txt_blit.target()[offset]); | |
| 433 | 442 | |
| 434 | 443 | switch(offset) |
| 435 | 444 | { |
| r14896 | r14897 | |
| 591 | 600 | end_dma_mark = 0; |
| 592 | 601 | |
| 593 | 602 | do{ |
| 594 | src = (state->m_framebuffer_vram[(0+dma_index)/4] & 0x0fffffff); | |
| 595 | dst = (state->m_framebuffer_vram[(4+dma_index)/4]); | |
| 596 | size = state->m_framebuffer_vram[(8+dma_index)/4]; | |
| 597 | type = (state->m_framebuffer_vram[(0+dma_index)/4] & 0xf0000000) >> 28; | |
| 603 | src = (state->m_framebuffer_vram.target()[(0+dma_index)/4] & 0x0fffffff); | |
| 604 | dst = (state->m_framebuffer_vram.target()[(4+dma_index)/4]); | |
| 605 | size = state->m_framebuffer_vram.target()[(8+dma_index)/4]; | |
| 606 | type = (state->m_framebuffer_vram.target()[(0+dma_index)/4] & 0xf0000000) >> 28; | |
| 598 | 607 | |
| 599 | 608 | #if 0 |
| 600 | 609 | if(type == 0xc || type == 0xd || type == 0xe) |
| r14896 | r14897 | |
| 660 | 669 | |
| 661 | 670 | WRITE32_MEMBER(coolridr_state::sysh1_dma_w) |
| 662 | 671 | { |
| 663 | COMBINE_DATA(&m_framebuffer_vram[offset]); | |
| 672 | COMBINE_DATA(&m_framebuffer_vram.target()[offset]); | |
| 664 | 673 | |
| 665 | 674 | if(offset*4 == 0x000) |
| 666 | 675 | { |
| 667 | if((m_framebuffer_vram[offset] & 0xff00000) == 0xfe00000) | |
| 668 | sysh1_dma_transfer(&space, m_framebuffer_vram[offset] & 0xffff); | |
| 676 | if((m_framebuffer_vram.target()[offset] & 0xff00000) == 0xfe00000) | |
| 677 | sysh1_dma_transfer(&space, m_framebuffer_vram.target()[offset] & 0xffff); | |
| 669 | 678 | } |
| 670 | 679 | } |
| 671 | 680 | |
| 672 | 681 | WRITE32_MEMBER(coolridr_state::sysh1_char_w) |
| 673 | 682 | { |
| 674 | COMBINE_DATA(&m_h1_charram[offset]); | |
| 683 | COMBINE_DATA(&m_h1_charram.target()[offset]); | |
| 675 | 684 | |
| 676 | 685 | { |
| 677 | 686 | UINT8 *gfx = machine().region("ram_gfx")->base(); |
| 678 | 687 | |
| 679 | gfx[offset*4+0] = (m_h1_charram[offset] & 0xff000000) >> 24; | |
| 680 | gfx[offset*4+1] = (m_h1_charram[offset] & 0x00ff0000) >> 16; | |
| 681 | gfx[offset*4+2] = (m_h1_charram[offset] & 0x0000ff00) >> 8; | |
| 682 | gfx[offset*4+3] = (m_h1_charram[offset] & 0x000000ff) >> 0; | |
| 688 | gfx[offset*4+0] = (m_h1_charram.target()[offset] & 0xff000000) >> 24; | |
| 689 | gfx[offset*4+1] = (m_h1_charram.target()[offset] & 0x00ff0000) >> 16; | |
| 690 | gfx[offset*4+2] = (m_h1_charram.target()[offset] & 0x0000ff00) >> 8; | |
| 691 | gfx[offset*4+3] = (m_h1_charram.target()[offset] & 0x000000ff) >> 0; | |
| 683 | 692 | |
| 684 | 693 | gfx_element_mark_dirty(machine().gfx[2], offset/64); //*4/256 |
| 685 | 694 | } |
| r14896 | r14897 | |
| 689 | 698 | AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_SHARE("share1") AM_WRITENOP |
| 690 | 699 | AM_RANGE(0x01000000, 0x01ffffff) AM_ROM AM_REGION("gfx_data",0x0000000) |
| 691 | 700 | |
| 692 | AM_RANGE(0x03000000, 0x030fffff) AM_RAM AM_ | |
| 701 | AM_RANGE(0x03000000, 0x030fffff) AM_RAM AM_ | |
| 693 | 702 | AM_RANGE(0x03c00000, 0x03c0ffff) AM_RAM_WRITE(sysh1_pal_w) AM_SHARE("paletteram") |
| 694 | AM_RANGE(0x03d00000, 0x03dfffff) AM_RAM_WRITE(sysh1_char_w) AM_BASE(m_h1_charram) //FIXME: half size | |
| 695 | AM_RANGE(0x03e00000, 0x03efffff) AM_RAM_WRITE(sysh1_dma_w) AM_BASE(m_framebuffer_vram) //FIXME: not all of it | |
| 703 | AM_RANGE(0x03d00000, 0x03dfffff) AM_RAM_WRITE(sysh1_char_w) AM_SHARE("h1_charram") //FIXME: half size | |
| 704 | AM_RANGE(0x03e00000, 0x03efffff) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("framebuffer_vram") //FIXME: not all of it | |
| 696 | 705 | |
| 697 | 706 | AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/ |
| 698 | AM_RANGE(0x03f40000, 0x03f4ffff) AM_RAM AM_BASE(m_txt_vram)//text tilemap + "lineram" | |
| 699 | AM_RANGE(0x04000000, 0x0400003f) AM_RAM_WRITE(sysh1_txt_blit_w) AM_BASE(m_sysh1_txt_blit) | |
| 700 | AM_RANGE(0x06000000, 0x060fffff) AM_RAM AM_BASE(m_sysh1_workram_h) | |
| 707 | AM_RANGE(0x03f40000, 0x03f4ffff) AM_RAM AM_SHARE("txt_vram")//text tilemap + "lineram" | |
| 708 | AM_RANGE(0x04000000, 0x0400003f) AM_RAM_WRITE(sysh1_txt_blit_w) AM_SHARE("sysh1_txt_blit") | |
| 709 | AM_RANGE(0x06000000, 0x060fffff) AM_RAM AM_SHARE("sysh1_workrah") | |
| 701 | 710 | AM_RANGE(0x20000000, 0x201fffff) AM_ROM AM_SHARE("share1") |
| 702 | 711 | |
| 703 | 712 | AM_RANGE(0x60000000, 0x600003ff) AM_WRITENOP |
| r14896 | r14897 | |
| 715 | 724 | AM_RANGE(0x03208900, 0x03208903) AM_RAM /*???*/ |
| 716 | 725 | AM_RANGE(0x03300400, 0x03300403) AM_RAM /*irq enable?*/ |
| 717 | 726 | |
| 718 | AM_RANGE(0x04000000, 0x0400003f) AM_READWRITE(sysh1_unk_r,sysh1_unk_w) AM_ | |
| 727 | AM_RANGE(0x04000000, 0x0400003f) AM_READWRITE(sysh1_unk_r,sysh1_unk_w) AM_ | |
| 719 | 728 | AM_RANGE(0x04200000, 0x0420003f) AM_RAM /*???*/ |
| 720 | 729 | |
| 721 | 730 | AM_RANGE(0x05000000, 0x05000fff) AM_RAM |
| r14896 | r14897 | |
| 1226 | 1235 | if(pc == 0x6012374 || pc == 0x6012392) |
| 1227 | 1236 | return 0; |
| 1228 | 1237 | |
| 1229 | return m_sysh1_workram_h[0xd88a4/4]; | |
| 1238 | return m_sysh1_workram_h.target()[0xd88a4/4]; | |
| 1230 | 1239 | } |
| 1231 | 1240 | #endif |
| 1232 | 1241 | |
| r14896 | r14897 | |
| 1237 | 1246 | if(pc == 0x6002cba || pc == 0x6002d42) |
| 1238 | 1247 | return 0; |
| 1239 | 1248 | |
| 1240 | return m_sysh1_workram_h[0xd8894/4]; | |
| 1249 | return m_sysh1_workram_h.target()[0xd8894/4]; | |
| 1241 | 1250 | } |
| 1242 | 1251 | |
| 1243 | 1252 | static DRIVER_INIT( coolridr ) |
| r14896 | r14897 | |
|---|---|---|
| 296 | 296 | { |
| 297 | 297 | public: |
| 298 | 298 | blitz_state(const machine_config &mconfig, device_type type, const char *tag) |
| 299 | : driver_device(mconfig, type, tag) { } | |
| 299 | : driver_device(mconfig, type, tag) , | |
| 300 | m_videoram(*this, "videoram"), | |
| 301 | m_colorram(*this, "colorram"){ } | |
| 300 | 302 | |
| 301 | UINT8 *m_videoram; | |
| 302 | UINT8 *m_colorram; | |
| 303 | required_shared_ptr<UINT8> m_videoram; | |
| 304 | required_shared_ptr<UINT8> m_colorram; | |
| 303 | 305 | tilemap_t *m_bg_tilemap; |
| 304 | 306 | int m_mux_data; |
| 305 | 307 | DECLARE_WRITE8_MEMBER(megadpkr_videoram_w); |
| r14896 | r14897 | |
| 315 | 317 | |
| 316 | 318 | WRITE8_MEMBER(blitz_state::megadpkr_videoram_w) |
| 317 | 319 | { |
| 318 | m_videoram[offset] = data; | |
| 320 | m_videoram.target()[offset] = data; | |
| 319 | 321 | m_bg_tilemap->mark_tile_dirty(offset); |
| 320 | 322 | } |
| 321 | 323 | |
| 322 | 324 | WRITE8_MEMBER(blitz_state::megadpkr_colorram_w) |
| 323 | 325 | { |
| 324 | m_colorram[offset] = data; | |
| 326 | m_colorram.target()[offset] = data; | |
| 325 | 327 | m_bg_tilemap->mark_tile_dirty(offset); |
| 326 | 328 | } |
| 327 | 329 | |
| r14896 | r14897 | |
| 337 | 339 | xx-- ---- unused. |
| 338 | 340 | */ |
| 339 | 341 | |
| 340 | int attr = state->m_colorram[tile_index]; | |
| 341 | int code = ((attr & 1) << 8) | state->m_videoram[tile_index]; | |
| 342 | int attr = state->m_colorram.target()[tile_index]; | |
| 343 | int code = ((attr & 1) << 8) | state->m_videoram.target()[tile_index]; | |
| 342 | 344 | int bank = (attr & 0x02) >> 1; /* bit 1 switch the gfx banks */ |
| 343 | 345 | int color = (attr & 0x3c) >> 2; /* bits 2-3-4-5 for color */ |
| 344 | 346 | |
| r14896 | r14897 | |
| 485 | 487 | AM_RANGE(0x10f8, 0x10fb) AM_DEVREADWRITE("pia1", pia6821_device, read, write) |
| 486 | 488 | */ |
| 487 | 489 | |
| 488 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(megadpkr_videoram_w) AM_BASE(m_videoram) | |
| 489 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(megadpkr_colorram_w) AM_BASE(m_colorram) | |
| 490 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(megadpkr_videoram_w) AM_SHARE("videoram") | |
| 491 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(megadpkr_colorram_w) AM_SHARE("colorram") | |
| 490 | 492 | |
| 491 | 493 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 492 | 494 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | public: |
| 34 | 34 | gaminator_state(const machine_config &mconfig, device_type type, const char *tag) |
| 35 | : driver_device(mconfig, type, tag) { } | |
| 35 | : driver_device(mconfig, type, tag){ } | |
| 36 | DECLARE_WRITE32_MEMBER(gamtor_unk_w); | |
| 36 | 37 | }; |
| 37 | 38 | |
| 38 | ||
| 39 | ||
| 39 | 40 | { |
| 40 | 41 | |
| 41 | 42 | } |
| r14896 | r14897 | |
| 45 | 46 | static ADDRESS_MAP_START( gaminator_map, AS_PROGRAM, 32, gaminator_state ) |
| 46 | 47 | AM_RANGE(0x00000000, 0x07ffffff) AM_ROM |
| 47 | 48 | AM_RANGE(0x08000000, 0x0bffffff) AM_RAM |
| 48 | AM_RANGE(0x1e040008, 0x1e04000b) AM_WRITE | |
| 49 | AM_RANGE(0x1e040008, 0x1e04000b) AM_WRITE | |
| 49 | 50 | |
| 50 | 51 | AM_RANGE(0x20000000, 0x2003ffff) AM_RAM |
| 51 | 52 | |
| 52 | 53 | /* standard VGA */ |
| 53 | 54 | // AM_RANGE(0x40000000, 0x40000fff) AM_RAM // regs |
| 54 | 55 | AM_RANGE(0x44000000, 0x4401ffff) AM_RAM // VRAM |
| 55 | // AM_RANGE(0x44000000, 0x44007fff) AM_RAM AM_BASE(m_tmapram1) // puts strings here, looks almost like a tilemap, but where are the tiles? | |
| 56 | // AM_RANGE(0x440a0000, 0x440a1fff) AM_RAM AM_BASE(m_tmapram2) // beetlem (like above, mirror?) | |
| 56 | // AM_RANGE(0x44000000, 0x44007fff) AM_RAM AM_SHARE("tmapram1") // puts strings here, looks almost like a tilemap, but where are the tiles? | |
| 57 | // AM_RANGE(0x440a0000, 0x440a1fff) AM_RAM AM_SHARE("tmapram2") // beetlem (like above, mirror?) | |
| 57 | 58 | |
| 58 | 59 | AM_RANGE(0xe0000000, 0xe00001ff) AM_RAM // nvram? |
| 59 | 60 |
| r14896 | r14897 | |
|---|---|---|
| 135 | 135 | AM_RANGE(0x8207, 0x8207) AM_MIRROR(0x00f8) AM_WRITE(tutankhm_flip_screen_y_w) |
| 136 | 136 | AM_RANGE(0x8300, 0x8300) AM_MIRROR(0x00ff) AM_WRITE(tutankhm_bankselect_w) |
| 137 | 137 | AM_RANGE(0x8600, 0x8600) AM_MIRROR(0x00ff) AM_WRITE_LEGACY(timeplt_sh_irqtrigger_w) |
| 138 | AM_RANGE(0x8700, 0x8700) AM_MIRROR(0x00ff) AM_WRITE(soundlatch_w) | |
| 138 | AM_RANGE(0x8700, 0x8700) AM_MIRROR(0x00ff) AM_WRITE(soundlatch_byte_w) | |
| 139 | 139 | AM_RANGE(0x8800, 0x8fff) AM_RAM |
| 140 | 140 | AM_RANGE(0x9000, 0x9fff) AM_ROMBANK("bank1") |
| 141 | 141 | AM_RANGE(0xa000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 73 | 73 | AM_RANGE(0x108006, 0x108007) AM_READ_PORT("GUNY2") |
| 74 | 74 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_BASE(m_vregs) /* Video Registers */ |
| 75 | 75 | AM_RANGE(0x10800c, 0x10800d) AM_WRITENOP /* CLR Video INT */ |
| 76 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 76 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 77 | 77 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 78 | 78 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2") |
| 79 | 79 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | 21 | intrscti_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | : driver_device(mconfig, type, tag) { } | |
| 22 | : driver_device(mconfig, type, tag) , | |
| 23 | m_ram(*this, "ram"){ } | |
| 23 | 24 | |
| 24 | UINT8 | |
| 25 | required_shared_ptr<UINT8> | |
| 25 | 26 | DECLARE_READ8_MEMBER(unk_r); |
| 26 | 27 | }; |
| 27 | 28 | |
| r14896 | r14897 | |
| 34 | 35 | static ADDRESS_MAP_START( intrscti_map, AS_PROGRAM, 8, intrscti_state ) |
| 35 | 36 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 36 | 37 | AM_RANGE(0x6000, 0x67ff) AM_RAM |
| 37 | AM_RANGE(0x7000, 0x77ff) AM_RAM AM_ | |
| 38 | AM_RANGE(0x7000, 0x77ff) AM_RAM AM_ | |
| 38 | 39 | AM_RANGE(0x8000, 0x8fff) AM_ROM |
| 39 | 40 | ADDRESS_MAP_END |
| 40 | 41 | |
| r14896 | r14897 | |
| 81 | 82 | for (x=0;x<32;x++) |
| 82 | 83 | { |
| 83 | 84 | int dat; |
| 84 | dat = state->m_ram[count]; | |
| 85 | dat = state->m_ram.target()[count]; | |
| 85 | 86 | drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0); |
| 86 | 87 | count++; |
| 87 | 88 | } |
| r14896 | r14897 | |
|---|---|---|
| 347 | 347 | static ADDRESS_MAP_START( rbisland_map, AS_PROGRAM, 16, rbisland_state ) |
| 348 | 348 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 349 | 349 | AM_RANGE(0x10c000, 0x10ffff) AM_RAM /* main RAM */ |
| 350 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 350 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 351 | 351 | AM_RANGE(0x201000, 0x203fff) AM_RAM /* r/w in initial checks */ |
| 352 | 352 | AM_RANGE(0x390000, 0x390003) AM_READ_PORT("DSWA") |
| 353 | 353 | AM_RANGE(0x3a0000, 0x3a0001) AM_WRITE(rbisland_spritectrl_w) |
| r14896 | r14897 | |
| 368 | 368 | static ADDRESS_MAP_START( jumping_map, AS_PROGRAM, 16, rbisland_state ) |
| 369 | 369 | AM_RANGE(0x000000, 0x09ffff) AM_ROM |
| 370 | 370 | AM_RANGE(0x10c000, 0x10ffff) AM_RAM /* main RAM */ |
| 371 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 371 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 372 | 372 | AM_RANGE(0x201000, 0x203fff) AM_RAM /* r/w in initial checks */ |
| 373 | 373 | AM_RANGE(0x400000, 0x400001) AM_READ_PORT("DSWA") |
| 374 | 374 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("DSWB") |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | if (ACCESSING_BITS_0_7) |
| 33 | 33 | { |
| 34 | soundlatch_w(space,offset,data & 0xff); | |
| 34 | soundlatch_byte_w(space,offset,data & 0xff); | |
| 35 | 35 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 36 | 36 | } |
| 37 | 37 | } |
| r14896 | r14897 | |
| 51 | 51 | AM_RANGE(0x905000, 0x907fff) AM_WRITENOP /* ??? */ |
| 52 | 52 | AM_RANGE(0x980000, 0x9bffff) AM_RAM AM_BASE(m_bgvideoram) |
| 53 | 53 | AM_RANGE(0xa00000, 0xa00fff) AM_WRITENOP /* more palette ? */ |
| 54 | AM_RANGE(0xa01000, 0xa017ff) AM_WRITE(paletteram | |
| 54 | AM_RANGE(0xa01000, 0xa017ff) AM_WRITE(paletteram | |
| 55 | 55 | AM_RANGE(0xa01800, 0xa027ff) AM_WRITENOP /* more palette ? */ |
| 56 | 56 | AM_RANGE(0xa80000, 0xa80001) AM_READ_PORT("IN0") |
| 57 | 57 | AM_RANGE(0xa80010, 0xa80011) AM_READ_PORT("IN1") AM_WRITE(soundcommand_w) |
| r14896 | r14897 | |
| 67 | 67 | AM_RANGE(0xf800, 0xf800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 68 | 68 | AM_RANGE(0xf810, 0xf811) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 69 | 69 | AM_RANGE(0xfc00, 0xfc00) AM_NOP /* irq ack ?? */ |
| 70 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 70 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r) | |
| 71 | 71 | ADDRESS_MAP_END |
| 72 | 72 | |
| 73 | 73 |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | WRITE8_MEMBER(tryout_state::tryout_sound_w) |
| 34 | 34 | { |
| 35 | soundlatch_w(space, 0, data); | |
| 35 | soundlatch_byte_w(space, 0, data); | |
| 36 | 36 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 37 | 37 | } |
| 38 | 38 | |
| r14896 | r14897 | |
| 76 | 76 | static ADDRESS_MAP_START( sound_cpu, AS_PROGRAM, 8, tryout_state ) |
| 77 | 77 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 78 | 78 | AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 79 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 79 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 80 | 80 | AM_RANGE(0xd000, 0xd000) AM_WRITE(tryout_sound_irq_ack_w) |
| 81 | 81 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 82 | 82 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | device_t *m_pic8259_2; |
| 41 | 41 | device_t *m_dma8237_1; |
| 42 | 42 | device_t *m_dma8237_2; |
| 43 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 44 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 45 | DECLARE_READ8_MEMBER(dma_page_select_r); | |
| 46 | DECLARE_WRITE8_MEMBER(dma_page_select_w); | |
| 43 | 47 | }; |
| 44 | 48 | |
| 45 | 49 | |
| r14896 | r14897 | |
| 58 | 62 | } |
| 59 | 63 | |
| 60 | 64 | |
| 61 | ||
| 65 | ||
| 62 | 66 | { |
| 63 | photoply_state *state = space->machine().driver_data<photoply_state>(); | |
| 64 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 67 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 65 | 68 | & 0xFF0000; |
| 66 | 69 | |
| 67 | return space | |
| 70 | return space. | |
| 68 | 71 | } |
| 69 | 72 | |
| 70 | 73 | |
| 71 | ||
| 74 | ||
| 72 | 75 | { |
| 73 | photoply_state *state = space->machine().driver_data<photoply_state>(); | |
| 74 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 76 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 75 | 77 | & 0xFF0000; |
| 76 | 78 | |
| 77 | space | |
| 79 | space. | |
| 78 | 80 | } |
| 79 | 81 | |
| 80 | ||
| 82 | ||
| 81 | 83 | { |
| 82 | photoply_state *state = space->machine().driver_data<photoply_state>(); | |
| 83 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 84 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 84 | 85 | |
| 85 | 86 | switch(offset % 8) |
| 86 | 87 | { |
| 87 | 88 | case 1: |
| 88 | data = | |
| 89 | data = | |
| 89 | 90 | break; |
| 90 | 91 | case 2: |
| 91 | data = | |
| 92 | data = | |
| 92 | 93 | break; |
| 93 | 94 | case 3: |
| 94 | data = | |
| 95 | data = | |
| 95 | 96 | break; |
| 96 | 97 | case 7: |
| 97 | data = | |
| 98 | data = | |
| 98 | 99 | break; |
| 99 | 100 | } |
| 100 | 101 | return data; |
| 101 | 102 | } |
| 102 | 103 | |
| 103 | 104 | |
| 104 | ||
| 105 | ||
| 105 | 106 | { |
| 106 | photoply_state *state = space->machine().driver_data<photoply_state>(); | |
| 107 | state->m_at_pages[offset % 0x10] = data; | |
| 107 | m_at_pages[offset % 0x10] = data; | |
| 108 | 108 | |
| 109 | 109 | switch(offset % 8) |
| 110 | 110 | { |
| 111 | 111 | case 1: |
| 112 | | |
| 112 | | |
| 113 | 113 | break; |
| 114 | 114 | case 2: |
| 115 | | |
| 115 | | |
| 116 | 116 | break; |
| 117 | 117 | case 3: |
| 118 | | |
| 118 | | |
| 119 | 119 | break; |
| 120 | 120 | case 7: |
| 121 | | |
| 121 | | |
| 122 | 122 | break; |
| 123 | 123 | } |
| 124 | 124 | } |
| r14896 | r14897 | |
| 138 | 138 | { |
| 139 | 139 | DEVCB_LINE(pc_dma_hrq_changed), |
| 140 | 140 | DEVCB_NULL, |
| 141 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 142 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 141 | DEVCB_DRIVER_MEMBER(photoply_state, pc_dma_read_byte), | |
| 142 | DEVCB_DRIVER_MEMBER(photoply_state, pc_dma_write_byte), | |
| 143 | 143 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 144 | 144 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 145 | 145 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 248 | 248 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 249 | 249 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 250 | 250 | AM_RANGE(0x0070, 0x007f) AM_RAM//DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) |
| 251 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 251 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 252 | 252 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 253 | 253 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8_LEGACY("dma8237_2", i8237_r, i8237_w, 0xffff) |
| 254 | 254 | AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 146 | 146 | WRITE16_MEMBER(rungun_state::sound_cmd1_w) |
| 147 | 147 | { |
| 148 | 148 | if (ACCESSING_BITS_8_15) |
| 149 | soundlatch_w(space, 0, data >> 8); | |
| 149 | soundlatch_byte_w(space, 0, data >> 8); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | WRITE16_MEMBER(rungun_state::sound_cmd2_w) |
| 153 | 153 | { |
| 154 | 154 | if (ACCESSING_BITS_8_15) |
| 155 | soundlatch2_w(space, 0, data >> 8); | |
| 155 | soundlatch2_byte_w(space, 0, data >> 8); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | WRITE16_MEMBER(rungun_state::sound_irq_w) |
| r14896 | r14897 | |
| 181 | 181 | |
| 182 | 182 | static ADDRESS_MAP_START( rungun_map, AS_PROGRAM, 16, rungun_state ) |
| 183 | 183 | AM_RANGE(0x000000, 0x2fffff) AM_ROM // main program + data |
| 184 | AM_RANGE(0x300000, 0x3007ff) AM_RAM_WRITE(paletteram | |
| 184 | AM_RANGE(0x300000, 0x3007ff) AM_RAM_WRITE(paletteram | |
| 185 | 185 | AM_RANGE(0x380000, 0x39ffff) AM_RAM // work RAM |
| 186 | 186 | AM_RANGE(0x400000, 0x43ffff) AM_READNOP // AM_READ_LEGACY(K053936_0_rom_r ) // '936 ROM readback window |
| 187 | 187 | AM_RANGE(0x480000, 0x48001f) AM_READWRITE(rng_sysregs_r, rng_sysregs_w) AM_BASE(m_sysreg) |
| r14896 | r14897 | |
| 247 | 247 | AM_RANGE(0xe400, 0xe62f) AM_DEVREADWRITE("k054539_1", k054539_device, read, write) |
| 248 | 248 | AM_RANGE(0xe630, 0xe7ff) AM_RAM |
| 249 | 249 | AM_RANGE(0xf000, 0xf000) AM_WRITE(sound_status_w) |
| 250 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 251 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 250 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r) | |
| 251 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_byte_r) | |
| 252 | 252 | AM_RANGE(0xf800, 0xf800) AM_WRITE(z80ctrl_w) |
| 253 | 253 | AM_RANGE(0xfff0, 0xfff3) AM_WRITENOP |
| 254 | 254 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 279 | 279 | { |
| 280 | 280 | public: |
| 281 | 281 | sfbonus_state(const machine_config &mconfig, device_type type, const char *tag) |
| 282 | : driver_device(mconfig, type, tag) { } | |
| 282 | : driver_device(mconfig, type, tag) , | |
| 283 | m_nvram(*this, "nvram"), | |
| 284 | m_1800_regs(*this, "1800_regs"), | |
| 285 | m_vregs(*this, "vregs"), | |
| 286 | m_2801_regs(*this, "2801_regs"), | |
| 287 | m_2c01_regs(*this, "2c01_regs"), | |
| 288 | m_3000_regs(*this, "3000_regs"), | |
| 289 | m_3800_regs(*this, "3800_regs"){ } | |
| 283 | 290 | |
| 284 | 291 | bitmap_ind16 *m_temp_reel_bitmap; |
| 285 | 292 | tilemap_t *m_tilemap; |
| r14896 | r14897 | |
| 293 | 300 | UINT8 *m_reel3_ram; |
| 294 | 301 | UINT8 *m_reel4_ram; |
| 295 | 302 | UINT8* m_videoram; |
| 296 | UINT8 *m_vregs; | |
| 297 | UINT8 *m_nvram; | |
| 298 | size_t m_nvram_size; | |
| 299 | UINT8* m_1800_regs; | |
| 300 | UINT8* m_3800_regs; | |
| 301 | UINT8* m_3000_regs; | |
| 302 | UINT8* m_2801_regs; | |
| 303 | UINT8* m_2c01_regs; | |
| 303 | required_shared_ptr<UINT8> m_nvram; | |
| 304 | required_shared_ptr<UINT8> m_1800_regs; | |
| 305 | required_shared_ptr<UINT8> m_vregs; | |
| 306 | required_shared_ptr<UINT8> m_2801_regs; | |
| 307 | required_shared_ptr<UINT8> m_2c01_regs; | |
| 308 | required_shared_ptr<UINT8> m_3000_regs; | |
| 309 | required_shared_ptr<UINT8> m_3800_regs; | |
| 304 | 310 | DECLARE_WRITE8_MEMBER(sfbonus_videoram_w); |
| 305 | 311 | DECLARE_WRITE8_MEMBER(sfbonus_bank_w); |
| 306 | 312 | DECLARE_READ8_MEMBER(sfbonus_2800_r); |
| r14896 | r14897 | |
| 802 | 808 | UINT8* selectbase = &state->m_videoram[0x600]; |
| 803 | 809 | UINT8* bg_scroll = &state->m_videoram[0x000]; |
| 804 | 810 | UINT8* reels_rowscroll = &state->m_videoram[0x400]; |
| 805 | int globalyscrollreels = (state->m_vregs[6] | state->m_vregs[7]<<8); | |
| 806 | int globalxscrollreels = (state->m_vregs[4] | state->m_vregs[5]<<8); | |
| 811 | int globalyscrollreels = (state->m_vregs.target()[6] | state->m_vregs.target()[7]<<8); | |
| 812 | int globalxscrollreels = (state->m_vregs.target()[4] | state->m_vregs.target()[5]<<8); | |
| 807 | 813 | globalyscrollreels += 8; |
| 808 | 814 | globalxscrollreels += 8; |
| 809 | 815 | |
| r14896 | r14897 | |
| 932 | 938 | { |
| 933 | 939 | sfbonus_state *state = screen.machine().driver_data<sfbonus_state>(); |
| 934 | 940 | |
| 935 | int globalyscroll = (state->m_vregs[2] | state->m_vregs[3]<<8); | |
| 936 | int globalxscroll = (state->m_vregs[0] | state->m_vregs[1]<<8); | |
| 941 | int globalyscroll = (state->m_vregs.target()[2] | state->m_vregs.target()[3]<<8); | |
| 942 | int globalxscroll = (state->m_vregs.target()[0] | state->m_vregs.target()[1]<<8); | |
| 937 | 943 | UINT8* front_rowscroll = &state->m_videoram[0x200]; |
| 938 | 944 | ioport_constructor ipt; |
| 939 | 945 | int i; |
| r14896 | r14897 | |
| 991 | 997 | } |
| 992 | 998 | #if 0 |
| 993 | 999 | popmessage("%02x %02x %02x %02x %02x %02x %02x %02x -- %02x -- %02x %02x -- %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", |
| 994 | state->m_3800_regs[0], | |
| 995 | state->m_3800_regs[1], | |
| 996 | state->m_3800_regs[2], | |
| 997 | state->m_3800_regs[3], | |
| 998 | state->m_3800_regs[4], | |
| 999 | state->m_3800_regs[5], | |
| 1000 | state->m_3800_regs[6], | |
| 1001 | state->m_3800_regs[7], | |
| 1002 | state->m_3000_regs[0], | |
| 1003 | state->m_2801_regs[0], | |
| 1004 | state->m_2c01_regs[0], | |
| 1005 | state->m_vregs[8], | |
| 1006 | state->m_vregs[0], | |
| 1007 | state->m_vregs[10], | |
| 1008 | state->m_vregs[11], | |
| 1009 | state->m_vregs[12], | |
| 1010 | state->m_vregs[13], | |
| 1011 | state->m_vregs[14], | |
| 1012 | state->m_vregs[15], | |
| 1013 | state->m_vregs[16], | |
| 1014 | state->m_vregs[17], | |
| 1015 | state->m_vregs[18], | |
| 1016 | state->m_vregs[19], | |
| 1017 | state->m_vregs[20], | |
| 1018 | state->m_vregs[21], | |
| 1019 | state->m_vregs[22], | |
| 1020 | state->m_vregs[23], | |
| 1021 | state->m_vregs[24], | |
| 1022 | state->m_vregs[25], | |
| 1023 | state->m_vregs[26], | |
| 1024 | state->m_vregs[27], | |
| 1025 | state->m_vregs[28], | |
| 1026 | state->m_vregs[29], | |
| 1027 | state->m_vregs[30], | |
| 1028 | state->m_vregs[31] | |
| 1000 | state->m_3800_regs.target()[0], | |
| 1001 | state->m_3800_regs.target()[1], | |
| 1002 | state->m_3800_regs.target()[2], | |
| 1003 | state->m_3800_regs.target()[3], | |
| 1004 | state->m_3800_regs.target()[4], | |
| 1005 | state->m_3800_regs.target()[5], | |
| 1006 | state->m_3800_regs.target()[6], | |
| 1007 | state->m_3800_regs.target()[7], | |
| 1008 | state->m_3000_regs.target()[0], | |
| 1009 | state->m_2801_regs.target()[0], | |
| 1010 | state->m_2c01_regs.target()[0], | |
| 1011 | state->m_vregs.target()[8], | |
| 1012 | state->m_vregs.target()[0], | |
| 1013 | state->m_vregs.target()[10], | |
| 1014 | state->m_vregs.target()[11], | |
| 1015 | state->m_vregs.target()[12], | |
| 1016 | state->m_vregs.target()[13], | |
| 1017 | state->m_vregs.target()[14], | |
| 1018 | state->m_vregs.target()[15], | |
| 1019 | state->m_vregs.target()[16], | |
| 1020 | state->m_vregs.target()[17], | |
| 1021 | state->m_vregs.target()[18], | |
| 1022 | state->m_vregs.target()[19], | |
| 1023 | state->m_vregs.target()[20], | |
| 1024 | state->m_vregs.target()[21], | |
| 1025 | state->m_vregs.target()[22], | |
| 1026 | state->m_vregs.target()[23], | |
| 1027 | state->m_vregs.target()[24], | |
| 1028 | state->m_vregs.target()[25], | |
| 1029 | state->m_vregs.target()[26], | |
| 1030 | state->m_vregs.target()[27], | |
| 1031 | state->m_vregs.target()[28], | |
| 1032 | state->m_vregs.target()[29], | |
| 1033 | state->m_vregs.target()[30], | |
| 1034 | state->m_vregs.target()[31] | |
| 1029 | 1035 | ); |
| 1030 | 1036 | |
| 1031 | 1037 | popmessage("-- %02x %02x %02x %02x %02x %02x %02x %02x", |
| 1032 | state->m_1800_regs[0], | |
| 1033 | state->m_1800_regs[1], | |
| 1034 | state->m_1800_regs[2], | |
| 1035 | state->m_1800_regs[3], | |
| 1036 | state->m_1800_regs[4], | |
| 1037 | state->m_1800_regs[5], | |
| 1038 | state->m_1800_regs[6], | |
| 1039 | state->m_1800_regs[7]); | |
| 1038 | state->m_1800_regs.target()[0], | |
| 1039 | state->m_1800_regs.target()[1], | |
| 1040 | state->m_1800_regs.target()[2], | |
| 1041 | state->m_1800_regs.target()[3], | |
| 1042 | state->m_1800_regs.target()[4], | |
| 1043 | state->m_1800_regs.target()[5], | |
| 1044 | state->m_1800_regs.target()[6], | |
| 1045 | state->m_1800_regs.target()[7]); | |
| 1040 | 1046 | #endif |
| 1041 | 1047 | |
| 1042 | 1048 | ipt = screen.machine().system().ipt; |
| r14896 | r14897 | |
| 1044 | 1050 | || (ipt == INPUT_PORTS_NAME(amcoe2_poker))) |
| 1045 | 1051 | { |
| 1046 | 1052 | // based on pirpok2 |
| 1047 | output_set_lamp_value(0, (state->m_1800_regs[6] & 0x1) >> 0); | |
| 1048 | output_set_lamp_value(1, (state->m_1800_regs[6] & 0x4) >> 2); | |
| 1049 | output_set_lamp_value(2, (state->m_1800_regs[5] & 0x4) >> 2); | |
| 1050 | output_set_lamp_value(3, (state->m_1800_regs[5] & 0x1) >> 0); | |
| 1051 | output_set_lamp_value(4, (state->m_1800_regs[4] & 0x4) >> 2); | |
| 1052 | output_set_lamp_value(5, (state->m_1800_regs[4] & 0x1) >> 0); | |
| 1053 | output_set_lamp_value(0, (state->m_1800_regs.target()[6] & 0x1) >> 0); | |
| 1054 | output_set_lamp_value(1, (state->m_1800_regs.target()[6] & 0x4) >> 2); | |
| 1055 | output_set_lamp_value(2, (state->m_1800_regs.target()[5] & 0x4) >> 2); | |
| 1056 | output_set_lamp_value(3, (state->m_1800_regs.target()[5] & 0x1) >> 0); | |
| 1057 | output_set_lamp_value(4, (state->m_1800_regs.target()[4] & 0x4) >> 2); | |
| 1058 | output_set_lamp_value(5, (state->m_1800_regs.target()[4] & 0x1) >> 0); | |
| 1053 | 1059 | } |
| 1054 | 1060 | else if ((ipt == INPUT_PORTS_NAME(amcoe1_reels3)) || (ipt == INPUT_PORTS_NAME(amcoe1_reels4)) |
| 1055 | 1061 | || (ipt == INPUT_PORTS_NAME(amcoe1_poker))) |
| 1056 | 1062 | { |
| 1057 | output_set_lamp_value(0, (state->m_1800_regs[0] & 0x2) >> 1); | |
| 1058 | output_set_lamp_value(1, (state->m_1800_regs[4] & 0x2) >> 1); | |
| 1059 | output_set_lamp_value(2, (state->m_1800_regs[3] & 0x2) >> 1); | |
| 1060 | output_set_lamp_value(3, (state->m_1800_regs[6] & 0x4) >> 2); | |
| 1061 | output_set_lamp_value(4, (state->m_1800_regs[4] & 0x4) >> 2); | |
| 1062 | output_set_lamp_value(5, (state->m_1800_regs[3] & 0x4) >> 2); | |
| 1063 | output_set_lamp_value(0, (state->m_1800_regs.target()[0] & 0x2) >> 1); | |
| 1064 | output_set_lamp_value(1, (state->m_1800_regs.target()[4] & 0x2) >> 1); | |
| 1065 | output_set_lamp_value(2, (state->m_1800_regs.target()[3] & 0x2) >> 1); | |
| 1066 | output_set_lamp_value(3, (state->m_1800_regs.target()[6] & 0x4) >> 2); | |
| 1067 | output_set_lamp_value(4, (state->m_1800_regs.target()[4] & 0x4) >> 2); | |
| 1068 | output_set_lamp_value(5, (state->m_1800_regs.target()[3] & 0x4) >> 2); | |
| 1063 | 1069 | } |
| 1064 | 1070 | |
| 1065 | 1071 | return 0; |
| r14896 | r14897 | |
| 1069 | 1075 | |
| 1070 | 1076 | static ADDRESS_MAP_START( sfbonus_map, AS_PROGRAM, 8, sfbonus_state ) |
| 1071 | 1077 | AM_RANGE(0x0000, 0xefff) AM_ROMBANK("bank1") AM_WRITE(sfbonus_videoram_w) |
| 1072 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_ | |
| 1078 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_ | |
| 1073 | 1079 | ADDRESS_MAP_END |
| 1074 | 1080 | |
| 1075 | 1081 | WRITE8_MEMBER(sfbonus_state::sfbonus_bank_w) |
| r14896 | r14897 | |
| 1113 | 1119 | // lamps and coin counters |
| 1114 | 1120 | WRITE8_MEMBER(sfbonus_state::sfbonus_1800_w) |
| 1115 | 1121 | { |
| 1116 | m_1800_regs[offset] = data; | |
| 1122 | m_1800_regs.target()[offset] = data; | |
| 1117 | 1123 | } |
| 1118 | 1124 | |
| 1119 | 1125 | WRITE8_MEMBER(sfbonus_state::sfbonus_3800_w) |
| 1120 | 1126 | { |
| 1121 | m_3800_regs[offset] = data; | |
| 1127 | m_3800_regs.target()[offset] = data; | |
| 1122 | 1128 | } |
| 1123 | 1129 | |
| 1124 | 1130 | WRITE8_MEMBER(sfbonus_state::sfbonus_3000_w) |
| 1125 | 1131 | { |
| 1126 | m_3000_regs[offset] = data; | |
| 1132 | m_3000_regs.target()[offset] = data; | |
| 1127 | 1133 | } |
| 1128 | 1134 | |
| 1129 | 1135 | WRITE8_MEMBER(sfbonus_state::sfbonus_2801_w) |
| 1130 | 1136 | { |
| 1131 | m_2801_regs[offset] = data; | |
| 1137 | m_2801_regs.target()[offset] = data; | |
| 1132 | 1138 | } |
| 1133 | 1139 | |
| 1134 | 1140 | WRITE8_MEMBER(sfbonus_state::sfbonus_2c01_w) |
| 1135 | 1141 | { |
| 1136 | m_2c01_regs[offset] = data; | |
| 1142 | m_2c01_regs.target()[offset] = data; | |
| 1137 | 1143 | } |
| 1138 | 1144 | |
| 1139 | 1145 | |
| r14896 | r14897 | |
| 1154 | 1160 | AM_RANGE(0x0c01, 0x0c01) AM_DEVWRITE("ramdac", ramdac_device, pal_w) |
| 1155 | 1161 | AM_RANGE(0x0c02, 0x0c02) AM_DEVWRITE("ramdac", ramdac_device, mask_w) |
| 1156 | 1162 | |
| 1157 | AM_RANGE(0x1800, 0x1807) AM_WRITE(sfbonus_1800_w) AM_ | |
| 1163 | AM_RANGE(0x1800, 0x1807) AM_WRITE(sfbonus_1800_w) AM_ | |
| 1158 | 1164 | |
| 1159 | AM_RANGE(0x2400, 0x241f) AM_RAM AM_ | |
| 1165 | AM_RANGE(0x2400, 0x241f) AM_RAM AM_ | |
| 1160 | 1166 | |
| 1161 | 1167 | AM_RANGE(0x2800, 0x2800) AM_READ(sfbonus_2800_r) |
| 1162 | AM_RANGE(0x2801, 0x2801) AM_READ(sfbonus_2801_r) AM_WRITE(sfbonus_2801_w) AM_ | |
| 1168 | AM_RANGE(0x2801, 0x2801) AM_READ(sfbonus_2801_r) AM_WRITE(sfbonus_2801_w) AM_ | |
| 1163 | 1169 | |
| 1164 | 1170 | AM_RANGE(0x2c00, 0x2c00) AM_READ(sfbonus_2c00_r) |
| 1165 | AM_RANGE(0x2c01, 0x2c01) AM_READ(sfbonus_2c01_r) AM_WRITE(sfbonus_2c01_w) AM_ | |
| 1171 | AM_RANGE(0x2c01, 0x2c01) AM_READ(sfbonus_2c01_r) AM_WRITE(sfbonus_2c01_w) AM_ | |
| 1166 | 1172 | |
| 1167 | AM_RANGE(0x3000, 0x3000) AM_WRITE(sfbonus_3000_w) AM_ | |
| 1173 | AM_RANGE(0x3000, 0x3000) AM_WRITE(sfbonus_3000_w) AM_ | |
| 1168 | 1174 | AM_RANGE(0x3400, 0x3400) AM_WRITE(sfbonus_bank_w) |
| 1169 | 1175 | AM_RANGE(0x3800, 0x3800) AM_READ(sfbonus_3800_r) |
| 1170 | 1176 | |
| 1171 | AM_RANGE(0x3800, 0x3807) AM_WRITE(sfbonus_3800_w) AM_ | |
| 1177 | AM_RANGE(0x3800, 0x3807) AM_WRITE(sfbonus_3800_w) AM_ | |
| 1172 | 1178 | ADDRESS_MAP_END |
| 1173 | 1179 | |
| 1174 | 1180 | |
| r14896 | r14897 | |
| 1217 | 1223 | { |
| 1218 | 1224 | sfbonus_state *state = machine.driver_data<sfbonus_state>(); |
| 1219 | 1225 | if (read_or_write) |
| 1220 | file->write(state->m_nvram,state->m_nvram | |
| 1226 | file->write(state->m_nvram,state->m_nvram.bytes()); | |
| 1221 | 1227 | else |
| 1222 | 1228 | { |
| 1223 | 1229 | if (file) |
| 1224 | 1230 | { |
| 1225 | memset(state->m_nvram,0x00,state->m_nvram_size); | |
| 1226 | file->read(state->m_nvram,state->m_nvram_size); | |
| 1231 | memset(state->m_nvram,0x00,state->m_nvram.bytes()); | |
| 1232 | file->read(state->m_nvram,state->m_nvram.bytes()); | |
| 1227 | 1233 | } |
| 1228 | 1234 | else |
| 1229 | 1235 | { |
| 1230 | 1236 | UINT8* defaultram = machine.region("defaults")->base(); |
| 1231 | memset(state->m_nvram,0x00,state->m_nvram | |
| 1237 | memset(state->m_nvram,0x00,state->m_nvram.bytes()); | |
| 1232 | 1238 | |
| 1233 | 1239 | if (defaultram) |
| 1234 | 1240 | if ((defaultram[0x02]==0x00) && (defaultram[0x03]==0x00)) // hack! rom region optional regions get cleared with garbage if no rom is present, this is not good! |
| r14896 | r14897 | |
|---|---|---|
| 129 | 129 | { |
| 130 | 130 | public: |
| 131 | 131 | crystal_state(const machine_config &mconfig, device_type type, const char *tag) |
| 132 | : driver_device(mconfig, type, tag) { } | |
| 132 | : driver_device(mconfig, type, tag) , | |
| 133 | m_sysregs(*this, "sysregs"), | |
| 134 | m_workram(*this, "workram"), | |
| 135 | m_vidregs(*this, "vidregs"), | |
| 136 | m_textureram(*this, "textureram"), | |
| 137 | m_frameram(*this, "frameram"), | |
| 138 | m_ResetPatch(*this, "ResetPatch"){ } | |
| 133 | 139 | |
| 134 | 140 | /* memory pointers */ |
| 135 | UINT32 * m_workram; | |
| 136 | UINT32 * m_textureram; | |
| 137 | UINT32 * m_frameram; | |
| 138 | UINT32 * m_sysregs; | |
| 139 | UINT32 * m_vidregs; | |
| 141 | required_shared_ptr<UINT32> m_sysregs; | |
| 142 | required_shared_ptr<UINT32> m_workram; | |
| 143 | required_shared_ptr<UINT32> m_vidregs; | |
| 144 | required_shared_ptr<UINT32> m_textureram; | |
| 145 | required_shared_ptr<UINT32> m_frameram; | |
| 146 | required_shared_ptr<UINT32> m_ResetPatch; | |
| 140 | 147 | // UINT32 * m_nvram; // currently this uses generic nvram handling |
| 141 | 148 | |
| 142 | 149 | #ifdef IDLE_LOOP_SPEEDUP |
| r14896 | r14897 | |
| 152 | 159 | UINT32 m_PIO; |
| 153 | 160 | UINT32 m_DMActrl[2]; |
| 154 | 161 | UINT8 m_OldPort4; |
| 155 | UINT32 *m_ResetPatch; | |
| 156 | 162 | |
| 157 | 163 | device_t *m_maincpu; |
| 158 | 164 | device_t *m_ds1302; |
| r14896 | r14897 | |
| 489 | 495 | AM_RANGE(0x01800810, 0x01800813) AM_READWRITE(DMA1_r, DMA1_w) |
| 490 | 496 | |
| 491 | 497 | AM_RANGE(0x01800c04, 0x01800c07) AM_WRITE(IntAck_w) |
| 492 | AM_RANGE(0x01800000, 0x0180ffff) AM_RAM AM_BASE(m_sysregs) | |
| 493 | AM_RANGE(0x02000000, 0x027fffff) AM_RAM AM_BASE(m_workram) | |
| 498 | AM_RANGE(0x01800000, 0x0180ffff) AM_RAM AM_SHARE("sysregs") | |
| 499 | AM_RANGE(0x02000000, 0x027fffff) AM_RAM AM_SHARE("workram") | |
| 494 | 500 | |
| 495 | 501 | AM_RANGE(0x030000a4, 0x030000a7) AM_READWRITE(FlipCount_r, FlipCount_w) |
| 496 | 502 | |
| 497 | AM_RANGE(0x03000000, 0x0300ffff) AM_RAM AM_BASE(m_vidregs) | |
| 498 | AM_RANGE(0x03800000, 0x03ffffff) AM_RAM AM_BASE(m_textureram) | |
| 499 | AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_BASE(m_frameram) | |
| 503 | AM_RANGE(0x03000000, 0x0300ffff) AM_RAM AM_SHARE("vidregs") | |
| 504 | AM_RANGE(0x03800000, 0x03ffffff) AM_RAM AM_SHARE("textureram") | |
| 505 | AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_SHARE("frameram") | |
| 500 | 506 | AM_RANGE(0x04800000, 0x04800fff) AM_DEVREADWRITE_LEGACY("vrender", vr0_snd_read, vr0_snd_write) |
| 501 | 507 | |
| 502 | 508 | AM_RANGE(0x05000000, 0x05000003) AM_READWRITE(FlashCmd_r, FlashCmd_w) |
| 503 | 509 | AM_RANGE(0x05000000, 0x05ffffff) AM_ROMBANK("bank1") |
| 504 | 510 | |
| 505 | AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_ | |
| 511 | AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_ | |
| 506 | 512 | |
| 507 | 513 | ADDRESS_MAP_END |
| 508 | 514 | |
| r14896 | r14897 | |
| 620 | 626 | state->m_Timer[i]->adjust(attotime::never); |
| 621 | 627 | } |
| 622 | 628 | |
| 623 | vr0_snd_set_areas(machine.device("vrender"), state->m_textureram, state->m_frameram); | |
| 629 | vr0_snd_set_areas(machine.device("vrender"), state->m_textureram, state->m_frameram.target()); | |
| 624 | 630 | #ifdef IDLE_LOOP_SPEEDUP |
| 625 | 631 | state->m_FlipCntRead = 0; |
| 626 | 632 | #endif |
| r14896 | r14897 | |
| 666 | 672 | } |
| 667 | 673 | |
| 668 | 674 | Visible = (UINT16*) Front; |
| 669 | DrawDest = (UINT16 *) state->m_frameram; | |
| 675 | DrawDest = (UINT16 *) state->m_frameram.target(); | |
| 670 | 676 | |
| 671 | 677 | |
| 672 | 678 | if (GetVidReg(space, 0x8c) & 0x80) |
| r14896 | r14897 | |
| 683 | 689 | tail = GetVidReg(space, 0x80); |
| 684 | 690 | while ((head & 0x7ff) != (tail & 0x7ff)) |
| 685 | 691 | { |
| 686 | DoFlip = vrender0_ProcessPacket(state->m_vr0video, 0x03800000 + head * 64, DrawDest, (UINT8*)state->m_textureram); | |
| 692 | DoFlip = vrender0_ProcessPacket(state->m_vr0video, 0x03800000 + head * 64, DrawDest, (UINT8*)state->m_textureram.target()); | |
| 687 | 693 | head++; |
| 688 | 694 | head &= 0x7ff; |
| 689 | 695 | if (DoFlip) |
| r14896 | r14897 | |
|---|---|---|
| 74 | 74 | * |
| 75 | 75 | *************************************/ |
| 76 | 76 | |
| 77 | ||
| 77 | ||
| 78 | 78 | { |
| 79 | eprom_state *state = space->machine().driver_data<eprom_state>(); | |
| 80 | int result = input_port_read(space->machine(), "260010"); | |
| 79 | int result = input_port_read(machine(), "260010"); | |
| 81 | 80 | |
| 82 | if (state->m_sound_to_cpu_ready) result ^= 0x0004; | |
| 83 | if (state->m_cpu_to_sound_ready) result ^= 0x0008; | |
| 81 | if (m_sound_to_cpu_ready) result ^= 0x0004; | |
| 82 | if (m_cpu_to_sound_ready) result ^= 0x0008; | |
| 84 | 83 | result ^= 0x0010; |
| 85 | 84 | |
| 86 | 85 | return result; |
| 87 | 86 | } |
| 88 | 87 | |
| 89 | 88 | |
| 90 | ||
| 89 | ||
| 91 | 90 | { |
| 92 | eprom_state *state = space->machine().driver_data<eprom_state>(); | |
| 93 | 91 | static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" }; |
| 94 | int result = input_port_read( | |
| 92 | int result = input_port_read( | |
| 95 | 93 | |
| 96 | | |
| 94 | | |
| 97 | 95 | return result; |
| 98 | 96 | } |
| 99 | 97 | |
| r14896 | r14897 | |
| 105 | 103 | * |
| 106 | 104 | *************************************/ |
| 107 | 105 | |
| 108 | ||
| 106 | ||
| 109 | 107 | { |
| 110 | eprom_state *state = space->machine().driver_data<eprom_state>(); | |
| 111 | 108 | |
| 112 | if (ACCESSING_BITS_0_7 && ( | |
| 109 | if (ACCESSING_BITS_0_7 && ( | |
| 113 | 110 | { |
| 114 | 111 | /* bit 0: reset extra CPU */ |
| 115 | 112 | if (data & 1) |
| 116 | cputag_set_input_line( | |
| 113 | cputag_set_input_line( | |
| 117 | 114 | else |
| 118 | cputag_set_input_line( | |
| 115 | cputag_set_input_line( | |
| 119 | 116 | |
| 120 | 117 | /* bits 1-4: screen intensity */ |
| 121 | | |
| 118 | | |
| 122 | 119 | |
| 123 | 120 | /* bit 5: video disable */ |
| 124 | | |
| 121 | | |
| 125 | 122 | } |
| 126 | 123 | } |
| 127 | 124 | |
| r14896 | r14897 | |
| 133 | 130 | * |
| 134 | 131 | *************************************/ |
| 135 | 132 | |
| 136 | ||
| 133 | ||
| 137 | 134 | { |
| 138 | eprom_state *state = space->machine().driver_data<eprom_state>(); | |
| 139 | return state->m_sync_data[offset]; | |
| 135 | return m_sync_data[offset]; | |
| 140 | 136 | } |
| 141 | 137 | |
| 142 | 138 | |
| 143 | ||
| 139 | ||
| 144 | 140 | { |
| 145 | eprom_state *state = space->machine().driver_data<eprom_state>(); | |
| 146 | int oldword = state->m_sync_data[offset]; | |
| 141 | int oldword = m_sync_data[offset]; | |
| 147 | 142 | int newword = oldword; |
| 148 | 143 | COMBINE_DATA(&newword); |
| 149 | 144 | |
| 150 | | |
| 145 | | |
| 151 | 146 | if ((oldword & 0xff00) != (newword & 0xff00)) |
| 152 | device_yield(&space | |
| 147 | device_yield(&space. | |
| 153 | 148 | } |
| 154 | 149 | |
| 155 | 150 | |
| r14896 | r14897 | |
| 167 | 162 | AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE("share1") |
| 168 | 163 | AM_RANGE(0x1f0000, 0x1fffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 169 | 164 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 170 | AM_RANGE(0x260010, 0x26001f) AM_READ_LEGACY(special_port1_r) | |
| 171 | AM_RANGE(0x260020, 0x26002f) AM_READ_LEGACY(adc_r) | |
| 165 | AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r) | |
| 166 | AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r) | |
| 172 | 167 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) |
| 173 | 168 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 174 | 169 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 175 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 170 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 176 | 171 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 177 | 172 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) |
| 178 | 173 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram") |
| r14896 | r14897 | |
| 192 | 187 | AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE("share1") |
| 193 | 188 | AM_RANGE(0x1f0000, 0x1fffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 194 | 189 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 195 | AM_RANGE(0x260010, 0x26001f) AM_READ_LEGACY(special_port1_r) | |
| 196 | AM_RANGE(0x260020, 0x26002f) AM_READ_LEGACY(adc_r) | |
| 190 | AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r) | |
| 191 | AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r) | |
| 197 | 192 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) |
| 198 | 193 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 199 | 194 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 200 | // AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 195 | // AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 201 | 196 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 202 | 197 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) |
| 203 | 198 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram") |
| r14896 | r14897 | |
| 220 | 215 | |
| 221 | 216 | static ADDRESS_MAP_START( extra_map, AS_PROGRAM, 16, eprom_state ) |
| 222 | 217 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 223 | AM_RANGE(0x16cc00, 0x16cc01) AM_READWRITE | |
| 218 | AM_RANGE(0x16cc00, 0x16cc01) AM_READWRITE | |
| 224 | 219 | AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE("share1") |
| 225 | 220 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 226 | AM_RANGE(0x260010, 0x26001f) AM_READ_LEGACY(special_port1_r) | |
| 227 | AM_RANGE(0x260020, 0x26002f) AM_READ_LEGACY(adc_r) | |
| 221 | AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r) | |
| 222 | AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r) | |
| 228 | 223 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) |
| 229 | 224 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 230 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 225 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 231 | 226 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 232 | 227 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) |
| 233 | 228 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 728 | 723 | atarijsa_init(machine, "260010", 0x0002); |
| 729 | 724 | |
| 730 | 725 | /* install CPU synchronization handlers */ |
| 731 | state->m_sync_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w)); | |
| 732 | state->m_sync_data = machine.device("extra")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w)); | |
| 726 | state->m_sync_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),state), write16_delegate(FUNC(eprom_state::sync_w),state)); | |
| 727 | state->m_sync_data = machine.device("extra")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),state), write16_delegate(FUNC(eprom_state::sync_w),state)); | |
| 733 | 728 | } |
| 734 | 729 | |
| 735 | 730 |
| r14896 | r14897 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | if (ACCESSING_BITS_0_7) |
| 31 | 31 | { |
| 32 | soundlatch_w(space, 0, data & 0xff); | |
| 32 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 33 | 33 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 34 | 34 | } |
| 35 | 35 | } |
| r14896 | r14897 | |
| 56 | 56 | AM_RANGE(0x1a4000, 0x1a4fff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w) |
| 57 | 57 | AM_RANGE(0x3e0000, 0x3e3fff) AM_RAM |
| 58 | 58 | AM_RANGE(0x3e8000, 0x3e87ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 59 | AM_RANGE(0x3f0000, 0x3f07ff) AM_RAM_WRITE(paletteram | |
| 59 | AM_RANGE(0x3f0000, 0x3f07ff) AM_RAM_WRITE(paletteram | |
| 60 | 60 | AM_RANGE(0x3f8002, 0x3f8003) AM_READ_PORT("P1_P2") |
| 61 | 61 | AM_RANGE(0x3f8004, 0x3f8005) AM_READ_PORT("DSW") |
| 62 | 62 | AM_RANGE(0x3f8006, 0x3f8007) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 72 | 72 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r,ym2151_w) |
| 73 | 73 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 74 | 74 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 75 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 75 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 76 | 76 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 77 | 77 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 78 | 78 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | public: |
| 53 | 53 | chinsan_state(const machine_config &mconfig, device_type type, const char *tag) |
| 54 | : driver_device(mconfig, type, tag) { } | |
| 54 | : driver_device(mconfig, type, tag) , | |
| 55 | m_video(*this, "video"){ } | |
| 55 | 56 | |
| 56 | 57 | /* memory pointers */ |
| 57 | UINT8 | |
| 58 | required_shared_ptr<UINT8> | |
| 58 | 59 | |
| 59 | 60 | /* misc */ |
| 60 | 61 | UINT8 m_port_select; |
| r14896 | r14897 | |
| 98 | 99 | for (x = 0; x < 64; x++) |
| 99 | 100 | { |
| 100 | 101 | int tileno, colour; |
| 101 | tileno = state->m_video[count] | (state->m_video[count + 0x800] << 8); | |
| 102 | colour = state->m_video[count + 0x1000] >> 3; | |
| 102 | tileno = state->m_video.target()[count] | (state->m_video.target()[count + 0x800] << 8); | |
| 103 | colour = state->m_video.target()[count + 0x1000] >> 3; | |
| 103 | 104 | drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tileno,colour,0,0,x*8,y*8); |
| 104 | 105 | count++; |
| 105 | 106 | } |
| r14896 | r14897 | |
| 242 | 243 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 243 | 244 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 244 | 245 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 245 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_ | |
| 246 | AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_ | |
| 246 | 247 | ADDRESS_MAP_END |
| 247 | 248 | |
| 248 | 249 | static ADDRESS_MAP_START( chinsan_io, AS_IO, 8, chinsan_state ) |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | public: |
| 94 | 94 | cshooter_state(const machine_config &mconfig, device_type type, const char *tag) |
| 95 | : driver_device(mconfig, type, tag) { } | |
| 95 | : driver_device(mconfig, type, tag) , | |
| 96 | m_txram(*this, "txram"), | |
| 97 | m_mainram(*this, "mainram"), | |
| 98 | m_spriteram(*this, "spriteram"){ } | |
| 96 | 99 | |
| 97 | UINT8 | |
| 100 | required_shared_ptr<UINT8> m_txram; | |
| 98 | 101 | tilemap_t *m_txtilemap; |
| 99 | UINT8 | |
| 102 | required_shared_ptr<UINT8> | |
| 100 | 103 | int m_coin_stat; |
| 101 | 104 | int m_counter; |
| 102 | UINT8 *m_spriteram; | |
| 103 | size_t m_spriteram_size; | |
| 105 | required_shared_ptr<UINT8> m_spriteram; | |
| 104 | 106 | DECLARE_WRITE8_MEMBER(cshooter_txram_w); |
| 105 | 107 | DECLARE_READ8_MEMBER(cshooter_coin_r); |
| 106 | 108 | DECLARE_WRITE8_MEMBER(cshooter_c500_w); |
| r14896 | r14897 | |
| 117 | 119 | static TILE_GET_INFO( get_cstx_tile_info ) |
| 118 | 120 | { |
| 119 | 121 | cshooter_state *state = machine.driver_data<cshooter_state>(); |
| 120 | int code = (state->m_txram[tile_index*2]); | |
| 121 | int attr = (state->m_txram[tile_index*2+1]); | |
| 122 | int code = (state->m_txram.target()[tile_index*2]); | |
| 123 | int attr = (state->m_txram.target()[tile_index*2+1]); | |
| 122 | 124 | int rg; |
| 123 | 125 | rg=0; |
| 124 | 126 | if (attr & 0x20) rg = 1; |
| r14896 | r14897 | |
| 133 | 135 | |
| 134 | 136 | WRITE8_MEMBER(cshooter_state::cshooter_txram_w) |
| 135 | 137 | { |
| 136 | m_txram[offset] = data; | |
| 138 | m_txram.target()[offset] = data; | |
| 137 | 139 | m_txtilemap->mark_tile_dirty(offset/2); |
| 138 | 140 | } |
| 139 | 141 | |
| r14896 | r14897 | |
| 152 | 154 | |
| 153 | 155 | //sprites |
| 154 | 156 | { |
| 155 | UINT8 *spriteram = state->m_spriteram; | |
| 157 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 156 | 158 | int i; |
| 157 | for(i=0;i<state->m_spriteram | |
| 159 | for(i=0;i<state->m_spriteram.bytes();i+=4) | |
| 158 | 160 | { |
| 159 | 161 | if(spriteram[i+3]!=0) |
| 160 | 162 | { |
| r14896 | r14897 | |
| 275 | 277 | AM_RANGE(0xc600, 0xc600) AM_WRITENOP // see notes |
| 276 | 278 | AM_RANGE(0xc700, 0xc700) AM_WRITE(cshooter_c700_w) |
| 277 | 279 | AM_RANGE(0xc801, 0xc801) AM_WRITENOP // see notes |
| 278 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(cshooter_txram_w) AM_ | |
| 280 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(cshooter_txram_w) AM_ | |
| 279 | 281 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 280 | 282 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 281 | 283 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 304 | 306 | AM_RANGE(0xc600, 0xc600) AM_WRITENOP // see notes |
| 305 | 307 | AM_RANGE(0xc700, 0xc700) AM_WRITE(cshooter_c700_w) |
| 306 | 308 | AM_RANGE(0xc801, 0xc801) AM_WRITENOP // see notes |
| 307 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(cshooter_txram_w) AM_ | |
| 309 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(cshooter_txram_w) AM_ | |
| 308 | 310 | AM_RANGE(0xd800, 0xdbff) AM_WRITE(pal2_w) AM_READ(pal_r) AM_SHARE("paletteram") |
| 309 | 311 | AM_RANGE(0xdc11, 0xdc11) AM_WRITE(bank_w) |
| 310 | 312 | AM_RANGE(0xdc00, 0xdc1f) AM_RAM //video registers |
| 311 | 313 | AM_RANGE(0xde00, 0xde0f) AM_READWRITE(seibu_sound_comms_r,seibu_sound_comms_w) |
| 312 | AM_RANGE(0xe000, 0xfdff) AM_RAM AM_BASE(m_mainram) | |
| 313 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 314 | AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE("mainram") | |
| 315 | AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE("spriteram") | |
| 314 | 316 | ADDRESS_MAP_END |
| 315 | 317 | |
| 316 | 318 |
| r14896 | r14897 | |
|---|---|---|
| 71 | 71 | if (ACCESSING_BITS_0_7) |
| 72 | 72 | { |
| 73 | 73 | m_pending_command = 1; |
| 74 | soundlatch_w(space, offset, data & 0xff); | |
| 74 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 75 | 75 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 76 | 76 | } |
| 77 | 77 | } |
| r14896 | r14897 | |
| 81 | 81 | if (ACCESSING_BITS_8_15) |
| 82 | 82 | { |
| 83 | 83 | m_pending_command = 1; |
| 84 | soundlatch_w(space, offset, (data >> 8) & 0xff); | |
| 84 | soundlatch_byte_w(space, offset, (data >> 8) & 0xff); | |
| 85 | 85 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 86 | 86 | } |
| 87 | 87 | } |
| r14896 | r14897 | |
| 90 | 90 | { |
| 91 | 91 | if(ACCESSING_BITS_8_15) |
| 92 | 92 | { |
| 93 | soundlatch_w(space, 0, (data >> 8) & 0xff); | |
| 93 | soundlatch_byte_w(space, 0, (data >> 8) & 0xff); | |
| 94 | 94 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 95 | 95 | } |
| 96 | 96 | } |
| r14896 | r14897 | |
| 142 | 142 | AM_RANGE(0xff8000, 0xff8fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(m_bg1videoram) |
| 143 | 143 | AM_RANGE(0xffc000, 0xffc3ff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 144 | 144 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(m_rasterram) /* bg1 scroll registers */ |
| 145 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 145 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 146 | 146 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE(pspikes_palette_bank_w) |
| 147 | 147 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE(pspikes_gfxbank_w) |
| 148 | 148 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_WRITE(aerofgt_bg1scrolly_w) |
| r14896 | r14897 | |
| 158 | 158 | AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 159 | 159 | AM_RANGE(0xffd200, 0xffd201) AM_WRITE(pspikesb_gfxbank_w) |
| 160 | 160 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(m_rasterram) /* bg1 scroll registers */ |
| 161 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 161 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 162 | 162 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") |
| 163 | 163 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") |
| 164 | 164 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_WRITE(aerofgt_bg1scrolly_w) |
| r14896 | r14897 | |
| 178 | 178 | AM_RANGE(0xffc000, 0xffcfff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 179 | 179 | //AM_RANGE(0xffd200, 0xffd201) AM_WRITE(pspikesb_gfxbank_w) |
| 180 | 180 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(m_rasterram) /* bg1 scroll registers */ |
| 181 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 181 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 182 | 182 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") |
| 183 | 183 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE(pspikes_gfxbank_w) |
| 184 | 184 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_WRITE(aerofgt_bg1scrolly_w) |
| r14896 | r14897 | |
| 193 | 193 | AM_RANGE(0xff8000, 0xff8fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(m_bg1videoram) |
| 194 | 194 | AM_RANGE(0xffc000, 0xffcbff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 195 | 195 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(m_rasterram) /* bg1 scroll registers */ |
| 196 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 196 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 197 | 197 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE(pspikes_palette_bank_w) |
| 198 | 198 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE(pspikes_gfxbank_w) |
| 199 | 199 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 211 | 211 | AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* work RAM */ |
| 212 | 212 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 213 | 213 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 214 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_RAM_WRITE(paletteram | |
| 214 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_RAM_WRITE(paletteram | |
| 215 | 215 | AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0") |
| 216 | 216 | AM_RANGE(0x0ff002, 0x0ff003) AM_READ_PORT("IN1") AM_WRITE(karatblz_gfxbank_w) |
| 217 | 217 | AM_RANGE(0x0ff004, 0x0ff005) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 229 | 229 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* work RAM */ |
| 230 | 230 | AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 231 | 231 | AM_RANGE(0xffd000, 0xffd1ff) AM_RAM AM_BASE(m_rasterram) /* bg1 scroll registers */ |
| 232 | AM_RANGE(0xffe000, 0xffe7ff) AM_RAM_WRITE(paletteram | |
| 232 | AM_RANGE(0xffe000, 0xffe7ff) AM_RAM_WRITE(paletteram | |
| 233 | 233 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE(spinlbrk_gfxbank_w) |
| 234 | 234 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE(aerofgt_bg2scrollx_w) |
| 235 | 235 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 247 | 247 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 248 | 248 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 249 | 249 | AM_RANGE(0x0fd000, 0x0fdfff) AM_RAM AM_BASE(m_rasterram) /* bg1 scroll registers */ |
| 250 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_RAM_WRITE(paletteram | |
| 250 | AM_RANGE(0x0fe000, 0x0fe7ff) AM_RAM_WRITE(paletteram | |
| 251 | 251 | AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0") |
| 252 | 252 | AM_RANGE(0x0ff002, 0x0ff003) AM_READ_PORT("IN1") AM_WRITE(aerofgt_bg1scrolly_w) |
| 253 | 253 | AM_RANGE(0x0ff004, 0x0ff005) AM_READ_PORT("DSW") AM_WRITE(aerofgt_bg2scrollx_w) |
| r14896 | r14897 | |
| 267 | 267 | AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE_SIZE(m_spriteram2, m_spriteram2_size) |
| 268 | 268 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 269 | 269 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 270 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram | |
| 270 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram | |
| 271 | 271 | AM_RANGE(0x0fe000, 0x0fe001) AM_READ_PORT("IN0") |
| 272 | 272 | AM_RANGE(0x0fe002, 0x0fe003) AM_READ_PORT("IN1") AM_WRITE(aerofgt_bg1scrolly_w) |
| 273 | 273 | AM_RANGE(0x0fe004, 0x0fe005) AM_READ_PORT("DSW1") AM_WRITE(aerofgt_bg2scrollx_w) |
| r14896 | r14897 | |
| 280 | 280 | |
| 281 | 281 | static ADDRESS_MAP_START( aerofgt_map, AS_PROGRAM, 16, aerofgt_state ) |
| 282 | 282 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 283 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM_WRITE(paletteram | |
| 283 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM_WRITE(paletteram | |
| 284 | 284 | AM_RANGE(0x1b0000, 0x1b07ff) AM_RAM AM_BASE(m_rasterram) /* used only for the scroll registers */ |
| 285 | 285 | AM_RANGE(0x1b0800, 0x1b0801) AM_NOP /* ??? */ |
| 286 | 286 | AM_RANGE(0x1b0ff0, 0x1b0fff) AM_RAM /* stack area during boot */ |
| r14896 | r14897 | |
| 312 | 312 | AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE_SIZE(m_spriteram2, m_spriteram2_size) |
| 313 | 313 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 314 | 314 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM //AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 315 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram | |
| 315 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram | |
| 316 | 316 | AM_RANGE(0x0fe000, 0x0fe001) AM_READ_PORT("IN0") |
| 317 | 317 | AM_RANGE(0x0fe002, 0x0fe003) AM_READ_PORT("IN1") |
| 318 | 318 | AM_RANGE(0x0fe004, 0x0fe005) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 341 | 341 | AM_RANGE(0x0e4000, 0x0e7fff) AM_RAM AM_BASE_SIZE(m_spriteram2, m_spriteram2_size) |
| 342 | 342 | AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */ |
| 343 | 343 | AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 344 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram | |
| 344 | AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_WRITE(paletteram | |
| 345 | 345 | AM_RANGE(0x0fe000, 0x0fe001) AM_READ_PORT("IN0") |
| 346 | 346 | AM_RANGE(0x0fe002, 0x0fe003) AM_READ_PORT("IN1") |
| 347 | 347 | AM_RANGE(0x0fe004, 0x0fe005) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 368 | 368 | AM_RANGE(0xff8000, 0xff8fff) AM_RAM_WRITE(aerofgt_bg1videoram_w) AM_BASE(m_bg1videoram) |
| 369 | 369 | AM_RANGE(0xffc000, 0xffc3ff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram3, m_spriteram3_size) |
| 370 | 370 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM AM_BASE(m_rasterram) /* bg1 scroll registers */ |
| 371 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 371 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 372 | 372 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE(pspikes_palette_bank_w) |
| 373 | 373 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE(pspikes_gfxbank_w) |
| 374 | 374 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_WRITE(aerofgt_bg1scrolly_w) |
| r14896 | r14897 | |
| 385 | 385 | static ADDRESS_MAP_START( turbofrc_sound_portmap, AS_IO, 8, aerofgt_state ) |
| 386 | 386 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 387 | 387 | AM_RANGE(0x00, 0x00) AM_WRITE(aerofgt_sh_bankswitch_w) |
| 388 | AM_RANGE(0x14, 0x14) AM_READ(soundlatch_r) AM_WRITE(pending_command_clear_w) | |
| 388 | AM_RANGE(0x14, 0x14) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w) | |
| 389 | 389 | AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 390 | 390 | ADDRESS_MAP_END |
| 391 | 391 | |
| r14896 | r14897 | |
| 394 | 394 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 395 | 395 | AM_RANGE(0x04, 0x04) AM_WRITE(aerofgt_sh_bankswitch_w) |
| 396 | 396 | AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w) |
| 397 | AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_r) | |
| 397 | AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r) | |
| 398 | 398 | ADDRESS_MAP_END |
| 399 | 399 | |
| 400 | 400 | static ADDRESS_MAP_START( aerfboot_sound_map, AS_PROGRAM, 8, aerofgt_state ) |
| r14896 | r14897 | |
| 402 | 402 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 403 | 403 | AM_RANGE(0x9000, 0x9000) AM_WRITE(aerfboot_okim6295_banking_w) |
| 404 | 404 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 405 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 405 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 406 | 406 | ADDRESS_MAP_END |
| 407 | 407 | |
| 408 | 408 | static ADDRESS_MAP_START( wbbc97_sound_map, AS_PROGRAM, 8, aerofgt_state ) |
| r14896 | r14897 | |
| 411 | 411 | AM_RANGE(0xf800, 0xf800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 412 | 412 | AM_RANGE(0xf810, 0xf811) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 413 | 413 | AM_RANGE(0xfc00, 0xfc00) AM_NOP |
| 414 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 414 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r) | |
| 415 | 415 | ADDRESS_MAP_END |
| 416 | 416 | |
| 417 | 417 | static INPUT_PORTS_START( pspikes ) |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | AM_RANGE(0x8083, 0x8083) AM_WRITENOP /* Coin counter 1 */ |
| 63 | 63 | AM_RANGE(0x8084, 0x8084) AM_WRITENOP /* Coin counter 2 */ |
| 64 | 64 | AM_RANGE(0x8087, 0x8087) AM_WRITE(irq_mask_w) |
| 65 | AM_RANGE(0x8100, 0x8100) AM_WRITE(soundlatch_w) | |
| 65 | AM_RANGE(0x8100, 0x8100) AM_WRITE(soundlatch_byte_w) | |
| 66 | 66 | AM_RANGE(0x8182, 0x818d) AM_WRITE(rocnrope_interrupt_vector_w) |
| 67 | 67 | AM_RANGE(0x6000, 0xffff) AM_ROM |
| 68 | 68 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | public: |
| 23 | 23 | ultrsprt_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | : driver_device(mconfig, type, tag) { } | |
| 24 | : driver_device(mconfig, type, tag) , | |
| 25 | m_vram(*this, "vram"), | |
| 26 | m_workram(*this, "workram"){ } | |
| 25 | 27 | |
| 26 | UINT32 *m_vram; | |
| 27 | UINT32 *m_workram; | |
| 28 | required_shared_ptr<UINT32> m_vram; | |
| 29 | required_shared_ptr<UINT32> m_workram; | |
| 28 | 30 | DECLARE_WRITE32_MEMBER(palette_w); |
| 29 | 31 | DECLARE_READ32_MEMBER(eeprom_r); |
| 30 | 32 | DECLARE_WRITE32_MEMBER(eeprom_w); |
| r14896 | r14897 | |
| 42 | 44 | ultrsprt_state *state = screen.machine().driver_data<ultrsprt_state>(); |
| 43 | 45 | int i, j; |
| 44 | 46 | |
| 45 | UINT8 *ram = (UINT8 *)state->m_vram; | |
| 47 | UINT8 *ram = (UINT8 *)state->m_vram.target(); | |
| 46 | 48 | |
| 47 | 49 | for (j=0; j < 400; j++) |
| 48 | 50 | { |
| r14896 | r14897 | |
| 105 | 107 | ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); |
| 106 | 108 | |
| 107 | 109 | /* configure fast RAM regions for DRC */ |
| 108 | ppcdrc_add_fastram(machine.device("maincpu"), 0x80000000, 0x8007ffff, FALSE, state->m_vram); | |
| 109 | ppcdrc_add_fastram(machine.device("maincpu"), 0xff000000, 0xff01ffff, FALSE, state->m_workram); | |
| 110 | ppcdrc_add_fastram(machine.device("maincpu"), 0x80000000, 0x8007ffff, FALSE, state->m_vram.target()); | |
| 111 | ppcdrc_add_fastram(machine.device("maincpu"), 0xff000000, 0xff01ffff, FALSE, state->m_workram.target()); | |
| 110 | 112 | } |
| 111 | 113 | |
| 112 | 114 | |
| 113 | 115 | |
| 114 | 116 | static ADDRESS_MAP_START( ultrsprt_map, AS_PROGRAM, 32, ultrsprt_state ) |
| 115 | AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_ | |
| 117 | AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_ | |
| 116 | 118 | AM_RANGE(0x70000000, 0x70000003) AM_READWRITE(eeprom_r, eeprom_w) |
| 117 | 119 | AM_RANGE(0x70000020, 0x70000023) AM_READ_PORT("P1") |
| 118 | 120 | AM_RANGE(0x70000040, 0x70000043) AM_READ_PORT("P2") |
| 119 | 121 | AM_RANGE(0x70000080, 0x70000087) AM_DEVWRITE_LEGACY("k056800", k056800_host_w) |
| 120 | 122 | AM_RANGE(0x70000088, 0x7000008f) AM_DEVREAD_LEGACY("k056800", k056800_host_r) |
| 121 | 123 | AM_RANGE(0x700000e0, 0x700000e3) AM_WRITE(int_ack_w) |
| 122 | AM_RANGE(0x7f000000, 0x7f01ffff) AM_RAM AM_ | |
| 124 | AM_RANGE(0x7f000000, 0x7f01ffff) AM_RAM AM_ | |
| 123 | 125 | AM_RANGE(0x7f700000, 0x7f703fff) AM_RAM_WRITE(palette_w) AM_SHARE("paletteram") |
| 124 | 126 | AM_RANGE(0x7f800000, 0x7f9fffff) AM_MIRROR(0x00600000) AM_ROM AM_REGION("user1", 0) |
| 125 | 127 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 185 | 185 | AM_RANGE(0x01c00060, 0x01c0007f) AM_READWRITE(midyunit_protection_r, midyunit_cmos_enable_w) |
| 186 | 186 | AM_RANGE(0x01e00000, 0x01e0001f) AM_WRITE(midyunit_sound_w) |
| 187 | 187 | AM_RANGE(0x01f00000, 0x01f0001f) AM_WRITE(midyunit_control_w) |
| 188 | AM_RANGE(0x02000000, 0x05ffffff) AM_READ(midyunit_gfxrom_r) AM_BASE(m_gfx_rom | |
| 188 | AM_RANGE(0x02000000, 0x05ffffff) AM_READ(midyunit_gfxrom_r) AM_BASE_SIZE(m_gfx_rom, | |
| 189 | 189 | AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w) |
| 190 | 190 | AM_RANGE(0xff800000, 0xffffffff) AM_ROM AM_REGION("user1", 0) |
| 191 | 191 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 196 | 196 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 197 | 197 | AM_RANGE(0x9000, 0x97ff) AM_DEVWRITE_LEGACY("oki", yawdim_oki_bank_w) |
| 198 | 198 | AM_RANGE(0x9800, 0x9fff) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 199 | AM_RANGE(0xa000, 0xa7ff) AM_READ(soundlatch_r) | |
| 199 | AM_RANGE(0xa000, 0xa7ff) AM_READ(soundlatch_byte_r) | |
| 200 | 200 | ADDRESS_MAP_END |
| 201 | 201 | |
| 202 | 202 |
| r14896 | r14897 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | WRITE8_MEMBER(senjyo_state::flip_screen_w) |
| 101 | 101 | { |
| 102 | flip_screen_set( | |
| 102 | flip_screen_set( | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static WRITE8_DEVICE_HANDLER( sound_cmd_w ) |
| r14896 | r14897 | |
| 165 | 165 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("sn1", sn76496_w) |
| 166 | 166 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("sn2", sn76496_w) |
| 167 | 167 | AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("sn3", sn76496_w) |
| 168 | AM_RANGE(0xd000, 0xd000) AM_WRITE | |
| 168 | AM_RANGE(0xd000, 0xd000) AM_WRITE | |
| 169 | 169 | #if 0 |
| 170 | 170 | AM_RANGE(0xe000, 0xe000) AM_WRITE_LEGACY(unknown) |
| 171 | 171 | AM_RANGE(0xf000, 0xf000) AM_WRITE_LEGACY(unknown) |
| r14896 | r14897 | |
| 233 | 233 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("sn1", sn76496_w) |
| 234 | 234 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("sn2", sn76496_w) |
| 235 | 235 | AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("sn3", sn76496_w) |
| 236 | AM_RANGE(0xd000, 0xd000) AM_WRITE | |
| 236 | AM_RANGE(0xd000, 0xd000) AM_WRITE | |
| 237 | 237 | #if 0 |
| 238 | 238 | AM_RANGE(0xe000, 0xe000) AM_WRITE_LEGACY(unknown) |
| 239 | 239 | AM_RANGE(0xf000, 0xf000) AM_WRITE_LEGACY(unknown) |
| r14896 | r14897 | |
|---|---|---|
| 98 | 98 | { |
| 99 | 99 | public: |
| 100 | 100 | spool99_state(const machine_config &mconfig, device_type type, const char *tag) |
| 101 | : driver_device(mconfig, type, tag) { } | |
| 101 | : driver_device(mconfig, type, tag) , | |
| 102 | m_main(*this, "main"), | |
| 103 | m_vram(*this, "vram"), | |
| 104 | m_cram(*this, "cram"){ } | |
| 102 | 105 | |
| 103 | UINT8 *m_main; | |
| 106 | required_shared_ptr<UINT8> m_main; | |
| 107 | required_shared_ptr<UINT8> m_vram; | |
| 108 | required_shared_ptr<UINT8> m_cram; | |
| 104 | 109 | tilemap_t *m_sc0_tilemap; |
| 105 | UINT8 *m_cram; | |
| 106 | UINT8 *m_vram; | |
| 107 | 110 | DECLARE_WRITE8_MEMBER(spool99_vram_w); |
| 108 | 111 | DECLARE_WRITE8_MEMBER(spool99_cram_w); |
| 109 | 112 | DECLARE_READ8_MEMBER(spool99_io_r); |
| r14896 | r14897 | |
| 113 | 116 | static TILE_GET_INFO( get_spool99_tile_info ) |
| 114 | 117 | { |
| 115 | 118 | spool99_state *state = machine.driver_data<spool99_state>(); |
| 116 | int code = ((state->m_vram[tile_index*2+1]<<8) | (state->m_vram[tile_index*2+0])); | |
| 117 | int color = state->m_cram[tile_index*2+0]; | |
| 119 | int code = ((state->m_vram.target()[tile_index*2+1]<<8) | (state->m_vram.target()[tile_index*2+0])); | |
| 120 | int color = state->m_cram.target()[tile_index*2+0]; | |
| 118 | 121 | |
| 119 | 122 | SET_TILE_INFO( |
| 120 | 123 | 0, |
| r14896 | r14897 | |
| 141 | 144 | WRITE8_MEMBER(spool99_state::spool99_vram_w) |
| 142 | 145 | { |
| 143 | 146 | |
| 144 | m_vram[offset] = data; | |
| 147 | m_vram.target()[offset] = data; | |
| 145 | 148 | m_sc0_tilemap->mark_tile_dirty(offset/2); |
| 146 | 149 | } |
| 147 | 150 | |
| 148 | 151 | WRITE8_MEMBER(spool99_state::spool99_cram_w) |
| 149 | 152 | { |
| 150 | 153 | |
| 151 | m_cram[offset] = data; | |
| 154 | m_cram.target()[offset] = data; | |
| 152 | 155 | m_sc0_tilemap->mark_tile_dirty(offset/2); |
| 153 | 156 | } |
| 154 | 157 | |
| r14896 | r14897 | |
| 209 | 212 | } |
| 210 | 213 | |
| 211 | 214 | static ADDRESS_MAP_START( spool99_map, AS_PROGRAM, 8, spool99_state ) |
| 212 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_ | |
| 215 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_ | |
| 213 | 216 | AM_RANGE(0x0100, 0xaeff) AM_ROM AM_REGION("maincpu", 0x100) AM_WRITENOP |
| 214 | 217 | AM_RANGE(0xaf00, 0xafff) AM_READ(spool99_io_r) |
| 215 | 218 | AM_RANGE(0xafed, 0xafed) AM_DEVWRITE_LEGACY("eeprom", eeprom_resetline_w ) |
| r14896 | r14897 | |
| 217 | 220 | AM_RANGE(0xafef, 0xafef) AM_DEVWRITE_LEGACY("eeprom", eeprom_dataline_w ) |
| 218 | 221 | AM_RANGE(0xaff8, 0xaff8) AM_DEVWRITE("oki", okim6295_device, write) |
| 219 | 222 | |
| 220 | AM_RANGE(0xb000, 0xb3ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 223 | AM_RANGE(0xb000, 0xb3ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 221 | 224 | |
| 222 | 225 | AM_RANGE(0xb800, 0xdfff) AM_RAM |
| 223 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_BASE(m_vram) | |
| 224 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_BASE(m_cram) | |
| 226 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_SHARE("vram") | |
| 227 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_SHARE("cram") | |
| 225 | 228 | ADDRESS_MAP_END |
| 226 | 229 | |
| 227 | 230 | READ8_MEMBER(spool99_state::vcarn_io_r) |
| r14896 | r14897 | |
| 255 | 258 | } |
| 256 | 259 | |
| 257 | 260 | static ADDRESS_MAP_START( vcarn_map, AS_PROGRAM, 8, spool99_state ) |
| 258 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_ | |
| 261 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_ | |
| 259 | 262 | AM_RANGE(0x0100, 0xa6ff) AM_ROM AM_REGION("maincpu", 0x100) AM_WRITENOP |
| 260 | 263 | AM_RANGE(0xa700, 0xa7ff) AM_READ(vcarn_io_r) |
| 261 | 264 | AM_RANGE(0xa745, 0xa745) AM_DEVWRITE_LEGACY("eeprom", eeprom_resetline_w ) |
| r14896 | r14897 | |
| 263 | 266 | AM_RANGE(0xa747, 0xa747) AM_DEVWRITE_LEGACY("eeprom", eeprom_dataline_w ) |
| 264 | 267 | AM_RANGE(0xa780, 0xa780) AM_DEVWRITE("oki", okim6295_device, write) |
| 265 | 268 | |
| 266 | AM_RANGE(0xa800, 0xabff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 269 | AM_RANGE(0xa800, 0xabff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 267 | 270 | |
| 268 | 271 | AM_RANGE(0xb000, 0xdfff) AM_RAM |
| 269 | 272 | // AM_RANGE(0xdf00, 0xdfff) AM_READWRITE(vcarn_io_r,vcarn_io_w) AM_BASE_LEGACY(&vcarn_io) |
| 270 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_BASE(m_vram) | |
| 271 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_BASE(m_cram) | |
| 273 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_SHARE("vram") | |
| 274 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_SHARE("cram") | |
| 272 | 275 | ADDRESS_MAP_END |
| 273 | 276 | |
| 274 | 277 |
| r14896 | r14897 | |
|---|---|---|
| 74 | 74 | public: |
| 75 | 75 | lgp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 76 | 76 | : driver_device(mconfig, type, tag), |
| 77 | m_laserdisc(*this, "laserdisc") { } | |
| 77 | m_laserdisc(*this, "laserdisc") , | |
| 78 | m_tile_ram(*this, "tile_ram"), | |
| 79 | m_tile_control_ram(*this, "tile_control_ram"){ } | |
| 78 | 80 | |
| 79 | 81 | required_device<pioneer_ldv1000_device> m_laserdisc; |
| 80 | UINT8 *m_tile_ram; | |
| 81 | UINT8 *m_tile_control_ram; | |
| 82 | required_shared_ptr<UINT8> m_tile_ram; | |
| 83 | required_shared_ptr<UINT8> m_tile_control_ram; | |
| 82 | 84 | emu_timer *m_irq_timer; |
| 83 | 85 | DECLARE_READ8_MEMBER(ldp_read); |
| 84 | 86 | DECLARE_WRITE8_MEMBER(ldp_write); |
| r14896 | r14897 | |
| 112 | 114 | /* Somewhere there's a flag that offsets the tilemap by 0x100*x */ |
| 113 | 115 | /* Palette is likely set somewhere as well (tile_control_ram?) */ |
| 114 | 116 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], |
| 115 | state->m_tile_ram[current_screen_character], | |
| 117 | state->m_tile_ram.target()[current_screen_character], | |
| 116 | 118 | 0, |
| 117 | 119 | 0, 0, charx*8, chary*8, 0); |
| 118 | 120 | } |
| r14896 | r14897 | |
| 141 | 143 | /* PROGRAM MAPS */ |
| 142 | 144 | static ADDRESS_MAP_START( main_program_map, AS_PROGRAM, 8, lgp_state ) |
| 143 | 145 | AM_RANGE(0x0000,0x7fff) AM_ROM |
| 144 | AM_RANGE(0xe000,0xe3ff) AM_RAM AM_BASE(m_tile_ram) | |
| 145 | AM_RANGE(0xe400,0xe7ff) AM_RAM AM_BASE(m_tile_control_ram) | |
| 146 | AM_RANGE(0xe000,0xe3ff) AM_RAM AM_SHARE("tile_ram") | |
| 147 | AM_RANGE(0xe400,0xe7ff) AM_RAM AM_SHARE("tile_control_ram") | |
| 146 | 148 | |
| 147 | 149 | // AM_RANGE(0xef00,0xef00) AM_READ_PORT("IN_TEST") |
| 148 | 150 | AM_RANGE(0xef80,0xef80) AM_READWRITE(ldp_read,ldp_write) |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | AM_RANGE(0x08800, 0x0bfff) AM_WRITEONLY |
| 68 | 68 | AM_RANGE(0x0a000, 0x0a001) AM_READ_PORT("P1_P2") |
| 69 | 69 | AM_RANGE(0x0a002, 0x0a003) AM_READ_PORT("DSW") |
| 70 | AM_RANGE(0x0c000, 0x0cfff) AM_WRITE(paletteram | |
| 70 | AM_RANGE(0x0c000, 0x0cfff) AM_WRITE(paletteram | |
| 71 | 71 | AM_RANGE(0x0d000, 0x0dfff) AM_WRITEONLY |
| 72 | 72 | AM_RANGE(0x0e000, 0x0e0ff) AM_WRITEONLY AM_BASE(m_scroll_ram) |
| 73 | 73 | AM_RANGE(0x0e100, 0x0ffff) AM_WRITEONLY |
| r14896 | r14897 | |
|---|---|---|
| 278 | 278 | AM_RANGE(0x000000, 0x02ffff) AM_ROM |
| 279 | 279 | AM_RANGE(0x030000, 0x033fff) AM_RAM /* 68K and DSP shared RAM */ |
| 280 | 280 | AM_RANGE(0x040000, 0x040fff) AM_RAM AM_SHARE("spriteram") |
| 281 | AM_RANGE(0x050000, 0x050dff) AM_RAM_WRITE(paletteram | |
| 281 | AM_RANGE(0x050000, 0x050dff) AM_RAM_WRITE(paletteram | |
| 282 | 282 | AM_RANGE(0x060000, 0x060001) AM_DEVWRITE8("crtc", mc6845_device, address_w, 0x00ff) |
| 283 | 283 | AM_RANGE(0x060002, 0x060003) AM_DEVWRITE8("crtc", mc6845_device, register_w, 0x00ff) |
| 284 | 284 | AM_RANGE(0x070000, 0x070003) AM_WRITE(twincobr_txscroll_w) /* text layer scroll */ |
| r14896 | r14897 | |
|---|---|---|
| 96 | 96 | coin_counter_w(machine(), 1,data & 0x02); |
| 97 | 97 | |
| 98 | 98 | /* bit 5 = flip screen */ |
| 99 | flip_screen_set( | |
| 99 | flip_screen_set( | |
| 100 | 100 | |
| 101 | 101 | /* other bit unknown */ |
| 102 | 102 | if ((data & 0xdc) != 0x10) popmessage("coincntr %02x",data); |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE_LEGACY("k007342", k007342_r, k007342_w) /* Color RAM + Video RAM */ |
| 61 | 61 | AM_RANGE(0x2000, 0x21ff) AM_DEVREADWRITE_LEGACY("k007420", k007420_r, k007420_w) /* Sprite RAM */ |
| 62 | 62 | AM_RANGE(0x2200, 0x23ff) AM_DEVREADWRITE_LEGACY("k007342", k007342_scroll_r, k007342_scroll_w) /* Scroll RAM */ |
| 63 | AM_RANGE(0x2400, 0x24ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_SHARE("paletteram")/* palette */ | |
| 63 | AM_RANGE(0x2400, 0x24ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_be_w) AM_SHARE("paletteram")/* palette */ | |
| 64 | 64 | AM_RANGE(0x2600, 0x2607) AM_DEVWRITE_LEGACY("k007342", k007342_vreg_w) /* Video Registers */ |
| 65 | 65 | AM_RANGE(0x2e00, 0x2e00) AM_READ_PORT("DSW1") |
| 66 | 66 | AM_RANGE(0x2e01, 0x2e01) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 70 | 70 | AM_RANGE(0x2e08, 0x2e08) AM_WRITE(battlnts_bankswitch_w) /* bankswitch control */ |
| 71 | 71 | AM_RANGE(0x2e0c, 0x2e0c) AM_WRITE(battlnts_spritebank_w) /* sprite bank select */ |
| 72 | 72 | AM_RANGE(0x2e10, 0x2e10) AM_WRITE(watchdog_reset_w) /* watchdog reset */ |
| 73 | AM_RANGE(0x2e14, 0x2e14) AM_WRITE(soundlatch_w) /* sound code # */ | |
| 73 | AM_RANGE(0x2e14, 0x2e14) AM_WRITE(soundlatch_byte_w) /* sound code # */ | |
| 74 | 74 | AM_RANGE(0x2e18, 0x2e18) AM_WRITE(battlnts_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 75 | 75 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") /* banked ROM */ |
| 76 | 76 | AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM 777e02.bin */ |
| r14896 | r14897 | |
| 81 | 81 | AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ |
| 82 | 82 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ym1", ym3812_r, ym3812_w) /* YM3812 (chip 1) */ |
| 83 | 83 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ym2", ym3812_r, ym3812_w) /* YM3812 (chip 2) */ |
| 84 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 84 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 85 | 85 | ADDRESS_MAP_END |
| 86 | 86 | |
| 87 | 87 | /************************************* |
| r14896 | r14897 | |
|---|---|---|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | ||
| 115 | ||
| 116 | 116 | { |
| 117 | running_machine &machine = space->machine(); | |
| 118 | address_space *srcspace = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
| 119 | address_space *dstspace = machine.device("sub")->memory().space(AS_PROGRAM); | |
| 117 | address_space *srcspace = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 118 | address_space *dstspace = machine().device("sub")->memory().space(AS_PROGRAM); | |
| 120 | 119 | UINT32 mcu_address, mcu_data; |
| 121 | 120 | |
| 122 | 121 | for ( mcu_address = 0x100010; mcu_address < (0x100010 + 6); mcu_address += 1 ) |
| r14896 | r14897 | |
| 124 | 123 | mcu_data = srcspace->read_byte(mcu_address ); |
| 125 | 124 | dstspace->write_byte(mcu_address-0x10, mcu_data); |
| 126 | 125 | } |
| 127 | cputag_set_input_line(machine, "sub", INPUT_LINE_IRQ7, HOLD_LINE); //MCU Initialised | |
| 126 | cputag_set_input_line(machine(), "sub", INPUT_LINE_IRQ7, HOLD_LINE); //MCU Initialised | |
| 128 | 127 | } |
| 129 | 128 | |
| 130 | 129 | static void galpani2_mcu_nmi1(running_machine &machine) |
| r14896 | r14897 | |
| 236 | 235 | //logerror("%s : MCU executes CHECKs synchro\n", machine.describe_context()); |
| 237 | 236 | } |
| 238 | 237 | |
| 239 | ||
| 238 | ||
| 240 | 239 | { |
| 241 | galpani2_state *state = space->machine().driver_data<galpani2_state>(); | |
| 242 | 240 | //for galpan2t: |
| 243 | 241 | //Triggered from 'maincpu' (00007D60),once, with no command, using alternate line, during init |
| 244 | 242 | //Triggered from 'maincpu' (000080BE),once, for unknown command, during init |
| 245 | 243 | //Triggered from 'maincpu' (0000741E),from here on...driven by int5, even if there's no command |
| 246 | if ( (data & 1) && !(state->m_old_mcu_nmi1 & 1) ) galpani2_mcu_nmi1(space->machine()); | |
| 247 | //if ( (data & 0x10) && !(state->m_old_mcu_nmi1 & 0x10) ) galpani2_mcu_nmi1(space->machine()); | |
| 244 | if ( (data & 1) && !(m_old_mcu_nmi1 & 1) ) galpani2_mcu_nmi1(machine()); | |
| 245 | //if ( (data & 0x10) && !(m_old_mcu_nmi1 & 0x10) ) galpani2_mcu_nmi1(machine()); | |
| 248 | 246 | //alternate line, same function? |
| 249 | | |
| 247 | | |
| 250 | 248 | } |
| 251 | 249 | |
| 252 | ||
| 250 | ||
| 253 | 251 | { |
| 254 | galpani2_state *state = space->machine().driver_data<galpani2_state>(); | |
| 255 | if ( (data & 1) && !(state->m_old_mcu_nmi2 & 1) ) galpani2_mcu_nmi2(space->machine()); | |
| 256 | state->m_old_mcu_nmi2 = data; | |
| 252 | if ( (data & 1) && !(m_old_mcu_nmi2 & 1) ) galpani2_mcu_nmi2(machine()); | |
| 253 | m_old_mcu_nmi2 = data; | |
| 257 | 254 | } |
| 258 | 255 | |
| 259 | 256 | |
| r14896 | r14897 | |
| 265 | 262 | |
| 266 | 263 | ***************************************************************************/ |
| 267 | 264 | |
| 268 | ||
| 265 | ||
| 269 | 266 | { |
| 270 | coin_counter_w(space->machine(), 0, data & 0x01); | |
| 271 | coin_counter_w(space->machine(), 1, data & 0x02); | |
| 272 | coin_lockout_w(space->machine(), 0,~data & 0x04); | |
| 273 | coin_lockout_w(space->machine(), 1,~data & 0x08); | |
| 267 | coin_counter_w(machine(), 0, data & 0x01); | |
| 268 | coin_counter_w(machine(), 1, data & 0x02); | |
| 269 | coin_lockout_w(machine(), 0,~data & 0x04); | |
| 270 | coin_lockout_w(machine(), 1,~data & 0x08); | |
| 274 | 271 | // & 0x10 CARD in lockout? |
| 275 | 272 | // & 0x20 CARD in lockout? |
| 276 | 273 | // & 0x40 CARD out |
| r14896 | r14897 | |
| 304 | 301 | AM_RANGE(0x314000, 0x314001) AM_WRITENOP // ? flip backgrounds ? |
| 305 | 302 | AM_RANGE(0x318000, 0x318001) AM_DEVREADWRITE_LEGACY("eeprom", galpani2_eeprom_r, galpani2_eeprom_w) // EEPROM |
| 306 | 303 | AM_RANGE(0x380000, 0x387fff) AM_RAM // Palette? |
| 307 | AM_RANGE(0x388000, 0x38ffff) AM_RAM_WRITE(paletteram | |
| 304 | AM_RANGE(0x388000, 0x38ffff) AM_RAM_WRITE(paletteram | |
| 308 | 305 | AM_RANGE(0x390000, 0x3901ff) AM_WRITENOP // ? at startup of service mode |
| 309 | 306 | |
| 310 | 307 | AM_RANGE(0x400000, 0x43ffff) AM_RAM_WRITE_LEGACY(galpani2_bg8_0_w) AM_BASE(m_bg8[0]) // Background 0 |
| r14896 | r14897 | |
| 327 | 324 | AM_RANGE(0x580000, 0x580001) AM_RAM AM_BASE(m_bg8_scrolly[1]) // Background 1 Scroll Y |
| 328 | 325 | AM_RANGE(0x5c0000, 0x5c0001) AM_WRITENOP // ? 0 at startup only |
| 329 | 326 | AM_RANGE(0x600000, 0x600001) AM_WRITENOP // Watchdog |
| 330 | AM_RANGE(0x640000, 0x640001) AM_WRITE8_LEGACY(galpani2_mcu_init_w, 0x00ff ) // ? 0 before resetting and at startup, Reset mcu ? | |
| 331 | AM_RANGE(0x680000, 0x680001) AM_WRITE8_LEGACY(galpani2_mcu_nmi1_w, 0x00ff) // ? 0 -> 1 -> 0 (lev 5) / 0 -> $10 -> 0 | |
| 332 | AM_RANGE(0x6c0000, 0x6c0001) AM_WRITE8_LEGACY(galpani2_coin_lockout_w, 0xff00 ) // Coin + Card Lockout | |
| 327 | AM_RANGE(0x640000, 0x640001) AM_WRITE8(galpani2_mcu_init_w, 0x00ff ) // ? 0 before resetting and at startup, Reset mcu ? | |
| 328 | AM_RANGE(0x680000, 0x680001) AM_WRITE8(galpani2_mcu_nmi1_w, 0x00ff) // ? 0 -> 1 -> 0 (lev 5) / 0 -> $10 -> 0 | |
| 329 | AM_RANGE(0x6c0000, 0x6c0001) AM_WRITE8(galpani2_coin_lockout_w, 0xff00 ) // Coin + Card Lockout | |
| 333 | 330 | AM_RANGE(0x780000, 0x780001) AM_READ_PORT("DSW1_P1") |
| 334 | 331 | AM_RANGE(0x780002, 0x780003) AM_READ_PORT("DSW2_P2") |
| 335 | 332 | AM_RANGE(0x780004, 0x780005) AM_READ_PORT("SPECIAL") |
| r14896 | r14897 | |
| 350 | 347 | ***************************************************************************/ |
| 351 | 348 | |
| 352 | 349 | |
| 353 | ||
| 350 | ||
| 354 | 351 | { |
| 355 | galpani2_state *state = space->machine().driver_data<galpani2_state>(); | |
| 356 | UINT16 *ROM = (UINT16 *) space->machine().region( "user1" )->base(); | |
| 357 | size_t len = space->machine().region( "user1" )->bytes() / 2; | |
| 352 | UINT16 *ROM = (UINT16 *) machine().region( "user1" )->base(); | |
| 353 | size_t len = machine().region( "user1" )->bytes() / 2; | |
| 358 | 354 | |
| 359 | offset += (0x800000/2) * (* | |
| 355 | offset += (0x800000/2) * (* | |
| 360 | 356 | |
| 361 | 357 | if ( offset < len ) return ROM[offset]; |
| 362 | 358 | else return 0xffff; //floating bus for absent ROMs |
| r14896 | r14897 | |
| 373 | 369 | AM_RANGE(0x6c0000, 0x6c0001) AM_WRITENOP // ? 0 at startup only |
| 374 | 370 | AM_RANGE(0x700000, 0x700001) AM_WRITENOP // Watchdog |
| 375 | 371 | // AM_RANGE(0x740000, 0x740001) AM_WRITENOP // ? Reset mcu |
| 376 | AM_RANGE(0x780000, 0x780001) AM_WRITE8 | |
| 372 | AM_RANGE(0x780000, 0x780001) AM_WRITE8 | |
| 377 | 373 | AM_RANGE(0x7c0000, 0x7c0001) AM_WRITEONLY AM_BASE(m_rombank) // Rom Bank |
| 378 | AM_RANGE(0x800000, 0xffffff) AM_READ | |
| 374 | AM_RANGE(0x800000, 0xffffff) AM_READ | |
| 379 | 375 | ADDRESS_MAP_END |
| 380 | 376 | |
| 381 | 377 | /*************************************************************************** |
| r14896 | r14897 | |
|---|---|---|
| 82 | 82 | DECLARE_WRITE32_MEMBER( bios_ext4_ram_w ); |
| 83 | 83 | |
| 84 | 84 | DECLARE_WRITE32_MEMBER( bios_ram_w ); |
| 85 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 86 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 87 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 88 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 85 | 89 | }; |
| 86 | 90 | |
| 87 | 91 | |
| r14896 | r14897 | |
| 398 | 402 | ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask); |
| 399 | 403 | } |
| 400 | 404 | |
| 401 | ||
| 405 | ||
| 402 | 406 | { |
| 403 | midqslvr_state *state = space->machine().driver_data<midqslvr_state>(); | |
| 404 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 407 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 405 | 408 | |
| 406 | 409 | switch(offset % 8) { |
| 407 | 410 | case 1: |
| 408 | data = | |
| 411 | data = | |
| 409 | 412 | break; |
| 410 | 413 | case 2: |
| 411 | data = | |
| 414 | data = | |
| 412 | 415 | break; |
| 413 | 416 | case 3: |
| 414 | data = | |
| 417 | data = | |
| 415 | 418 | break; |
| 416 | 419 | case 7: |
| 417 | data = | |
| 420 | data = | |
| 418 | 421 | break; |
| 419 | 422 | } |
| 420 | 423 | return data; |
| 421 | 424 | } |
| 422 | 425 | |
| 423 | 426 | |
| 424 | ||
| 427 | ||
| 425 | 428 | { |
| 426 | midqslvr_state *state = space->machine().driver_data<midqslvr_state>(); | |
| 427 | state->m_at_pages[offset % 0x10] = data; | |
| 429 | m_at_pages[offset % 0x10] = data; | |
| 428 | 430 | |
| 429 | 431 | switch(offset % 8) { |
| 430 | 432 | case 1: |
| 431 | | |
| 433 | | |
| 432 | 434 | break; |
| 433 | 435 | case 2: |
| 434 | | |
| 436 | | |
| 435 | 437 | break; |
| 436 | 438 | case 3: |
| 437 | | |
| 439 | | |
| 438 | 440 | break; |
| 439 | 441 | case 7: |
| 440 | | |
| 442 | | |
| 441 | 443 | break; |
| 442 | 444 | } |
| 443 | 445 | } |
| 444 | 446 | |
| 445 | static READ32_HANDLER(at_page32_r) | |
| 446 | { | |
| 447 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 448 | } | |
| 449 | ||
| 450 | ||
| 451 | static WRITE32_HANDLER(at_page32_w) | |
| 452 | { | |
| 453 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 454 | } | |
| 455 | ||
| 456 | 447 | static READ8_DEVICE_HANDLER(at_dma8237_2_r) |
| 457 | 448 | { |
| 458 | 449 | return i8237_r(device, offset / 2); |
| r14896 | r14897 | |
| 485 | 476 | } |
| 486 | 477 | |
| 487 | 478 | |
| 488 | ||
| 479 | ||
| 489 | 480 | { |
| 490 | midqslvr_state *state = space->machine().driver_data<midqslvr_state>(); | |
| 491 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 481 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 492 | 482 | & 0xFF0000; |
| 493 | 483 | |
| 494 | return space | |
| 484 | return space. | |
| 495 | 485 | } |
| 496 | 486 | |
| 497 | 487 | |
| 498 | ||
| 488 | ||
| 499 | 489 | { |
| 500 | midqslvr_state *state = space->machine().driver_data<midqslvr_state>(); | |
| 501 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 490 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 502 | 491 | & 0xFF0000; |
| 503 | 492 | |
| 504 | space | |
| 493 | space. | |
| 505 | 494 | } |
| 506 | 495 | |
| 507 | 496 | static void set_dma_channel(device_t *device, int channel, int state) |
| r14896 | r14897 | |
| 519 | 508 | { |
| 520 | 509 | DEVCB_LINE(pc_dma_hrq_changed), |
| 521 | 510 | DEVCB_NULL, |
| 522 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 523 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 511 | DEVCB_DRIVER_MEMBER(midqslvr_state, pc_dma_read_byte), | |
| 512 | DEVCB_DRIVER_MEMBER(midqslvr_state, pc_dma_write_byte), | |
| 524 | 513 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 525 | 514 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 526 | 515 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 558 | 547 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 559 | 548 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 560 | 549 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) /* todo: nvram (CMOS Setup Save)*/ |
| 561 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 550 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 562 | 551 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 563 | 552 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 564 | 553 | AM_RANGE(0x00e8, 0x00ef) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 286 | 286 | AM_RANGE(0x01500000, 0x0153ffff) AM_MIRROR(0xfc000000) AM_WRITE(exterm_output_port_0_w) |
| 287 | 287 | AM_RANGE(0x01580000, 0x015bffff) AM_MIRROR(0xfc000000) AM_WRITE(sound_latch_w) |
| 288 | 288 | AM_RANGE(0x015c0000, 0x015fffff) AM_MIRROR(0xfc000000) AM_WRITE(watchdog_reset16_w) |
| 289 | AM_RANGE(0x01800000, 0x01807fff) AM_MIRROR(0xfc7f8000) AM_RAM_WRITE(paletteram | |
| 289 | AM_RANGE(0x01800000, 0x01807fff) AM_MIRROR(0xfc7f8000) AM_RAM_WRITE(paletteram | |
| 290 | 290 | AM_RANGE(0x02800000, 0x02807fff) AM_MIRROR(0xfc7f8000) AM_RAM AM_SHARE("nvram") |
| 291 | 291 | AM_RANGE(0x03000000, 0x03ffffff) AM_MIRROR(0xfc000000) AM_ROM AM_REGION("user1", 0) |
| 292 | 292 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 817 | 817 | state->m_fifoin_read_request = 1; |
| 818 | 818 | } |
| 819 | 819 | |
| 820 | ||
| 820 | ||
| 821 | 821 | { |
| 822 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 823 | UINT8 r = state->m_sb_coin_latch; | |
| 822 | UINT8 r = m_sb_coin_latch; | |
| 824 | 823 | |
| 825 | | |
| 824 | | |
| 826 | 825 | return r; |
| 827 | 826 | } |
| 828 | 827 | |
| 829 | ||
| 828 | ||
| 830 | 829 | { |
| 831 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 832 | 830 | if (data) |
| 833 | | |
| 831 | | |
| 834 | 832 | else |
| 835 | | |
| 833 | | |
| 836 | 834 | } |
| 837 | 835 | |
| 838 | ||
| 836 | ||
| 839 | 837 | { |
| 840 | UINT8 r = z80_fifoout_pop(space); | |
| 838 | UINT8 r = z80_fifoout_pop(&space); | |
| 841 | 839 | |
| 842 | 840 | return r; |
| 843 | 841 | } |
| 844 | 842 | |
| 845 | ||
| 843 | ||
| 846 | 844 | { |
| 847 | 845 | if( ACCESSING_BITS_0_7 ) { |
| 848 | z80_fifoin_push(space, data & 0xff); | |
| 846 | z80_fifoin_push(&space, data & 0xff); | |
| 849 | 847 | } |
| 850 | 848 | } |
| 851 | 849 | |
| 852 | ||
| 850 | ||
| 853 | 851 | { |
| 854 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 855 | 852 | UINT32 r = 0; |
| 856 | if ( | |
| 853 | if ( | |
| 857 | 854 | { |
| 858 | 855 | r |= 2; |
| 859 | 856 | } |
| 860 | 857 | return r | 1; |
| 861 | 858 | } |
| 862 | 859 | |
| 863 | ||
| 860 | ||
| 864 | 861 | { |
| 865 | cputag_set_input_line( | |
| 862 | cputag_set_input_line( | |
| 866 | 863 | return 0xffffffff; |
| 867 | 864 | } |
| 868 | 865 | |
| 869 | ||
| 866 | ||
| 870 | 867 | { |
| 871 | 868 | return 0xffffffff; |
| 872 | 869 | } |
| r14896 | r14897 | |
| 890 | 887 | oki2->set_bank_base((data & 0x4000000) ? 0x40000 : 0); |
| 891 | 888 | } |
| 892 | 889 | |
| 893 | ||
| 890 | ||
| 894 | 891 | { |
| 895 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 896 | 892 | if( ACCESSING_BITS_0_7 ) { |
| 897 | if (state->m_z80_prg_fifo_pos<0x40000) state->m_z80_rom[state->m_z80_prg_fifo_pos] = data & 0xff; | |
| 898 | state->m_z80_prg_fifo_pos++; | |
| 893 | if (m_z80_prg_fifo_pos<0x40000) m_z80_rom[m_z80_prg_fifo_pos] = data & 0xff; | |
| 894 | m_z80_prg_fifo_pos++; | |
| 899 | 895 | } |
| 900 | 896 | } |
| 901 | 897 | |
| 902 | ||
| 898 | ||
| 903 | 899 | { |
| 904 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 905 | 900 | // tile banks |
| 906 | 901 | if( ACCESSING_BITS_16_23 ) { |
| 907 | rf2_set_layer_banks( | |
| 902 | rf2_set_layer_banks( | |
| 908 | 903 | } |
| 909 | 904 | |
| 910 | 905 | logerror("z80 data = %08x mask = %08x\n",data,mem_mask); |
| 911 | 906 | if( ACCESSING_BITS_0_7 ) { |
| 912 | 907 | if( data & 0x1 ) { |
| 913 | state->m_z80_prg_fifo_pos = 0; | |
| 914 | cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, CLEAR_LINE ); | |
| 908 | m_z80_prg_fifo_pos = 0; | |
| 909 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, CLEAR_LINE ); | |
| 915 | 910 | } else { |
| 916 | cputag_set_input_line( | |
| 911 | cputag_set_input_line( | |
| 917 | 912 | } |
| 918 | 913 | } |
| 919 | 914 | } |
| 920 | 915 | |
| 921 | ||
| 916 | ||
| 922 | 917 | { |
| 923 | 918 | if( ACCESSING_BITS_0_7 ) |
| 924 | 919 | { |
| 925 | return input_port_read( | |
| 920 | return input_port_read( | |
| 926 | 921 | } |
| 927 | 922 | return 0xffffffff; |
| 928 | 923 | } |
| 929 | 924 | |
| 930 | ||
| 925 | ||
| 931 | 926 | { |
| 932 | 927 | if( ACCESSING_BITS_0_7 ) |
| 933 | 928 | { |
| 934 | return input_port_read( | |
| 929 | return input_port_read( | |
| 935 | 930 | } |
| 936 | 931 | return 0xffffffff; |
| 937 | 932 | } |
| r14896 | r14897 | |
| 957 | 952 | } |
| 958 | 953 | /********************************************************************/ |
| 959 | 954 | |
| 960 | ||
| 955 | ||
| 961 | 956 | { |
| 962 | UINT8 r = z80_fifoin_pop(space); | |
| 957 | UINT8 r = z80_fifoin_pop(&space); | |
| 963 | 958 | |
| 964 | 959 | return r; |
| 965 | 960 | } |
| 966 | 961 | |
| 967 | ||
| 962 | ||
| 968 | 963 | { |
| 969 | z80_fifoout_push(space, data); | |
| 964 | z80_fifoout_push(&space, data); | |
| 970 | 965 | } |
| 971 | 966 | |
| 972 | ||
| 967 | ||
| 973 | 968 | { |
| 974 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 975 | 969 | UINT8 r = 0; |
| 976 | if ( | |
| 970 | if ( | |
| 977 | 971 | { |
| 978 | 972 | r |= 2; |
| 979 | 973 | } |
| 980 | 974 | return r | 1; |
| 981 | 975 | } |
| 982 | 976 | |
| 983 | ||
| 977 | ||
| 984 | 978 | { |
| 985 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 986 | if ((data & 7) != state->m_z80_lastbank) | |
| 979 | if ((data & 7) != m_z80_lastbank) | |
| 987 | 980 | { |
| 988 | state->m_z80_lastbank = (data & 7); | |
| 989 | memory_set_bankptr(space->machine(), "bank4", state->m_z80_rom + (0x8000 * state->m_z80_lastbank)); | |
| 981 | m_z80_lastbank = (data & 7); | |
| 982 | memory_set_bankptr(machine(), "bank4", m_z80_rom + (0x8000 * m_z80_lastbank)); | |
| 990 | 983 | } |
| 991 | 984 | } |
| 992 | 985 | |
| 993 | ||
| 986 | ||
| 994 | 987 | { |
| 995 | return input_port_read( | |
| 988 | return input_port_read( | |
| 996 | 989 | } |
| 997 | 990 | |
| 998 | ||
| 991 | ||
| 999 | 992 | { |
| 1000 | return input_port_read( | |
| 993 | return input_port_read( | |
| 1001 | 994 | } |
| 1002 | 995 | |
| 1003 | ||
| 996 | ||
| 1004 | 997 | { |
| 1005 | UINT8 *sound = (UINT8*)space->machine().region("user2")->base(); | |
| 1006 | UINT16 *sound16 = (UINT16*)space->machine().region("user2")->base(); | |
| 998 | UINT8 *sound = (UINT8*)machine().region("user2")->base(); | |
| 999 | UINT16 *sound16 = (UINT16*)machine().region("user2")->base(); | |
| 1007 | 1000 | |
| 1008 | 1001 | if (mem_mask == 0x000000ff) |
| 1009 | 1002 | { |
| r14896 | r14897 | |
| 1042 | 1035 | AM_RANGE(0x00000490, 0x00000493) AM_WRITE(video_dma_length_w) |
| 1043 | 1036 | AM_RANGE(0x00000494, 0x00000497) AM_WRITE(video_dma_address_w) |
| 1044 | 1037 | AM_RANGE(0x0000050c, 0x0000050f) AM_WRITE(sprite_dma_start_w) |
| 1045 | AM_RANGE(0x00000600, 0x00000603) AM_READ | |
| 1038 | AM_RANGE(0x00000600, 0x00000603) AM_READ | |
| 1046 | 1039 | AM_RANGE(0x00000600, 0x00000603) AM_WRITENOP /* Unknown */ |
| 1047 | AM_RANGE(0x00000604, 0x00000607) AM_READ_LEGACY(spi_controls1_r) /* Player controls */ | |
| 1048 | AM_RANGE(0x00000608, 0x0000060b) AM_READ_LEGACY(spi_unknown_r) /* Unknown */ | |
| 1049 | AM_RANGE(0x0000060c, 0x0000060f) AM_READ_LEGACY(spi_controls2_r) /* Player controls (start) */ | |
| 1050 | AM_RANGE(0x00000680, 0x00000683) AM_WRITE_LEGACY(sound_fifo_w) | |
| 1051 | AM_RANGE(0x00000684, 0x00000687) AM_READ_LEGACY(sound_fifo_status_r) | |
| 1040 | AM_RANGE(0x00000604, 0x00000607) AM_READ(spi_controls1_r) /* Player controls */ | |
| 1041 | AM_RANGE(0x00000608, 0x0000060b) AM_READ(spi_unknown_r) /* Unknown */ | |
| 1042 | AM_RANGE(0x0000060c, 0x0000060f) AM_READ(spi_controls2_r) /* Player controls (start) */ | |
| 1043 | AM_RANGE(0x00000680, 0x00000683) AM_WRITE(sound_fifo_w) | |
| 1044 | AM_RANGE(0x00000684, 0x00000687) AM_READ(sound_fifo_status_r) | |
| 1052 | 1045 | AM_RANGE(0x00000684, 0x00000687) AM_WRITENOP /* Unknown */ |
| 1053 | 1046 | AM_RANGE(0x000006d0, 0x000006d3) AM_DEVWRITE8_LEGACY("ds2404", ds2404_1w_reset_w, 0x000000ff) |
| 1054 | 1047 | AM_RANGE(0x000006d4, 0x000006d7) AM_DEVWRITE8_LEGACY("ds2404", ds2404_data_w, 0x000000ff) |
| r14896 | r14897 | |
| 1056 | 1049 | AM_RANGE(0x000006dc, 0x000006df) AM_DEVREAD8_LEGACY("ds2404", ds2404_data_r, 0x000000ff) |
| 1057 | 1050 | AM_RANGE(0x00000800, 0x0003ffff) AM_RAM AM_BASE(m_spimainram) |
| 1058 | 1051 | AM_RANGE(0x00200000, 0x003fffff) AM_ROM AM_SHARE("share2") |
| 1059 | AM_RANGE(0x00a00000, 0x013fffff) AM_READ | |
| 1052 | AM_RANGE(0x00a00000, 0x013fffff) AM_READ | |
| 1060 | 1053 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("share2") /* ROM location in real-mode */ |
| 1061 | 1054 | ADDRESS_MAP_END |
| 1062 | 1055 | |
| r14896 | r14897 | |
| 1064 | 1057 | AM_RANGE(0x0000, 0x3fff) AM_RAMBANK("bank5") |
| 1065 | 1058 | AM_RANGE(0x4002, 0x4002) AM_WRITENOP /* ack RST 10 */ |
| 1066 | 1059 | AM_RANGE(0x4003, 0x4003) AM_WRITENOP /* Unknown */ |
| 1067 | AM_RANGE(0x4004, 0x4004) AM_WRITE_LEGACY(sb_coin_w) /* single board systems */ | |
| 1068 | AM_RANGE(0x4008, 0x4008) AM_READWRITE_LEGACY(z80_soundfifo_r, z80_soundfifo_w) | |
| 1069 | AM_RANGE(0x4009, 0x4009) AM_READ_LEGACY(z80_soundfifo_status_r) | |
| 1070 | AM_RANGE(0x400a, 0x400a) AM_READ_LEGACY(z80_jp1_r) | |
| 1060 | AM_RANGE(0x4004, 0x4004) AM_WRITE(sb_coin_w) /* single board systems */ | |
| 1061 | AM_RANGE(0x4008, 0x4008) AM_READWRITE(z80_soundfifo_r, z80_soundfifo_w) | |
| 1062 | AM_RANGE(0x4009, 0x4009) AM_READ(z80_soundfifo_status_r) | |
| 1063 | AM_RANGE(0x400a, 0x400a) AM_READ(z80_jp1_r) | |
| 1071 | 1064 | AM_RANGE(0x400b, 0x400b) AM_WRITENOP /* Unknown */ |
| 1072 | AM_RANGE(0x4013, 0x4013) AM_READ_LEGACY(z80_coin_r) | |
| 1073 | AM_RANGE(0x401b, 0x401b) AM_WRITE_LEGACY(z80_bank_w) /* control register: bits 0-2 = bank @ 8000, bit 3 = watchdog? */ | |
| 1065 | AM_RANGE(0x4013, 0x4013) AM_READ(z80_coin_r) | |
| 1066 | AM_RANGE(0x401b, 0x401b) AM_WRITE(z80_bank_w) /* control register: bits 0-2 = bank @ 8000, bit 3 = watchdog? */ | |
| 1074 | 1067 | AM_RANGE(0x6000, 0x600f) AM_DEVREADWRITE_LEGACY("ymf", ymf271_r, ymf271_w) |
| 1075 | 1068 | AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank4") |
| 1076 | 1069 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1140 | 1133 | AM_RANGE(0x00000490, 0x00000493) AM_WRITE(video_dma_length_w) |
| 1141 | 1134 | AM_RANGE(0x00000494, 0x00000497) AM_WRITE(video_dma_address_w) |
| 1142 | 1135 | AM_RANGE(0x0000050c, 0x0000050f) AM_WRITE(sprite_dma_start_w) |
| 1143 | AM_RANGE(0x00000600, 0x00000603) AM_READ_LEGACY(spi_int_r) /* Unknown */ | |
| 1144 | AM_RANGE(0x00000604, 0x00000607) AM_READ_LEGACY(spi_controls1_r) /* Player controls */ | |
| 1145 | AM_RANGE(0x00000608, 0x0000060b) AM_READ_LEGACY(spi_unknown_r) | |
| 1146 | AM_RANGE(0x0000060c, 0x0000060f) AM_READ_LEGACY(spi_controls2_r) /* Player controls (start) */ | |
| 1136 | AM_RANGE(0x00000600, 0x00000603) AM_READ(spi_int_r) /* Unknown */ | |
| 1137 | AM_RANGE(0x00000604, 0x00000607) AM_READ(spi_controls1_r) /* Player controls */ | |
| 1138 | AM_RANGE(0x00000608, 0x0000060b) AM_READ(spi_unknown_r) | |
| 1139 | AM_RANGE(0x0000060c, 0x0000060f) AM_READ(spi_controls2_r) /* Player controls (start) */ | |
| 1147 | 1140 | AM_RANGE(0x0000068c, 0x0000068f) AM_DEVWRITE_LEGACY("eeprom", eeprom_w) |
| 1148 | 1141 | AM_RANGE(0x00000800, 0x0003ffff) AM_RAM AM_BASE(m_spimainram) |
| 1149 | 1142 | AM_RANGE(0x00200000, 0x003fffff) AM_ROM AM_SHARE("share2") |
| r14896 | r14897 | |
| 1152 | 1145 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("share2") /* ROM location in real-mode */ |
| 1153 | 1146 | ADDRESS_MAP_END |
| 1154 | 1147 | |
| 1155 | ||
| 1148 | ||
| 1156 | 1149 | { |
| 1157 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 1158 | state->m_ejsakura_input_port = data; | |
| 1150 | m_ejsakura_input_port = data; | |
| 1159 | 1151 | } |
| 1160 | 1152 | |
| 1161 | 1153 | static ADDRESS_MAP_START( sys386f2_map, AS_PROGRAM, 32, seibuspi_state ) |
| 1162 | 1154 | AM_RANGE(0x00000000, 0x0000000f) AM_RAM |
| 1163 | AM_RANGE(0x00000010, 0x00000013) AM_READ | |
| 1155 | AM_RANGE(0x00000010, 0x00000013) AM_READ | |
| 1164 | 1156 | AM_RANGE(0x00000090, 0x00000097) AM_RAM /* Unknown */ |
| 1165 | AM_RANGE(0x00000400, 0x00000403) AM_READNOP AM_WRITE | |
| 1157 | AM_RANGE(0x00000400, 0x00000403) AM_READNOP AM_WRITE | |
| 1166 | 1158 | AM_RANGE(0x00000404, 0x00000407) AM_DEVWRITE_LEGACY("eeprom", sys386f2_eeprom_w) |
| 1167 | 1159 | AM_RANGE(0x00000408, 0x0000040f) AM_DEVWRITE8_LEGACY("ymz", ymz280b_w, 0x000000ff) |
| 1168 | 1160 | AM_RANGE(0x00000484, 0x00000487) AM_WRITE(palette_dma_start_w) |
| r14896 | r14897 | |
| 1171 | 1163 | AM_RANGE(0x00000500, 0x0000054f) AM_RAM /* Unknown */ |
| 1172 | 1164 | AM_RANGE(0x00000560, 0x00000563) AM_WRITE(sprite_dma_start_w) |
| 1173 | 1165 | AM_RANGE(0x00000600, 0x00000607) AM_DEVREAD8_LEGACY("ymz", ymz280b_r, 0x000000ff) |
| 1174 | AM_RANGE(0x00000608, 0x0000060b) AM_READ_LEGACY(spi_unknown_r) | |
| 1175 | AM_RANGE(0x0000060c, 0x0000060f) AM_READ_LEGACY(spi_controls1_r) /* Player controls */ | |
| 1166 | AM_RANGE(0x00000608, 0x0000060b) AM_READ(spi_unknown_r) | |
| 1167 | AM_RANGE(0x0000060c, 0x0000060f) AM_READ(spi_controls1_r) /* Player controls */ | |
| 1176 | 1168 | AM_RANGE(0x00000800, 0x0003ffff) AM_RAM AM_BASE(m_spimainram) |
| 1177 | 1169 | AM_RANGE(0x00200000, 0x003fffff) AM_ROM AM_SHARE("share2") |
| 1178 | 1170 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("share2") /* ROM location in real-mode */ |
| r14896 | r14897 | |
| 1828 | 1820 | cputag_set_input_line(machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE ); |
| 1829 | 1821 | device_set_irq_callback(machine.device("maincpu"), spi_irq_callback); |
| 1830 | 1822 | |
| 1831 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00000680, 0x00000683, FUNC(sound_fifo_r)); | |
| 1832 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00000688, 0x0000068b, FUNC(z80_prg_fifo_w)); | |
| 1833 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000068c, 0x0000068f, FUNC(z80_enable_w)); | |
| 1823 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sound_fifo_r),state)); | |
| 1824 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x00000688, 0x0000068b, write32_delegate(FUNC(seibuspi_state::z80_prg_fifo_w),state)); | |
| 1825 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x0000068c, 0x0000068f, write32_delegate(FUNC(seibuspi_state::z80_enable_w),state)); | |
| 1834 | 1826 | |
| 1835 | 1827 | memory_set_bankptr(machine, "bank4", state->m_z80_rom); |
| 1836 | 1828 | memory_set_bankptr(machine, "bank5", state->m_z80_rom); |
| r14896 | r14897 | |
| 1913 | 1905 | memcpy(state->m_z80_rom, rom, 0x40000); |
| 1914 | 1906 | |
| 1915 | 1907 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*machine.device("eeprom"), 0x0000068c, 0x0000068f, FUNC(eeprom_w)); |
| 1916 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1908 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1917 | 1909 | |
| 1918 | 1910 | device_set_irq_callback(machine.device("maincpu"), spi_irq_callback); |
| 1919 | 1911 | |
| r14896 | r14897 | |
| 1952 | 1944 | |
| 1953 | 1945 | MACHINE_CONFIG_END |
| 1954 | 1946 | |
| 1955 | ||
| 1947 | ||
| 1956 | 1948 | { |
| 1957 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 1958 | if (cpu_get_pc(&space->device())==0x00305bb2) device_spin_until_interrupt(&space->device()); // idle | |
| 1959 | return state->m_spimainram[(0x0018cb4-0x800)/4]; | |
| 1949 | if (cpu_get_pc(&space.device())==0x00305bb2) device_spin_until_interrupt(&space.device()); // idle | |
| 1950 | return m_spimainram[(0x0018cb4-0x800)/4]; | |
| 1960 | 1951 | } |
| 1961 | 1952 | |
| 1962 | ||
| 1953 | ||
| 1963 | 1954 | { |
| 1964 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 1965 | if (cpu_get_pc(&space->device())== 0x30582e) device_spin_until_interrupt(&space->device()); // idle | |
| 1966 | return state->m_spimainram[(0x0018c9c-0x800)/4]; | |
| 1955 | if (cpu_get_pc(&space.device())== 0x30582e) device_spin_until_interrupt(&space.device()); // idle | |
| 1956 | return m_spimainram[(0x0018c9c-0x800)/4]; | |
| 1967 | 1957 | } |
| 1968 | 1958 | |
| 1969 | ||
| 1959 | ||
| 1970 | 1960 | { |
| 1971 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 1972 | // printf("cpu_get_pc(&space->device()) %06x\n", cpu_get_pc(&space->device())); | |
| 1961 | // printf("cpu_get_pc(&space.device()) %06x\n", cpu_get_pc(&space.device())); | |
| 1973 | 1962 | |
| 1974 | 1963 | /* batlbalu */ |
| 1975 | if (cpu_get_pc(&space | |
| 1964 | if (cpu_get_pc(&space. | |
| 1976 | 1965 | |
| 1977 | 1966 | /* batlball */ |
| 1978 | if (cpu_get_pc(&space | |
| 1967 | if (cpu_get_pc(&space. | |
| 1979 | 1968 | |
| 1980 | return | |
| 1969 | return | |
| 1981 | 1970 | } |
| 1982 | 1971 | |
| 1983 | ||
| 1972 | ||
| 1984 | 1973 | { |
| 1985 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 1986 | 1974 | /* rdft */ |
| 1987 | if (cpu_get_pc(&space | |
| 1975 | if (cpu_get_pc(&space. | |
| 1988 | 1976 | |
| 1989 | 1977 | /* rdftau */ |
| 1990 | if (cpu_get_pc(&space | |
| 1978 | if (cpu_get_pc(&space. | |
| 1991 | 1979 | |
| 1992 | 1980 | /* rdftj */ |
| 1993 | if (cpu_get_pc(&space | |
| 1981 | if (cpu_get_pc(&space. | |
| 1994 | 1982 | |
| 1995 | 1983 | /* rdftdi */ |
| 1996 | if (cpu_get_pc(&space | |
| 1984 | if (cpu_get_pc(&space. | |
| 1997 | 1985 | |
| 1998 | 1986 | /* rdftu */ |
| 1999 | if (cpu_get_pc(&space | |
| 1987 | if (cpu_get_pc(&space. | |
| 2000 | 1988 | |
| 2001 | // mame_printf_debug("%08x\n",cpu_get_pc(&space | |
| 1989 | // mame_printf_debug("%08x\n",cpu_get_pc(&space. | |
| 2002 | 1990 | |
| 2003 | return | |
| 1991 | return | |
| 2004 | 1992 | } |
| 2005 | 1993 | |
| 2006 | ||
| 1994 | ||
| 2007 | 1995 | { |
| 2008 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 2009 | 1996 | /* viprp1 */ |
| 2010 | if (cpu_get_pc(&space | |
| 1997 | if (cpu_get_pc(&space. | |
| 2011 | 1998 | |
| 2012 | 1999 | /* viprp1s */ |
| 2013 | if (cpu_get_pc(&space | |
| 2000 | if (cpu_get_pc(&space. | |
| 2014 | 2001 | |
| 2015 | 2002 | /* viprp1ot */ |
| 2016 | if (cpu_get_pc(&space | |
| 2003 | if (cpu_get_pc(&space. | |
| 2017 | 2004 | |
| 2018 | // mame_printf_debug("%08x\n",cpu_get_pc(&space | |
| 2005 | // mame_printf_debug("%08x\n",cpu_get_pc(&space. | |
| 2019 | 2006 | |
| 2020 | return | |
| 2007 | return | |
| 2021 | 2008 | } |
| 2022 | 2009 | |
| 2023 | ||
| 2010 | ||
| 2024 | 2011 | { |
| 2025 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 2026 | 2012 | /* viperp1o */ |
| 2027 | if (cpu_get_pc(&space->device())==0x0201f99) device_spin_until_interrupt(&space->device()); // idle | |
| 2028 | // mame_printf_debug("%08x\n",cpu_get_pc(&space->device())); | |
| 2029 | return state->m_spimainram[(0x001d49c-0x800)/4]; | |
| 2013 | if (cpu_get_pc(&space.device())==0x0201f99) device_spin_until_interrupt(&space.device()); // idle | |
| 2014 | // mame_printf_debug("%08x\n",cpu_get_pc(&space.device())); | |
| 2015 | return m_spimainram[(0x001d49c-0x800)/4]; | |
| 2030 | 2016 | } |
| 2031 | 2017 | |
| 2032 | 2018 | #ifdef UNUSED_FUNCTION |
| r14896 | r14897 | |
| 2039 | 2025 | } |
| 2040 | 2026 | #endif |
| 2041 | 2027 | |
| 2042 | ||
| 2028 | ||
| 2043 | 2029 | { |
| 2044 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 2045 | 2030 | |
| 2046 | 2031 | /* rdft22kc */ |
| 2047 | if (cpu_get_pc(&space | |
| 2032 | if (cpu_get_pc(&space. | |
| 2048 | 2033 | |
| 2049 | 2034 | /* rdft2, rdft2j */ |
| 2050 | if (cpu_get_pc(&space | |
| 2035 | if (cpu_get_pc(&space. | |
| 2051 | 2036 | |
| 2052 | 2037 | /* rdft2us */ |
| 2053 | if (cpu_get_pc(&space | |
| 2038 | if (cpu_get_pc(&space. | |
| 2054 | 2039 | |
| 2055 | 2040 | /* rdft2a */ |
| 2056 | if (cpu_get_pc(&space | |
| 2041 | if (cpu_get_pc(&space. | |
| 2057 | 2042 | |
| 2058 | // mame_printf_debug("%08x\n",cpu_get_pc(&space | |
| 2043 | // mame_printf_debug("%08x\n",cpu_get_pc(&space. | |
| 2059 | 2044 | |
| 2060 | return | |
| 2045 | return | |
| 2061 | 2046 | } |
| 2062 | 2047 | |
| 2063 | ||
| 2048 | ||
| 2064 | 2049 | { |
| 2065 | seibuspi_state *state = space->machine().driver_data<seibuspi_state>(); | |
| 2066 | 2050 | /* rfjet, rfjetu, rfjeta */ |
| 2067 | if (cpu_get_pc(&space | |
| 2051 | if (cpu_get_pc(&space. | |
| 2068 | 2052 | |
| 2069 | 2053 | /* rfjetus */ |
| 2070 | if (cpu_get_pc(&space | |
| 2054 | if (cpu_get_pc(&space. | |
| 2071 | 2055 | { |
| 2072 | 2056 | UINT32 r; |
| 2073 | device_spin_until_interrupt(&space | |
| 2057 | device_spin_until_interrupt(&space. | |
| 2074 | 2058 | // Hack to enter test mode |
| 2075 | r = state->m_spimainram[(0x002894c-0x800)/4] & (~0x400); | |
| 2076 | return r | (((input_port_read(space->machine(), "SYSTEM") ^ 0xff)<<8) & 0x400); | |
| 2059 | r = m_spimainram[(0x002894c-0x800)/4] & (~0x400); | |
| 2060 | return r | (((input_port_read(machine(), "SYSTEM") ^ 0xff)<<8) & 0x400); | |
| 2077 | 2061 | } |
| 2078 | 2062 | |
| 2079 | 2063 | /* rfjetj */ |
| 2080 | if (cpu_get_pc(&space | |
| 2064 | if (cpu_get_pc(&space. | |
| 2081 | 2065 | |
| 2082 | // mame_printf_debug("%08x\n",cpu_get_pc(&space | |
| 2066 | // mame_printf_debug("%08x\n",cpu_get_pc(&space. | |
| 2083 | 2067 | |
| 2084 | 2068 | |
| 2085 | return | |
| 2069 | return | |
| 2086 | 2070 | } |
| 2087 | 2071 | |
| 2088 | 2072 | static void init_spi(running_machine &machine) |
| r14896 | r14897 | |
| 2098 | 2082 | |
| 2099 | 2083 | static DRIVER_INIT( rdft ) |
| 2100 | 2084 | { |
| 2101 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00298d0, 0x00298d3, FUNC(rdft_speedup_r) ); | |
| 2085 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); | |
| 2086 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x00298d0, 0x00298d3, read32_delegate(FUNC(seibuspi_state::rdft_speedup_r),state)); | |
| 2102 | 2087 | |
| 2103 | 2088 | init_spi(machine); |
| 2104 | 2089 | } |
| 2105 | 2090 | |
| 2106 | 2091 | static DRIVER_INIT( senkyu ) |
| 2107 | 2092 | { |
| 2108 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018cb4, 0x0018cb7, FUNC(senkyu_speedup_r) ); | |
| 2093 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); | |
| 2094 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0018cb4, 0x0018cb7, read32_delegate(FUNC(seibuspi_state::senkyu_speedup_r),state)); | |
| 2109 | 2095 | |
| 2110 | 2096 | init_spi(machine); |
| 2111 | 2097 | } |
| 2112 | 2098 | |
| 2113 | 2099 | static DRIVER_INIT( senkyua ) |
| 2114 | 2100 | { |
| 2115 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018c9c, 0x0018c9f, FUNC(senkyua_speedup_r) ); | |
| 2101 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); | |
| 2102 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0018c9c, 0x0018c9f, read32_delegate(FUNC(seibuspi_state::senkyua_speedup_r),state)); | |
| 2116 | 2103 | |
| 2117 | 2104 | init_spi(machine); |
| 2118 | 2105 | } |
| 2119 | 2106 | |
| 2120 | 2107 | static DRIVER_INIT( batlball ) |
| 2121 | 2108 | { |
| 2122 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018db4, 0x0018db7, FUNC(batlball_speedup_r) ); | |
| 2109 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); | |
| 2110 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0018db4, 0x0018db7, read32_delegate(FUNC(seibuspi_state::batlball_speedup_r),state)); | |
| 2123 | 2111 | |
| 2124 | 2112 | init_spi(machine); |
| 2125 | 2113 | } |
| r14896 | r14897 | |
| 2127 | 2115 | static DRIVER_INIT( ejanhs ) |
| 2128 | 2116 | { |
| 2129 | 2117 | // idle skip doesn't work properly? |
| 2130 | // machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x002d224, 0x002d227, FUNC(ejanhs_speedup_r) ); | |
| 2118 | // seibuspi_state *state = machine.driver_data<seibuspi_state>(); | |
| 2119 | // machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x002d224, 0x002d227, read32_delegate(FUNC(seibuspi_state::ejanhs_speedup_r),state)); | |
| 2131 | 2120 | |
| 2132 | 2121 | init_spi(machine); |
| 2133 | 2122 | } |
| 2134 | 2123 | |
| 2135 | 2124 | static DRIVER_INIT( viprp1 ) |
| 2136 | 2125 | { |
| 2137 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001e2e0, 0x001e2e3, FUNC(viprp1_speedup_r) ); | |
| 2126 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); | |
| 2127 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x001e2e0, 0x001e2e3, read32_delegate(FUNC(seibuspi_state::viprp1_speedup_r),state)); | |
| 2138 | 2128 | |
| 2139 | 2129 | init_spi(machine); |
| 2140 | 2130 | } |
| 2141 | 2131 | |
| 2142 | 2132 | static DRIVER_INIT( viprp1o ) |
| 2143 | 2133 | { |
| 2144 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001d49c, 0x001d49f, FUNC(viprp1o_speedup_r) ); | |
| 2134 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); | |
| 2135 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x001d49c, 0x001d49f, read32_delegate(FUNC(seibuspi_state::viprp1o_speedup_r),state)); | |
| 2145 | 2136 | |
| 2146 | 2137 | init_spi(machine); |
| 2147 | 2138 | } |
| r14896 | r14897 | |
| 2154 | 2145 | state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0"); |
| 2155 | 2146 | state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1"); |
| 2156 | 2147 | |
| 2157 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2148 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2158 | 2149 | seibuspi_rise10_text_decrypt(machine.region("gfx1")->base()); |
| 2159 | 2150 | seibuspi_rise10_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes()); |
| 2160 | 2151 | seibuspi_rise10_sprite_decrypt(machine.region("gfx3")->base(), 0x600000); |
| r14896 | r14897 | |
| 2179 | 2170 | state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0"); |
| 2180 | 2171 | state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1"); |
| 2181 | 2172 | |
| 2182 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2173 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2183 | 2174 | seibuspi_rise11_text_decrypt(machine.region("gfx1")->base()); |
| 2184 | 2175 | seibuspi_rise11_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes()); |
| 2185 | 2176 | seibuspi_rise11_sprite_decrypt_rfjet(machine.region("gfx3")->base(), 0x800000); |
| r14896 | r14897 | |
|---|---|---|
| 131 | 131 | WRITE8_MEMBER(sauro_state::sauro_sound_command_w) |
| 132 | 132 | { |
| 133 | 133 | data |= 0x80; |
| 134 | soundlatch_w(space, offset, data); | |
| 134 | soundlatch_byte_w(space, offset, data); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | READ8_MEMBER(sauro_state::sauro_sound_command_r) |
| 138 | 138 | { |
| 139 | int ret = soundlatch_r(space, offset); | |
| 140 | soundlatch_clear_w(space, offset, 0); | |
| 139 | int ret = soundlatch_byte_r(space, offset); | |
| 140 | soundlatch_clear_byte_w(space, offset, 0); | |
| 141 | 141 | return ret; |
| 142 | 142 | } |
| 143 | 143 | |
| r14896 | r14897 | |
| 155 | 155 | |
| 156 | 156 | WRITE8_MEMBER(sauro_state::flip_screen_w) |
| 157 | 157 | { |
| 158 | flip_screen_set( | |
| 158 | flip_screen_set( | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static WRITE8_DEVICE_HANDLER( adpcm_w ) |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | public: |
| 33 | 33 | timetrv_state(const machine_config &mconfig, device_type type, const char *tag) |
| 34 | : driver_device(mconfig, type, tag) { } | |
| 34 | : driver_device(mconfig, type, tag) , | |
| 35 | m_led_vram_lo(*this, "led_vralo"), | |
| 36 | m_led_vram_hi(*this, "led_vrahi"){ } | |
| 35 | 37 | |
| 36 | UINT8 *m_led_vram_lo; | |
| 37 | UINT8 *m_led_vram_hi; | |
| 38 | required_shared_ptr<UINT8> m_led_vram_lo; | |
| 39 | required_shared_ptr<UINT8> m_led_vram_hi; | |
| 38 | 40 | DECLARE_READ8_MEMBER(test1_r); |
| 39 | 41 | DECLARE_READ8_MEMBER(test2_r); |
| 40 | 42 | DECLARE_READ8_MEMBER(in_r); |
| r14896 | r14897 | |
| 51 | 53 | static SCREEN_UPDATE_IND16( timetrv ) |
| 52 | 54 | { |
| 53 | 55 | timetrv_state *state = screen.machine().driver_data<timetrv_state>(); |
| 54 | popmessage("%s%s",state->m_led_vram_lo,state->m_led_vram_hi); | |
| 56 | popmessage("%s%s",state->m_led_vram_lo.target(),state->m_led_vram_hi.target()); | |
| 55 | 57 | return 0; |
| 56 | 58 | } |
| 57 | 59 | |
| r14896 | r14897 | |
| 91 | 93 | AM_RANGE(0x1080, 0x1082) AM_READ(in_r) //dsw |
| 92 | 94 | AM_RANGE(0x1100, 0x1105) AM_WRITENOP //laserdisc write area |
| 93 | 95 | AM_RANGE(0x1100, 0x1105) AM_READ(ld_r) //5 -> laserdisc read status |
| 94 | AM_RANGE(0x1180, 0x1187) AM_RAM AM_BASE(m_led_vram_lo)//led string,part 1 | |
| 95 | AM_RANGE(0x1200, 0x1207) AM_RAM AM_BASE(m_led_vram_hi)//led string,part 2 | |
| 96 | AM_RANGE(0x1180, 0x1187) AM_RAM AM_SHARE("led_vralo")//led string,part 1 | |
| 97 | AM_RANGE(0x1200, 0x1207) AM_RAM AM_SHARE("led_vrahi")//led string,part 2 | |
| 96 | 98 | AM_RANGE(0xff80, 0xffff) AM_RAM //am80188-em-like cpu internal regs? |
| 97 | 99 | ADDRESS_MAP_END |
| 98 | 100 |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | m_nmi_enable = data & 1; |
| 38 | 38 | m_flipscreen = (data & 2) ? 1 : 0; |
| 39 | flip_screen_set( | |
| 39 | flip_screen_set( | |
| 40 | 40 | |
| 41 | 41 | // bit2,3 unknown |
| 42 | 42 | } |
| r14896 | r14897 | |
|---|---|---|
| 1 | 1 | /* Astra Fruit Machines |
| 2 | -- Unknown HW platform (related to pluto5.c?) | |
| 3 | -- 68k based | |
| 2 | -- Unknown 68340 based HW platform (seems related to pluto5.c?) | |
| 4 | 3 | -- dumps are of an unknown quality |
| 5 | 4 | -- These might all be the same system with different rom configurations, or different systems (unknown) |
| 6 | 5 | -- Some sets contain what look to be additional sound roms, others have them in the main program roms? |
| r14896 | r14897 | |
| 15 | 14 | #include "cpu/m68000/m68000.h" |
| 16 | 15 | |
| 17 | 16 | |
| 17 | ||
| 18 | 18 | class astrafr_state : public driver_device |
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | 21 | astrafr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | : driver_device(mconfig, type, tag) { } | |
| 22 | : driver_device(mconfig, type, tag) | |
| 23 | { | |
| 24 | fgpa_first_read_addr = 0xffff; | |
| 25 | fgpa_rom_write_addr = 0xffff; | |
| 26 | fgpa_after_rom_write_addr = 0xffff; | |
| 27 | } | |
| 28 | ||
| 29 | // ports move above from game to game.. | |
| 30 | UINT16 fgpa_rom_write_addr; | |
| 31 | UINT16 fgpa_first_read_addr; | |
| 32 | UINT16 fgpa_after_rom_write_addr; | |
| 33 | ||
| 34 | DECLARE_READ8_MEMBER( astra_fgpa_r ) | |
| 35 | { | |
| 36 | int pc = cpu_get_pc(&space.device()); | |
| 37 | ||
| 38 | if (offset==fgpa_first_read_addr) | |
| 39 | { | |
| 40 | return 0xff; | |
| 41 | } | |
| 42 | else | |
| 43 | { | |
| 44 | logerror("%08x astra_fgpa_r offset %02x\n", pc, offset); | |
| 45 | return 0xff; | |
| 46 | } | |
| 47 | } | |
| 48 | ||
| 49 | DECLARE_WRITE8_MEMBER( astra_fgpa_w ) | |
| 50 | { | |
| 51 | int pc = cpu_get_pc(&space.device()); | |
| 52 | ||
| 53 | if (offset==fgpa_rom_write_addr) | |
| 54 | { | |
| 55 | // the games write most of the ROM data to a port | |
| 56 | // I think it kicks the FPGA into life? | |
| 57 | } | |
| 58 | else | |
| 59 | { | |
| 60 | logerror("%08x astra_fgpa_w offset %02x %02x\n", pc, offset, data); | |
| 61 | } | |
| 62 | } | |
| 63 | ||
| 64 | /* 2nd copy for the 2nd board (assume same addresses for now */ | |
| 65 | DECLARE_READ8_MEMBER( astra_fgpa_slave_r ) | |
| 66 | { | |
| 67 | int pc = cpu_get_pc(&space.device()); | |
| 68 | ||
| 69 | if (offset==fgpa_first_read_addr) | |
| 70 | { | |
| 71 | return 0xff; | |
| 72 | } | |
| 73 | else | |
| 74 | { | |
| 75 | logerror("%08x astra_fgpa_slave_r offset %02x\n", pc, offset); | |
| 76 | return 0xff; | |
| 77 | } | |
| 78 | } | |
| 79 | ||
| 80 | DECLARE_WRITE8_MEMBER( astra_fgpa_slave_w ) | |
| 81 | { | |
| 82 | int pc = cpu_get_pc(&space.device()); | |
| 83 | ||
| 84 | if (offset==fgpa_rom_write_addr) | |
| 85 | { | |
| 86 | // the games write most of the ROM data to a port | |
| 87 | // I think it kicks the FPGA into life? | |
| 88 | } | |
| 89 | else | |
| 90 | { | |
| 91 | logerror("%08x astra_fgpa_slave_w offset %02x %02x\n", pc, offset, data); | |
| 92 | } | |
| 93 | } | |
| 94 | ||
| 23 | 95 | }; |
| 24 | 96 | |
| 25 | 97 | |
| 26 | 98 | static ADDRESS_MAP_START( astrafr_master_map, AS_PROGRAM, 32, astrafr_state ) |
| 27 | 99 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 100 | AM_RANGE(0x800000, 0x8000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff) | |
| 28 | 101 | AM_RANGE(0x400000, 0x40ffff) AM_RAM // as_partyd set |
| 29 | 102 | ADDRESS_MAP_END |
| 30 | 103 | |
| 31 | // probably identical, afaik they're lin | |
| 104 | // probably identical, afaik they're lin | |
| 32 | 105 | static ADDRESS_MAP_START( astrafr_slave_map, AS_PROGRAM, 32, astrafr_state ) |
| 33 | 106 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 107 | AM_RANGE(0x800000, 0x8000ff) AM_READWRITE8(astra_fgpa_slave_r, astra_fgpa_slave_w, 0xffffffff) | |
| 34 | 108 | AM_RANGE(0x400000, 0x40ffff) AM_RAM // as_partyd set |
| 35 | 109 | ADDRESS_MAP_END |
| 36 | 110 | |
| 37 | 111 | |
| 112 | static ADDRESS_MAP_START( astrafr_master_alt_map, AS_PROGRAM, 32, astrafr_state ) | |
| 113 | AM_RANGE(0x0000000, 0x01fffff) AM_ROM | |
| 114 | AM_RANGE(0x1000000, 0x1009fff) AM_RAM // ? | |
| 115 | AM_RANGE(0x2000000, 0x20000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff) | |
| 116 | ADDRESS_MAP_END | |
| 117 | ||
| 118 | ||
| 119 | ||
| 120 | ||
| 38 | 121 | static ADDRESS_MAP_START( astra_map, AS_PROGRAM, 32, astrafr_state ) |
| 39 | 122 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 123 | AM_RANGE(0x800000, 0x8000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff) | |
| 40 | 124 | AM_RANGE(0x400000, 0x40ffff) AM_RAM // as_partyd set |
| 41 | 125 | ADDRESS_MAP_END |
| 42 | 126 | |
| 127 | static ADDRESS_MAP_START( astra_alt_map, AS_PROGRAM, 32, astrafr_state ) | |
| 128 | AM_RANGE(0x0000000, 0x01fffff) AM_ROM | |
| 129 | AM_RANGE(0x1000000, 0x1009fff) AM_RAM // ? | |
| 130 | AM_RANGE(0x2000000, 0x20000ff) AM_READWRITE8(astra_fgpa_r, astra_fgpa_w, 0xffffffff) | |
| 131 | ADDRESS_MAP_END | |
| 43 | 132 | |
| 44 | 133 | static INPUT_PORTS_START( astrafr ) |
| 45 | 134 | INPUT_PORTS_END |
| 46 | 135 | |
| 136 | /* the FPGA area read/write addresses move around ... */ | |
| 137 | static MACHINE_START( astra_37 ) | |
| 138 | { | |
| 139 | astrafr_state *state = machine.driver_data<astrafr_state>(); | |
| 140 | state->fgpa_after_rom_write_addr = 0x30; | |
| 141 | state->fgpa_first_read_addr = 0x33; | |
| 142 | state->fgpa_rom_write_addr = 0x37; | |
| 143 | } | |
| 47 | 144 | |
| 145 | static MACHINE_START( astra_2e ) | |
| 146 | { | |
| 147 | astrafr_state *state = machine.driver_data<astrafr_state>(); | |
| 148 | state->fgpa_after_rom_write_addr = 0x20; | |
| 149 | state->fgpa_first_read_addr = 0x23; | |
| 150 | state->fgpa_rom_write_addr = 0x2e; | |
| 151 | } | |
| 152 | ||
| 153 | ||
| 48 | 154 | static MACHINE_CONFIG_START( astrafr_dual, astrafr_state ) |
| 49 | ||
| 50 | MCFG_CPU_ADD("maincpu", M68020, 16000000) // probably 68340 like other systems of this era? definitely not plain 68k | |
| 155 | MCFG_CPU_ADD("maincpu", M68340, 16000000) | |
| 51 | 156 | MCFG_CPU_PROGRAM_MAP(astrafr_master_map) |
| 52 | 157 | |
| 53 | MCFG_CPU_ADD("slavecpu", M680 | |
| 158 | MCFG_CPU_ADD("slavecpu", M68340 | |
| 54 | 159 | MCFG_CPU_PROGRAM_MAP(astrafr_slave_map) |
| 55 | 160 | MACHINE_CONFIG_END |
| 56 | 161 | |
| 162 | static MACHINE_CONFIG_DERIVED( astrafr_dual_2e, astrafr_dual ) | |
| 163 | MCFG_MACHINE_START( astra_2e ) | |
| 164 | MACHINE_CONFIG_END | |
| 57 | 165 | |
| 166 | static MACHINE_CONFIG_DERIVED( astrafr_dual_37, astrafr_dual ) | |
| 167 | MCFG_MACHINE_START( astra_37 ) | |
| 168 | MACHINE_CONFIG_END | |
| 169 | ||
| 170 | static MACHINE_CONFIG_START( astrafr_dual_alt, astrafr_state ) | |
| 171 | MCFG_CPU_ADD("maincpu", M68340, 16000000) | |
| 172 | MCFG_CPU_PROGRAM_MAP(astrafr_master_alt_map) | |
| 173 | ||
| 174 | MCFG_CPU_ADD("slavecpu", M68340, 16000000) | |
| 175 | MCFG_CPU_PROGRAM_MAP(astrafr_slave_map) | |
| 176 | MACHINE_CONFIG_END | |
| 177 | ||
| 178 | static MACHINE_CONFIG_DERIVED( astrafr_dual_alt_37, astrafr_dual_alt ) | |
| 179 | MCFG_MACHINE_START( astra_37 ) | |
| 180 | MACHINE_CONFIG_END | |
| 181 | ||
| 182 | ||
| 183 | ||
| 58 | 184 | static MACHINE_CONFIG_START( astra_single, astrafr_state ) |
| 59 | ||
| 60 | MCFG_CPU_ADD("maincpu", M68020, 16000000) | |
| 185 | MCFG_CPU_ADD("maincpu", M68340, 16000000) | |
| 61 | 186 | MCFG_CPU_PROGRAM_MAP(astra_map) |
| 62 | 187 | MACHINE_CONFIG_END |
| 63 | 188 | |
| 189 | static MACHINE_CONFIG_DERIVED( astra_single_37, astra_single ) | |
| 190 | MCFG_MACHINE_START( astra_37 ) | |
| 191 | MACHINE_CONFIG_END | |
| 64 | 192 | |
| 193 | static MACHINE_CONFIG_DERIVED( astra_single_2e, astra_single ) | |
| 194 | MCFG_MACHINE_START( astra_2e ) | |
| 195 | MACHINE_CONFIG_END | |
| 65 | 196 | |
| 197 | static MACHINE_START( astra_57 ) | |
| 198 | { | |
| 199 | astrafr_state *state = machine.driver_data<astrafr_state>(); | |
| 200 | // state->fgpa_after_rom_write_addr = 0x20; | |
| 201 | // state->fgpa_first_read_addr = 0x23; | |
| 202 | state->fgpa_rom_write_addr = 0x57; | |
| 203 | } | |
| 66 | 204 | |
| 67 | /* are the ptM roms Master nad ptS roms Slave? | |
| 205 | ||
| 206 | static MACHINE_CONFIG_START( astra_single_alt, astrafr_state ) | |
| 207 | MCFG_CPU_ADD("maincpu", M68340, 16000000) | |
| 208 | MCFG_CPU_PROGRAM_MAP(astra_alt_map) | |
| 209 | MACHINE_CONFIG_END | |
| 210 | ||
| 211 | static MACHINE_CONFIG_DERIVED( astra_single_alt_57, astra_single_alt ) | |
| 212 | MCFG_MACHINE_START( astra_57 ) | |
| 213 | MACHINE_CONFIG_END | |
| 214 | ||
| 215 | static MACHINE_CONFIG_DERIVED( astra_single_alt_37, astra_single_alt ) | |
| 216 | MCFG_MACHINE_START( astra_37 ) | |
| 217 | MACHINE_CONFIG_END | |
| 218 | ||
| 219 | /* are the ptM roms Master and ptS roms Slave? | |
| 68 | 220 | or is as_partyd set actually the master, with the larger roms? |
| 69 | 221 | */ |
| 70 | 222 | |
| r14896 | r14897 | |
| 75 | 227 | ROM_REGION( 0x200000, "slavecpu", 0 ) |
| 76 | 228 | ROM_LOAD( "pts105.u1", 0x0000, 0x080000, CRC(0699143f) SHA1(486dff92c27ede8cd0d9395f6e4418ba0d056e90) ) |
| 77 | 229 | |
| 78 | ROM_REGION( 0x200000, "altrevs", 0 ) | |
| 230 | ROM_REGION( 0x200000, "altrevs", 0 ) /* these were in 'party time' sets, but I don't think they're all party time! */ | |
| 79 | 231 | ROM_LOAD( "pts105d.u1", 0x0000, 0x080000, CRC(0f628b8c) SHA1(c970db9274df6b9c0383ae6e0bcf9b24288a40cd) ) |
| 232 | ROM_LOAD( "ptmv0-02.bin", 0x0000, 0x080000, CRC(e9dd8674) SHA1(ace543bc7fea8d09661e76c1ade4e1f27db5a116) ) | |
| 233 | ROM_LOAD( "ptmv1-04.bin", 0x0000, 0x080000, CRC(32af5358) SHA1(bd61c396824bb2b6845126162c4ff797564ebdf2) ) | |
| 234 | ROM_LOAD( "ptmv1-13.bin", 0x0000, 0x080000, CRC(4f321735) SHA1(3f9b0b64c42011d948291cd774a922393793a4b1) ) | |
| 235 | ROM_LOAD( "joker03.u1", 0x0000, 0x080000, CRC(a3dd15e8) SHA1(95d04de6c991b3c1ff43b0f477f03213e83f63f2) ) | |
| 236 | ROM_LOAD( "joker03.u2", 0x0000, 0x080000, CRC(57b3305a) SHA1(c38bc7db6c9a3f8f5371bb4c555333404fed6a9f) ) | |
| 237 | ROM_LOAD( "jokr03d.u1", 0x0000, 0x080000, CRC(aa268a5b) SHA1(cce89dbaaaf2d44daf127de1ad6d621c46d892fc) ) | |
| 238 | ROM_LOAD( "jokr03g.u1", 0x0000, 0x080000, CRC(cb12f8fa) SHA1(7a9c9fe72b70fe1b4a3be2edfde9d7a54d7a8219) ) | |
| 239 | ROM_LOAD( "jst0-05.u1", 0x0000, 0x080000, CRC(38f2d7b0) SHA1(11ccb5b5a35e43f505a7d3ebc36a0694111fed11) ) | |
| 240 | ROM_LOAD( "jst0-05.u2", 0x0000, 0x080000, CRC(97c14933) SHA1(8515601fbacf76a78a95e4a46a47809fcec021bc) ) | |
| 241 | ROM_LOAD( "jst0-05d.u1", 0x0000, 0x080000, CRC(31094803) SHA1(b7b5fd97681c38de5e877ca7b09909c82316d4d8) ) | |
| 242 | ROM_LOAD( "jst0-05g.u1", 0x0000, 0x080000, CRC(503d3aa2) SHA1(818e79126ca8ae6bbd1eaac2ae13977b3402f497) ) | |
| 243 | ROM_LOAD( "jst0-06.u1", 0x0000, 0x080000, CRC(b6106ca4) SHA1(dedeeff6e8c13da1f62e882cbeb36567a631e563) ) | |
| 244 | ROM_LOAD( "jst0-06.u2", 0x0000, 0x080000, CRC(49a78695) SHA1(af99df8c97a8c3bcb5a81a38b985e1fc92176927) ) | |
| 245 | ROM_LOAD( "jst0-06d.u1", 0x0000, 0x080000, CRC(bfebf317) SHA1(7f1a2a8e3f3de6a03452f535d2c314810bc652da) ) | |
| 246 | ROM_LOAD( "jst0-06g.u1", 0x0000, 0x080000, CRC(dedf81b6) SHA1(0579501c939eacb93d1455eaf74b629c2170b05b) ) | |
| 247 | ROM_LOAD( "l7v1-03.bin", 0x0000, 0x080000, CRC(878d1a3d) SHA1(fd7cb08f698bb6bbfed1c57486e53dce062d22e4) ) | |
| 248 | ROM_LOAD( "l7v1-03d.bin", 0x0000, 0x080000, CRC(91a81e50) SHA1(6086861bd5a53fa17df8b155acd47e9aa45a032d) ) | |
| 249 | ROM_LOAD( "pbmv0-06.u1", 0x0000, 0x080000, CRC(d0283320) SHA1(472f0e0dd45da61081ca12e466ac02dc82eb4431) ) | |
| 250 | ROM_LOAD( "pbmv0-06.u2", 0x0000, 0x080000, CRC(38fb2ff6) SHA1(628dcdcbf4767db62b4bdee7b7feff32715e6a2d) ) | |
| 251 | ROM_LOAD( "pbs0-06d.u1", 0x0000, 0x080000, CRC(f24e84d2) SHA1(d54e787c91c79a26383971249f935529e2a492f4) ) | |
| 252 | ROM_LOAD( "pbs0-06g.u1", 0x0000, 0x080000, CRC(937af673) SHA1(88f33fd3921440a99b662fec7291c8b9845210a5) ) | |
| 253 | ROM_LOAD( "pbsv0-06.u1", 0x0000, 0x080000, CRC(fbb51b61) SHA1(c1459f8f2d9f182e5be55bbcaf143315f7efc3b0) ) | |
| 254 | ROM_LOAD( "pbsv0-06.u2", 0x0000, 0x080000, CRC(2f0934de) SHA1(915a16898087f396457d712e3847f4f7c0bd5c06) ) | |
| 255 | ROM_LOAD( "pgm0-04.u1", 0x0000, 0x040000, CRC(2885367c) SHA1(c33cb554889b1f7390baa416a77953f45a80044f) ) | |
| 256 | ROM_LOAD( "pgm0-04.u2", 0x0000, 0x040000, CRC(c5eed515) SHA1(9b832a6ef301a25bccf2d97cca0c9a012ca0090a) ) | |
| 257 | ROM_LOAD( "pgm1-00.u1", 0x0000, 0x040000, CRC(1fa4e10f) SHA1(787ec967a9aba5934db79fe67efb32370d2c0258) ) | |
| 258 | ROM_LOAD( "pgm1-00.u2", 0x0000, 0x040000, CRC(8b5a6178) SHA1(e1f9898ef37877ce50630a468b3c187a4fe253fa) ) | |
| 259 | ROM_LOAD( "pgs0-04d.u1", 0x0000, 0x040000, CRC(1f5ede2c) SHA1(ac67536a021b531efe18027806f1f86504d72493) ) | |
| 260 | ROM_LOAD( "pgsv0-04.u1", 0x0000, 0x040000, CRC(cb3387be) SHA1(2add224a8839e83cc04901274acc7ca4a781b7d9) ) | |
| 261 | ROM_LOAD( "pgsv0-04.u2", 0x0000, 0x040000, CRC(63054bd6) SHA1(59cf8dd7efdaf2491a2aca8fbcda2d3b8b70fbf7) ) | |
| 262 | ROM_LOAD( "pgsv1-00.u1", 0x0000, 0x040000, CRC(725dd2af) SHA1(f8ecd1282809c0906497c62a68429152c10e2da0) ) | |
| 263 | ROM_LOAD( "pgsv1-00.u2", 0x0000, 0x040000, CRC(067dd0c2) SHA1(ac36aeb63b33969dc0a49150e41bfdd8624072de) ) | |
| 264 | ROM_LOAD( "pgsv100d.u1", 0x0000, 0x040000, CRC(a6308b3d) SHA1(125ed244bcb7a515dfc9c34c12bc74f8cd50e8dd) ) | |
| 265 | ROM_LOAD( "ptp003d.u1", 0x0000, 0x100000, CRC(2b2c05b6) SHA1(541a53c84c07bd7e1f09d4d033cf652ab838b4ef) ) | |
| 266 | ROM_LOAD( "ptp003g.u1", 0x0000, 0x100000, CRC(d9d0e151) SHA1(35fb4412602b9fd3b66e7170cc1984693b9c9ebd) ) | |
| 267 | ROM_LOAD( "ptpv003.u1", 0x0000, 0x100000, CRC(07c189da) SHA1(c4574cdedba87058312db84c6ee7f4a7142eea65) ) | |
| 268 | ROM_LOAD( "ptpv003.u2", 0x0000, 0x100000, CRC(e1f78cf4) SHA1(5f72b2604fd7ee300f6bd5b5a12d98c77b03b9ba) ) | |
| 269 | ROM_LOAD( "pts1-04d.bin", 0x0000, 0x080000, CRC(95564b9f) SHA1(98091d4badd346578882db75a8d72ddaa810b3f5) ) | |
| 270 | ROM_LOAD( "pts1-13d.bin", 0x0000, 0x080000, CRC(876232cf) SHA1(5d2355f85bde636dcb6f3dbd87874294db8e1ded) ) | |
| 271 | ROM_LOAD( "ptsv0-02.bin", 0x0000, 0x080000, CRC(3cc9c022) SHA1(1eb3c237971cf407057d077fd08e4436c765ae43) ) | |
| 272 | ROM_LOAD( "ptsv1-04.bin", 0x0000, 0x080000, CRC(9cadd42c) SHA1(e6ead7112195a17797672112c7bbd4910ae6eb50) ) | |
| 273 | ROM_LOAD( "ptsv1-13.bin", 0x0000, 0x080000, CRC(8e99ad7c) SHA1(d4cfce825b4a718a12d80e79ed943797c6510ad6) ) | |
| 274 | ROM_LOAD( "sov0-03.u1", 0x0000, 0x080000, CRC(4e2e7a79) SHA1(77f32b43d2e01cb0223feccb9e29c3fde0a6e9b7) ) | |
| 275 | ROM_LOAD( "sov0-03.u2", 0x0000, 0x080000, CRC(1ef8712a) SHA1(1a2ef378679384e720e5b20f1420454102f18258) ) | |
| 276 | ROM_LOAD( "sov0-03d.u1", 0x0000, 0x080000, CRC(47d5e5ca) SHA1(d3624a8b8545f67d14bee90bc3967c13b8497e5b) ) | |
| 277 | ROM_LOAD( "hog0-03.u1", 0x0000, 0x080000, CRC(eaa26ab0) SHA1(ee7d76b92c3274ba8c5ba59184bb3334fbbc64c4) ) | |
| 278 | ROM_LOAD( "jjrv1-02.u1", 0x0000, 0x080000, CRC(0f05e392) SHA1(64c885c92fb26c0ed64b8283793cdf86d2bc0e35) ) | |
| 279 | ROM_LOAD( "jjrv1-02.u2", 0x0000, 0x080000, CRC(1d86f26c) SHA1(e7db51b217e9fb8a0440b7c7591c5ea4142540bc) ) | |
| 80 | 280 | ROM_END |
| 81 | 281 | |
| 82 | 282 | ROM_START( as_partya ) |
| r14896 | r14897 | |
| 1387 | 1587 | |
| 1388 | 1588 | ROM_START( as_stp ) |
| 1389 | 1589 | ROM_REGION( 0x200000, "maincpu", 0 ) |
| 1390 | ROM_LOAD16_BYTE( "1st1_03.bin", 0x0000, 0x080000, CRC(6f34a144) SHA1(69f7e58bf7d868f75ef3f4242a0b6624452a3558) ) | |
| 1391 | ROM_LOAD16_BYTE( "2st1_03.bin", 0x0000, 0x080000, CRC(cc04e763) SHA1(532c914d4925d19b2c416d29711e7eb506eb75e5) ) | |
| 1590 | ROM_LOAD16_BYTE( "1st1_03.bin", 0x00000, 0x080000, CRC(6f34a144) SHA1(69f7e58bf7d868f75ef3f4242a0b6624452a3558) ) | |
| 1591 | ROM_LOAD16_BYTE( "2st1_03.bin", 0x00001, 0x080000, CRC(cc04e763) SHA1(532c914d4925d19b2c416d29711e7eb506eb75e5) ) | |
| 1392 | 1592 | |
| 1393 | 1593 | ROM_REGION( 0x200000, "altrevs", 0 ) |
| 1394 | 1594 | ROM_LOAD16_BYTE( "1st1_03g.bin", 0x0000, 0x080000, CRC(f08d5a74) SHA1(ee2c0fb15354178880f9ecf82f6d5f3ca3f0879d) ) |
| r14896 | r14897 | |
| 1398 | 1598 | |
| 1399 | 1599 | ROM_START( as_stpa ) |
| 1400 | 1600 | ROM_REGION( 0x200000, "maincpu", 0 ) |
| 1401 | ROM_LOAD16_BYTE( "stp102.u1", 0x0000, 0x080000, CRC(8df15c17) SHA1(45f6bdd3e213cea5de5feca8e2c4658b17507014) ) | |
| 1402 | ROM_LOAD16_BYTE( "stp102.u2", 0x0000, 0x080000, CRC(a06d6e4a) SHA1(d0ca62e98863ae9d07a8f81f8e9c0d655c0eab2b) ) | |
| 1601 | ROM_LOAD16_BYTE( "stp102.u1", 0x00000, 0x080000, CRC(8df15c17) SHA1(45f6bdd3e213cea5de5feca8e2c4658b17507014) ) | |
| 1602 | ROM_LOAD16_BYTE( "stp102.u2", 0x00001, 0x080000, CRC(a06d6e4a) SHA1(d0ca62e98863ae9d07a8f81f8e9c0d655c0eab2b) ) | |
| 1403 | 1603 | |
| 1404 | 1604 | ROM_REGION( 0x200000, "altrevs", 0 ) |
| 1405 | 1605 | ROM_LOAD16_BYTE( "stp102d.u1", 0x0000, 0x080000, CRC(840ac3a4) SHA1(d843c0884bfe470ea3bcf778e1786869fb032619) ) |
| r14896 | r14897 | |
| 1407 | 1607 | |
| 1408 | 1608 | ROM_START( as_stpb ) |
| 1409 | 1609 | ROM_REGION( 0x200000, "maincpu", 0 ) |
| 1410 | ROM_LOAD16_BYTE( "stp105.u1", 0x0000, 0x080000, CRC(c3c600b4) SHA1(e570ed887e8aad6b816872c8468e15ab5b904ad5) ) | |
| 1411 | ROM_LOAD16_BYTE( "stp105.u2", 0x0000, 0x080000, CRC(7f23fe83) SHA1(e8b0a141ca3c578a1c0d49b237b309326a01300d) ) | |
| 1610 | ROM_LOAD16_BYTE( "stp105.u1", 0x00000, 0x080000, CRC(c3c600b4) SHA1(e570ed887e8aad6b816872c8468e15ab5b904ad5) ) | |
| 1611 | ROM_LOAD16_BYTE( "stp105.u2", 0x00001, 0x080000, CRC(7f23fe83) SHA1(e8b0a141ca3c578a1c0d49b237b309326a01300d) ) | |
| 1412 | 1612 | |
| 1413 | 1613 | ROM_REGION( 0x200000, "altrevs", 0 ) |
| 1414 | 1614 | ROM_LOAD16_BYTE( "stp105d.u1", 0x0000, 0x080000, CRC(ca3d9f07) SHA1(2f20259aa1adf5a7144bd8e35746b10a2f9e5f54) ) |
| r14896 | r14897 | |
| 1795 | 1995 | |
| 1796 | 1996 | |
| 1797 | 1997 | // Linked games (single rom per CPU with master/slave?) |
| 1798 | GAME( 200?, as_party, 0 , astrafr_dual, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V105)", GAME_IS_SKELETON_MECHANICAL) | |
| 1799 | GAME( 200?, as_partya, as_party , astrafr_dual, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V110)", GAME_IS_SKELETON_MECHANICAL) | |
| 1800 | GAME( 200?, as_partyb, as_party , astrafr_dual, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V112)", GAME_IS_SKELETON_MECHANICAL) | |
| 1801 | GAME( 200?, as_partyc, as_party , astrafr_dual, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V206)" ,GAME_IS_SKELETON_MECHANICAL) | |
| 1802 | GAME( 200?, as_partyd, as_party , astrafr_dual, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V401)", GAME_IS_SKELETON_MECHANICAL) // significantly different set | |
| 1803 | GAME( 200?, as_partye, as_party , astrafr_dual, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V907)", GAME_IS_SKELETON_MECHANICAL) | |
| 1804 | GAME( 200?, as_partyf, as_party , astrafr_dual, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V906)", GAME_IS_SKELETON_MECHANICAL) | |
| 1998 | GAME( 200?, as_party, 0 , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V105)", GAME_IS_SKELETON_MECHANICAL) | |
| 1999 | GAME( 200?, as_partya, as_party , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V110)", GAME_IS_SKELETON_MECHANICAL) | |
| 2000 | GAME( 200?, as_partyb, as_party , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V112)", GAME_IS_SKELETON_MECHANICAL) | |
| 2001 | GAME( 200?, as_partyc, as_party , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V206)" ,GAME_IS_SKELETON_MECHANICAL) | |
| 2002 | GAME( 200?, as_partyd, as_party , astrafr_dual_37, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V401)", GAME_IS_SKELETON_MECHANICAL) // significantly different set | |
| 2003 | GAME( 200?, as_partye, as_party , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V907)", GAME_IS_SKELETON_MECHANICAL) | |
| 2004 | GAME( 200?, as_partyf, as_party , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Party Time (Astra, V906)", GAME_IS_SKELETON_MECHANICAL) | |
| 1805 | 2005 | |
| 1806 | GAME( 200?, as_letsp, 0 , astrafr_dual, astrafr, 0, ROT0, "Astra", "Let's Party (Astra, V904)", GAME_IS_SKELETON_MECHANICAL) | |
| 2006 | GAME( 200?, as_letsp, 0 , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Let's Party (Astra, V904)", GAME_IS_SKELETON_MECHANICAL) | |
| 1807 | 2007 | |
| 1808 | GAME( 200?, as_topsl, 0 , astrafr_dual, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V103)", GAME_IS_SKELETON_MECHANICAL) | |
| 1809 | GAME( 200?, as_topsla, as_topsl , astrafr_dual, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V104)", GAME_IS_SKELETON_MECHANICAL) | |
| 1810 | GAME( 200?, as_topslb, as_topsl , astrafr_dual, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V201)", GAME_IS_SKELETON_MECHANICAL) | |
| 1811 | GAME( 200?, as_topslc, as_topsl , astrafr_dual, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V203)", GAME_IS_SKELETON_MECHANICAL) | |
| 1812 | GAME( 200?, as_topsld, as_topsl , astrafr_dual, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V205)", GAME_IS_SKELETON_MECHANICAL) | |
| 2008 | GAME( 200?, as_topsl, 0 , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V103)", GAME_IS_SKELETON_MECHANICAL) | |
| 2009 | GAME( 200?, as_topsla, as_topsl , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V104)", GAME_IS_SKELETON_MECHANICAL) | |
| 2010 | GAME( 200?, as_topslb, as_topsl , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V201)", GAME_IS_SKELETON_MECHANICAL) | |
| 2011 | GAME( 200?, as_topslc, as_topsl , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V203)", GAME_IS_SKELETON_MECHANICAL) | |
| 2012 | GAME( 200?, as_topsld, as_topsl , astrafr_dual_2e, astrafr, 0, ROT0, "Astra", "Top Slot (Astra, V205)", GAME_IS_SKELETON_MECHANICAL) | |
| 1813 | 2013 | |
| 1814 | 2014 | |
| 1815 | 2015 | // Other HW? (has u1/u2 pairing) |
| r14896 | r14897 | |
| 1822 | 2022 | |
| 1823 | 2023 | // u1/u2 pairing and Linked? |
| 1824 | 2024 | |
| 1825 | GAME( 200?, as_hc, 0 , astrafr_dual , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V107)", GAME_IS_SKELETON_MECHANICAL) | |
| 1826 | GAME( 200?, as_hca, as_hc , astrafr_dual , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V109)", GAME_IS_SKELETON_MECHANICAL) | |
| 1827 | GAME( 200?, as_hcb, as_hc , astrafr_dual , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V110)", GAME_IS_SKELETON_MECHANICAL) | |
| 1828 | GAME( 200?, as_hcc, as_hc , astrafr_dual , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V111)", GAME_IS_SKELETON_MECHANICAL) | |
| 1829 | GAME( 200?, as_hcd, as_hc , astrafr_dual , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V909)", GAME_IS_SKELETON_MECHANICAL) | |
| 2025 | GAME( 200?, as_hc, 0 , astrafr_dual_37 , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V107)", GAME_IS_SKELETON_MECHANICAL) | |
| 2026 | GAME( 200?, as_hca, as_hc , astrafr_dual_37 , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V109)", GAME_IS_SKELETON_MECHANICAL) | |
| 2027 | GAME( 200?, as_hcb, as_hc , astrafr_dual_37 , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V110)", GAME_IS_SKELETON_MECHANICAL) | |
| 2028 | GAME( 200?, as_hcc, as_hc , astrafr_dual_37 , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V111)", GAME_IS_SKELETON_MECHANICAL) | |
| 2029 | GAME( 200?, as_hcd, as_hc , astrafr_dual_37 , astrafr, astradec_dual, ROT0, "Astra", "Hokey Cokey (Astra, V909)", GAME_IS_SKELETON_MECHANICAL) | |
| 1830 | 2030 | |
| 1831 | 2031 | // Non-Astra, same hw? |
| 1832 | 2032 | |
| 1833 | GAME( 200?, as_cshah, 0 , astra_single , astrafr, astradec, ROT0, "Lowen", "Cash Ahoi (Lowen, V105)", GAME_IS_SKELETON_MECHANICAL) | |
| 2033 | GAME( 200?, as_cshah, 0 , astra_single_alt_57 , astrafr, astradec, ROT0, "Lowen", "Cash Ahoi (Lowen, V105)", GAME_IS_SKELETON_MECHANICAL) | |
| 1834 | 2034 | |
| 1835 | 2035 | |
| 1836 | 2036 | GAME( 200?, as_big10, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Big 10 (Astra, V500)", GAME_IS_SKELETON_MECHANICAL) // BB96 |
| r14896 | r14897 | |
| 1842 | 2042 | GAME( 200?, as_bigcs, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Big Cash (Astra, V101)", GAME_IS_SKELETON_MECHANICAL) // CF97/CF98 |
| 1843 | 2043 | GAME( 200?, as_bigcsa, as_bigcs , astra_single, astrafr, 0, ROT0, "Astra", "Big Cash (Astra, V103)", GAME_IS_SKELETON_MECHANICAL) // CF97/CF98 |
| 1844 | 2044 | |
| 1845 | GAME( 200?, as_bbr, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) // FA00/CU98 | |
| 1846 | GAME( 200?, as_bbra, as_bbr , astra_single, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V102,alt)" , GAME_IS_SKELETON_MECHANICAL) // FA00/CU98 | |
| 1847 | GAME( 200?, as_bbrb, as_bbr , astra_single, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V201)" , GAME_IS_SKELETON_MECHANICAL) // FA00/CU98 | |
| 1848 | GAME( 200?, as_bbrc, as_bbr , astra_single, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V003)" , GAME_IS_SKELETON_MECHANICAL) // CU98 | |
| 1849 | GAME( 200?, as_bbrd, as_bbr , astra_single, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) // CU98 | |
| 1850 | GAME( 200?, as_bbre, as_bbr , astra_single, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) // FG01 | |
| 1851 | GAME( 200?, as_bbrf, as_bbr , astra_single, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V004)" , GAME_IS_SKELETON_MECHANICAL) // FN01 | |
| 2045 | GAME( 200?, as_bbr, 0 , astra_single_2e, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) // FA00/CU98 | |
| 2046 | GAME( 200?, as_bbra, as_bbr , astra_single_2e, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V102,alt)" , GAME_IS_SKELETON_MECHANICAL) // FA00/CU98 | |
| 2047 | GAME( 200?, as_bbrb, as_bbr , astra_single_2e, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V201)" , GAME_IS_SKELETON_MECHANICAL) // FA00/CU98 | |
| 2048 | GAME( 200?, as_bbrc, as_bbr , astra_single_2e, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V003)" , GAME_IS_SKELETON_MECHANICAL) // CU98 | |
| 2049 | GAME( 200?, as_bbrd, as_bbr , astra_single_2e, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) // CU98 | |
| 2050 | GAME( 200?, as_bbre, as_bbr , astra_single_37, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) // FG01 | |
| 2051 | GAME( 200?, as_bbrf, as_bbr , astra_single_37, astrafr, 0, ROT0, "Astra", "Bullion Bars (Astra, V004)" , GAME_IS_SKELETON_MECHANICAL) // FN01 | |
| 1852 | 2052 | |
| 1853 | 2053 | GAME( 200?, as_dblcs, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Double Cash (Astra, V110)" , GAME_IS_SKELETON_MECHANICAL) // BR97 |
| 1854 | 2054 | GAME( 200?, as_dblcsa, as_dblcs , astra_single, astrafr, 0, ROT0, "Astra", "Double Cash (Astra, V112)" , GAME_IS_SKELETON_MECHANICAL) // BR97 |
| r14896 | r14897 | |
| 1898 | 2098 | GAME( 200?, as_lbt, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Little Big 10 (Astra, V103)" , GAME_IS_SKELETON_MECHANICAL) |
| 1899 | 2099 | GAME( 200?, as_lbta, as_lbt , astra_single, astrafr, 0, ROT0, "Astra", "Little Big 10 (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) |
| 1900 | 2100 | |
| 1901 | GAME( 200?, as_ldl, 0 , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Little Devils (Astra, V700)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2101 | GAME( 200?, as_ldl, 0 , astra_single_2e, astrafr, astradec_sml, ROT0, "Astra", "Little Devils (Astra, V700)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1902 | 2102 | GAME( 200?, as_ldla, as_ldl , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Little Devils (Astra, V600)" , GAME_IS_SKELETON_MECHANICAL) |
| 1903 | 2103 | GAME( 200?, as_ldlb, as_ldl , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Little Devils (Astra, V312)" , GAME_IS_SKELETON_MECHANICAL) |
| 1904 | 2104 | GAME( 200?, as_ldlc, as_ldl , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Little Devils (Astra, V003)" , GAME_IS_SKELETON_MECHANICAL) |
| 1905 | 2105 | GAME( 200?, as_ldld, as_ldl , astra_single, astrafr, 0, ROT0, "Astra", "Little Devils (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) |
| 1906 | 2106 | GAME( 200?, as_ldle, as_ldl , astra_single, astrafr, 0, ROT0, "Astra", "Little Devils (Astra, V103)" , GAME_IS_SKELETON_MECHANICAL) |
| 1907 | GAME( 200?, as_mp, 0 , astra_single, astrafr, astradec, ROT0, "Lowen", "Mission Possible (Lowen, V118)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2107 | GAME( 200?, as_mp, 0 , astra_single_2e, astrafr, astradec, ROT0, "Lowen", "Mission Possible (Lowen, V118)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1908 | 2108 | GAME( 200?, as_mp2, 0 , astra_single, astrafr, 0, ROT0, "Lowen", "Mission Possible 2 (Lowen, V114)" , GAME_IS_SKELETON_MECHANICAL) |
| 1909 | GAME( 200?, as_otr, 0 , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Over The Rainbow (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2109 | GAME( 200?, as_otr, 0 , astra_single_2e, astrafr, astradec_sml, ROT0, "Astra", "Over The Rainbow (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1910 | 2110 | GAME( 200?, as_otra, as_otr , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Over The Rainbow (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) // incomplete set |
| 1911 | GAME( 200?, as_ptf, 0 , astrafr_dual, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) // strange extra sound(?) roms in here | |
| 1912 | GAME( 200?, as_ptfa, as_ptf , astrafr_dual, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra, V803)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1913 | GAME( 200?, as_ptfb, as_ptf , astrafr_dual, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra, V905)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1914 | GAME( 200?, as_ptfc, as_ptf , astrafr_dual, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2111 | GAME( 200?, as_ptf, 0 , astrafr_dual_37, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) // strange extra sound(?) roms in here | |
| 2112 | GAME( 200?, as_ptfa, as_ptf , astrafr_dual_37, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra, V803)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2113 | GAME( 200?, as_ptfb, as_ptf , astrafr_dual_37, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra, V905)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2114 | GAME( 200?, as_ptfc, as_ptf , astrafr_dual_37, astrafr, astradec_sml_dual, ROT0, "Astra", "Party Fruits (Astra)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1915 | 2115 | GAME( 200?, as_pia, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Pay It Again (Astra, V202)" , GAME_IS_SKELETON_MECHANICAL) |
| 1916 | 2116 | GAME( 200?, as_piaa, as_pia , astra_single, astrafr, 0, ROT0, "Astra", "Pay It Again (Astra, V206)" , GAME_IS_SKELETON_MECHANICAL) |
| 1917 | 2117 | GAME( 200?, as_piab, as_pia , astra_single, astrafr, 0, ROT0, "Astra", "Pay It Again (Astra, V904)" , GAME_IS_SKELETON_MECHANICAL) |
| 1918 | GAME( 200?, as_pharg, 0 , astra_single, astrafr, astradec, ROT0, "Astra", "Pharaoh's Gold (Astra, V005)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2118 | GAME( 200?, as_pharg, 0 , astra_single_37, astrafr, astradec, ROT0, "Astra", "Pharaoh's Gold (Astra, V005)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1919 | 2119 | GAME( 200?, as_pharga, as_pharg , astra_single, astrafr, astradec, ROT0, "Astra", "Pharaoh's Gold (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) |
| 1920 | 2120 | GAME( 200?, as_phargb, as_pharg , astra_single, astrafr, astradec, ROT0, "Astra", "Pharaoh's Gold (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) |
| 1921 | 2121 | GAME( 200?, as_phargc, as_pharg , astra_single, astrafr, astradec, ROT0, "Astra", "Pharaoh's Gold (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) |
| 1922 | 2122 | GAME( 200?, as_phargd, as_pharg , astra_single, astrafr, astradec, ROT0, "Astra", "Pharaoh's Gold (Astra, V106)" , GAME_IS_SKELETON_MECHANICAL) |
| 1923 | 2123 | GAME( 200?, as_pharge, as_pharg , astra_single, astrafr, astradec, ROT0, "Astra", "Pharaoh's Gold (Astra, V107)" , GAME_IS_SKELETON_MECHANICAL) |
| 1924 | GAME( 200?, as_pb, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Piggy Banking (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2124 | GAME( 200?, as_pb, 0 , astra_single_2e, astrafr, 0, ROT0, "Astra", "Piggy Banking (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1925 | 2125 | // this might be another mix of master / slave sets, and multiple games.... |
| 1926 | GAME( 200?, as_rtr, 0 , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1927 | GAME( 200?, as_rtra, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101, alt 1)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1928 | GAME( 200?, as_rtrb, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101, alt 2)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1929 | GAME( 200?, as_rtrc, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101, alt 3)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1930 | GAME( 200?, as_rtrd, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V100, )" , GAME_IS_SKELETON_MECHANICAL) | |
| 1931 | GAME( 200?, as_rtre, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V100, alt)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1932 | GAME( 200?, as_rtrf, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V200)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2126 | GAME( 200?, as_rtr, 0 , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2127 | GAME( 200?, as_rtra, as_rtr , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101, alt 1)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2128 | GAME( 200?, as_rtrb, as_rtr , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101, alt 2)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2129 | GAME( 200?, as_rtrc, as_rtr , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V101, alt 3)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2130 | GAME( 200?, as_rtrd, as_rtr , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V100, )" , GAME_IS_SKELETON_MECHANICAL) | |
| 2131 | GAME( 200?, as_rtre, as_rtr , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V100, alt)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2132 | GAME( 200?, as_rtrf, as_rtr , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V200)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1933 | 2133 | GAME( 200?, as_rtrg, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V200, alt)" , GAME_IS_SKELETON_MECHANICAL) |
| 1934 | GAME( 200?, as_rtrh, as_rtr , astra_single, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V202)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2134 | GAME( 200?, as_rtrh, as_rtr , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Ready To Roll (Astra, V202)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1935 | 2135 | |
| 1936 | GAME( 200?, as_rab, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Ring A Bell (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2136 | GAME( 200?, as_rab, 0 , astra_single_2e, astrafr, 0, ROT0, "Astra", "Ring A Bell (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1937 | 2137 | GAME( 200?, as_raba, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "Ring A Bell (Astra, V106)" , GAME_IS_SKELETON_MECHANICAL) |
| 1938 | 2138 | GAME( 200?, as_rabb, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "Ring A Bell (Astra, V107)" , GAME_IS_SKELETON_MECHANICAL) |
| 1939 | 2139 | GAME( 200?, as_rabc, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "Ring A Bell (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) |
| 1940 | GAME( 200?, as_rbg, 0 , astra_single, astrafr, 0, ROT0, "Astra", "River Boat Gambler (Astra, V304)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2140 | GAME( 200?, as_rbg, 0 , astra_single_2e, astrafr, 0, ROT0, "Astra", "River Boat Gambler (Astra, V304)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1941 | 2141 | GAME( 200?, as_rbga, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "River Boat Gambler (Astra, V303)" , GAME_IS_SKELETON_MECHANICAL) |
| 1942 | 2142 | GAME( 200?, as_rbgb, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "River Boat Gambler (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) |
| 1943 | 2143 | GAME( 200?, as_rbgc, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "River Boat Gambler (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) |
| 1944 | 2144 | GAME( 200?, as_rbgd, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "River Boat Gambler (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) |
| 1945 | 2145 | GAME( 200?, as_rbge, as_rab , astra_single, astrafr, 0, ROT0, "Astra", "River Boat Gambler (Astra, V008)" , GAME_IS_SKELETON_MECHANICAL) |
| 1946 | GAME( 200?, as_rbglo, 0 , astrafr_dual, astrafr, astradec_sml_dual, ROT0, "Lowen", "River Boat Gambler (Lowen, V106)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2146 | GAME( 200?, as_rbglo, 0 , astrafr_dual_37, astrafr, astradec_sml_dual, ROT0, "Lowen", "River Boat Gambler (Lowen, V106)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1947 | 2147 | GAME( 200?, as_rox, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Roll X (Astra, V006)" , GAME_IS_SKELETON_MECHANICAL) |
| 1948 | GAME( 200?, as_csv, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Slot Slant (?) (Astra, V202)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2148 | GAME( 200?, as_csv, 0 , astra_single_37, astrafr, 0, ROT0, "Astra", "Slot Slant (?) (Astra, V202)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1949 | 2149 | GAME( 200?, as_sltcl, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Slots Classic (?) (Astra)" , GAME_IS_SKELETON_MECHANICAL) |
| 1950 | GAME( 200?, as_stp, 0 , astra_single, astrafr, astradec, ROT0, "Astra", "Stampede (Astra, V103)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2150 | GAME( 200?, as_stp, 0 , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Stampede (Astra, V103)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1951 | 2151 | GAME( 200?, as_stpa, as_stp , astra_single, astrafr, astradec, ROT0, "Astra", "Stampede (Astra, V102)" , GAME_IS_SKELETON_MECHANICAL) |
| 1952 | 2152 | GAME( 200?, as_stpb, as_stp , astra_single, astrafr, astradec, ROT0, "Astra", "Stampede (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) |
| 1953 | GAME( 200?, as_siu, 0 , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Step It Up (Astra, V202)" , GAME_IS_SKELETON_MECHANICAL) // extra sound roms(?) in this set | |
| 2153 | GAME( 200?, as_siu, 0 , astra_single_37, astrafr, astradec_sml, ROT0, "Astra", "Step It Up (Astra, V202)" , GAME_IS_SKELETON_MECHANICAL) // extra sound roms(?) in this set | |
| 1954 | 2154 | GAME( 200?, as_siua, as_siu , astra_single, astrafr, astradec_sml, ROT0, "Astra", "Step It Up (Astra, V203)" , GAME_IS_SKELETON_MECHANICAL) |
| 1955 | 2155 | GAME( 200?, as_sld, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Super Little Devil (Astra, V700)" , GAME_IS_SKELETON_MECHANICAL) |
| 1956 | 2156 | GAME( 200?, as_slda, as_sld , astra_single, astrafr, 0, ROT0, "Astra", "Super Little Devil (Astra, V600)" , GAME_IS_SKELETON_MECHANICAL) |
| r14896 | r14897 | |
| 1958 | 2158 | GAME( 200?, as_sldc, as_sld , astra_single, astrafr, 0, ROT0, "Astra", "Super Little Devil (Astra, V400)" , GAME_IS_SKELETON_MECHANICAL) |
| 1959 | 2159 | GAME( 200?, as_sldd, as_sld , astra_single, astrafr, 0, ROT0, "Astra", "Super Little Devil (Astra, V200)" , GAME_IS_SKELETON_MECHANICAL) |
| 1960 | 2160 | GAME( 200?, as_slde, as_sld , astra_single, astrafr, 0, ROT0, "Astra", "Super Little Devil (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) |
| 1961 | GAME( 200?, as_tem, 0 , astra_single, astrafr, astradec, ROT0, "Astra", "Temptation (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1962 | GAME( 200?, as_tema, as_tem , astra_single, astrafr, astradec, ROT0, "Astra", "Temptation (Astra, V006)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1963 | GAME( 200?, as_tbl, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2161 | GAME( 200?, as_tem, 0 , astra_single_alt_37, astrafr, astradec, ROT0, "Astra", "Temptation (Astra, V101)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2162 | GAME( 200?, as_tema, as_tem , astra_single_alt_37, astrafr, astradec, ROT0, "Astra", "Temptation (Astra, V006)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2163 | GAME( 200?, as_tbl, 0 , astra_single_2e, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1964 | 2164 | GAME( 200?, as_tbla, as_tbl , astra_single, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V105)" , GAME_IS_SKELETON_MECHANICAL) |
| 1965 | 2165 | GAME( 200?, as_tblb, as_tbl , astra_single, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V106)" , GAME_IS_SKELETON_MECHANICAL) |
| 1966 | 2166 | GAME( 200?, as_tblc, as_tbl , astra_single, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V103)" , GAME_IS_SKELETON_MECHANICAL) |
| 1967 | 2167 | GAME( 200?, as_tbld, as_tbl , astra_single, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V304)" , GAME_IS_SKELETON_MECHANICAL) |
| 1968 | 2168 | GAME( 200?, as_tble, as_tbl , astra_single, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V303)" , GAME_IS_SKELETON_MECHANICAL) |
| 1969 | 2169 | GAME( 200?, as_tblf, as_tbl , astra_single, astrafr, 0, ROT0, "Astra", "Triple Bells (Astra, V301)" , GAME_IS_SKELETON_MECHANICAL) |
| 1970 | GAME( 200?, as_td, 0 , astra_single, astrafr, astradec, ROT0, "Astra", "Twin Dragons (Astra, V103)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2170 | GAME( 200?, as_td, 0 , astra_single_2e, astrafr, astradec, ROT0, "Astra", "Twin Dragons (Astra, V103)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1971 | 2171 | |
| 1972 | 2172 | GAME( 200?, as_twp, 0 , astra_single, astrafr, 0, ROT0, "Astra", "Twin Pots (Astra, V106)" , GAME_IS_SKELETON_MECHANICAL) |
| 1973 | 2173 | GAME( 200?, as_twpa, as_twp , astra_single, astrafr, 0, ROT0, "Astra", "Twin Pots (Astra, V104)" , GAME_IS_SKELETON_MECHANICAL) |
| 1974 | GAME( 200?, as_vn, 0 , astrafr_dual, astrafr, astradec_dual, ROT0, "Astra", "Vegas Nights (Astra, V205)" , GAME_IS_SKELETON_MECHANICAL) | |
| 2174 | GAME( 200?, as_vn, 0 , astrafr_dual_alt_37, astrafr, astradec_dual, ROT0, "Astra", "Vegas Nights (Astra, V205)" , GAME_IS_SKELETON_MECHANICAL) | |
| 1975 | 2175 | GAME( 200?, as_vcv, 0 , astra_single, astrafr, astradec, ROT0, "Astra", "Viva Cash Vegas (Astra, V005)" , GAME_IS_SKELETON_MECHANICAL) |
| 1976 | 2176 | GAME( 200?, as_vcva, as_vcv , astra_single, astrafr, astradec, ROT0, "Astra", "Viva Cash Vegas (Astra, V107)" , GAME_IS_SKELETON_MECHANICAL) |
| 1977 | 2177 | GAME( 200?, as_vcvb, as_vcv , astra_single, astrafr, astradec, ROT0, "Astra", "Viva Cash Vegas (Astra, V106)" , GAME_IS_SKELETON_MECHANICAL) |
| r14896 | r14897 | |
|---|---|---|
| 499 | 499 | UINT8 initial_value = ppi8255_get_port_c(ppi); |
| 500 | 500 | ppi8255_set_port_c(ppi, initial_value & ~0x40); |
| 501 | 501 | ppi8255_set_port_c(ppi, initial_value | 0x40); |
| 502 | return soundlatch_r(space, offset); | |
| 502 | return soundlatch_byte_r(space, offset); | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | /* if we have a Z80 PIO, get the data from the port and toggle the strobe */ |
| r14896 | r14897 | |
| 518 | 518 | WRITE8_MEMBER(system1_state::soundport_w) |
| 519 | 519 | { |
| 520 | 520 | /* boost interleave when communicating with the sound CPU */ |
| 521 | soundlatch_w(space, 0, data); | |
| 521 | soundlatch_byte_w(space, 0, data); | |
| 522 | 522 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); |
| 523 | 523 | } |
| 524 | 524 |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | READ8_MEMBER(niyanpai_state::niyanpai_sound_r) |
| 64 | 64 | { |
| 65 | return soundlatch_r(space, 0); | |
| 65 | return soundlatch_byte_r(space, 0); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | WRITE16_MEMBER(niyanpai_state::niyanpai_sound_w) |
| 69 | 69 | { |
| 70 | soundlatch_w(space, 0, ((data >> 8) & 0xff)); | |
| 70 | soundlatch_byte_w(space, 0, ((data >> 8) & 0xff)); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | WRITE8_MEMBER(niyanpai_state::niyanpai_soundclr_w) |
| 74 | 74 | { |
| 75 | soundlatch_clear_w(space, 0, 0); | |
| 75 | soundlatch_clear_byte_w(space, 0, 0); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 |
| r14896 | r14897 | |
|---|---|---|
| 200 | 200 | { |
| 201 | 201 | public: |
| 202 | 202 | witch_state(const machine_config &mconfig, device_type type, const char *tag) |
| 203 | : driver_device(mconfig, type, tag) { } | |
| 203 | : driver_device(mconfig, type, tag) , | |
| 204 | m_gfx0_vram(*this, "gfx0_vram"), | |
| 205 | m_gfx0_cram(*this, "gfx0_cram"), | |
| 206 | m_gfx1_vram(*this, "gfx1_vram"), | |
| 207 | m_gfx1_cram(*this, "gfx1_cram"), | |
| 208 | m_sprite_ram(*this, "sprite_ram"){ } | |
| 204 | 209 | |
| 205 | 210 | tilemap_t *m_gfx0a_tilemap; |
| 206 | 211 | tilemap_t *m_gfx0b_tilemap; |
| 207 | 212 | tilemap_t *m_gfx1_tilemap; |
| 208 | UINT8 *m_gfx0_cram; | |
| 209 | UINT8 *m_gfx0_vram; | |
| 210 | UINT8 *m_gfx1_cram; | |
| 211 | UINT8 *m_gfx1_vram; | |
| 212 | UINT8 *m_sprite_ram; | |
| 213 | required_shared_ptr<UINT8> m_gfx0_vram; | |
| 214 | required_shared_ptr<UINT8> m_gfx0_cram; | |
| 215 | required_shared_ptr<UINT8> m_gfx1_vram; | |
| 216 | required_shared_ptr<UINT8> m_gfx1_cram; | |
| 217 | required_shared_ptr<UINT8> m_sprite_ram; | |
| 213 | 218 | int m_scrollx; |
| 214 | 219 | int m_scrolly; |
| 215 | 220 | UINT8 m_reg_a002; |
| r14896 | r14897 | |
| 234 | 239 | static TILE_GET_INFO( get_gfx0b_tile_info ) |
| 235 | 240 | { |
| 236 | 241 | witch_state *state = machine.driver_data<witch_state>(); |
| 237 | int code = state->m_gfx0_vram[tile_index]; | |
| 238 | int color = state->m_gfx0_cram[tile_index]; | |
| 242 | int code = state->m_gfx0_vram.target()[tile_index]; | |
| 243 | int color = state->m_gfx0_cram.target()[tile_index]; | |
| 239 | 244 | |
| 240 | 245 | code=code | ((color & 0xe0) << 3); |
| 241 | 246 | |
| r14896 | r14897 | |
| 254 | 259 | static TILE_GET_INFO( get_gfx0a_tile_info ) |
| 255 | 260 | { |
| 256 | 261 | witch_state *state = machine.driver_data<witch_state>(); |
| 257 | int code = state->m_gfx0_vram[tile_index]; | |
| 258 | int color = state->m_gfx0_cram[tile_index]; | |
| 262 | int code = state->m_gfx0_vram.target()[tile_index]; | |
| 263 | int color = state->m_gfx0_cram.target()[tile_index]; | |
| 259 | 264 | |
| 260 | 265 | code=code | ((color & 0xe0) << 3); |
| 261 | 266 | |
| r14896 | r14897 | |
| 274 | 279 | static TILE_GET_INFO( get_gfx1_tile_info ) |
| 275 | 280 | { |
| 276 | 281 | witch_state *state = machine.driver_data<witch_state>(); |
| 277 | int code = state->m_gfx1_vram[tile_index]; | |
| 278 | int color = state->m_gfx1_cram[tile_index]; | |
| 282 | int code = state->m_gfx1_vram.target()[tile_index]; | |
| 283 | int color = state->m_gfx1_cram.target()[tile_index]; | |
| 279 | 284 | |
| 280 | 285 | SET_TILE_INFO( |
| 281 | 286 | 0, |
| r14896 | r14897 | |
| 286 | 291 | |
| 287 | 292 | WRITE8_MEMBER(witch_state::gfx0_vram_w) |
| 288 | 293 | { |
| 289 | m_gfx0_vram[offset] = data; | |
| 294 | m_gfx0_vram.target()[offset] = data; | |
| 290 | 295 | m_gfx0a_tilemap->mark_tile_dirty(offset); |
| 291 | 296 | m_gfx0b_tilemap->mark_tile_dirty(offset); |
| 292 | 297 | } |
| 293 | 298 | |
| 294 | 299 | WRITE8_MEMBER(witch_state::gfx0_cram_w) |
| 295 | 300 | { |
| 296 | m_gfx0_cram[offset] = data; | |
| 301 | m_gfx0_cram.target()[offset] = data; | |
| 297 | 302 | m_gfx0a_tilemap->mark_tile_dirty(offset); |
| 298 | 303 | m_gfx0b_tilemap->mark_tile_dirty(offset); |
| 299 | 304 | } |
| 300 | 305 | READ8_MEMBER(witch_state::gfx0_vram_r) |
| 301 | 306 | { |
| 302 | return m_gfx0_vram[offset]; | |
| 307 | return m_gfx0_vram.target()[offset]; | |
| 303 | 308 | } |
| 304 | 309 | |
| 305 | 310 | READ8_MEMBER(witch_state::gfx0_cram_r) |
| 306 | 311 | { |
| 307 | return m_gfx0_cram[offset]; | |
| 312 | return m_gfx0_cram.target()[offset]; | |
| 308 | 313 | } |
| 309 | 314 | |
| 310 | 315 | #define FIX_OFFSET() do { \ |
| r14896 | r14897 | |
| 313 | 318 | WRITE8_MEMBER(witch_state::gfx1_vram_w) |
| 314 | 319 | { |
| 315 | 320 | FIX_OFFSET(); |
| 316 | m_gfx1_vram[offset] = data; | |
| 321 | m_gfx1_vram.target()[offset] = data; | |
| 317 | 322 | m_gfx1_tilemap->mark_tile_dirty(offset); |
| 318 | 323 | } |
| 319 | 324 | |
| 320 | 325 | WRITE8_MEMBER(witch_state::gfx1_cram_w) |
| 321 | 326 | { |
| 322 | 327 | FIX_OFFSET(); |
| 323 | m_gfx1_cram[offset] = data; | |
| 328 | m_gfx1_cram.target()[offset] = data; | |
| 324 | 329 | m_gfx1_tilemap->mark_tile_dirty(offset); |
| 325 | 330 | } |
| 326 | 331 | READ8_MEMBER(witch_state::gfx1_vram_r) |
| 327 | 332 | { |
| 328 | 333 | FIX_OFFSET(); |
| 329 | return m_gfx1_vram[offset]; | |
| 334 | return m_gfx1_vram.target()[offset]; | |
| 330 | 335 | } |
| 331 | 336 | |
| 332 | 337 | READ8_MEMBER(witch_state::gfx1_cram_r) |
| 333 | 338 | { |
| 334 | 339 | FIX_OFFSET(); |
| 335 | return m_gfx1_cram[offset]; | |
| 340 | return m_gfx1_cram.target()[offset]; | |
| 336 | 341 | } |
| 337 | 342 | |
| 338 | 343 | READ8_MEMBER(witch_state::read_a00x) |
| r14896 | r14897 | |
| 466 | 471 | AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 467 | 472 | AM_RANGE(0x8008, 0x8009) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 468 | 473 | AM_RANGE(0xa000, 0xa00f) AM_READWRITE(read_a00x, write_a00x) |
| 469 | AM_RANGE(0xc000, 0xc3ff) AM_READWRITE(gfx0_vram_r, gfx0_vram_w) AM_BASE(m_gfx0_vram) | |
| 470 | AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(gfx0_cram_r, gfx0_cram_w) AM_BASE(m_gfx0_cram) | |
| 471 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(gfx1_vram_r, gfx1_vram_w) AM_BASE(m_gfx1_vram) | |
| 472 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(gfx1_cram_r, gfx1_cram_w) AM_BASE(m_gfx1_cram) | |
| 473 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(m_sprite_ram) | |
| 474 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_SHARE("paletteram") | |
| 475 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_SHARE("paletteram2") | |
| 474 | AM_RANGE(0xc000, 0xc3ff) AM_READWRITE(gfx0_vram_r, gfx0_vram_w) AM_SHARE("gfx0_vram") | |
| 475 | AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(gfx0_cram_r, gfx0_cram_w) AM_SHARE("gfx0_cram") | |
| 476 | AM_RANGE(0xc800, 0xcbff) AM_READWRITE(gfx1_vram_r, gfx1_vram_w) AM_SHARE("gfx1_vram") | |
| 477 | AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(gfx1_cram_r, gfx1_cram_w) AM_SHARE("gfx1_cram") | |
| 478 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("sprite_ram") | |
| 479 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 480 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 476 | 481 | AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_SHARE("share1") |
| 477 | 482 | AM_RANGE(0xf100, 0xf17f) AM_RAM AM_SHARE("nvram") |
| 478 | 483 | AM_RANGE(0xf180, 0xffff) AM_RAM AM_SHARE("share2") |
| r14896 | r14897 | |
| 719 | 724 | for(i=0;i<0x800;i+=0x20) { |
| 720 | 725 | |
| 721 | 726 | |
| 722 | sx = state->m_sprite_ram[i+1]; | |
| 727 | sx = state->m_sprite_ram.target()[i+1]; | |
| 723 | 728 | if(sx!=0xF8) { |
| 724 | tileno = (state->m_sprite_ram[i]<<2) | (( state->m_sprite_ram[i+0x800] & 0x07 ) << 10 ); | |
| 729 | tileno = (state->m_sprite_ram.target()[i]<<2) | (( state->m_sprite_ram.target()[i+0x800] & 0x07 ) << 10 ); | |
| 725 | 730 | |
| 726 | sy = state->m_sprite_ram[i+2]; | |
| 727 | flags = state->m_sprite_ram[i+3]; | |
| 731 | sy = state->m_sprite_ram.target()[i+2]; | |
| 732 | flags = state->m_sprite_ram.target()[i+3]; | |
| 728 | 733 | |
| 729 | 734 | flipx = (flags & 0x10 ) ? 1 : 0; |
| 730 | 735 | flipy = (flags & 0x20 ) ? 1 : 0; |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | { |
| 88 | 88 | public: |
| 89 | 89 | luckgrln_state(const machine_config &mconfig, device_type type, const char *tag) |
| 90 | : driver_device(mconfig, type, tag) { } | |
| 90 | : driver_device(mconfig, type, tag) , | |
| 91 | m_reel1_ram(*this, "reel1_ram"), | |
| 92 | m_reel1_attr(*this, "reel1_attr"), | |
| 93 | m_reel1_scroll(*this, "reel1_scroll"), | |
| 94 | m_reel2_ram(*this, "reel2_ram"), | |
| 95 | m_reel2_attr(*this, "reel2_attr"), | |
| 96 | m_reel2_scroll(*this, "reel2_scroll"), | |
| 97 | m_reel3_ram(*this, "reel3_ram"), | |
| 98 | m_reel3_attr(*this, "reel3_attr"), | |
| 99 | m_reel3_scroll(*this, "reel3_scroll"), | |
| 100 | m_reel4_ram(*this, "reel4_ram"), | |
| 101 | m_reel4_attr(*this, "reel4_attr"), | |
| 102 | m_reel4_scroll(*this, "reel4_scroll"), | |
| 103 | m_luck_vram1(*this, "luck_vram1"), | |
| 104 | m_luck_vram2(*this, "luck_vram2"), | |
| 105 | m_luck_vram3(*this, "luck_vram3"){ } | |
| 91 | 106 | |
| 92 | UINT8 *m_luck_vram1; | |
| 93 | UINT8 *m_luck_vram2; | |
| 94 | UINT8 *m_luck_vram3; | |
| 95 | 107 | UINT8 m_nmi_enable; |
| 96 | 108 | tilemap_t *m_reel1_tilemap; |
| 97 | 109 | tilemap_t *m_reel2_tilemap; |
| 98 | 110 | tilemap_t *m_reel3_tilemap; |
| 99 | 111 | tilemap_t *m_reel4_tilemap; |
| 100 | UINT8* m_reel1_ram; | |
| 101 | UINT8* m_reel2_ram; | |
| 102 | UINT8* m_reel3_ram; | |
| 103 | UINT8* m_reel4_ram; | |
| 104 | UINT8* m_reel1_scroll; | |
| 105 | UINT8* m_reel2_scroll; | |
| 106 | UINT8* m_reel3_scroll; | |
| 107 | UINT8* m_reel4_scroll; | |
| 108 | UINT8* m_reel1_attr; | |
| 109 | UINT8* m_reel2_attr; | |
| 110 | UINT8* m_reel3_attr; | |
| 111 | UINT8* m_reel4_attr; | |
| 112 | required_shared_ptr<UINT8> m_reel1_ram; | |
| 113 | required_shared_ptr<UINT8> m_reel1_attr; | |
| 114 | required_shared_ptr<UINT8> m_reel1_scroll; | |
| 115 | required_shared_ptr<UINT8> m_reel2_ram; | |
| 116 | required_shared_ptr<UINT8> m_reel2_attr; | |
| 117 | required_shared_ptr<UINT8> m_reel2_scroll; | |
| 118 | required_shared_ptr<UINT8> m_reel3_ram; | |
| 119 | required_shared_ptr<UINT8> m_reel3_attr; | |
| 120 | required_shared_ptr<UINT8> m_reel3_scroll; | |
| 121 | required_shared_ptr<UINT8> m_reel4_ram; | |
| 122 | required_shared_ptr<UINT8> m_reel4_attr; | |
| 123 | required_shared_ptr<UINT8> m_reel4_scroll; | |
| 124 | required_shared_ptr<UINT8> m_luck_vram1; | |
| 125 | required_shared_ptr<UINT8> m_luck_vram2; | |
| 126 | required_shared_ptr<UINT8> m_luck_vram3; | |
| 127 | ||
| 112 | 128 | int m_palette_count; |
| 113 | 129 | UINT8 m_palette_ram[0x10000]; |
| 114 | 130 | DECLARE_WRITE8_MEMBER(luckgrln_reel1_ram_w); |
| r14896 | r14897 | |
| 133 | 149 | |
| 134 | 150 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel1_ram_w) |
| 135 | 151 | { |
| 136 | m_reel1_ram[offset] = data; | |
| 152 | m_reel1_ram.target()[offset] = data; | |
| 137 | 153 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 138 | 154 | } |
| 139 | 155 | |
| 140 | 156 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel1_attr_w) |
| 141 | 157 | { |
| 142 | m_reel1_attr[offset] = data; | |
| 158 | m_reel1_attr.target()[offset] = data; | |
| 143 | 159 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 144 | 160 | } |
| 145 | 161 | |
| r14896 | r14897 | |
| 148 | 164 | static TILE_GET_INFO( get_luckgrln_reel1_tile_info ) |
| 149 | 165 | { |
| 150 | 166 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 151 | int code = state->m_reel1_ram[tile_index]; | |
| 152 | int attr = state->m_reel1_attr[tile_index]; | |
| 167 | int code = state->m_reel1_ram.target()[tile_index]; | |
| 168 | int attr = state->m_reel1_attr.target()[tile_index]; | |
| 153 | 169 | int col = (attr & 0x1f); |
| 154 | 170 | |
| 155 | 171 | code |= (attr & 0xe0)<<3; |
| r14896 | r14897 | |
| 165 | 181 | |
| 166 | 182 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel2_ram_w) |
| 167 | 183 | { |
| 168 | m_reel2_ram[offset] = data; | |
| 184 | m_reel2_ram.target()[offset] = data; | |
| 169 | 185 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 170 | 186 | } |
| 171 | 187 | |
| 172 | 188 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel2_attr_w) |
| 173 | 189 | { |
| 174 | m_reel2_attr[offset] = data; | |
| 190 | m_reel2_attr.target()[offset] = data; | |
| 175 | 191 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 176 | 192 | } |
| 177 | 193 | |
| r14896 | r14897 | |
| 179 | 195 | static TILE_GET_INFO( get_luckgrln_reel2_tile_info ) |
| 180 | 196 | { |
| 181 | 197 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 182 | int code = state->m_reel2_ram[tile_index]; | |
| 183 | int attr = state->m_reel2_attr[tile_index]; | |
| 198 | int code = state->m_reel2_ram.target()[tile_index]; | |
| 199 | int attr = state->m_reel2_attr.target()[tile_index]; | |
| 184 | 200 | int col = (attr & 0x1f); |
| 185 | 201 | |
| 186 | 202 | code |= (attr & 0xe0)<<3; |
| r14896 | r14897 | |
| 195 | 211 | |
| 196 | 212 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel3_ram_w) |
| 197 | 213 | { |
| 198 | m_reel3_ram[offset] = data; | |
| 214 | m_reel3_ram.target()[offset] = data; | |
| 199 | 215 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 200 | 216 | } |
| 201 | 217 | |
| 202 | 218 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel3_attr_w) |
| 203 | 219 | { |
| 204 | m_reel3_attr[offset] = data; | |
| 220 | m_reel3_attr.target()[offset] = data; | |
| 205 | 221 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 206 | 222 | } |
| 207 | 223 | |
| r14896 | r14897 | |
| 209 | 225 | static TILE_GET_INFO( get_luckgrln_reel3_tile_info ) |
| 210 | 226 | { |
| 211 | 227 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 212 | int code = state->m_reel3_ram[tile_index]; | |
| 213 | int attr = state->m_reel3_attr[tile_index]; | |
| 228 | int code = state->m_reel3_ram.target()[tile_index]; | |
| 229 | int attr = state->m_reel3_attr.target()[tile_index]; | |
| 214 | 230 | int col = (attr & 0x1f); |
| 215 | 231 | |
| 216 | 232 | code |= (attr & 0xe0)<<3; |
| r14896 | r14897 | |
| 224 | 240 | |
| 225 | 241 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel4_ram_w) |
| 226 | 242 | { |
| 227 | m_reel4_ram[offset] = data; | |
| 243 | m_reel4_ram.target()[offset] = data; | |
| 228 | 244 | m_reel4_tilemap->mark_tile_dirty(offset); |
| 229 | 245 | } |
| 230 | 246 | |
| 231 | 247 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel4_attr_w) |
| 232 | 248 | { |
| 233 | m_reel4_attr[offset] = data; | |
| 249 | m_reel4_attr.target()[offset] = data; | |
| 234 | 250 | m_reel4_tilemap->mark_tile_dirty(offset); |
| 235 | 251 | } |
| 236 | 252 | |
| r14896 | r14897 | |
| 238 | 254 | static TILE_GET_INFO( get_luckgrln_reel4_tile_info ) |
| 239 | 255 | { |
| 240 | 256 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 241 | int code = state->m_reel4_ram[tile_index]; | |
| 242 | int attr = state->m_reel4_attr[tile_index]; | |
| 257 | int code = state->m_reel4_ram.target()[tile_index]; | |
| 258 | int attr = state->m_reel4_attr.target()[tile_index]; | |
| 243 | 259 | int col = (attr & 0x1f); |
| 244 | 260 | |
| 245 | 261 | code |= (attr & 0xe0)<<3; |
| r14896 | r14897 | |
| 284 | 300 | |
| 285 | 301 | for (i= 0;i < 64;i++) |
| 286 | 302 | { |
| 287 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]); | |
| 288 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]); | |
| 289 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]); | |
| 290 | state->m_reel4_tilemap->set_scrolly(i, state->m_reel4_scroll[i]); | |
| 303 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]); | |
| 304 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]); | |
| 305 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]); | |
| 306 | state->m_reel4_tilemap->set_scrolly(i, state->m_reel4_scroll.target()[i]); | |
| 291 | 307 | } |
| 292 | 308 | |
| 293 | 309 | |
| r14896 | r14897 | |
| 301 | 317 | |
| 302 | 318 | for (x=0;x<64;x++) |
| 303 | 319 | { |
| 304 | UINT16 tile = (state->m_luck_vram1[count] & 0xff); | |
| 305 | UINT16 tile_high = (state->m_luck_vram2[count]); | |
| 306 | UINT16 tileattr = (state->m_luck_vram3[count]); | |
| 320 | UINT16 tile = (state->m_luck_vram1.target()[count] & 0xff); | |
| 321 | UINT16 tile_high = (state->m_luck_vram2.target()[count]); | |
| 322 | UINT16 tileattr = (state->m_luck_vram3.target()[count]); | |
| 307 | 323 | UINT8 col = 0; |
| 308 | 324 | UINT8 region = 0; |
| 309 | 325 | UINT8 bgenable; |
| r14896 | r14897 | |
| 372 | 388 | AM_RANGE(0x10000, 0x1ffff) AM_ROM AM_REGION("rom_data",0x10000) |
| 373 | 389 | AM_RANGE(0x20000, 0x2ffff) AM_ROM AM_REGION("rom_data",0x00000) |
| 374 | 390 | |
| 375 | AM_RANGE(0x0c000, 0x0c1ff) AM_RAM_WRITE(luckgrln_reel1_ram_w) AM_BASE(m_reel1_ram) // only written to half way | |
| 376 | AM_RANGE(0x0c800, 0x0c9ff) AM_RAM_WRITE(luckgrln_reel1_attr_w) AM_BASE(m_reel1_attr) | |
| 377 | AM_RANGE(0x0d000, 0x0d03f) AM_RAM AM_BASE(m_reel1_scroll) AM_MIRROR(0x000c0) | |
| 391 | AM_RANGE(0x0c000, 0x0c1ff) AM_RAM_WRITE(luckgrln_reel1_ram_w) AM_SHARE("reel1_ram") // only written to half way | |
| 392 | AM_RANGE(0x0c800, 0x0c9ff) AM_RAM_WRITE(luckgrln_reel1_attr_w) AM_SHARE("reel1_attr") | |
| 393 | AM_RANGE(0x0d000, 0x0d03f) AM_RAM AM_SHARE("reel1_scroll") AM_MIRROR(0x000c0) | |
| 378 | 394 | |
| 379 | AM_RANGE(0x0c200, 0x0c3ff) AM_RAM_WRITE(luckgrln_reel2_ram_w) AM_BASE(m_reel2_ram) | |
| 380 | AM_RANGE(0x0ca00, 0x0cbff) AM_RAM_WRITE(luckgrln_reel2_attr_w) AM_BASE(m_reel2_attr) | |
| 381 | AM_RANGE(0x0d200, 0x0d23f) AM_RAM AM_BASE(m_reel2_scroll) AM_MIRROR(0x000c0) | |
| 395 | AM_RANGE(0x0c200, 0x0c3ff) AM_RAM_WRITE(luckgrln_reel2_ram_w) AM_SHARE("reel2_ram") | |
| 396 | AM_RANGE(0x0ca00, 0x0cbff) AM_RAM_WRITE(luckgrln_reel2_attr_w) AM_SHARE("reel2_attr") | |
| 397 | AM_RANGE(0x0d200, 0x0d23f) AM_RAM AM_SHARE("reel2_scroll") AM_MIRROR(0x000c0) | |
| 382 | 398 | |
| 383 | AM_RANGE(0x0c400, 0x0c5ff) AM_RAM_WRITE(luckgrln_reel3_ram_w ) AM_BASE(m_reel3_ram) | |
| 384 | AM_RANGE(0x0cc00, 0x0cdff) AM_RAM_WRITE(luckgrln_reel3_attr_w) AM_BASE(m_reel3_attr) | |
| 385 | AM_RANGE(0x0d400, 0x0d43f) AM_RAM AM_BASE(m_reel3_scroll) AM_MIRROR(0x000c0) | |
| 399 | AM_RANGE(0x0c400, 0x0c5ff) AM_RAM_WRITE(luckgrln_reel3_ram_w ) AM_SHARE("reel3_ram") | |
| 400 | AM_RANGE(0x0cc00, 0x0cdff) AM_RAM_WRITE(luckgrln_reel3_attr_w) AM_SHARE("reel3_attr") | |
| 401 | AM_RANGE(0x0d400, 0x0d43f) AM_RAM AM_SHARE("reel3_scroll") AM_MIRROR(0x000c0) | |
| 386 | 402 | |
| 387 | AM_RANGE(0x0c600, 0x0c7ff) AM_RAM_WRITE(luckgrln_reel4_ram_w ) AM_BASE(m_reel4_ram) | |
| 388 | AM_RANGE(0x0ce00, 0x0cfff) AM_RAM_WRITE(luckgrln_reel4_attr_w) AM_BASE(m_reel4_attr) | |
| 389 | AM_RANGE(0x0d600, 0x0d63f) AM_RAM AM_BASE(m_reel4_scroll) | |
| 403 | AM_RANGE(0x0c600, 0x0c7ff) AM_RAM_WRITE(luckgrln_reel4_ram_w ) AM_SHARE("reel4_ram") | |
| 404 | AM_RANGE(0x0ce00, 0x0cfff) AM_RAM_WRITE(luckgrln_reel4_attr_w) AM_SHARE("reel4_attr") | |
| 405 | AM_RANGE(0x0d600, 0x0d63f) AM_RAM AM_SHARE("reel4_scroll") | |
| 390 | 406 | |
| 391 | 407 | // AM_RANGE(0x0d200, 0x0d2ff) AM_RAM |
| 392 | 408 | |
| 393 | 409 | |
| 394 | 410 | AM_RANGE(0x0d800, 0x0dfff) AM_RAM // nvram |
| 395 | 411 | |
| 396 | AM_RANGE(0x0e000, 0x0e7ff) AM_RAM AM_BASE(m_luck_vram1) | |
| 397 | AM_RANGE(0x0e800, 0x0efff) AM_RAM AM_BASE(m_luck_vram2) | |
| 398 | AM_RANGE(0x0f000, 0x0f7ff) AM_RAM AM_BASE(m_luck_vram3) | |
| 412 | AM_RANGE(0x0e000, 0x0e7ff) AM_RAM AM_SHARE("luck_vram1") | |
| 413 | AM_RANGE(0x0e800, 0x0efff) AM_RAM AM_SHARE("luck_vram2") | |
| 414 | AM_RANGE(0x0f000, 0x0f7ff) AM_RAM AM_SHARE("luck_vram3") | |
| 399 | 415 | |
| 400 | 416 | |
| 401 | 417 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | public: |
| 102 | 102 | sigmab98_state(const machine_config &mconfig, device_type type, const char *tag) |
| 103 | 103 | : driver_device(mconfig, type, tag), |
| 104 | m_maincpu(*this,"maincpu") | |
| 105 | { } | |
| 104 | m_maincpu(*this,"maincpu"), | |
| 105 | m_spriteram(*this, "spriteram"), | |
| 106 | m_nvram(*this, "nvram"){ } | |
| 106 | 107 | |
| 107 | UINT8 *m_spriteram; | |
| 108 | size_t m_spriteram_size; | |
| 108 | required_device<cpu_device> m_maincpu; | |
| 109 | required_shared_ptr<UINT8> m_spriteram; | |
| 110 | required_shared_ptr<UINT8> m_nvram; | |
| 111 | ||
| 109 | 112 | UINT8 m_reg; |
| 110 | 113 | UINT8 m_rombank; |
| 111 | 114 | UINT8 m_reg2; |
| r14896 | r14897 | |
| 116 | 119 | UINT8 m_c8; |
| 117 | 120 | UINT8 m_vblank; |
| 118 | 121 | UINT8 m_out[3]; |
| 119 | UINT8 *m_nvram; | |
| 120 | 122 | |
| 121 | required_device<cpu_device> m_maincpu; | |
| 122 | 123 | UINT8 m_vblank_vector; |
| 123 | 124 | UINT8 m_timer0_vector; |
| 124 | 125 | UINT8 m_timer1_vector; |
| r14896 | r14897 | |
| 212 | 213 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri_mask) |
| 213 | 214 | { |
| 214 | 215 | sigmab98_state *state = machine.driver_data<sigmab98_state>(); |
| 215 | UINT8 *end = state->m_spriteram - 0x10; | |
| 216 | UINT8 *s = end + state->m_spriteram_size; | |
| 216 | UINT8 *end = state->m_spriteram.target() - 0x10; | |
| 217 | UINT8 *s = end + state->m_spriteram.bytes(); | |
| 217 | 218 | |
| 218 | 219 | for ( ; s != end; s -= 0x10 ) |
| 219 | 220 | { |
| r14896 | r14897 | |
| 479 | 480 | // 02 hopper motor on (active low)? |
| 480 | 481 | WRITE8_MEMBER(sigmab98_state::c8_w) |
| 481 | 482 | { |
| 482 | ticket_dispenser_ | |
| 483 | machine().device<ticket_dispenser_ | |
| 483 | 484 | |
| 484 | 485 | m_c8 = data; |
| 485 | 486 | show_outputs(); |
| r14896 | r14897 | |
| 489 | 490 | AM_RANGE( 0x0000, 0x7fff ) AM_ROM |
| 490 | 491 | AM_RANGE( 0x8000, 0x9fff ) AM_ROMBANK("rombank") |
| 491 | 492 | |
| 492 | AM_RANGE( 0xa000, 0xafff ) AM_RAM AM_ | |
| 493 | AM_RANGE( 0xa000, 0xafff ) AM_RAM AM_ | |
| 493 | 494 | |
| 494 | AM_RANGE( 0xc000, 0xc1ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_be_w) AM_SHARE("paletteram") | |
| 495 | AM_RANGE( 0xc000, 0xc1ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_be_w) AM_SHARE("paletteram") | |
| 495 | 496 | |
| 496 | 497 | AM_RANGE( 0xc800, 0xc87f ) AM_RAM |
| 497 | 498 | |
| r14896 | r14897 | |
| 712 | 713 | // 01 hopper motor on (active low)? |
| 713 | 714 | WRITE8_MEMBER(sigmab98_state::sammymdl_hopper_w) |
| 714 | 715 | { |
| 715 | ticket_dispenser_ | |
| 716 | machine().device<ticket_dispenser_ | |
| 716 | 717 | |
| 717 | 718 | m_out[2] = data; |
| 718 | 719 | show_3_outputs(); |
| r14896 | r14897 | |
| 722 | 723 | { |
| 723 | 724 | UINT8 ret = input_port_read(machine(), "COIN"); |
| 724 | 725 | |
| 725 | // if ( !ticket_dispenser_ | |
| 726 | // if ( !machine().device<ticket_dispenser_ | |
| 726 | 727 | // ret &= ~0x01; |
| 727 | 728 | |
| 728 | 729 | return ret; |
| r14896 | r14897 | |
| 737 | 738 | AM_RANGE( 0xa000, 0xafff ) AM_RAM |
| 738 | 739 | AM_RANGE( 0xb000, 0xbfff ) AM_RAMBANK("sprbank") |
| 739 | 740 | |
| 740 | AM_RANGE( 0xd000, 0xd1ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_be_w ) AM_SHARE("paletteram") | |
| 741 | AM_RANGE( 0xd000, 0xd1ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_be_w ) AM_SHARE("paletteram") | |
| 741 | 742 | AM_RANGE( 0xd800, 0xd87f ) AM_RAM // table? |
| 742 | 743 | |
| 743 | 744 | AM_RANGE( 0xe011, 0xe011 ) AM_WRITENOP // IRQ Enable? Screen disable? |
| r14896 | r14897 | |
| 901 | 902 | |
| 902 | 903 | case 0x65: // SPRITERAM |
| 903 | 904 | if (offset < 0x1000) |
| 904 | return m_spriteram[offset]; | |
| 905 | return m_spriteram.target()[offset]; | |
| 905 | 906 | |
| 906 | 907 | case 0x67: // PALETTERAM + TABLE? + REGS |
| 907 | 908 | if (offset < 0x200) |
| r14896 | r14897 | |
| 922 | 923 | case 0x65: // SPRITERAM |
| 923 | 924 | if (offset < 0x1000) |
| 924 | 925 | { |
| 925 | m_spriteram[offset] = data; | |
| 926 | m_spriteram.target()[offset] = data; | |
| 926 | 927 | return; |
| 927 | 928 | } |
| 928 | 929 | break; |
| r14896 | r14897 | |
| 930 | 931 | case 0x67: // PALETTERAM + TABLE? + REGS |
| 931 | 932 | if (offset < 0x200) |
| 932 | 933 | { |
| 933 | paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data); | |
| 934 | paletteram_xRRRRRGGGGGBBBBB_byte_be_w(space, offset, data); | |
| 934 | 935 | // m_generic_paletteram_8[offset] = data; |
| 935 | 936 | return; |
| 936 | 937 | } |
| r14896 | r14897 | |
| 1073 | 1074 | break; |
| 1074 | 1075 | |
| 1075 | 1076 | case 0x6c: // 3800 IS RAM! (1000 bytes) - SPRITERAM |
| 1076 | memory_set_bankptr(machine(), "rombank0", m_spriteram); | |
| 1077 | memory_set_bankptr(machine(), "sprbank0", m_spriteram); | |
| 1077 | memory_set_bankptr(machine(), "rombank0", m_spriteram.target()); | |
| 1078 | memory_set_bankptr(machine(), "sprbank0", m_spriteram.target()); | |
| 1078 | 1079 | // memory_set_bankptr(machine(), "sprbank1", m_spriteram + 0x1000*4); // scratch |
| 1079 | 1080 | break; |
| 1080 | 1081 | |
| r14896 | r14897 | |
| 1138 | 1139 | m_rambank = data; |
| 1139 | 1140 | switch (data) |
| 1140 | 1141 | { |
| 1141 | case 0x52: memory_set_bankptr(machine(), "palbank", m_nvram); break; | |
| 1142 | case 0x52: memory_set_bankptr(machine(), "palbank", m_nvram.target()); break; | |
| 1142 | 1143 | case 0x64: memory_set_bankptr(machine(), "palbank", m_generic_paletteram_8); break; |
| 1143 | 1144 | default: |
| 1144 | 1145 | logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", machine().describe_context(), data, m_reg2); |
| r14896 | r14897 | |
| 1171 | 1172 | { |
| 1172 | 1173 | if (m_rambank == 0x64) |
| 1173 | 1174 | { |
| 1174 | paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data); | |
| 1175 | paletteram_xRRRRRGGGGGBBBBB_byte_be_w(space, offset, data); | |
| 1175 | 1176 | // m_generic_paletteram_8[offset] = data; |
| 1176 | 1177 | } |
| 1177 | 1178 | else if (m_rambank == 0x52) |
| 1178 | 1179 | { |
| 1179 | m_nvram[offset] = data; | |
| 1180 | m_nvram.target()[offset] = data; | |
| 1180 | 1181 | } |
| 1181 | 1182 | else |
| 1182 | 1183 | { |
| r14896 | r14897 | |
| 1189 | 1190 | if (m_rombank == 0x6c) |
| 1190 | 1191 | { |
| 1191 | 1192 | if (offset < 0x200) |
| 1192 | paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data); | |
| 1193 | paletteram_xRRRRRGGGGGBBBBB_byte_be_w(space, offset, data); | |
| 1193 | 1194 | // m_generic_paletteram_8[offset] = data; |
| 1194 | 1195 | } |
| 1195 | 1196 | else |
| r14896 | r14897 | |
| 1377 | 1378 | |
| 1378 | 1379 | case 0x64: // SPRITERAM |
| 1379 | 1380 | if (offset < 0x1000) |
| 1380 | return m_spriteram[offset]; | |
| 1381 | return m_spriteram.target()[offset]; | |
| 1381 | 1382 | break; |
| 1382 | 1383 | |
| 1383 | 1384 | case 0x66: // PALETTERAM + TABLE? |
| r14896 | r14897 | |
| 1402 | 1403 | case 0x64: // SPRITERAM |
| 1403 | 1404 | if (offset < 0x1000) |
| 1404 | 1405 | { |
| 1405 | m_spriteram[offset] = data; | |
| 1406 | m_spriteram.target()[offset] = data; | |
| 1406 | 1407 | return; |
| 1407 | 1408 | } |
| 1408 | 1409 | break; |
| r14896 | r14897 | |
| 1410 | 1411 | case 0x66: // PALETTERAM + TABLE? |
| 1411 | 1412 | if (offset < 0x200) |
| 1412 | 1413 | { |
| 1413 | paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data); | |
| 1414 | paletteram_xRRRRRGGGGGBBBBB_byte_be_w(space, offset, data); | |
| 1414 | 1415 | // m_generic_paletteram_8[offset] = data; |
| 1415 | 1416 | return; |
| 1416 | 1417 | } |
| r14896 | r14897 | |
| 1509 | 1510 | PORT_START("IN1") |
| 1510 | 1511 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // ? (coin error, pulses mask 4 of port c6) |
| 1511 | 1512 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) PORT_NAME("Medal") // coin/medal in (coin error) |
| 1512 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r) | |
| 1513 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) | |
| 1513 | 1514 | PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) |
| 1514 | 1515 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet") // bet / select in test menu |
| 1515 | 1516 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Play") // play game / select in test menu |
| r14896 | r14897 | |
| 1547 | 1548 | PORT_START("IN1") |
| 1548 | 1549 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // ? (coin error, pulses mask 4 of port c6) |
| 1549 | 1550 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) PORT_NAME("Medal") // coin/medal in (coin error) |
| 1550 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r) | |
| 1551 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) | |
| 1551 | 1552 | PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) |
| 1552 | 1553 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CODE(KEYCODE_1) // bet / select in test menu |
| 1553 | 1554 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Rock (Gu)") |
| r14896 | r14897 | |
| 1585 | 1586 | PORT_START("IN1") |
| 1586 | 1587 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(10) // ? (coin error, pulses mask 4 of port c6) |
| 1587 | 1588 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) PORT_NAME("Medal") // coin/medal in (coin error) |
| 1588 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r) | |
| 1589 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) | |
| 1589 | 1590 | PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) |
| 1590 | 1591 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CODE(KEYCODE_1) // bet / enter in test menu |
| 1591 | 1592 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) |
| r14896 | r14897 | |
| 1625 | 1626 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(5) PORT_NAME("Medal") // medal in |
| 1626 | 1627 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw |
| 1627 | 1628 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1628 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r) | |
| 1629 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) | |
| 1629 | 1630 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1630 | 1631 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1631 | 1632 | INPUT_PORTS_END |
| r14896 | r14897 | |
| 1647 | 1648 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1648 | 1649 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw |
| 1649 | 1650 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // button |
| 1650 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r) | |
| 1651 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) | |
| 1651 | 1652 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin / set in test mode |
| 1652 | 1653 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1653 | 1654 | INPUT_PORTS_END |
| r14896 | r14897 | |
| 1690 | 1691 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 1691 | 1692 | MCFG_EEPROM_ADD("eeprom", eeprom_intf) |
| 1692 | 1693 | |
| 1693 | MCFG_TICKET_DISPENSER_ADD("hopper", 200, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) | |
| 1694 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) | |
| 1694 | 1695 | |
| 1695 | 1696 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1696 | 1697 | MCFG_SCREEN_REFRESH_RATE(60) // ? |
| r14896 | r14897 | |
| 1744 | 1745 | MCFG_NVRAM_ADD_0FILL("nvram") // battery |
| 1745 | 1746 | MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit) |
| 1746 | 1747 | |
| 1747 | MCFG_TICKET_DISPENSER_ADD("hopper", 200, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) | |
| 1748 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) | |
| 1748 | 1749 | |
| 1749 | 1750 | // video hardware |
| 1750 | 1751 | MCFG_SCREEN_ADD("screen", RASTER) |
| r14896 | r14897 | |
| 2113 | 2114 | memory_configure_bank(machine, "rambank", 1, 4, bankedram, 0x1000); |
| 2114 | 2115 | memory_set_bank(machine, "rambank", 0); |
| 2115 | 2116 | |
| 2116 | state->m_spriteram = auto_alloc_array(machine, UINT8, 0x1000 * 5); | |
| 2117 | memset(state->m_spriteram, 0, 0x1000 * 5); | |
| 2118 | state->m_spriteram_size = 0x1000; | |
| 2117 | //state->m_spriteram = auto_alloc_array(machine, UINT8, 0x1000 * 5); | |
| 2118 | //memset(state->m_spriteram, 0, 0x1000 * 5); | |
| 2119 | //state->m_spriteram_size = 0x1000; | |
| 2119 | 2120 | memory_configure_bank(machine, "sprbank", 0, 5, state->m_spriteram, 0x1000); |
| 2120 | 2121 | memory_set_bank(machine, "sprbank", 0); |
| 2121 | 2122 | |
| r14896 | r14897 | |
| 2161 | 2162 | memory_set_bankptr(machine, "palbank", state->m_generic_paletteram_8); |
| 2162 | 2163 | state->m_rambank = 0x64; |
| 2163 | 2164 | |
| 2164 | state->m_spriteram = auto_alloc_array(machine, UINT8, 0x1000 * 5); | |
| 2165 | memset(state->m_spriteram, 0, 0x1000 * 5); | |
| 2166 | state->m_spriteram_size = 0x1000; | |
| 2165 | //state->m_spriteram = auto_alloc_array(machine, UINT8, 0x1000 * 5); | |
| 2166 | //memset(state->m_spriteram, 0, 0x1000 * 5); | |
| 2167 | //state->m_spriteram_size = 0x1000; | |
| 2167 | 2168 | memory_set_bankptr(machine, "sprbank0", state->m_spriteram + 0x1000*4); // scratch |
| 2168 | 2169 | memory_set_bankptr(machine, "sprbank1", state->m_spriteram + 0x1000*4); // scratch |
| 2169 | 2170 | |
| r14896 | r14897 | |
| 2273 | 2274 | state->m_generic_paletteram_8.allocate(0x200); |
| 2274 | 2275 | memset(state->m_generic_paletteram_8, 0, 0x200); |
| 2275 | 2276 | |
| 2276 | state->m_spriteram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 2277 | memset(state->m_spriteram, 0, 0x1000); | |
| 2278 | state->m_spriteram_size = 0x1000; | |
| 2277 | //state->m_spriteram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 2278 | //memset(state->m_spriteram, 0, 0x1000); | |
| 2279 | //state->m_spriteram_size = 0x1000; | |
| 2279 | 2280 | |
| 2280 | 2281 | state->m_rombank = 0x65; |
| 2281 | 2282 | state->m_rambank = 0x53; |
| r14896 | r14897 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | WRITE8_MEMBER(shootout_state::sound_cpu_command_w) |
| 50 | 50 | { |
| 51 | soundlatch_w( space, offset, data ); | |
| 51 | soundlatch_byte_w( space, offset, data ); | |
| 52 | 52 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE ); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | WRITE8_MEMBER(shootout_state::shootout_flipscreen_w) |
| 56 | 56 | { |
| 57 | flip_screen_set( | |
| 57 | flip_screen_set( | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | WRITE8_MEMBER(shootout_state::shootout_coin_counter_w) |
| r14896 | r14897 | |
| 99 | 99 | static ADDRESS_MAP_START( shootout_sound_map, AS_PROGRAM, 8, shootout_state ) |
| 100 | 100 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 101 | 101 | AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r,ym2203_w) |
| 102 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 102 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 103 | 103 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 104 | 104 | AM_RANGE(0xd000, 0xd000) AM_WRITENOP // unknown, NOT irq/nmi mask |
| 105 | 105 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main */ |
| 68 | 68 | AM_RANGE(0x200000, 0x203fff) AM_DEVREADWRITE_LEGACY("pc090oj", pc090oj_word_r, pc090oj_word_w) |
| 69 | 69 | AM_RANGE(0x400000, 0x47ffff) AM_READWRITE(volfied_video_ram_r, volfied_video_ram_w) |
| 70 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(paletteram | |
| 70 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(paletteram | |
| 71 | 71 | AM_RANGE(0x600000, 0x600001) AM_WRITE(volfied_video_mask_w) |
| 72 | 72 | AM_RANGE(0x700000, 0x700001) AM_WRITE(volfied_sprite_ctrl_w) |
| 73 | 73 | AM_RANGE(0xd00000, 0xd00001) AM_READWRITE(volfied_video_ctrl_r, volfied_video_ctrl_w) |
| r14896 | r14897 | |
|---|---|---|
| 706 | 706 | set_led_status(space->machine(), 1, data & 0x01); |
| 707 | 707 | set_led_status(space->machine(), 2, data & 0x02); |
| 708 | 708 | set_led_status(space->machine(), 3, data & 0x04); |
| 709 | ticket_dispenser_w(device->machine(). | |
| 709 | device->machine().device<ticket_dispenser_device>("ticket")->write(*device->machine().memory().first_spac | |
| 710 | 710 | coin_counter_w(space->machine(), 0, (data & 0x20) >> 5); |
| 711 | 711 | } |
| 712 | 712 | |
| r14896 | r14897 | |
| 725 | 725 | /* bit 4 controls the ticket dispenser */ |
| 726 | 726 | /* bit 5 controls the coin counter */ |
| 727 | 727 | /* bit 6 controls the diagnostic sound LED */ |
| 728 | ticket_dispenser_w(device->machine(). | |
| 728 | device->machine().device<ticket_dispenser_device>("ticket")->write(*device->machine().memory().first_spac | |
| 729 | 729 | coin_counter_w(space->machine(), 0, (data & 0x20) >> 5); |
| 730 | 730 | } |
| 731 | 731 | |
| r14896 | r14897 | |
| 1692 | 1692 | MCFG_MACHINE_RESET(itech32) |
| 1693 | 1693 | MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", itech32_state, nvram_init) |
| 1694 | 1694 | |
| 1695 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 1695 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 1696 | 1696 | |
| 1697 | 1697 | /* video hardware */ |
| 1698 | 1698 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r14896 | r14897 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | UINT32 m_idle_skip_ram; |
| 149 | 149 | required_device<cpu_device> m_maincpu; |
| 150 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 151 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 152 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 153 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 154 | DECLARE_WRITE32_MEMBER(bios_ram_w); | |
| 155 | DECLARE_READ16_MEMBER(calchase_iocard1_r); | |
| 156 | DECLARE_READ16_MEMBER(calchase_iocard2_r); | |
| 157 | DECLARE_READ16_MEMBER(calchase_iocard3_r); | |
| 158 | DECLARE_READ16_MEMBER(calchase_iocard4_r); | |
| 159 | DECLARE_READ16_MEMBER(calchase_iocard5_r); | |
| 160 | DECLARE_READ32_MEMBER(calchase_idle_skip_r); | |
| 161 | DECLARE_WRITE32_MEMBER(calchase_idle_skip_w); | |
| 150 | 162 | }; |
| 151 | 163 | |
| 152 | 164 | |
| r14896 | r14897 | |
| 175 | 187 | |
| 176 | 188 | |
| 177 | 189 | |
| 178 | ||
| 190 | ||
| 179 | 191 | { |
| 180 | calchase_state *state = space->machine().driver_data<calchase_state>(); | |
| 181 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 192 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 182 | 193 | |
| 183 | 194 | switch(offset % 8) { |
| 184 | 195 | case 1: |
| 185 | data = | |
| 196 | data = | |
| 186 | 197 | break; |
| 187 | 198 | case 2: |
| 188 | data = | |
| 199 | data = | |
| 189 | 200 | break; |
| 190 | 201 | case 3: |
| 191 | data = | |
| 202 | data = | |
| 192 | 203 | break; |
| 193 | 204 | case 7: |
| 194 | data = | |
| 205 | data = | |
| 195 | 206 | break; |
| 196 | 207 | } |
| 197 | 208 | return data; |
| 198 | 209 | } |
| 199 | 210 | |
| 200 | 211 | |
| 201 | ||
| 212 | ||
| 202 | 213 | { |
| 203 | calchase_state *state = space->machine().driver_data<calchase_state>(); | |
| 204 | state->m_at_pages[offset % 0x10] = data; | |
| 214 | m_at_pages[offset % 0x10] = data; | |
| 205 | 215 | |
| 206 | 216 | switch(offset % 8) { |
| 207 | 217 | case 1: |
| 208 | | |
| 218 | | |
| 209 | 219 | break; |
| 210 | 220 | case 2: |
| 211 | | |
| 221 | | |
| 212 | 222 | break; |
| 213 | 223 | case 3: |
| 214 | | |
| 224 | | |
| 215 | 225 | break; |
| 216 | 226 | case 7: |
| 217 | | |
| 227 | | |
| 218 | 228 | break; |
| 219 | 229 | } |
| 220 | 230 | } |
| r14896 | r14897 | |
| 229 | 239 | } |
| 230 | 240 | |
| 231 | 241 | |
| 232 | ||
| 242 | ||
| 233 | 243 | { |
| 234 | calchase_state *state = space->machine().driver_data<calchase_state>(); | |
| 235 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 244 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 236 | 245 | & 0xFF0000; |
| 237 | 246 | |
| 238 | return space | |
| 247 | return space. | |
| 239 | 248 | } |
| 240 | 249 | |
| 241 | 250 | |
| 242 | ||
| 251 | ||
| 243 | 252 | { |
| 244 | calchase_state *state = space->machine().driver_data<calchase_state>(); | |
| 245 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 253 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 246 | 254 | & 0xFF0000; |
| 247 | 255 | |
| 248 | space | |
| 256 | space. | |
| 249 | 257 | } |
| 250 | 258 | |
| 251 | 259 | static void set_dma_channel(device_t *device, int channel, int state) |
| r14896 | r14897 | |
| 263 | 271 | { |
| 264 | 272 | DEVCB_LINE(pc_dma_hrq_changed), |
| 265 | 273 | DEVCB_NULL, |
| 266 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 267 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 274 | DEVCB_DRIVER_MEMBER(calchase_state, pc_dma_read_byte), | |
| 275 | DEVCB_DRIVER_MEMBER(calchase_state, pc_dma_write_byte), | |
| 268 | 276 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 269 | 277 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 270 | 278 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 281 | 289 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL } |
| 282 | 290 | }; |
| 283 | 291 | |
| 284 | static READ32_HANDLER(at_page32_r) | |
| 285 | { | |
| 286 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 287 | } | |
| 288 | ||
| 289 | ||
| 290 | static WRITE32_HANDLER(at_page32_w) | |
| 291 | { | |
| 292 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 293 | } | |
| 294 | ||
| 295 | 292 | static READ32_DEVICE_HANDLER( ide_r ) |
| 296 | 293 | { |
| 297 | 294 | return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask); |
| r14896 | r14897 | |
| 485 | 482 | } |
| 486 | 483 | } |
| 487 | 484 | |
| 488 | ||
| 485 | ||
| 489 | 486 | { |
| 490 | calchase_state *state = space->machine().driver_data<calchase_state>(); | |
| 491 | //if (state->m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled | |
| 492 | if (state->m_mxtc_config_reg[0x63] & 0x50) | |
| 487 | //if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled | |
| 488 | if (m_mxtc_config_reg[0x63] & 0x50) | |
| 493 | 489 | { |
| 494 | COMBINE_DATA( | |
| 490 | COMBINE_DATA( | |
| 495 | 491 | } |
| 496 | 492 | } |
| 497 | 493 | |
| 498 | ||
| 494 | ||
| 499 | 495 | { |
| 500 | return input_port_read( | |
| 496 | return input_port_read( | |
| 501 | 497 | } |
| 502 | 498 | |
| 503 | ||
| 499 | ||
| 504 | 500 | { |
| 505 | return input_port_read( | |
| 501 | return input_port_read( | |
| 506 | 502 | } |
| 507 | 503 | |
| 508 | ||
| 504 | ||
| 509 | 505 | { |
| 510 | return input_port_read( | |
| 506 | return input_port_read( | |
| 511 | 507 | } |
| 512 | 508 | |
| 513 | 509 | /* These two controls wheel pot or whatever this game uses ... */ |
| 514 | ||
| 510 | ||
| 515 | 511 | { |
| 516 | return input_port_read( | |
| 512 | return input_port_read( | |
| 517 | 513 | } |
| 518 | 514 | |
| 519 | ||
| 515 | ||
| 520 | 516 | { |
| 521 | return input_port_read( | |
| 517 | return input_port_read( | |
| 522 | 518 | } |
| 523 | 519 | |
| 524 | 520 | |
| r14896 | r14897 | |
| 533 | 529 | AM_RANGE(0x000c0000, 0x000c7fff) AM_RAM AM_REGION("video_bios", 0) |
| 534 | 530 | AM_RANGE(0x000c8000, 0x000cffff) AM_NOP |
| 535 | 531 | //AM_RANGE(0x000d0000, 0x000d0003) AM_RAM // XYLINX - Sincronus serial communication |
| 536 | AM_RANGE(0x000d0004, 0x000d0007) AM_READ16_LEGACY(calchase_iocard1_r, 0x0000ffff) | |
| 537 | AM_RANGE(0x000d000c, 0x000d000f) AM_READ16_LEGACY(calchase_iocard2_r, 0x0000ffff) | |
| 538 | AM_RANGE(0x000d0030, 0x000d0033) AM_READ16_LEGACY(calchase_iocard3_r, 0xffff0000) | |
| 539 | AM_RANGE(0x000d0030, 0x000d0033) AM_READ16_LEGACY(calchase_iocard4_r, 0x0000ffff) | |
| 540 | AM_RANGE(0x000d0034, 0x000d0037) AM_READ16_LEGACY(calchase_iocard5_r, 0x0000ffff) | |
| 532 | AM_RANGE(0x000d0004, 0x000d0007) AM_READ16(calchase_iocard1_r, 0x0000ffff) | |
| 533 | AM_RANGE(0x000d000c, 0x000d000f) AM_READ16(calchase_iocard2_r, 0x0000ffff) | |
| 534 | AM_RANGE(0x000d0030, 0x000d0033) AM_READ16(calchase_iocard3_r, 0xffff0000) | |
| 535 | AM_RANGE(0x000d0030, 0x000d0033) AM_READ16(calchase_iocard4_r, 0x0000ffff) | |
| 536 | AM_RANGE(0x000d0034, 0x000d0037) AM_READ16(calchase_iocard5_r, 0x0000ffff) | |
| 541 | 537 | AM_RANGE(0x000d0008, 0x000d000b) AM_WRITENOP // ??? |
| 542 | 538 | AM_RANGE(0x000d0024, 0x000d0027) AM_DEVWRITE16_LEGACY("dac_l",calchase_dac_w,0x0000ffff) |
| 543 | 539 | AM_RANGE(0x000d0028, 0x000d002b) AM_DEVWRITE16_LEGACY("dac_r",calchase_dac_w,0x0000ffff) |
| r14896 | r14897 | |
| 546 | 542 | |
| 547 | 543 | //GRULL AM_RANGE(0x000e0000, 0x000effff) AM_RAM |
| 548 | 544 | //GRULL-AM_RANGE(0x000f0000, 0x000fffff) AM_ROMBANK("bank1") |
| 549 | //GRULL AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE | |
| 545 | //GRULL AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE | |
| 550 | 546 | AM_RANGE(0x000e0000, 0x000fffff) AM_ROMBANK("bank1") |
| 551 | AM_RANGE(0x000e0000, 0x000fffff) AM_WRITE | |
| 547 | AM_RANGE(0x000e0000, 0x000fffff) AM_WRITE | |
| 552 | 548 | AM_RANGE(0x00100000, 0x03ffffff) AM_RAM // 64MB |
| 553 | 549 | AM_RANGE(0x02000000, 0x28ffffff) AM_NOP |
| 554 | 550 | //AM_RANGE(0x04000000, 0x040001ff) AM_RAM |
| r14896 | r14897 | |
| 568 | 564 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 569 | 565 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 570 | 566 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) /* todo: nvram (CMOS Setup Save)*/ |
| 571 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 567 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 572 | 568 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 573 | 569 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 574 | 570 | //AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| r14896 | r14897 | |
| 941 | 937 | MACHINE_CONFIG_END |
| 942 | 938 | |
| 943 | 939 | |
| 944 | ||
| 940 | ||
| 945 | 941 | { |
| 946 | calchase_state *state = space->machine().driver_data<calchase_state>(); | |
| 947 | 942 | |
| 948 | if(cpu_get_pc(&space->device())==0x1406f48) | |
| 949 | device_spin_until_interrupt(state->m_maincpu); | |
| 943 | if(cpu_get_pc(&space.device())==0x1406f48) | |
| 944 | device_spin_until_interrupt(m_maincpu); | |
| 950 | 945 | |
| 951 | return | |
| 946 | return | |
| 952 | 947 | } |
| 953 | 948 | |
| 954 | ||
| 949 | ||
| 955 | 950 | { |
| 956 | calchase_state *state = space->machine().driver_data<calchase_state>(); | |
| 957 | 951 | |
| 958 | COMBINE_DATA(& | |
| 952 | COMBINE_DATA(& | |
| 959 | 953 | } |
| 960 | 954 | |
| 961 | 955 | static DRIVER_INIT( calchase ) |
| r14896 | r14897 | |
| 971 | 965 | |
| 972 | 966 | kbdc8042_init(machine, &at8042); |
| 973 | 967 | |
| 974 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 968 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 975 | 969 | } |
| 976 | 970 | |
| 977 | 971 | ROM_START( calchase ) |
| r14896 | r14897 | |
|---|---|---|
| 91 | 91 | if (ACCESSING_BITS_0_7) |
| 92 | 92 | { |
| 93 | 93 | m_soundlatch_status = 1; |
| 94 | soundlatch_w(space, 0, data & 0xff); | |
| 94 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| r14896 | r14897 | |
| 104 | 104 | AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(ashnojoe_tileram6_w) AM_BASE(m_tileram_6) |
| 105 | 105 | AM_RANGE(0x047000, 0x047fff) AM_RAM_WRITE(ashnojoe_tileram7_w) AM_BASE(m_tileram_7) |
| 106 | 106 | AM_RANGE(0x048000, 0x048fff) AM_RAM_WRITE(ashnojoe_tileram_w) AM_BASE(m_tileram) |
| 107 | AM_RANGE(0x049000, 0x049fff) AM_RAM_WRITE(paletteram | |
| 107 | AM_RANGE(0x049000, 0x049fff) AM_RAM_WRITE(paletteram | |
| 108 | 108 | AM_RANGE(0x04a000, 0x04a001) AM_READ_PORT("P1") |
| 109 | 109 | AM_RANGE(0x04a002, 0x04a003) AM_READ_PORT("P2") |
| 110 | 110 | AM_RANGE(0x04a004, 0x04a005) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 126 | 126 | READ8_MEMBER(ashnojoe_state::sound_latch_r) |
| 127 | 127 | { |
| 128 | 128 | m_soundlatch_status = 0; |
| 129 | return soundlatch_r(space, 0); | |
| 129 | return soundlatch_byte_r(space, 0); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | READ8_MEMBER(ashnojoe_state::sound_latch_status_r) |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | public: |
| 84 | 84 | popobear_state(const machine_config &mconfig, device_type type, const char *tag) |
| 85 | 85 | : driver_device(mconfig, type, tag), |
| 86 | m_maincpu(*this,"maincpu") | |
| 87 | { } | |
| 86 | m_maincpu(*this,"maincpu"), | |
| 87 | m_spr(*this, "spr"), | |
| 88 | m_vram(*this, "vram"), | |
| 89 | m_vregs(*this, "vregs"){ } | |
| 88 | 90 | |
| 89 | UINT16 *m_vregs; | |
| 90 | UINT16 *m_vram; | |
| 91 | UINT16 *m_spr; | |
| 92 | 91 | required_device<cpu_device> m_maincpu; |
| 92 | required_shared_ptr<UINT16> m_spr; | |
| 93 | required_shared_ptr<UINT16> m_vram; | |
| 94 | required_shared_ptr<UINT16> m_vregs; | |
| 93 | 95 | DECLARE_READ8_MEMBER(popo_620000_r); |
| 94 | 96 | DECLARE_WRITE8_MEMBER(popobear_irq_ack_w); |
| 95 | 97 | }; |
| r14896 | r14897 | |
| 102 | 104 | static void draw_layer(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, UINT8 layer_n) |
| 103 | 105 | { |
| 104 | 106 | popobear_state *state = machine.driver_data<popobear_state>(); |
| 105 | UINT8* vram = (UINT8 *)state->m_vram; | |
| 106 | UINT16* vreg = (UINT16 *)state->m_vregs; | |
| 107 | UINT8* vram = (UINT8 *)state->m_vram.target(); | |
| 108 | UINT16* vreg = (UINT16 *)state->m_vregs.target(); | |
| 107 | 109 | int count; |
| 108 | 110 | const UINT8 vreg_base[] = { 0x10/2, 0x14/2 }; |
| 109 | 111 | int xscroll,yscroll; |
| 110 | 112 | |
| 111 | // count = (state->m_vregs[vreg_base[layer_n]]<<5); | |
| 113 | // count = (state->m_vregs.target()[vreg_base[layer_n]]<<5); | |
| 112 | 114 | // count &= 0xfc000; |
| 113 | 115 | count = (0xf0000+layer_n*0x4000); |
| 114 | 116 | if(layer_n & 2) |
| r14896 | r14897 | |
| 175 | 177 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect) |
| 176 | 178 | { |
| 177 | 179 | popobear_state *state = machine.driver_data<popobear_state>(); |
| 178 | UINT8* vram = (UINT8 *)state->m_spr; | |
| 180 | UINT8* vram = (UINT8 *)state->m_spr.target(); | |
| 179 | 181 | int i; |
| 180 | 182 | #if 0 |
| 181 | 183 | static int bank_test = 1; |
| r14896 | r14897 | |
| 257 | 259 | |
| 258 | 260 | bitmap.fill(0, cliprect); |
| 259 | 261 | |
| 260 | //popmessage("%04x",state->m_vregs[0/2]); | |
| 262 | //popmessage("%04x",state->m_vregs.target()[0/2]); | |
| 261 | 263 | |
| 262 | 264 | draw_layer(screen.machine(),bitmap,cliprect,3); |
| 263 | 265 | draw_layer(screen.machine(),bitmap,cliprect,2); |
| r14896 | r14897 | |
| 289 | 291 | ADDRESS_MAP_UNMAP_HIGH |
| 290 | 292 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 291 | 293 | AM_RANGE(0x210000, 0x21ffff) AM_RAM |
| 292 | AM_RANGE(0x280000, 0x2fffff) AM_RAM AM_BASE(m_spr) // unknown boundaries, 0x2ff800 contains a sprite list | |
| 293 | AM_RANGE(0x300000, 0x3fffff) AM_RAM AM_BASE(m_vram) | |
| 294 | AM_RANGE(0x280000, 0x2fffff) AM_RAM AM_SHARE("spr") // unknown boundaries, 0x2ff800 contains a sprite list | |
| 295 | AM_RANGE(0x300000, 0x3fffff) AM_RAM AM_SHARE("vram") | |
| 294 | 296 | |
| 295 | 297 | /* Most if not all of these are vregs */ |
| 296 | AM_RANGE(0x480000, 0x48001f) AM_RAM AM_ | |
| 298 | AM_RANGE(0x480000, 0x48001f) AM_RAM AM_ | |
| 297 | 299 | AM_RANGE(0x480020, 0x480023) AM_RAM |
| 298 | 300 | AM_RANGE(0x480028, 0x48002d) AM_RAM |
| 299 | 301 | // AM_RANGE(0x480020, 0x480021) AM_NOP //AM_READ_LEGACY(popo_480020_r) AM_WRITE_LEGACY(popo_480020_w) |
| r14896 | r14897 | |
| 303 | 305 | AM_RANGE(0x480034, 0x480035) AM_RAM // coin counter or coin lockout |
| 304 | 306 | AM_RANGE(0x48003a, 0x48003b) AM_RAM //AM_READ_LEGACY(popo_48003a_r) AM_WRITE_LEGACY(popo_48003a_w) |
| 305 | 307 | |
| 306 | AM_RANGE(0x480400, 0x4807ff) AM_RAM AM_WRITE(paletteram | |
| 308 | AM_RANGE(0x480400, 0x4807ff) AM_RAM AM_WRITE(paletteram | |
| 307 | 309 | |
| 308 | 310 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("IN0") |
| 309 | 311 | AM_RANGE(0x520000, 0x520001) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | public: |
| 20 | 20 | minivadr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | : driver_device(mconfig, type, tag) { } | |
| 21 | : driver_device(mconfig, type, tag) , | |
| 22 | m_videoram(*this, "videoram"){ } | |
| 22 | 23 | |
| 23 | 24 | /* memory pointers */ |
| 24 | UINT8 * m_videoram; | |
| 25 | size_t m_videoram_size; | |
| 25 | required_shared_ptr<UINT8> m_videoram; | |
| 26 | 26 | }; |
| 27 | 27 | |
| 28 | 28 | /************************************* |
| r14896 | r14897 | |
| 36 | 36 | minivadr_state *state = screen.machine().driver_data<minivadr_state>(); |
| 37 | 37 | offs_t offs; |
| 38 | 38 | |
| 39 | for (offs = 0; offs < state->m_videoram | |
| 39 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 40 | 40 | { |
| 41 | 41 | int i; |
| 42 | 42 | |
| 43 | 43 | UINT8 x = offs << 3; |
| 44 | 44 | int y = offs >> 5; |
| 45 | UINT8 data = state->m_videoram[offs]; | |
| 45 | UINT8 data = state->m_videoram.target()[offs]; | |
| 46 | 46 | |
| 47 | 47 | for (i = 0; i < 8; i++) |
| 48 | 48 | { |
| r14896 | r14897 | |
| 60 | 60 | |
| 61 | 61 | static ADDRESS_MAP_START( minivadr_map, AS_PROGRAM, 8, minivadr_state ) |
| 62 | 62 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 63 | AM_RANGE(0xa000, 0xbfff) AM_RAM AM_ | |
| 63 | AM_RANGE(0xa000, 0xbfff) AM_RAM AM_ | |
| 64 | 64 | AM_RANGE(0xe008, 0xe008) AM_READ_PORT("INPUTS") AM_WRITENOP // W - ??? |
| 65 | 65 | ADDRESS_MAP_END |
| 66 | 66 |
| r14896 | r14897 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | case 0x0e: /* OUT14 */ |
| 191 | 191 | /* O-21 connector */ |
| 192 | soundlatch_w(space, 0, data); | |
| 192 | soundlatch_byte_w(space, 0, data); | |
| 193 | 193 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 194 | 194 | break; |
| 195 | 195 | } |
| r14896 | r14897 | |
| 563 | 563 | AM_RANGE(0x4803, 0x4803) AM_MIRROR(0x07f8) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| 564 | 564 | AM_RANGE(0x4804, 0x4805) AM_MIRROR(0x07fa) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w) |
| 565 | 565 | AM_RANGE(0x4805, 0x4805) AM_MIRROR(0x07fa) AM_DEVREAD_LEGACY("ay3", ay8910_r) |
| 566 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_r) | |
| 566 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r) | |
| 567 | 567 | ADDRESS_MAP_END |
| 568 | 568 | |
| 569 | 569 |
| r14896 | r14897 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | WRITE8_MEMBER(lkage_state::lkage_sound_command_w) |
| 108 | 108 | { |
| 109 | soundlatch_w(space, offset, data); | |
| 109 | soundlatch_byte_w(space, offset, data); | |
| 110 | 110 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 111 | 111 | } |
| 112 | 112 | |
| r14896 | r14897 | |
| 135 | 135 | static ADDRESS_MAP_START( lkage_map, AS_PROGRAM, 8, lkage_state ) |
| 136 | 136 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 137 | 137 | AM_RANGE(0xe000, 0xe7ff) AM_RAM /* work ram */ |
| 138 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_SHARE("paletteram") | |
| 138 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 139 | 139 | AM_RANGE(0xf000, 0xf003) AM_RAM AM_BASE(m_vreg) /* video registers */ |
| 140 | 140 | AM_RANGE(0xf060, 0xf060) AM_WRITE(lkage_sound_command_w) |
| 141 | 141 | AM_RANGE(0xf061, 0xf061) AM_WRITENOP AM_READ(sound_status_r) |
| r14896 | r14897 | |
| 187 | 187 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 188 | 188 | AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w) |
| 189 | 189 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r,ym2203_w) |
| 190 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_r) AM_WRITENOP /* ??? */ | |
| 190 | AM_RANGE(0xb000, 0xb000) AM_READ(soundlatch_byte_r) AM_WRITENOP /* ??? */ | |
| 191 | 191 | AM_RANGE(0xb001, 0xb001) AM_READNOP /* ??? */ AM_WRITE(lkage_sh_nmi_enable_w) |
| 192 | 192 | AM_RANGE(0xb002, 0xb002) AM_WRITE(lkage_sh_nmi_disable_w) |
| 193 | 193 | AM_RANGE(0xb003, 0xb003) AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 107 | 107 | AM_RANGE(0x00000, 0x0afff) AM_RAM |
| 108 | 108 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE_LEGACY(seibucrtc_sc0vram_w) AM_BASE_LEGACY(&seibucrtc_sc0vram) |
| 109 | 109 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE_LEGACY(seibucrtc_sc3vram_w) AM_BASE_LEGACY(&seibucrtc_sc3vram) |
| 110 | AM_RANGE(0x0d000, 0x0dfff) AM_RAM_WRITE(paletteram | |
| 110 | AM_RANGE(0x0d000, 0x0dfff) AM_RAM_WRITE(paletteram | |
| 111 | 111 | /*Guess: these two aren't used/initialized at all.*/ |
| 112 | 112 | AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE_LEGACY(seibucrtc_sc1vram_w) AM_BASE_LEGACY(&seibucrtc_sc1vram) |
| 113 | 113 | AM_RANGE(0x0e800, 0x0efff) AM_RAM_WRITE_LEGACY(seibucrtc_sc2vram_w) AM_BASE_LEGACY(&seibucrtc_sc2vram) |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | { |
| 141 | 141 | |
| 142 | 142 | if (ACCESSING_BITS_0_7) |
| 143 | soundlatch_w(space, 0, data & 0xff); /* Ninja Gaiden */ | |
| 143 | soundlatch_byte_w(space, 0, data & 0xff); /* Ninja Gaiden */ | |
| 144 | 144 | if (ACCESSING_BITS_8_15) |
| 145 | soundlatch_w(space, 0, data >> 8); /* Tecmo Knight */ | |
| 145 | soundlatch_byte_w(space, 0, data >> 8); /* Tecmo Knight */ | |
| 146 | 146 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 147 | 147 | } |
| 148 | 148 | |
| r14896 | r14897 | |
| 151 | 151 | |
| 152 | 152 | if (ACCESSING_BITS_8_15) |
| 153 | 153 | { |
| 154 | soundlatch_w(space, 0, data >> 8); | |
| 154 | soundlatch_byte_w(space, 0, data >> 8); | |
| 155 | 155 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 156 | 156 | } |
| 157 | 157 | } |
| r14896 | r14897 | |
| 394 | 394 | AM_RANGE(0x072000, 0x073fff) AM_READWRITE(gaiden_videoram2_r, gaiden_videoram2_w) AM_BASE(m_videoram2) |
| 395 | 395 | AM_RANGE(0x074000, 0x075fff) AM_READWRITE(gaiden_videoram3_r, gaiden_videoram3_w) AM_BASE(m_videoram3) |
| 396 | 396 | AM_RANGE(0x076000, 0x077fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 397 | AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram | |
| 397 | AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram | |
| 398 | 398 | AM_RANGE(0x07a000, 0x07a001) AM_READ_PORT("SYSTEM") |
| 399 | 399 | AM_RANGE(0x07a002, 0x07a003) AM_READ_PORT("P1_P2") AM_WRITE(gaiden_sproffsety_w) |
| 400 | 400 | AM_RANGE(0x07a004, 0x07a005) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 420 | 420 | AM_RANGE(0x072000, 0x073fff) AM_RAM_WRITE(gaiden_videoram2_w) AM_BASE(m_videoram2) |
| 421 | 421 | AM_RANGE(0x074000, 0x075fff) AM_RAM_WRITE(gaiden_videoram3_w) AM_BASE(m_videoram3) |
| 422 | 422 | AM_RANGE(0x076000, 0x077fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 423 | AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram | |
| 423 | AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram | |
| 424 | 424 | AM_RANGE(0x07a000, 0x07a001) AM_READ_PORT("SYSTEM") |
| 425 | 425 | AM_RANGE(0x07a002, 0x07a003) AM_READ_PORT("P1_P2") |
| 426 | 426 | AM_RANGE(0x07a004, 0x07a005) AM_READ_PORT("DSW") |
| r14896 | r14897 | |
| 440 | 440 | AM_RANGE(0xf810, 0xf811) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 441 | 441 | AM_RANGE(0xf820, 0xf821) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 442 | 442 | AM_RANGE(0xfc00, 0xfc00) AM_NOP /* ?? */ |
| 443 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 443 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r) | |
| 444 | 444 | ADDRESS_MAP_END |
| 445 | 445 | |
| 446 | 446 | static ADDRESS_MAP_START( drgnbowl_sound_map, AS_PROGRAM, 8, gaiden_state ) |
| r14896 | r14897 | |
| 452 | 452 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 453 | 453 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 454 | 454 | AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 455 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) | |
| 455 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) | |
| 456 | 456 | ADDRESS_MAP_END |
| 457 | 457 | |
| 458 | 458 | static INPUT_PORTS_START( common ) |
| r14896 | r14897 | |
| 906 | 906 | AM_RANGE(0xc400, 0xc401) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 907 | 907 | AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 908 | 908 | // AM_RANGE(0xfc00, 0xfc00) AM_NOP /* ?? */ |
| 909 | // AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 909 | // AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r) | |
| 910 | 910 | ADDRESS_MAP_END |
| 911 | 911 | |
| 912 | 912 | static ADDRESS_MAP_START( mastninj_map, AS_PROGRAM, 16, gaiden_state ) |
| r14896 | r14897 | |
| 916 | 916 | AM_RANGE(0x072000, 0x073fff) AM_READWRITE(gaiden_videoram2_r, gaiden_videoram2_w) AM_BASE(m_videoram2) |
| 917 | 917 | AM_RANGE(0x074000, 0x075fff) AM_READWRITE(gaiden_videoram3_r, gaiden_videoram3_w) AM_BASE(m_videoram3) |
| 918 | 918 | AM_RANGE(0x076000, 0x077fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 919 | AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram | |
| 919 | AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram | |
| 920 | 920 | // AM_RANGE(0x078800, 0x079fff) AM_RAM |
| 921 | 921 | AM_RANGE(0x07a000, 0x07a001) AM_READ_PORT("SYSTEM") |
| 922 | 922 | AM_RANGE(0x07a002, 0x07a003) AM_READ_PORT("P1_P2") |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | public: |
| 38 | 38 | quizshow_state(const machine_config &mconfig, device_type type, const char *tag) |
| 39 | : driver_device(mconfig, type, tag) { } | |
| 39 | : driver_device(mconfig, type, tag) , | |
| 40 | m_main_ram(*this, "main_ram"), | |
| 41 | m_fo_state(*this, "fo_state"){ } | |
| 40 | 42 | |
| 41 | 43 | tilemap_t *m_tilemap; |
| 42 | UINT8* m_fo_state; | |
| 43 | UINT8* m_main_ram; | |
| 44 | required_shared_ptr<UINT8> m_main_ram; | |
| 45 | required_shared_ptr<UINT8> m_fo_state; | |
| 44 | 46 | UINT32 m_clocks; |
| 45 | 47 | int m_blink_state; |
| 46 | 48 | int m_category_enable; |
| r14896 | r14897 | |
| 86 | 88 | static TILE_GET_INFO( get_tile_info ) |
| 87 | 89 | { |
| 88 | 90 | quizshow_state *state = machine.driver_data<quizshow_state>(); |
| 89 | UINT8 code = state->m_main_ram[tile_index]; | |
| 91 | UINT8 code = state->m_main_ram.target()[tile_index]; | |
| 90 | 92 | |
| 91 | 93 | // d6: blink, d7: invert |
| 92 | 94 | UINT8 color = (code & (state->m_blink_state | 0x80)) >> 6; |
| r14896 | r14897 | |
| 198 | 200 | |
| 199 | 201 | WRITE8_MEMBER(quizshow_state::quizshow_main_ram_w) |
| 200 | 202 | { |
| 201 | m_main_ram[offset]=data; | |
| 203 | m_main_ram.target()[offset]=data; | |
| 202 | 204 | m_tilemap->mark_tile_dirty(offset); |
| 203 | 205 | } |
| 204 | 206 | |
| r14896 | r14897 | |
| 217 | 219 | AM_RANGE(0x1884, 0x1884) AM_READ_PORT("IN2") |
| 218 | 220 | AM_RANGE(0x1888, 0x1888) AM_READ_PORT("IN3") |
| 219 | 221 | AM_RANGE(0x1900, 0x1900) AM_READ(quizshow_timing_r) |
| 220 | AM_RANGE(0x1e00, 0x1fff) AM_RAM_WRITE(quizshow_main_ram_w) AM_ | |
| 222 | AM_RANGE(0x1e00, 0x1fff) AM_RAM_WRITE(quizshow_main_ram_w) AM_ | |
| 221 | 223 | ADDRESS_MAP_END |
| 222 | 224 | |
| 223 | 225 | static ADDRESS_MAP_START( quizshow_io_map, AS_IO, 8, quizshow_state ) |
| r14896 | r14897 | |
| 225 | 227 | // AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_NOP // unused |
| 226 | 228 | // AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_NOP // unused |
| 227 | 229 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(quizshow_tape_signal_r) |
| 228 | AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_RAM AM_ | |
| 230 | AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_RAM AM_ | |
| 229 | 231 | ADDRESS_MAP_END |
| 230 | 232 | |
| 231 | 233 |
| r14896 | r14897 | |
|---|---|---|
| 232 | 232 | AM_RANGE(0x1085, 0x1085) AM_MIRROR(0x0078) AM_WRITENOP /* CN3.2 */ |
| 233 | 233 | AM_RANGE(0x1086, 0x1086) AM_MIRROR(0x0078) AM_WRITENOP /* CN3.4 */ |
| 234 | 234 | AM_RANGE(0x1087, 0x1087) AM_MIRROR(0x0078) AM_WRITE(irq_mask_w) /* INT */ |
| 235 | AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x007f) AM_WRITE(soundlatch_w) /* 32 */ | |
| 235 | AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x007f) AM_WRITE(soundlatch_byte_w) /* 32 */ | |
| 236 | 236 | AM_RANGE(0x1200, 0x1200) AM_MIRROR(0x007f) AM_READ_PORT("DSW2") |
| 237 | 237 | AM_RANGE(0x1280, 0x1280) AM_MIRROR(0x007c) AM_READ_PORT("SYSTEM") |
| 238 | 238 | AM_RANGE(0x1281, 0x1281) AM_MIRROR(0x007c) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 271 | 271 | AM_RANGE(0x1085, 0x1085) AM_MIRROR(0x0078) AM_WRITENOP /* CN3.2 */ |
| 272 | 272 | AM_RANGE(0x1086, 0x1086) AM_MIRROR(0x0078) AM_WRITENOP /* CN3.4 */ |
| 273 | 273 | AM_RANGE(0x1087, 0x1087) AM_MIRROR(0x0078) AM_WRITE(irq_mask_w) /* INT */ |
| 274 | // AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x007f) AM_WRITE(soundlatch_w) /* 32 */ | |
| 274 | // AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x007f) AM_WRITE(soundlatch_byte_w) /* 32 */ | |
| 275 | 275 | AM_RANGE(0x1200, 0x1200) AM_MIRROR(0x007f) AM_READ_PORT("DSW2") |
| 276 | 276 | AM_RANGE(0x1280, 0x1280) AM_MIRROR(0x007c) AM_READ_PORT("SYSTEM") |
| 277 | 277 | AM_RANGE(0x1281, 0x1281) AM_MIRROR(0x007c) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 298 | 298 | AM_RANGE(0x9081, 0x9081) AM_WRITE_LEGACY(konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 299 | 299 | AM_RANGE(0x9083, 0x9084) AM_WRITE(coin_w) |
| 300 | 300 | AM_RANGE(0x9087, 0x9087) AM_WRITE(irq_mask_w) |
| 301 | AM_RANGE(0x9100, 0x9100) AM_WRITE(soundlatch_w) | |
| 301 | AM_RANGE(0x9100, 0x9100) AM_WRITE(soundlatch_byte_w) | |
| 302 | 302 | AM_RANGE(0x9200, 0x9200) AM_READ_PORT("DSW2") |
| 303 | 303 | AM_RANGE(0x9280, 0x9280) AM_READ_PORT("SYSTEM") |
| 304 | 304 | AM_RANGE(0x9281, 0x9281) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 331 | 331 | AM_RANGE(0x10b1, 0x10b1) AM_READNOP AM_WRITE_LEGACY(konami_sh_irqtrigger_w) |
| 332 | 332 | AM_RANGE(0x10b3, 0x10b4) AM_WRITE(coin_w) // actually not used |
| 333 | 333 | AM_RANGE(0x10b7, 0x10b7) AM_READNOP AM_WRITE(irq_mask_w) |
| 334 | AM_RANGE(0x1100, 0x1100) AM_WRITE(soundlatch_w) | |
| 334 | AM_RANGE(0x1100, 0x1100) AM_WRITE(soundlatch_byte_w) | |
| 335 | 335 | AM_RANGE(0x1200, 0x1200) AM_READ_PORT("DSW2") |
| 336 | 336 | AM_RANGE(0x1280, 0x1280) AM_READ_PORT("SYSTEM") |
| 337 | 337 | AM_RANGE(0x1281, 0x1281) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 358 | 358 | AM_RANGE(0x1081, 0x1081) AM_WRITE_LEGACY(konami_sh_irqtrigger_w) /* cause interrupt on audio CPU */ |
| 359 | 359 | AM_RANGE(0x1083, 0x1084) AM_WRITE(coin_w) |
| 360 | 360 | AM_RANGE(0x1087, 0x1087) AM_WRITE(irq_mask_w) |
| 361 | AM_RANGE(0x1100, 0x1100) AM_WRITE(soundlatch_w) | |
| 361 | AM_RANGE(0x1100, 0x1100) AM_WRITE(soundlatch_byte_w) | |
| 362 | 362 | AM_RANGE(0x1200, 0x1200) AM_READ_PORT("DSW2") |
| 363 | 363 | AM_RANGE(0x1280, 0x1280) AM_READ_PORT("SYSTEM") |
| 364 | 364 | AM_RANGE(0x1281, 0x1281) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 389 | 389 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, trackfld_state ) |
| 390 | 390 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 391 | 391 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x1c00) AM_RAM |
| 392 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_r) | |
| 392 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_byte_r) | |
| 393 | 393 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_READ_LEGACY(trackfld_sh_timer_r) |
| 394 | 394 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE_LEGACY(konami_SN76496_latch_w) |
| 395 | 395 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_DEVREADWRITE_LEGACY("snsnd", trackfld_SN76496_r, konami_SN76496_w) |
| r14896 | r14897 | |
| 403 | 403 | static ADDRESS_MAP_START( hyprolyb_sound_map, AS_PROGRAM, 8, trackfld_state ) |
| 404 | 404 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 405 | 405 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x1c00) AM_RAM |
| 406 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_r) | |
| 406 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_byte_r) | |
| 407 | 407 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_READ_LEGACY(trackfld_sh_timer_r) |
| 408 | 408 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1fff) AM_WRITE_LEGACY(konami_SN76496_latch_w) |
| 409 | 409 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_DEVREADWRITE_LEGACY("snsnd", trackfld_SN76496_r, konami_SN76496_w) |
| r14896 | r14897 | |
|---|---|---|
| 585 | 585 | AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_astrof_color) |
| 586 | 586 | AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w) |
| 587 | 587 | AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(astrof_video_control_2_w) |
| 588 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(astrof_audio_1_w) | |
| 589 | AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE_LEGACY(astrof_audio_2_w) | |
| 588 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(astrof_audio_1_w) | |
| 589 | AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(astrof_audio_2_w) | |
| 590 | 590 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP |
| 591 | 591 | AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP |
| 592 | 592 | AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ(irq_clear_r) AM_WRITENOP |
| r14896 | r14897 | |
| 604 | 604 | AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_astrof_color) |
| 605 | 605 | AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w) |
| 606 | 606 | AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(spfghmk2_video_control_2_w) |
| 607 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE | |
| 607 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE | |
| 608 | 608 | AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_NOP |
| 609 | 609 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP |
| 610 | 610 | AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP |
| r14896 | r14897 | |
| 623 | 623 | AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_astrof_color) |
| 624 | 624 | AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w) |
| 625 | 625 | AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(tomahawk_video_control_2_w) |
| 626 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE | |
| 626 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE | |
| 627 | 627 | AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(m_tomahawk_protection) |
| 628 | 628 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP |
| 629 | 629 | AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 460 | 460 | public: |
| 461 | 461 | vegas_state(const machine_config &mconfig, device_type type, const char *tag) |
| 462 | 462 | : driver_device(mconfig, type, tag), |
| 463 | m_timekeeper(*this, "timekeeper") { } | |
| 463 | m_timekeeper(*this, "timekeeper") , | |
| 464 | m_rambase(*this, "rambase"), | |
| 465 | m_nile_regs(*this, "nile_regs"), | |
| 466 | m_rombase(*this, "rombase"){ } | |
| 464 | 467 | |
| 465 | 468 | required_device<m48t37_device> m_timekeeper; |
| 466 | UINT32 *m_rambase; | |
| 467 | UINT32 *m_rombase; | |
| 468 | size_t m_ramsize; | |
| 469 | UINT32 *m_nile_regs; | |
| 469 | required_shared_ptr<UINT32> m_rambase; | |
| 470 | required_shared_ptr<UINT32> m_nile_regs; | |
| 471 | required_shared_ptr<UINT32> m_rombase; | |
| 470 | 472 | UINT16 m_nile_irq_state; |
| 471 | 473 | UINT16 m_ide_irq_state; |
| 472 | 474 | UINT32 m_pci_bridge_regs[0x40]; |
| r14896 | r14897 | |
| 544 | 546 | mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC); |
| 545 | 547 | |
| 546 | 548 | /* configure fast RAM regions for DRC */ |
| 547 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, state->m_ramsize - 1, FALSE, state->m_rambase); | |
| 548 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase); | |
| 549 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, state->m_rambase.bytes() - 1, FALSE, state->m_rambase.target()); | |
| 550 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase.target()); | |
| 549 | 551 | |
| 550 | 552 | /* register for save states */ |
| 551 | 553 | state_save_register_global(machine, state->m_nile_irq_state); |
| r14896 | r14897 | |
| 843 | 845 | static void update_nile_irqs(running_machine &machine) |
| 844 | 846 | { |
| 845 | 847 | vegas_state *state = machine.driver_data<vegas_state>(); |
| 846 | UINT32 intctll = state->m_nile_regs[NREG_INTCTRL+0]; | |
| 847 | UINT32 intctlh = state->m_nile_regs[NREG_INTCTRL+1]; | |
| 848 | UINT32 intctll = state->m_nile_regs.target()[NREG_INTCTRL+0]; | |
| 849 | UINT32 intctlh = state->m_nile_regs.target()[NREG_INTCTRL+1]; | |
| 848 | 850 | UINT8 irq[6]; |
| 849 | 851 | int i; |
| 850 | 852 | |
| 851 | 853 | /* check for UART transmit IRQ enable and synthsize one */ |
| 852 | if (state->m_nile_regs[NREG_UARTIER] & 2) | |
| 854 | if (state->m_nile_regs.target()[NREG_UARTIER] & 2) | |
| 853 | 855 | state->m_nile_irq_state |= 0x0010; |
| 854 | 856 | else |
| 855 | 857 | state->m_nile_irq_state &= ~0x0010; |
| 856 | 858 | |
| 857 | 859 | irq[0] = irq[1] = irq[2] = irq[3] = irq[4] = irq[5] = 0; |
| 858 | state->m_nile_regs[NREG_INTSTAT0+0] = 0; | |
| 859 | state->m_nile_regs[NREG_INTSTAT0+1] = 0; | |
| 860 | state->m_nile_regs[NREG_INTSTAT1+0] = 0; | |
| 861 | state->m_nile_regs[NREG_INTSTAT1+1] = 0; | |
| 860 | state->m_nile_regs.target()[NREG_INTSTAT0+0] = 0; | |
| 861 | state->m_nile_regs.target()[NREG_INTSTAT0+1] = 0; | |
| 862 | state->m_nile_regs.target()[NREG_INTSTAT1+0] = 0; | |
| 863 | state->m_nile_regs.target()[NREG_INTSTAT1+1] = 0; | |
| 862 | 864 | |
| 863 | 865 | /* handle the lower interrupts */ |
| 864 | 866 | for (i = 0; i < 8; i++) |
| r14896 | r14897 | |
| 869 | 871 | if (vector < 6) |
| 870 | 872 | { |
| 871 | 873 | irq[vector] = 1; |
| 872 | state->m_nile_regs[NREG_INTSTAT0 + vector/2] |= 1 << (i + 16*(vector&1)); | |
| 874 | state->m_nile_regs.target()[NREG_INTSTAT0 + vector/2] |= 1 << (i + 16*(vector&1)); | |
| 873 | 875 | } |
| 874 | 876 | } |
| 875 | 877 | |
| r14896 | r14897 | |
| 882 | 884 | if (vector < 6) |
| 883 | 885 | { |
| 884 | 886 | irq[vector] = 1; |
| 885 | state->m_nile_regs[NREG_INTSTAT0 + vector/2] |= 1 << (i + 8 + 16*(vector&1)); | |
| 887 | state->m_nile_regs.target()[NREG_INTSTAT0 + vector/2] |= 1 << (i + 8 + 16*(vector&1)); | |
| 886 | 888 | } |
| 887 | 889 | } |
| 888 | 890 | |
| r14896 | r14897 | |
| 909 | 911 | { |
| 910 | 912 | vegas_state *state = machine.driver_data<vegas_state>(); |
| 911 | 913 | int which = param; |
| 912 | UINT32 *regs = &state->m_nile_regs[NREG_T0CTRL + which * 4]; | |
| 914 | UINT32 *regs = &state->m_nile_regs.target()[NREG_T0CTRL + which * 4]; | |
| 913 | 915 | if (LOG_TIMERS) logerror("timer %d fired\n", which); |
| 914 | 916 | |
| 915 | 917 | /* adjust the timer to fire again */ |
| r14896 | r14897 | |
| 941 | 943 | static READ32_HANDLER( nile_r ) |
| 942 | 944 | { |
| 943 | 945 | vegas_state *state = space->machine().driver_data<vegas_state>(); |
| 944 | UINT32 result = state->m_nile_regs[offset]; | |
| 946 | UINT32 result = state->m_nile_regs.target()[offset]; | |
| 945 | 947 | int logit = 1, which; |
| 946 | 948 | |
| 947 | 949 | switch (offset) |
| r14896 | r14897 | |
| 998 | 1000 | case NREG_T2CNTR: /* general purpose timer control (counter) */ |
| 999 | 1001 | case NREG_T3CNTR: /* watchdog timer control (counter) */ |
| 1000 | 1002 | which = (offset - NREG_T0CTRL) / 4; |
| 1001 | if (state->m_nile_regs[offset - 1] & 1) | |
| 1003 | if (state->m_nile_regs.target()[offset - 1] & 1) | |
| 1002 | 1004 | { |
| 1003 | if (state->m_nile_regs[offset] & 2) | |
| 1005 | if (state->m_nile_regs.target()[offset] & 2) | |
| 1004 | 1006 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1005 | result = state->m_nile_regs[offset + 1] = state->m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK; | |
| 1007 | result = state->m_nile_regs.target()[offset + 1] = state->m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK; | |
| 1006 | 1008 | } |
| 1007 | 1009 | |
| 1008 | 1010 | if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", cpu_get_pc(&space->device()), which, offset*4, result); |
| r14896 | r14897 | |
| 1010 | 1012 | break; |
| 1011 | 1013 | |
| 1012 | 1014 | case NREG_UARTIIR: /* serial port interrupt ID */ |
| 1013 | if (state->m_nile_regs[NREG_UARTIER] & 2) | |
| 1015 | if (state->m_nile_regs.target()[NREG_UARTIER] & 2) | |
| 1014 | 1016 | result = 0x02; /* transmitter buffer IRQ pending */ |
| 1015 | 1017 | else |
| 1016 | 1018 | result = 0x01; /* no IRQ pending */ |
| r14896 | r14897 | |
| 1054 | 1056 | static WRITE32_HANDLER( nile_w ) |
| 1055 | 1057 | { |
| 1056 | 1058 | vegas_state *state = space->machine().driver_data<vegas_state>(); |
| 1057 | UINT32 olddata = state->m_nile_regs[offset]; | |
| 1059 | UINT32 olddata = state->m_nile_regs.target()[offset]; | |
| 1058 | 1060 | int logit = 1, which; |
| 1059 | 1061 | |
| 1060 | COMBINE_DATA(&state->m_nile_regs[offset]); | |
| 1062 | COMBINE_DATA(&state->m_nile_regs.target()[offset]); | |
| 1061 | 1063 | |
| 1062 | 1064 | switch (offset) |
| 1063 | 1065 | { |
| r14896 | r14897 | |
| 1092 | 1094 | case NREG_INTCLR+1: /* Interrupt clear */ |
| 1093 | 1095 | if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", cpu_get_pc(&space->device()), offset*4, data, mem_mask); |
| 1094 | 1096 | logit = 0; |
| 1095 | state->m_nile_irq_state &= ~(state->m_nile_regs[offset] & ~0xf00); | |
| 1097 | state->m_nile_irq_state &= ~(state->m_nile_regs.target()[offset] & ~0xf00); | |
| 1096 | 1098 | update_nile_irqs(space->machine()); |
| 1097 | 1099 | break; |
| 1098 | 1100 | |
| r14896 | r14897 | |
| 1113 | 1115 | break; |
| 1114 | 1116 | |
| 1115 | 1117 | case NREG_PCIINIT1+0: /* PCI master */ |
| 1116 | if (((olddata & 0xe) == 0xa) != ((state->m_nile_regs[offset] & 0xe) == 0xa)) | |
| 1118 | if (((olddata & 0xe) == 0xa) != ((state->m_nile_regs.target()[offset] & 0xe) == 0xa)) | |
| 1117 | 1119 | remap_dynamic_addresses(space->machine()); |
| 1118 | 1120 | logit = 0; |
| 1119 | 1121 | break; |
| r14896 | r14897 | |
| 1127 | 1129 | logit = 0; |
| 1128 | 1130 | |
| 1129 | 1131 | /* timer just enabled? */ |
| 1130 | if (!(olddata & 1) && (state->m_nile_regs[offset] & 1)) | |
| 1132 | if (!(olddata & 1) && (state->m_nile_regs.target()[offset] & 1)) | |
| 1131 | 1133 | { |
| 1132 | UINT32 scale = state->m_nile_regs[offset + 1]; | |
| 1133 | if (state->m_nile_regs[offset] & 2) | |
| 1134 | UINT32 scale = state->m_nile_regs.target()[offset + 1]; | |
| 1135 | if (state->m_nile_regs.target()[offset] & 2) | |
| 1134 | 1136 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1135 | 1137 | if (scale != 0) |
| 1136 | 1138 | state->m_timer[which]->adjust(TIMER_PERIOD * scale, which); |
| 1137 | if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (state->m_nile_regs[offset + 1] + 1)).attoseconds)); | |
| 1139 | if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (state->m_nile_regs.target()[offset + 1] + 1)).attoseconds)); | |
| 1138 | 1140 | } |
| 1139 | 1141 | |
| 1140 | 1142 | /* timer disabled? */ |
| 1141 | else if ((olddata & 1) && !(state->m_nile_regs[offset] & 1)) | |
| 1143 | else if ((olddata & 1) && !(state->m_nile_regs.target()[offset] & 1)) | |
| 1142 | 1144 | { |
| 1143 | if (state->m_nile_regs[offset] & 2) | |
| 1145 | if (state->m_nile_regs.target()[offset] & 2) | |
| 1144 | 1146 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1145 | state->m_nile_regs[offset + 1] = state->m_timer[which]->remaining().as_double() * SYSTEM_CLOCK; | |
| 1147 | state->m_nile_regs.target()[offset + 1] = state->m_timer[which]->remaining().as_double() * SYSTEM_CLOCK; | |
| 1146 | 1148 | state->m_timer[which]->adjust(attotime::never, which); |
| 1147 | 1149 | } |
| 1148 | 1150 | break; |
| r14896 | r14897 | |
| 1155 | 1157 | if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", cpu_get_pc(&space->device()), which, offset*4, data, mem_mask); |
| 1156 | 1158 | logit = 0; |
| 1157 | 1159 | |
| 1158 | if (state->m_nile_regs[offset - 1] & 1) | |
| 1160 | if (state->m_nile_regs.target()[offset - 1] & 1) | |
| 1159 | 1161 | { |
| 1160 | if (state->m_nile_regs[offset - 1] & 2) | |
| 1162 | if (state->m_nile_regs.target()[offset - 1] & 2) | |
| 1161 | 1163 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1162 | state->m_timer[which]->adjust(TIMER_PERIOD * state->m_nile_regs[offset], which); | |
| 1164 | state->m_timer[which]->adjust(TIMER_PERIOD * state->m_nile_regs.target()[offset], which); | |
| 1163 | 1165 | } |
| 1164 | 1166 | break; |
| 1165 | 1167 | |
| r14896 | r14897 | |
| 1558 | 1560 | state->m_dynamic_count = 0; |
| 1559 | 1561 | |
| 1560 | 1562 | /* DCS2 */ |
| 1561 | base = state->m_nile_regs[NREG_DCS2] & 0x1fffff00; | |
| 1562 | if (base >= state->m_ramsize) | |
| 1563 | base = state->m_nile_regs.target()[NREG_DCS2] & 0x1fffff00; | |
| 1564 | if (base >= state->m_rambase.bytes()) | |
| 1563 | 1565 | { |
| 1564 | 1566 | add_dynamic_address(state, base + 0x0000, base + 0x0003, sio_irq_clear_r, sio_irq_clear_w); |
| 1565 | 1567 | add_dynamic_address(state, base + 0x1000, base + 0x1003, sio_irq_enable_r, sio_irq_enable_w); |
| r14896 | r14897 | |
| 1572 | 1574 | } |
| 1573 | 1575 | |
| 1574 | 1576 | /* DCS3 */ |
| 1575 | base = state->m_nile_regs[NREG_DCS3] & 0x1fffff00; | |
| 1576 | if (base >= state->m_ramsize) | |
| 1577 | base = state->m_nile_regs.target()[NREG_DCS3] & 0x1fffff00; | |
| 1578 | if (base >= state->m_rambase.bytes()) | |
| 1577 | 1579 | add_dynamic_address(state, base + 0x0000, base + 0x0003, analog_port_r, analog_port_w); |
| 1578 | 1580 | |
| 1579 | 1581 | /* DCS4 */ |
| 1580 | base = state->m_nile_regs[NREG_DCS4] & 0x1fffff00; | |
| 1581 | if (base >= state->m_ramsize) | |
| 1582 | base = state->m_nile_regs.target()[NREG_DCS4] & 0x1fffff00; | |
| 1583 | if (base >= state->m_rambase.bytes()) | |
| 1582 | 1584 | add_dynamic_address(state, base + 0x0000, base + 0x7fff, timekeeper_r, timekeeper_w); |
| 1583 | 1585 | |
| 1584 | 1586 | /* DCS5 */ |
| 1585 | base = state->m_nile_regs[NREG_DCS5] & 0x1fffff00; | |
| 1586 | if (base >= state->m_ramsize) | |
| 1587 | base = state->m_nile_regs.target()[NREG_DCS5] & 0x1fffff00; | |
| 1588 | if (base >= state->m_rambase.bytes()) | |
| 1587 | 1589 | add_dynamic_address(state, base + 0x0000, base + 0x0003, sio_r, sio_w); |
| 1588 | 1590 | |
| 1589 | 1591 | /* DCS6 */ |
| 1590 | base = state->m_nile_regs[NREG_DCS6] & 0x1fffff00; | |
| 1591 | if (base >= state->m_ramsize) | |
| 1592 | base = state->m_nile_regs.target()[NREG_DCS6] & 0x1fffff00; | |
| 1593 | if (base >= state->m_rambase.bytes()) | |
| 1592 | 1594 | { |
| 1593 | 1595 | add_dynamic_address(state, base + 0x0000, base + 0x003f, midway_ioasic_packed_r, midway_ioasic_packed_w); |
| 1594 | 1596 | add_dynamic_address(state, base + 0x1000, base + 0x1003, NULL, asic_fifo_w); |
| r14896 | r14897 | |
| 1602 | 1604 | } |
| 1603 | 1605 | |
| 1604 | 1606 | /* DCS7 */ |
| 1605 | base = state->m_nile_regs[NREG_DCS7] & 0x1fffff00; | |
| 1606 | if (base >= state->m_ramsize) | |
| 1607 | base = state->m_nile_regs.target()[NREG_DCS7] & 0x1fffff00; | |
| 1608 | if (base >= state->m_rambase.bytes()) | |
| 1607 | 1609 | { |
| 1608 | 1610 | add_dynamic_device_address(state, ethernet, base + 0x1000, base + 0x100f, ethernet_r, ethernet_w); |
| 1609 | 1611 | if (state->m_dcs_idma_cs == 7) |
| r14896 | r14897 | |
| 1614 | 1616 | } |
| 1615 | 1617 | |
| 1616 | 1618 | /* PCI config space */ |
| 1617 | if ((state->m_nile_regs[NREG_PCIINIT1] & 0xe) == 0xa) | |
| 1619 | if ((state->m_nile_regs.target()[NREG_PCIINIT1] & 0xe) == 0xa) | |
| 1618 | 1620 | { |
| 1619 | base = state->m_nile_regs[NREG_PCIW1] & 0x1fffff00; | |
| 1620 | if (base >= state->m_ramsize) | |
| 1621 | base = state->m_nile_regs.target()[NREG_PCIW1] & 0x1fffff00; | |
| 1622 | if (base >= state->m_rambase.bytes()) | |
| 1621 | 1623 | { |
| 1622 | 1624 | add_dynamic_address(state, base + (1 << (21 + 4)) + 0x0000, base + (1 << (21 + 4)) + 0x00ff, pci_3dfx_r, pci_3dfx_w); |
| 1623 | 1625 | add_dynamic_address(state, base + (1 << (21 + 5)) + 0x0000, base + (1 << (21 + 5)) + 0x00ff, pci_ide_r, pci_ide_w); |
| r14896 | r14897 | |
| 1629 | 1631 | { |
| 1630 | 1632 | /* IDE controller */ |
| 1631 | 1633 | base = state->m_pci_ide_regs[0x04] & 0xfffffff0; |
| 1632 | if (base >= state->m_rams | |
| 1634 | if (base >= state->m_rambas | |
| 1633 | 1635 | add_dynamic_device_address(state, ide, base + 0x0000, base + 0x000f, ide_main_r, ide_main_w); |
| 1634 | 1636 | |
| 1635 | 1637 | base = state->m_pci_ide_regs[0x05] & 0xfffffffc; |
| 1636 | if (base >= state->m_rams | |
| 1638 | if (base >= state->m_rambas | |
| 1637 | 1639 | add_dynamic_device_address(state, ide, base + 0x0000, base + 0x0003, ide_alt_r, ide_alt_w); |
| 1638 | 1640 | |
| 1639 | 1641 | base = state->m_pci_ide_regs[0x08] & 0xfffffff0; |
| 1640 | if (base >= state->m_rams | |
| 1642 | if (base >= state->m_rambas | |
| 1641 | 1643 | add_dynamic_device_address(state, ide, base + 0x0000, base + 0x0007, ide_bus_master32_r, ide_bus_master32_w); |
| 1642 | 1644 | |
| 1643 | 1645 | /* 3dfx card */ |
| 1644 | 1646 | base = state->m_pci_3dfx_regs[0x04] & 0xfffffff0; |
| 1645 | if (base >= state->m_rams | |
| 1647 | if (base >= state->m_rambas | |
| 1646 | 1648 | { |
| 1647 | 1649 | if (voodoo_type == VOODOO_2) |
| 1648 | 1650 | add_dynamic_device_address(state, state->m_voodoo, base + 0x000000, base + 0xffffff, voodoo_r, voodoo_w); |
| r14896 | r14897 | |
| 1653 | 1655 | if (voodoo_type >= VOODOO_BANSHEE) |
| 1654 | 1656 | { |
| 1655 | 1657 | base = state->m_pci_3dfx_regs[0x05] & 0xfffffff0; |
| 1656 | if (base >= state->m_rams | |
| 1658 | if (base >= state->m_rambas | |
| 1657 | 1659 | add_dynamic_device_address(state, state->m_voodoo, base + 0x0000000, base + 0x1ffffff, banshee_fb_r, banshee_fb_w); |
| 1658 | 1660 | |
| 1659 | 1661 | base = state->m_pci_3dfx_regs[0x06] & 0xfffffff0; |
| 1660 | if (base >= state->m_rams | |
| 1662 | if (base >= state->m_rambas | |
| 1661 | 1663 | add_dynamic_device_address(state, state->m_voodoo, base + 0x0000000, base + 0x00000ff, banshee_io_r, banshee_io_w); |
| 1662 | 1664 | |
| 1663 | 1665 | base = state->m_pci_3dfx_regs[0x0c] & 0xffff0000; |
| 1664 | if (base >= state->m_rams | |
| 1666 | if (base >= state->m_rambas | |
| 1665 | 1667 | add_dynamic_device_address(state, state->m_voodoo, base + 0x0000000, base + 0x000ffff, banshee_rom_r, NULL); |
| 1666 | 1668 | } |
| 1667 | 1669 | } |
| r14896 | r14897 | |
| 1702 | 1704 | |
| 1703 | 1705 | static ADDRESS_MAP_START( vegas_map_8mb, AS_PROGRAM, 32, vegas_state ) |
| 1704 | 1706 | ADDRESS_MAP_UNMAP_HIGH |
| 1705 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(m_rambase) AM_SIZE(m_ramsize) | |
| 1706 | AM_RANGE(0x1fa00000, 0x1fa00fff) AM_READWRITE_LEGACY(nile_r, nile_w) AM_BASE(m_nile_regs) | |
| 1707 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_BASE(m_rombase) | |
| 1707 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_SHARE("rambase") | |
| 1708 | AM_RANGE(0x1fa00000, 0x1fa00fff) AM_READWRITE_LEGACY(nile_r, nile_w) AM_SHARE("nile_regs") | |
| 1709 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rombase") | |
| 1708 | 1710 | ADDRESS_MAP_END |
| 1709 | 1711 | |
| 1710 | 1712 | |
| 1711 | 1713 | static ADDRESS_MAP_START( vegas_map_32mb, AS_PROGRAM, 32, vegas_state ) |
| 1712 | 1714 | ADDRESS_MAP_UNMAP_HIGH |
| 1713 | AM_RANGE(0x00000000, 0x01ffffff) AM_RAM AM_BASE(m_rambase) AM_SIZE(m_ramsize) | |
| 1714 | AM_RANGE(0x1fa00000, 0x1fa00fff) AM_READWRITE_LEGACY(nile_r, nile_w) AM_BASE(m_nile_regs) | |
| 1715 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_BASE(m_rombase) | |
| 1715 | AM_RANGE(0x00000000, 0x01ffffff) AM_RAM AM_SHARE("rambase") | |
| 1716 | AM_RANGE(0x1fa00000, 0x1fa00fff) AM_READWRITE_LEGACY(nile_r, nile_w) AM_SHARE("nile_regs") | |
| 1717 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rombase") | |
| 1716 | 1718 | ADDRESS_MAP_END |
| 1717 | 1719 | |
| 1718 | 1720 |
| r14896 | r14897 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | WRITE8_MEMBER(tecmo_state::tecmo_sound_command_w) |
| 66 | 66 | { |
| 67 | soundlatch_w(space, offset, data); | |
| 67 | soundlatch_byte_w(space, offset, data); | |
| 68 | 68 | cputag_set_input_line(machine(), "soundcpu",INPUT_LINE_NMI,PULSE_LINE); |
| 69 | 69 | } |
| 70 | 70 | |
| r14896 | r14897 | |
| 139 | 139 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(tecmo_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 140 | 140 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(tecmo_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 141 | 141 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 142 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_SHARE("paletteram") | |
| 142 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_be_w) AM_SHARE("paletteram") | |
| 143 | 143 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("bank1") |
| 144 | 144 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("JOY1") |
| 145 | 145 | AM_RANGE(0xf801, 0xf801) AM_READ_PORT("BUTTONS1") |
| r14896 | r14897 | |
| 166 | 166 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(tecmo_txvideoram_w) AM_BASE(m_txvideoram) |
| 167 | 167 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(tecmo_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 168 | 168 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(tecmo_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 169 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_SHARE("paletteram") | |
| 169 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_be_w) AM_SHARE("paletteram") | |
| 170 | 170 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 171 | 171 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("bank1") |
| 172 | 172 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("JOY1") |
| r14896 | r14897 | |
| 195 | 195 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(tecmo_txvideoram_w) AM_BASE(m_txvideoram) |
| 196 | 196 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 197 | 197 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 198 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_SHARE("paletteram") | |
| 198 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_be_w) AM_SHARE("paletteram") | |
| 199 | 199 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("bank1") |
| 200 | 200 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("JOY1") |
| 201 | 201 | AM_RANGE(0xf801, 0xf801) AM_READ_PORT("BUTTONS1") |
| r14896 | r14897 | |
| 221 | 221 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 222 | 222 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 223 | 223 | AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 224 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) AM_DEVWRITE_LEGACY("msm", tecmo_adpcm_start_w) | |
| 224 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) AM_DEVWRITE_LEGACY("msm", tecmo_adpcm_start_w) | |
| 225 | 225 | AM_RANGE(0xd000, 0xd000) AM_WRITE(tecmo_adpcm_end_w) |
| 226 | 226 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE_LEGACY("msm", tecmo_adpcm_vol_w) |
| 227 | 227 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* NMI acknowledge */ |
| r14896 | r14897 | |
| 233 | 233 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 234 | 234 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 235 | 235 | AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 236 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) AM_DEVWRITE_LEGACY("msm", tecmo_adpcm_start_w) | |
| 236 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) AM_DEVWRITE_LEGACY("msm", tecmo_adpcm_start_w) | |
| 237 | 237 | AM_RANGE(0xc400, 0xc400) AM_WRITE(tecmo_adpcm_end_w) |
| 238 | 238 | AM_RANGE(0xc800, 0xc800) AM_DEVWRITE_LEGACY("msm", tecmo_adpcm_vol_w) |
| 239 | 239 | AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP /* NMI acknowledge */ |
| r14896 | r14897 | |
|---|---|---|
| 132 | 132 | m_mips(*this, "mips"), |
| 133 | 133 | m_adsp(*this, "adsp"), |
| 134 | 134 | m_pci(*this, "pcibus") |
| 135 | { } | |
| 135 | , | |
| 136 | m_adsp_pram(*this, "adsp_pram"){ } | |
| 136 | 137 | |
| 137 | 138 | required_device<cpu_device> m_mips; |
| 138 | 139 | required_device<adsp2181_device> m_adsp; |
| r14896 | r14897 | |
| 150 | 151 | |
| 151 | 152 | |
| 152 | 153 | /* ADSP-2181 */ |
| 153 | UINT32 | |
| 154 | required_shared_ptr<UINT32> | |
| 154 | 155 | |
| 155 | 156 | struct |
| 156 | 157 | { |
| r14896 | r14897 | |
| 241 | 242 | word |= adsp_boot[i*3 + 1] << 8; |
| 242 | 243 | word |= adsp_boot[i*3 + 2]; |
| 243 | 244 | |
| 244 | m_adsp_pram[i] = word; | |
| 245 | m_adsp_pram.target()[i] = word; | |
| 245 | 246 | } |
| 246 | 247 | } |
| 247 | 248 | |
| r14896 | r14897 | |
| 851 | 852 | |
| 852 | 853 | static ADDRESS_MAP_START( adsp_program_map, AS_PROGRAM, 32, magictg_state ) |
| 853 | 854 | ADDRESS_MAP_UNMAP_HIGH |
| 854 | AM_RANGE(0x0000, 0x3fff) AM_RAM AM_ | |
| 855 | AM_RANGE(0x0000, 0x3fff) AM_RAM AM_ | |
| 855 | 856 | ADDRESS_MAP_END |
| 856 | 857 | |
| 857 | 858 | static ADDRESS_MAP_START( adsp_data_map, AS_DATA, 16, magictg_state ) |
| r14896 | r14897 | |
|---|---|---|
| 99 | 99 | DECLARE_WRITE32_MEMBER( bios_ext4_ram_w ); |
| 100 | 100 | |
| 101 | 101 | DECLARE_WRITE32_MEMBER( bios_ram_w ); |
| 102 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 103 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 104 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 105 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 102 | 106 | }; |
| 103 | 107 | |
| 104 | 108 | // Intel 82439TX System Controller (MXTC) |
| r14896 | r14897 | |
| 389 | 393 | ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask); |
| 390 | 394 | } |
| 391 | 395 | |
| 392 | ||
| 396 | ||
| 393 | 397 | { |
| 394 | xtom3d_state *state = space->machine().driver_data<xtom3d_state>(); | |
| 395 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 398 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 396 | 399 | |
| 397 | 400 | switch(offset % 8) { |
| 398 | 401 | case 1: |
| 399 | data = | |
| 402 | data = | |
| 400 | 403 | break; |
| 401 | 404 | case 2: |
| 402 | data = | |
| 405 | data = | |
| 403 | 406 | break; |
| 404 | 407 | case 3: |
| 405 | data = | |
| 408 | data = | |
| 406 | 409 | break; |
| 407 | 410 | case 7: |
| 408 | data = | |
| 411 | data = | |
| 409 | 412 | break; |
| 410 | 413 | } |
| 411 | 414 | return data; |
| 412 | 415 | } |
| 413 | 416 | |
| 414 | 417 | |
| 415 | ||
| 418 | ||
| 416 | 419 | { |
| 417 | xtom3d_state *state = space->machine().driver_data<xtom3d_state>(); | |
| 418 | state->m_at_pages[offset % 0x10] = data; | |
| 420 | m_at_pages[offset % 0x10] = data; | |
| 419 | 421 | |
| 420 | 422 | switch(offset % 8) { |
| 421 | 423 | case 1: |
| 422 | | |
| 424 | | |
| 423 | 425 | break; |
| 424 | 426 | case 2: |
| 425 | | |
| 427 | | |
| 426 | 428 | break; |
| 427 | 429 | case 3: |
| 428 | | |
| 430 | | |
| 429 | 431 | break; |
| 430 | 432 | case 7: |
| 431 | | |
| 433 | | |
| 432 | 434 | break; |
| 433 | 435 | } |
| 434 | 436 | } |
| 435 | 437 | |
| 436 | static READ32_HANDLER(at_page32_r) | |
| 437 | { | |
| 438 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 439 | } | |
| 440 | 438 | |
| 441 | ||
| 442 | static WRITE32_HANDLER(at_page32_w) | |
| 443 | { | |
| 444 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 445 | } | |
| 446 | ||
| 447 | 439 | static READ8_DEVICE_HANDLER(at_dma8237_2_r) |
| 448 | 440 | { |
| 449 | 441 | return i8237_r(device, offset / 2); |
| r14896 | r14897 | |
| 476 | 468 | } |
| 477 | 469 | |
| 478 | 470 | |
| 479 | ||
| 471 | ||
| 480 | 472 | { |
| 481 | xtom3d_state *state = space->machine().driver_data<xtom3d_state>(); | |
| 482 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 473 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 483 | 474 | & 0xFF0000; |
| 484 | 475 | |
| 485 | return space | |
| 476 | return space. | |
| 486 | 477 | } |
| 487 | 478 | |
| 488 | 479 | |
| 489 | ||
| 480 | ||
| 490 | 481 | { |
| 491 | xtom3d_state *state = space->machine().driver_data<xtom3d_state>(); | |
| 492 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 482 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 493 | 483 | & 0xFF0000; |
| 494 | 484 | |
| 495 | space | |
| 485 | space. | |
| 496 | 486 | } |
| 497 | 487 | |
| 498 | 488 | static void set_dma_channel(device_t *device, int channel, int state) |
| r14896 | r14897 | |
| 510 | 500 | { |
| 511 | 501 | DEVCB_LINE(pc_dma_hrq_changed), |
| 512 | 502 | DEVCB_NULL, |
| 513 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 514 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 503 | DEVCB_DRIVER_MEMBER(xtom3d_state, pc_dma_read_byte), | |
| 504 | DEVCB_DRIVER_MEMBER(xtom3d_state, pc_dma_write_byte), | |
| 515 | 505 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 516 | 506 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 517 | 507 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 548 | 538 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 549 | 539 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 550 | 540 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) /* todo: nvram (CMOS Setup Save)*/ |
| 551 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 541 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 552 | 542 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 553 | 543 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 554 | 544 | AM_RANGE(0x00e8, 0x00ef) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| 167 | ||
| 167 | ||
| 168 | 168 | { |
| 169 | device_t *pandora = | |
| 169 | device_t *pandora = | |
| 170 | 170 | |
| 171 | 171 | if (ACCESSING_BITS_8_15) |
| 172 | 172 | { |
| 173 | UINT8 *rom = | |
| 173 | UINT8 *rom = | |
| 174 | 174 | |
| 175 | 175 | memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000); |
| 176 | 176 | |
| r14896 | r14897 | |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | ||
| 182 | ||
| 183 | 183 | { |
| 184 | 184 | if (ACCESSING_BITS_8_15) |
| 185 | 185 | { |
| 186 | UINT8 *rom = | |
| 186 | UINT8 *rom = | |
| 187 | 187 | |
| 188 | 188 | memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000); |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | #ifdef UNUSED_FUNCTION |
| 193 | ||
| 193 | ||
| 194 | 194 | { |
| 195 | 195 | device_t *pandora = machine.device("pandora"); |
| 196 | 196 | |
| r14896 | r14897 | |
| 203 | 203 | } |
| 204 | 204 | #endif |
| 205 | 205 | |
| 206 | ||
| 206 | ||
| 207 | 207 | { |
| 208 | 208 | if (ACCESSING_BITS_8_15) |
| 209 | 209 | { |
| 210 | coin_counter_w(space->machine(), 0, data & 0x100); | |
| 211 | coin_counter_w(space->machine(), 1, data & 0x200); | |
| 210 | coin_counter_w(machine(), 0, data & 0x100); | |
| 211 | coin_counter_w(machine(), 1, data & 0x200); | |
| 212 | 212 | |
| 213 | coin_lockout_w(space->machine(), 0, ~data & 0x400); | |
| 214 | coin_lockout_w(space->machine(), 1, ~data & 0x800); | |
| 213 | coin_lockout_w(machine(), 0, ~data & 0x400); | |
| 214 | coin_lockout_w(machine(), 1, ~data & 0x800); | |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | ||
| 218 | ||
| 219 | 219 | { |
| 220 | 220 | int i; |
| 221 | 221 | for(i = 0; i < 8; i++) |
| 222 | 222 | { |
| 223 | 223 | // or offset + i * 0x2000 ? |
| 224 | galpanic_bgvideoram_w(space, offset * 8 + i, data, mem_mask); | |
| 224 | galpanic_bgvideoram_w(&space, offset * 8 + i, data, mem_mask); | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | static ADDRESS_MAP_START( galpanic_map, AS_PROGRAM, 16, galpanic_state ) |
| 229 | 229 | AM_RANGE(0x000000, 0x3fffff) AM_ROM |
| 230 | 230 | AM_RANGE(0x400000, 0x400001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 231 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE(m_fgvideoram | |
| 231 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE_SIZE(m_fgvideoram, | |
| 232 | 232 | AM_RANGE(0x520000, 0x53ffff) AM_RAM_WRITE_LEGACY(galpanic_bgvideoram_w) AM_BASE(m_bgvideoram) /* + work RAM */ |
| 233 | 233 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE_LEGACY(galpanic_paletteram_w) AM_SHARE("paletteram") /* 1024 colors, but only 512 seem to be used */ |
| 234 | 234 | AM_RANGE(0x700000, 0x701fff) AM_DEVREADWRITE_LEGACY("pandora", pandora_spriteram_LSB_r, pandora_spriteram_LSB_w) |
| r14896 | r14897 | |
| 236 | 236 | AM_RANGE(0x800000, 0x800001) AM_READ_PORT("DSW1") |
| 237 | 237 | AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2") |
| 238 | 238 | AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM") |
| 239 | AM_RANGE(0x900000, 0x900001) AM_WRITE_LEGACY(galpanic_6295_bankswitch_w) | |
| 240 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE_LEGACY(galpanic_coin_w) /* coin counters */ | |
| 239 | AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanic_6295_bankswitch_w) | |
| 240 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE(galpanic_coin_w) /* coin counters */ | |
| 241 | 241 | AM_RANGE(0xb00000, 0xb00001) AM_WRITENOP /* ??? */ |
| 242 | 242 | AM_RANGE(0xc00000, 0xc00001) AM_WRITENOP /* ??? */ |
| 243 | 243 | AM_RANGE(0xd00000, 0xd00001) AM_WRITENOP /* ??? */ |
| 244 | 244 | AM_RANGE(0xe00000, 0xe00015) AM_READWRITE(galpanib_calc_r,galpanib_calc_w) /* CALC1 MCU interaction (simulated) */ |
| 245 | 245 | ADDRESS_MAP_END |
| 246 | 246 | |
| 247 | ||
| 247 | ||
| 248 | 248 | { |
| 249 | return ( | |
| 249 | return ( | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /* a kludge! */ |
| r14896 | r14897 | |
| 263 | 263 | |
| 264 | 264 | static ADDRESS_MAP_START( comad_map, AS_PROGRAM, 16, galpanic_state ) |
| 265 | 265 | AM_RANGE(0x000000, 0x4fffff) AM_ROM |
| 266 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE(m_fgvideoram | |
| 266 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE_SIZE(m_fgvideoram, | |
| 267 | 267 | AM_RANGE(0x520000, 0x53ffff) AM_RAM_WRITE_LEGACY(galpanic_bgvideoram_w) AM_BASE(m_bgvideoram) /* + work RAM */ |
| 268 | 268 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE_LEGACY(galpanic_paletteram_w) AM_SHARE("paletteram") /* 1024 colors, but only 512 seem to be used */ |
| 269 | 269 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 271 | 271 | AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2") |
| 272 | 272 | AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM") |
| 273 | 273 | // AM_RANGE(0x800006, 0x800007) ?? |
| 274 | AM_RANGE(0x80000a, 0x80000b) AM_READ_LEGACY(comad_timer_r) /* bits 8-a = timer? palette update code waits for them to be 111 */ | |
| 275 | AM_RANGE(0x80000c, 0x80000d) AM_READ_LEGACY(comad_timer_r) /* missw96 bits 8-a = timer? palette update code waits for them to be 111 */ | |
| 276 | AM_RANGE(0x900000, 0x900001) AM_WRITE_LEGACY(galpanica_6295_bankswitch_w) /* not sure */ | |
| 274 | AM_RANGE(0x80000a, 0x80000b) AM_READ(comad_timer_r) /* bits 8-a = timer? palette update code waits for them to be 111 */ | |
| 275 | AM_RANGE(0x80000c, 0x80000d) AM_READ(comad_timer_r) /* missw96 bits 8-a = timer? palette update code waits for them to be 111 */ | |
| 276 | AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w) /* not sure */ | |
| 277 | 277 | AM_RANGE(0xc00000, 0xc0ffff) AM_RAM /* missw96 */ |
| 278 | 278 | AM_RANGE(0xc80000, 0xc8ffff) AM_RAM /* fantasia, newfant */ |
| 279 | 279 | AM_RANGE(0xf00000, 0xf00001) AM_DEVREAD8_LEGACY("oki", comad_okim6295_r, 0xff00) AM_DEVWRITE8("oki", okim6295_device, write, 0xff00) /* fantasia, missw96 */ |
| r14896 | r14897 | |
| 282 | 282 | |
| 283 | 283 | static ADDRESS_MAP_START( fantsia2_map, AS_PROGRAM, 16, galpanic_state ) |
| 284 | 284 | AM_RANGE(0x000000, 0x4fffff) AM_ROM |
| 285 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE(m_fgvideoram | |
| 285 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE_SIZE(m_fgvideoram, | |
| 286 | 286 | AM_RANGE(0x520000, 0x53ffff) AM_RAM_WRITE_LEGACY(galpanic_bgvideoram_w) AM_BASE(m_bgvideoram) /* + work RAM */ |
| 287 | 287 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE_LEGACY(galpanic_paletteram_w) AM_SHARE("paletteram") /* 1024 colors, but only 512 seem to be used */ |
| 288 | 288 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 290 | 290 | AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2") |
| 291 | 291 | AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM") |
| 292 | 292 | // AM_RANGE(0x800006, 0x800007) ?? |
| 293 | AM_RANGE(0x800008, 0x800009) AM_READ_LEGACY(comad_timer_r) /* bits 8-a = timer? palette update code waits for them to be 111 */ | |
| 294 | AM_RANGE(0x900000, 0x900001) AM_WRITE_LEGACY(galpanica_6295_bankswitch_w) /* not sure */ | |
| 293 | AM_RANGE(0x800008, 0x800009) AM_READ(comad_timer_r) /* bits 8-a = timer? palette update code waits for them to be 111 */ | |
| 294 | AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w) /* not sure */ | |
| 295 | 295 | AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP /* coin counters, + ? */ |
| 296 | 296 | AM_RANGE(0xc80000, 0xc80001) AM_DEVREAD8_LEGACY("oki", comad_okim6295_r, 0xff00) AM_DEVWRITE8("oki", okim6295_device, write, 0xff00) |
| 297 | 297 | AM_RANGE(0xf80000, 0xf8ffff) AM_RAM |
| r14896 | r14897 | |
| 300 | 300 | |
| 301 | 301 | static ADDRESS_MAP_START( galhustl_map, AS_PROGRAM, 16, galpanic_state ) |
| 302 | 302 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 303 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE(m_fgvideoram | |
| 303 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE_SIZE(m_fgvideoram, | |
| 304 | 304 | AM_RANGE(0x520000, 0x53ffff) AM_WRITE_LEGACY(galpanic_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 305 | AM_RANGE(0x580000, 0x583fff) AM_RAM_WRITE | |
| 305 | AM_RANGE(0x580000, 0x583fff) AM_RAM_WRITE | |
| 306 | 306 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE_LEGACY(galpanic_paletteram_w) AM_SHARE("paletteram") /* 1024 colors, but only 512 seem to be used */ |
| 307 | 307 | AM_RANGE(0x600800, 0x600fff) AM_RAM // writes only 1? |
| 308 | 308 | AM_RANGE(0x680000, 0x68001f) AM_RAM // regs? |
| r14896 | r14897 | |
| 311 | 311 | AM_RANGE(0x800000, 0x800001) AM_READ_PORT("DSW1") |
| 312 | 312 | AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2") |
| 313 | 313 | AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM") |
| 314 | AM_RANGE(0x900000, 0x900001) AM_WRITE | |
| 314 | AM_RANGE(0x900000, 0x900001) AM_WRITE | |
| 315 | 315 | AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP // ? |
| 316 | 316 | AM_RANGE(0xd00000, 0xd00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00) |
| 317 | 317 | AM_RANGE(0xe80000, 0xe8ffff) AM_RAM |
| 318 | 318 | ADDRESS_MAP_END |
| 319 | 319 | |
| 320 | 320 | #ifdef UNUSED_FUNCTION |
| 321 | READ16_ | |
| 321 | READ16_M | |
| 322 | 322 | { |
| 323 | return | |
| 323 | return | |
| 324 | 324 | } |
| 325 | 325 | #endif |
| 326 | 326 | |
| 327 | 327 | static ADDRESS_MAP_START( zipzap_map, AS_PROGRAM, 16, galpanic_state ) |
| 328 | 328 | AM_RANGE(0x000000, 0x4fffff) AM_ROM |
| 329 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE(m_fgvideoram | |
| 329 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE_SIZE(m_fgvideoram, | |
| 330 | 330 | AM_RANGE(0x520000, 0x53ffff) AM_RAM_WRITE_LEGACY(galpanic_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 331 | AM_RANGE(0x580000, 0x583fff) AM_RAM_WRITE | |
| 331 | AM_RANGE(0x580000, 0x583fff) AM_RAM_WRITE | |
| 332 | 332 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE_LEGACY(galpanic_paletteram_w) AM_SHARE("paletteram") /* 1024 colors, but only 512 seem to be used */ |
| 333 | 333 | AM_RANGE(0x680000, 0x68001f) AM_RAM |
| 334 | 334 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 338 | 338 | AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2") |
| 339 | 339 | AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM") |
| 340 | 340 | |
| 341 | AM_RANGE(0x900000, 0x900001) AM_WRITE | |
| 341 | AM_RANGE(0x900000, 0x900001) AM_WRITE | |
| 342 | 342 | |
| 343 | 343 | AM_RANGE(0xc00000, 0xc00001) AM_DEVREAD8_LEGACY("oki", comad_okim6295_r, 0xff00) AM_DEVWRITE8("oki", okim6295_device, write, 0xff00) /* fantasia, missw96 */ |
| 344 | 344 | |
| r14896 | r14897 | |
| 347 | 347 | |
| 348 | 348 | static ADDRESS_MAP_START( supmodel_map, AS_PROGRAM, 16, galpanic_state ) |
| 349 | 349 | AM_RANGE(0x000000, 0x4fffff) AM_ROM |
| 350 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE(m_fgvideoram | |
| 350 | AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_BASE_SIZE(m_fgvideoram, | |
| 351 | 351 | AM_RANGE(0x520000, 0x53ffff) AM_RAM_WRITE_LEGACY(galpanic_bgvideoram_w) AM_BASE(m_bgvideoram) |
| 352 | // AM_RANGE(0x580000, 0x583fff) AM_RAM_WRITE | |
| 352 | // AM_RANGE(0x580000, 0x583fff) AM_RAM_WRITE | |
| 353 | 353 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE_LEGACY(galpanic_paletteram_w) AM_SHARE("paletteram") /* 1024 colors, but only 512 seem to be used */ |
| 354 | 354 | AM_RANGE(0x680000, 0x68001f) AM_RAM |
| 355 | 355 | AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 357 | 357 | AM_RANGE(0x800000, 0x800001) AM_READ_PORT("DSW1") |
| 358 | 358 | AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2") |
| 359 | 359 | AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM") |
| 360 | AM_RANGE(0x800006, 0x800007) AM_READ_LEGACY(comad_timer_r) | |
| 361 | AM_RANGE(0x800008, 0x800009) AM_READ_LEGACY(comad_timer_r) | |
| 362 | AM_RANGE(0x900000, 0x900001) AM_WRITE_LEGACY(galpanica_6295_bankswitch_w) /* not sure */ | |
| 360 | AM_RANGE(0x800006, 0x800007) AM_READ(comad_timer_r) | |
| 361 | AM_RANGE(0x800008, 0x800009) AM_READ(comad_timer_r) | |
| 362 | AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w) /* not sure */ | |
| 363 | 363 | AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP |
| 364 | 364 | AM_RANGE(0xc80000, 0xc8ffff) AM_RAM |
| 365 | 365 | AM_RANGE(0xd80000, 0xd80001) AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | m_nmi_enable = data & 0x01; |
| 46 | 46 | m_irq_enable = data & 0x02; |
| 47 | 47 | |
| 48 | flip_screen_set( | |
| 48 | flip_screen_set( | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | WRITE8_MEMBER(finalizr_state::finalizr_i8039_irq_w) |
| r14896 | r14897 | |
| 109 | 109 | AM_RANGE(0x081a, 0x081a) AM_DEVWRITE_LEGACY("snsnd", sn76496_w) /* This address triggers the SN chip to read the data port. */ |
| 110 | 110 | AM_RANGE(0x081b, 0x081b) AM_WRITENOP /* Loads the snd command into the snd latch */ |
| 111 | 111 | AM_RANGE(0x081c, 0x081c) AM_WRITE(finalizr_i8039_irq_w) /* custom sound chip */ |
| 112 | AM_RANGE(0x081d, 0x081d) AM_WRITE(soundlatch_w) /* custom sound chip */ | |
| 112 | AM_RANGE(0x081d, 0x081d) AM_WRITE(soundlatch_byte_w) /* custom sound chip */ | |
| 113 | 113 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_BASE(m_colorram) |
| 114 | 114 | AM_RANGE(0x2400, 0x27ff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 115 | 115 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_BASE(m_colorram2) |
| r14896 | r14897 | |
| 126 | 126 | ADDRESS_MAP_END |
| 127 | 127 | |
| 128 | 128 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, finalizr_state ) |
| 129 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch_r) | |
| 129 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch_byte_r) | |
| 130 | 130 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 131 | 131 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_w) |
| 132 | 132 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITE(i8039_T0_w) |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | * |
| 46 | 46 | *************************************/ |
| 47 | 47 | |
| 48 | ||
| 48 | ||
| 49 | 49 | { |
| 50 | return atarivc_r(* | |
| 50 | return atarivc_r(* | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| 54 | ||
| 54 | ||
| 55 | 55 | { |
| 56 | atarivc_w(* | |
| 56 | atarivc_w(* | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| r14896 | r14897 | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | ||
| 83 | ||
| 84 | 84 | { |
| 85 | 85 | } |
| 86 | 86 | |
| r14896 | r14897 | |
| 92 | 92 | * |
| 93 | 93 | *************************************/ |
| 94 | 94 | |
| 95 | ||
| 95 | ||
| 96 | 96 | { |
| 97 | shuuz_state *state = space->machine().driver_data<shuuz_state>(); | |
| 98 | 97 | /* trackball -- rotated 45 degrees? */ |
| 99 | 98 | int which = offset & 1; |
| 100 | 99 | |
| 101 | 100 | /* when reading the even ports, do a real analog port update */ |
| 102 | 101 | if (which == 0) |
| 103 | 102 | { |
| 104 | int dx = (INT8)input_port_read(space->machine(), "TRACKX"); | |
| 105 | int dy = (INT8)input_port_read(space->machine(), "TRACKY"); | |
| 103 | int dx = (INT8)input_port_read(machine(), "TRACKX"); | |
| 104 | int dy = (INT8)input_port_read(machine(), "TRACKY"); | |
| 106 | 105 | |
| 107 | state->m_cur[0] = dx + dy; | |
| 108 | state->m_cur[1] = dx - dy; | |
| 106 | m_cur[0] = dx + dy; | |
| 107 | m_cur[1] = dx - dy; | |
| 109 | 108 | } |
| 110 | 109 | |
| 111 | 110 | /* clip the result to -0x3f to +0x3f to remove directional ambiguities */ |
| 112 | return | |
| 111 | return | |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | 114 | |
| r14896 | r14897 | |
| 120 | 119 | * |
| 121 | 120 | *************************************/ |
| 122 | 121 | |
| 123 | ||
| 122 | ||
| 124 | 123 | { |
| 125 | int result = input_port_read( | |
| 124 | int result = input_port_read( | |
| 126 | 125 | |
| 127 | if ((result & 0x0800) && atarigen_get_hblank(* | |
| 126 | if ((result & 0x0800) && atarigen_get_hblank(* | |
| 128 | 127 | result &= ~0x0800; |
| 129 | 128 | |
| 130 | 129 | return result; |
| r14896 | r14897 | |
| 143 | 142 | AM_RANGE(0x100000, 0x100fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 144 | 143 | AM_RANGE(0x101000, 0x101fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 145 | 144 | AM_RANGE(0x102000, 0x102001) AM_WRITE(watchdog_reset16_w) |
| 146 | AM_RANGE(0x103000, 0x103003) AM_READ_LEGACY(leta_r) | |
| 147 | AM_RANGE(0x105000, 0x105001) AM_READWRITE_LEGACY(special_port0_r, latch_w) | |
| 145 | AM_RANGE(0x103000, 0x103003) AM_READ(leta_r) | |
| 146 | AM_RANGE(0x105000, 0x105001) AM_READWRITE(special_port0_r, latch_w) | |
| 148 | 147 | AM_RANGE(0x105002, 0x105003) AM_READ_PORT("BUTTONS") |
| 149 | 148 | AM_RANGE(0x106000, 0x106001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 150 | 149 | AM_RANGE(0x107000, 0x107007) AM_NOP |
| 151 | 150 | AM_RANGE(0x3e0000, 0x3e087f) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 152 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 151 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 153 | 152 | AM_RANGE(0x3f4000, 0x3f5eff) AM_RAM_WRITE_LEGACY(atarigen_playfield_latched_msb_w) AM_BASE(m_playfield) |
| 154 | 153 | AM_RANGE(0x3f5f00, 0x3f5f7f) AM_RAM AM_BASE(m_atarivc_eof_data) |
| 155 | 154 | AM_RANGE(0x3f5f80, 0x3f5fff) AM_READWRITE_LEGACY(atarimo_0_slipram_r, atarimo_0_slipram_w) |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | WRITE8_MEMBER(speedspn_state::speedspn_sound_w) |
| 94 | 94 | { |
| 95 | soundlatch_w(space, 1, data); | |
| 95 | soundlatch_byte_w(space, 1, data); | |
| 96 | 96 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 97 | 97 | } |
| 98 | 98 | |
| r14896 | r14897 | |
| 107 | 107 | |
| 108 | 108 | static ADDRESS_MAP_START( speedspn_map, AS_PROGRAM, 8, speedspn_state ) |
| 109 | 109 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 110 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_SHARE("paletteram") /* RAM COLOUR */ | |
| 110 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_le_w) AM_SHARE("paletteram") /* RAM COLOUR */ | |
| 111 | 111 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(speedspn_attram_w) AM_BASE(m_attram) |
| 112 | 112 | AM_RANGE(0x9000, 0x9fff) AM_READWRITE(speedspn_vidram_r,speedspn_vidram_w) /* RAM FIX / RAM OBJECTS (selected by bit 0 of port 17) */ |
| 113 | 113 | AM_RANGE(0xa000, 0xa7ff) AM_RAM |
| r14896 | r14897 | |
| 135 | 135 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 136 | 136 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("oki", oki_banking_w) |
| 137 | 137 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 138 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 138 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 139 | 139 | ADDRESS_MAP_END |
| 140 | 140 | |
| 141 | 141 |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | public: |
| 62 | 62 | enigma2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 63 | : driver_device(mconfig, type, tag) { } | |
| 63 | : driver_device(mconfig, type, tag) , | |
| 64 | m_videoram(*this, "videoram"){ } | |
| 64 | 65 | |
| 65 | 66 | /* memory pointers */ |
| 66 | UINT8 | |
| 67 | required_shared_ptr<UINT8> | |
| 67 | 68 | |
| 68 | 69 | /* misc */ |
| 69 | 70 | int m_blink_count; |
| r14896 | r14897 | |
| 231 | 232 | offs_t color_map_address = (y >> 3 << 5) | (x >> 3); |
| 232 | 233 | /* the schematics shows it like this, but it doesn't work as this would |
| 233 | 234 | produce no stars, due to the contents of the PROM -- maybe there is |
| 234 | a star disabled bit somewhere that's connected here instead of flip_screen | |
| 235 | a star disabled bit somewhere that's connected here instead of flip_screen | |
| 235 | 236 | /* star_map_address = (y >> 4 << 6) | (engima2_flip_screen_get() << 5) | (x >> 3); */ |
| 236 | 237 | offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3); |
| 237 | 238 | |
| r14896 | r14897 | |
| 241 | 242 | and the adder at 16A is activated */ |
| 242 | 243 | if (state->m_flip_screen) videoram_address = (~videoram_address + 0x0400) & 0x1fff; |
| 243 | 244 | |
| 244 | video_data = state->m_videoram[videoram_address]; | |
| 245 | video_data = state->m_videoram.target()[videoram_address]; | |
| 245 | 246 | |
| 246 | 247 | fore_color = color_map_base[color_map_address] & 0x07; |
| 247 | 248 | star_color = star_map_base[star_map_address] & 0x07; |
| r14896 | r14897 | |
| 312 | 313 | and the adder at 16A is activated */ |
| 313 | 314 | if (state->m_flip_screen) videoram_address = (~videoram_address + 0x0400) & 0x1fff; |
| 314 | 315 | |
| 315 | video_data = state->m_videoram[videoram_address]; | |
| 316 | video_data = state->m_videoram.target()[videoram_address]; | |
| 316 | 317 | } |
| 317 | 318 | |
| 318 | 319 | /* plot the current pixel */ |
| r14896 | r14897 | |
| 447 | 448 | static ADDRESS_MAP_START( engima2_main_cpu_map, AS_PROGRAM, 8, enigma2_state ) |
| 448 | 449 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 449 | 450 | AM_RANGE(0x0000, 0x1fff) AM_ROM AM_WRITENOP |
| 450 | AM_RANGE(0x2000, 0x3fff) AM_MIRROR(0x4000) AM_RAM AM_ | |
| 451 | AM_RANGE(0x2000, 0x3fff) AM_MIRROR(0x4000) AM_RAM AM_ | |
| 451 | 452 | AM_RANGE(0x4000, 0x4fff) AM_ROM AM_WRITENOP |
| 452 | 453 | AM_RANGE(0x5000, 0x57ff) AM_READ(dip_switch_r) AM_WRITENOP |
| 453 | 454 | AM_RANGE(0x5800, 0x5800) AM_MIRROR(0x07f8) AM_NOP |
| r14896 | r14897 | |
| 462 | 463 | |
| 463 | 464 | static ADDRESS_MAP_START( engima2a_main_cpu_map, AS_PROGRAM, 8, enigma2_state ) |
| 464 | 465 | AM_RANGE(0x0000, 0x1fff) AM_ROM AM_WRITENOP |
| 465 | AM_RANGE(0x2000, 0x3fff) AM_MIRROR(0x4000) AM_RAM AM_ | |
| 466 | AM_RANGE(0x2000, 0x3fff) AM_MIRROR(0x4000) AM_RAM AM_ | |
| 466 | 467 | AM_RANGE(0x4000, 0x4fff) AM_ROM AM_WRITENOP |
| 467 | 468 | AM_RANGE(0x5000, 0x57ff) AM_READ(dip_switch_r) AM_WRITENOP |
| 468 | 469 | AM_RANGE(0x5800, 0x5fff) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 76 | 76 | public: |
| 77 | 77 | igspoker_state(const machine_config &mconfig, device_type type, const char *tag) |
| 78 | 78 | : driver_device(mconfig, type, tag), |
| 79 | m_maincpu(*this, "maincpu") | |
| 80 | { } | |
| 79 | m_maincpu(*this, "maincpu"), | |
| 80 | m_bg_tile_ram(*this, "bg_tile_ram"), | |
| 81 | m_fg_tile_ram(*this, "fg_tile_ram"), | |
| 82 | m_fg_color_ram(*this, "fg_color_ram"){ } | |
| 81 | 83 | |
| 84 | required_device<cpu_device> m_maincpu; | |
| 85 | required_shared_ptr<UINT8> m_bg_tile_ram; | |
| 86 | required_shared_ptr<UINT8> m_fg_tile_ram; | |
| 87 | required_shared_ptr<UINT8> m_fg_color_ram; | |
| 82 | 88 | int m_nmi_enable; |
| 83 | 89 | int m_bg_enable; |
| 84 | 90 | int m_hopper; |
| 85 | UINT8 *m_fg_tile_ram; | |
| 86 | UINT8 *m_fg_color_ram; | |
| 87 | UINT8 *m_bg_tile_ram; | |
| 88 | 91 | tilemap_t *m_fg_tilemap; |
| 89 | 92 | tilemap_t *m_bg_tilemap; |
| 90 | 93 | UINT8 m_out[3]; |
| 91 | 94 | size_t m_protection_res; |
| 92 | 95 | |
| 93 | required_device<cpu_device> m_maincpu; | |
| 94 | 96 | DECLARE_READ8_MEMBER(igs_irqack_r); |
| 95 | 97 | DECLARE_WRITE8_MEMBER(igs_irqack_w); |
| 96 | 98 | DECLARE_WRITE8_MEMBER(bg_tile_w); |
| r14896 | r14897 | |
| 146 | 148 | static TILE_GET_INFO( get_bg_tile_info ) |
| 147 | 149 | { |
| 148 | 150 | igspoker_state *state = machine.driver_data<igspoker_state>(); |
| 149 | int code = state->m_bg_tile_ram[tile_index]; | |
| 151 | int code = state->m_bg_tile_ram.target()[tile_index]; | |
| 150 | 152 | SET_TILE_INFO(1 + (tile_index & 3), code, 0, 0); |
| 151 | 153 | } |
| 152 | 154 | |
| 153 | 155 | static TILE_GET_INFO( get_fg_tile_info ) |
| 154 | 156 | { |
| 155 | 157 | igspoker_state *state = machine.driver_data<igspoker_state>(); |
| 156 | int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8); | |
| 158 | int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8); | |
| 157 | 159 | int tile = code & 0x1fff; |
| 158 | 160 | SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0); |
| 159 | 161 | } |
| 160 | 162 | |
| 161 | 163 | WRITE8_MEMBER(igspoker_state::bg_tile_w) |
| 162 | 164 | { |
| 163 | m_bg_tile_ram[offset] = data; | |
| 165 | m_bg_tile_ram.target()[offset] = data; | |
| 164 | 166 | m_bg_tilemap->mark_tile_dirty(offset); |
| 165 | 167 | } |
| 166 | 168 | |
| 167 | 169 | WRITE8_MEMBER(igspoker_state::fg_tile_w) |
| 168 | 170 | { |
| 169 | m_fg_tile_ram[offset] = data; | |
| 171 | m_fg_tile_ram.target()[offset] = data; | |
| 170 | 172 | m_fg_tilemap->mark_tile_dirty(offset); |
| 171 | 173 | } |
| 172 | 174 | |
| 173 | 175 | WRITE8_MEMBER(igspoker_state::fg_color_w) |
| 174 | 176 | { |
| 175 | m_fg_color_ram[offset] = data; | |
| 177 | m_fg_color_ram.target()[offset] = data; | |
| 176 | 178 | m_fg_tilemap->mark_tile_dirty(offset); |
| 177 | 179 | } |
| 178 | 180 | |
| r14896 | r14897 | |
| 351 | 353 | ADDRESS_MAP_END |
| 352 | 354 | |
| 353 | 355 | static ADDRESS_MAP_START( igspoker_io_map, AS_IO, 8, igspoker_state ) |
| 354 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 355 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 356 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 357 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 356 | 358 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") /* DSW1 */ |
| 357 | 359 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") /* DSW2 */ |
| 358 | 360 | AM_RANGE(0x4002, 0x4002) AM_READ_PORT("DSW3") /* DSW3 */ |
| r14896 | r14897 | |
| 1105 | 1107 | |
| 1106 | 1108 | |
| 1107 | 1109 | static ADDRESS_MAP_START( number10_io_map, AS_IO, 8, igspoker_state ) |
| 1108 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 1109 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 1110 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 1111 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 1110 | 1112 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") /* DSW1 */ |
| 1111 | 1113 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") /* DSW2 */ |
| 1112 | 1114 | AM_RANGE(0x4002, 0x4002) AM_READ_PORT("DSW3") /* DSW3 */ |
| r14896 | r14897 | |
| 1128 | 1130 | ADDRESS_MAP_END |
| 1129 | 1131 | |
| 1130 | 1132 | static ADDRESS_MAP_START( cpokerpk_io_map, AS_IO, 8, igspoker_state ) |
| 1131 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 1132 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 1133 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 1134 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 1133 | 1135 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") /* DSW1 */ |
| 1134 | 1136 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") /* DSW2 */ |
| 1135 | 1137 | AM_RANGE(0x4002, 0x4002) AM_READ_PORT("DSW3") /* DSW3 */ |
| r14896 | r14897 | |
|---|---|---|
| 369 | 369 | { |
| 370 | 370 | segas1x_state *state = machine.driver_data<segas1x_state>(); |
| 371 | 371 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 372 | state->soundlatch_w(*space, 0, param); | |
| 372 | state->soundlatch_byte_w(*space, 0, param); | |
| 373 | 373 | device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, ASSERT_LINE); |
| 374 | 374 | } |
| 375 | 375 | |
| r14896 | r14897 | |
| 385 | 385 | segas1x_state *state = space->machine().driver_data<segas1x_state>(); |
| 386 | 386 | |
| 387 | 387 | device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 388 | return state->soundlatch_r(*space, offset); | |
| 388 | return state->soundlatch_byte_r(*space, offset); | |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | public: |
| 51 | 51 | koikoi_state(const machine_config &mconfig, device_type type, const char *tag) |
| 52 | : driver_device(mconfig, type, tag) { } | |
| 52 | : driver_device(mconfig, type, tag) , | |
| 53 | m_videoram(*this, "videoram"){ } | |
| 53 | 54 | |
| 54 | 55 | /* memory pointers */ |
| 55 | UINT8 | |
| 56 | required_shared_ptr<UINT8> | |
| 56 | 57 | |
| 57 | 58 | /* video-related */ |
| 58 | 59 | tilemap_t *m_tmap; |
| r14896 | r14897 | |
| 77 | 78 | static TILE_GET_INFO( get_tile_info ) |
| 78 | 79 | { |
| 79 | 80 | koikoi_state *state = machine.driver_data<koikoi_state>(); |
| 80 | int code = state->m_videoram[tile_index] | ((state->m_videoram[tile_index + 0x400] & 0x40) << 2); | |
| 81 | int color = (state->m_videoram[tile_index + 0x400] & 0x1f); | |
| 82 | int flip = (state->m_videoram[tile_index + 0x400] & 0x80) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0; | |
| 81 | int code = state->m_videoram.target()[tile_index] | ((state->m_videoram.target()[tile_index + 0x400] & 0x40) << 2); | |
| 82 | int color = (state->m_videoram.target()[tile_index + 0x400] & 0x1f); | |
| 83 | int flip = (state->m_videoram.target()[tile_index + 0x400] & 0x80) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0; | |
| 83 | 84 | |
| 84 | 85 | SET_TILE_INFO( 0, code, color, flip); |
| 85 | 86 | } |
| r14896 | r14897 | |
| 150 | 151 | |
| 151 | 152 | WRITE8_MEMBER(koikoi_state::vram_w) |
| 152 | 153 | { |
| 153 | m_videoram[offset] = data; | |
| 154 | m_videoram.target()[offset] = data; | |
| 154 | 155 | m_tmap->mark_tile_dirty(offset & 0x3ff); |
| 155 | 156 | } |
| 156 | 157 | |
| r14896 | r14897 | |
| 222 | 223 | static ADDRESS_MAP_START( koikoi_map, AS_PROGRAM, 8, koikoi_state ) |
| 223 | 224 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 224 | 225 | AM_RANGE(0x6000, 0x67ff) AM_RAM |
| 225 | AM_RANGE(0x7000, 0x77ff) AM_RAM_WRITE(vram_w) AM_ | |
| 226 | AM_RANGE(0x7000, 0x77ff) AM_RAM_WRITE(vram_w) AM_ | |
| 226 | 227 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW") |
| 227 | 228 | AM_RANGE(0x9000, 0x9007) AM_READWRITE(io_r, io_w) |
| 228 | 229 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 95 | 95 | { |
| 96 | 96 | public: |
| 97 | 97 | mil4000_state(const machine_config &mconfig, device_type type, const char *tag) |
| 98 | : driver_device(mconfig, type, tag) { } | |
| 98 | : driver_device(mconfig, type, tag) , | |
| 99 | m_sc0_vram(*this, "sc0_vram"), | |
| 100 | m_sc1_vram(*this, "sc1_vram"), | |
| 101 | m_sc2_vram(*this, "sc2_vram"), | |
| 102 | m_sc3_vram(*this, "sc3_vram"){ } | |
| 99 | 103 | |
| 100 | UINT16 *m_sc0_vram; | |
| 101 | UINT16 *m_sc1_vram; | |
| 102 | UINT16 *m_sc2_vram; | |
| 103 | UINT16 *m_sc3_vram; | |
| 104 | required_shared_ptr<UINT16> m_sc0_vram; | |
| 105 | required_shared_ptr<UINT16> m_sc1_vram; | |
| 106 | required_shared_ptr<UINT16> m_sc2_vram; | |
| 107 | required_shared_ptr<UINT16> m_sc3_vram; | |
| 104 | 108 | tilemap_t *m_sc0_tilemap; |
| 105 | 109 | tilemap_t *m_sc1_tilemap; |
| 106 | 110 | tilemap_t *m_sc2_tilemap; |
| r14896 | r14897 | |
| 119 | 123 | static TILE_GET_INFO( get_sc0_tile_info ) |
| 120 | 124 | { |
| 121 | 125 | mil4000_state *state = machine.driver_data<mil4000_state>(); |
| 122 | UINT32 data = (state->m_sc0_vram[tile_index*2]<<16) | state->m_sc0_vram[tile_index*2+1]; | |
| 126 | UINT32 data = (state->m_sc0_vram.target()[tile_index*2]<<16) | state->m_sc0_vram.target()[tile_index*2+1]; | |
| 123 | 127 | int tile = data >> 14; |
| 124 | int color = (state->m_sc0_vram[tile_index*2+1] & 0x1f)+0; | |
| 128 | int color = (state->m_sc0_vram.target()[tile_index*2+1] & 0x1f)+0; | |
| 125 | 129 | |
| 126 | 130 | SET_TILE_INFO( |
| 127 | 131 | 0, |
| r14896 | r14897 | |
| 133 | 137 | static TILE_GET_INFO( get_sc1_tile_info ) |
| 134 | 138 | { |
| 135 | 139 | mil4000_state *state = machine.driver_data<mil4000_state>(); |
| 136 | UINT32 data = (state->m_sc1_vram[tile_index*2]<<16) | state->m_sc1_vram[tile_index*2+1]; | |
| 140 | UINT32 data = (state->m_sc1_vram.target()[tile_index*2]<<16) | state->m_sc1_vram.target()[tile_index*2+1]; | |
| 137 | 141 | int tile = data >> 14; |
| 138 | int color = (state->m_sc1_vram[tile_index*2+1] & 0x1f)+0x10; | |
| 142 | int color = (state->m_sc1_vram.target()[tile_index*2+1] & 0x1f)+0x10; | |
| 139 | 143 | |
| 140 | 144 | SET_TILE_INFO( |
| 141 | 145 | 0, |
| r14896 | r14897 | |
| 147 | 151 | static TILE_GET_INFO( get_sc2_tile_info ) |
| 148 | 152 | { |
| 149 | 153 | mil4000_state *state = machine.driver_data<mil4000_state>(); |
| 150 | UINT32 data = (state->m_sc2_vram[tile_index*2]<<16) | state->m_sc2_vram[tile_index*2+1]; | |
| 154 | UINT32 data = (state->m_sc2_vram.target()[tile_index*2]<<16) | state->m_sc2_vram.target()[tile_index*2+1]; | |
| 151 | 155 | int tile = data >> 14; |
| 152 | int color = (state->m_sc2_vram[tile_index*2+1] & 0x1f)+0x20; | |
| 156 | int color = (state->m_sc2_vram.target()[tile_index*2+1] & 0x1f)+0x20; | |
| 153 | 157 | |
| 154 | 158 | SET_TILE_INFO( |
| 155 | 159 | 0, |
| r14896 | r14897 | |
| 161 | 165 | static TILE_GET_INFO( get_sc3_tile_info ) |
| 162 | 166 | { |
| 163 | 167 | mil4000_state *state = machine.driver_data<mil4000_state>(); |
| 164 | UINT32 data = (state->m_sc3_vram[tile_index*2]<<16) | state->m_sc3_vram[tile_index*2+1]; | |
| 168 | UINT32 data = (state->m_sc3_vram.target()[tile_index*2]<<16) | state->m_sc3_vram.target()[tile_index*2+1]; | |
| 165 | 169 | int tile = data >> 14; |
| 166 | int color = (state->m_sc3_vram[tile_index*2+1] & 0x1f)+0x30; | |
| 170 | int color = (state->m_sc3_vram.target()[tile_index*2+1] & 0x1f)+0x30; | |
| 167 | 171 | |
| 168 | 172 | SET_TILE_INFO( |
| 169 | 173 | 0, |
| r14896 | r14897 | |
| 219 | 223 | |
| 220 | 224 | WRITE16_MEMBER(mil4000_state::sc0_vram_w) |
| 221 | 225 | { |
| 222 | m_sc0_vram[offset] = data; | |
| 226 | m_sc0_vram.target()[offset] = data; | |
| 223 | 227 | m_sc0_tilemap->mark_tile_dirty(offset/2); |
| 224 | 228 | } |
| 225 | 229 | |
| 226 | 230 | WRITE16_MEMBER(mil4000_state::sc1_vram_w) |
| 227 | 231 | { |
| 228 | m_sc1_vram[offset] = data; | |
| 232 | m_sc1_vram.target()[offset] = data; | |
| 229 | 233 | m_sc1_tilemap->mark_tile_dirty(offset/2); |
| 230 | 234 | } |
| 231 | 235 | |
| 232 | 236 | WRITE16_MEMBER(mil4000_state::sc2_vram_w) |
| 233 | 237 | { |
| 234 | m_sc2_vram[offset] = data; | |
| 238 | m_sc2_vram.target()[offset] = data; | |
| 235 | 239 | m_sc2_tilemap->mark_tile_dirty(offset/2); |
| 236 | 240 | } |
| 237 | 241 | |
| 238 | 242 | WRITE16_MEMBER(mil4000_state::sc3_vram_w) |
| 239 | 243 | { |
| 240 | m_sc3_vram[offset] = data; | |
| 244 | m_sc3_vram.target()[offset] = data; | |
| 241 | 245 | m_sc3_tilemap->mark_tile_dirty(offset/2); |
| 242 | 246 | } |
| 243 | 247 | |
| r14896 | r14897 | |
| 273 | 277 | |
| 274 | 278 | static ADDRESS_MAP_START( mil4000_map, AS_PROGRAM, 16, mil4000_state ) |
| 275 | 279 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 276 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(m_sc0_vram) // CY62256L-70, U77 | |
| 277 | AM_RANGE(0x504000, 0x507fff) AM_RAM_WRITE(sc1_vram_w) AM_BASE(m_sc1_vram) // CY62256L-70, U77 | |
| 278 | AM_RANGE(0x508000, 0x50bfff) AM_RAM_WRITE(sc2_vram_w) AM_BASE(m_sc2_vram) // CY62256L-70, U78 | |
| 279 | AM_RANGE(0x50c000, 0x50ffff) AM_RAM_WRITE(sc3_vram_w) AM_BASE(m_sc3_vram) // CY62256L-70, U78 | |
| 280 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(sc0_vram_w) AM_SHARE("sc0_vram") // CY62256L-70, U77 | |
| 281 | AM_RANGE(0x504000, 0x507fff) AM_RAM_WRITE(sc1_vram_w) AM_SHARE("sc1_vram") // CY62256L-70, U77 | |
| 282 | AM_RANGE(0x508000, 0x50bfff) AM_RAM_WRITE(sc2_vram_w) AM_SHARE("sc2_vram") // CY62256L-70, U78 | |
| 283 | AM_RANGE(0x50c000, 0x50ffff) AM_RAM_WRITE(sc3_vram_w) AM_SHARE("sc3_vram") // CY62256L-70, U78 | |
| 280 | 284 | |
| 281 | 285 | AM_RANGE(0x708000, 0x708001) AM_READ_PORT("IN0") |
| 282 | 286 | AM_RANGE(0x708002, 0x708003) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 286 | 290 | AM_RANGE(0x708010, 0x708011) AM_NOP //touch screen |
| 287 | 291 | AM_RANGE(0x70801e, 0x70801f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 288 | 292 | |
| 289 | AM_RANGE(0x780000, 0x780fff) AM_RAM_WRITE(paletteram | |
| 293 | AM_RANGE(0x780000, 0x780fff) AM_RAM_WRITE(paletteram | |
| 290 | 294 | AM_RANGE(0xff0000, 0xffffff) AM_RAM AM_SHARE("nvram") // 2x CY62256L-70 (U7 & U8). |
| 291 | 295 | |
| 292 | 296 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 239 | 239 | { |
| 240 | 240 | public: |
| 241 | 241 | gticlub_state(const machine_config &mconfig, device_type type, const char *tag) |
| 242 | : driver_device(mconfig, type, tag) { } | |
| 242 | : driver_device(mconfig, type, tag) , | |
| 243 | m_work_ram(*this, "work_ram"){ } | |
| 243 | 244 | |
| 244 | UINT32 | |
| 245 | required_shared_ptr<UINT32> | |
| 245 | 246 | UINT32 *m_sharc_dataram_0; |
| 246 | 247 | UINT32 *m_sharc_dataram_1; |
| 247 | 248 | DECLARE_WRITE32_MEMBER(paletteram32_w); |
| r14896 | r14897 | |
| 410 | 411 | ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); |
| 411 | 412 | |
| 412 | 413 | /* configure fast RAM regions for DRC */ |
| 413 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_work_ram); | |
| 414 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_work_ram.target()); | |
| 414 | 415 | } |
| 415 | 416 | |
| 416 | 417 | static ADDRESS_MAP_START( gticlub_map, AS_PROGRAM, 32, gticlub_state ) |
| 417 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_ | |
| 418 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_ | |
| 418 | 419 | AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(gticlub_k001604_reg_r, gticlub_k001604_reg_w) |
| 419 | 420 | AM_RANGE(0x74010000, 0x7401ffff) AM_RAM_WRITE(paletteram32_w) AM_SHARE("paletteram") |
| 420 | 421 | AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(gticlub_k001604_tile_r, gticlub_k001604_tile_w) |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | public: |
| 54 | 54 | mazerbla_state(const machine_config &mconfig, device_type type, const char *tag) |
| 55 | : driver_device(mconfig, type, tag) { } | |
| 55 | : driver_device(mconfig, type, tag) , | |
| 56 | m_videoram(*this, "videoram"), | |
| 57 | m_cfb_ram(*this, "cfb_ram"){ } | |
| 56 | 58 | |
| 57 | 59 | /* memory pointers */ |
| 58 | UINT8 * m_cfb_ram; | |
| 59 | UINT8 * m_videoram; | |
| 60 | size_t m_videoram_size; | |
| 60 | required_shared_ptr<UINT8> m_videoram; | |
| 61 | required_shared_ptr<UINT8> m_cfb_ram; | |
| 61 | 62 | |
| 62 | 63 | /* video-related */ |
| 63 | 64 | bitmap_ind16 m_tmpbitmaps[4]; |
| r14896 | r14897 | |
| 394 | 395 | m_vcu_gfx_param_addr = offset; |
| 395 | 396 | |
| 396 | 397 | /* offset = 0 is not known */ |
| 397 | m_xpos = m_cfb_ram[m_vcu_gfx_param_addr + 1] | (m_cfb_ram[m_vcu_gfx_param_addr + 2]<<8); | |
| 398 | m_ypos = m_cfb_ram[m_vcu_gfx_param_addr + 3] | (m_cfb_ram[m_vcu_gfx_param_addr + 4]<<8); | |
| 399 | m_color1 = m_cfb_ram[m_vcu_gfx_param_addr + 5]; | |
| 400 | m_color2 = m_cfb_ram[m_vcu_gfx_param_addr + 6]; | |
| 401 | m_mode = m_cfb_ram[m_vcu_gfx_param_addr + 7]; | |
| 402 | m_pix_xsize = m_cfb_ram[m_vcu_gfx_param_addr + 8]; | |
| 403 | m_pix_ysize = m_cfb_ram[m_vcu_gfx_param_addr + 9]; | |
| 398 | m_xpos = m_cfb_ram.target()[m_vcu_gfx_param_addr + 1] | (m_cfb_ram.target()[m_vcu_gfx_param_addr + 2]<<8); | |
| 399 | m_ypos = m_cfb_ram.target()[m_vcu_gfx_param_addr + 3] | (m_cfb_ram.target()[m_vcu_gfx_param_addr + 4]<<8); | |
| 400 | m_color1 = m_cfb_ram.target()[m_vcu_gfx_param_addr + 5]; | |
| 401 | m_color2 = m_cfb_ram.target()[m_vcu_gfx_param_addr + 6]; | |
| 402 | m_mode = m_cfb_ram.target()[m_vcu_gfx_param_addr + 7]; | |
| 403 | m_pix_xsize = m_cfb_ram.target()[m_vcu_gfx_param_addr + 8]; | |
| 404 | m_pix_ysize = m_cfb_ram.target()[m_vcu_gfx_param_addr + 9]; | |
| 404 | 405 | |
| 405 | 406 | m_plane = m_mode & 3; |
| 406 | 407 | |
| r14896 | r14897 | |
| 427 | 428 | logerror("paradr="); |
| 428 | 429 | logerror("%3x ", m_vcu_gfx_param_addr ); |
| 429 | 430 | |
| 430 | logerror("%02x ", m_cfb_ram[vcu_gfx_param_addr + 0] ); | |
| 431 | logerror("%02x ", m_cfb_ram.target()[vcu_gfx_param_addr + 0] ); | |
| 431 | 432 | logerror("x=%04x ", m_xpos ); //1,2 |
| 432 | 433 | logerror("y=%04x ", m_ypos ); //3,4 |
| 433 | 434 | logerror("color1=%02x ", m_color1); //5 |
| r14896 | r14897 | |
| 570 | 571 | logerror("paladr="); |
| 571 | 572 | logerror("%3x ", m_vcu_gfx_param_addr ); |
| 572 | 573 | |
| 573 | logerror("%02x ", m_cfb_ram[m_vcu_gfx_param_addr + 0] ); | |
| 574 | logerror("%02x ", m_cfb_ram.target()[m_vcu_gfx_param_addr + 0] ); | |
| 574 | 575 | logerror("x=%04x ", m_xpos ); //1,2 |
| 575 | 576 | logerror("y=%04x ", m_ypos ); //3,4 |
| 576 | 577 | logerror("color1=%02x ", m_color1); //5 |
| r14896 | r14897 | |
| 586 | 587 | logerror("%04x: ", offset + y * 16); |
| 587 | 588 | for (x = 0; x < 16; x++) |
| 588 | 589 | { |
| 589 | logerror("%02x ", m_cfb_ram[offset + x + y * 16]); | |
| 590 | logerror("%02x ", m_cfb_ram.target()[offset + x + y * 16]); | |
| 590 | 591 | } |
| 591 | 592 | logerror("\n"); |
| 592 | 593 | } |
| r14896 | r14897 | |
| 663 | 664 | { |
| 664 | 665 | for (x = 0; x < 16; x++) |
| 665 | 666 | { |
| 666 | UINT8 colour = m_cfb_ram[offs + x + y * 16]; | |
| 667 | UINT8 colour = m_cfb_ram.target()[offs + x + y * 16]; | |
| 667 | 668 | |
| 668 | 669 | /* red component */ |
| 669 | 670 | bit1 = (colour >> 7) & 0x01; |
| r14896 | r14897 | |
| 698 | 699 | { |
| 699 | 700 | for (x = 0; x < 16; x++) |
| 700 | 701 | { |
| 701 | UINT8 dat = m_cfb_ram[offs + x + y * 16]; | |
| 702 | UINT8 dat = m_cfb_ram.target()[offs + x + y * 16]; | |
| 702 | 703 | m_lookup_ram[lookup_offs + x + y * 16] = dat; |
| 703 | 704 | } |
| 704 | 705 | } |
| r14896 | r14897 | |
| 712 | 713 | { |
| 713 | 714 | for (x = 0; x < 16; x++) |
| 714 | 715 | { |
| 715 | UINT8 dat = m_cfb_ram[offs + x + y * 16]; | |
| 716 | UINT8 dat = m_cfb_ram.target()[offs + x + y * 16]; | |
| 716 | 717 | m_lookup_ram[lookup_offs + x + y * 16] = dat; |
| 717 | 718 | } |
| 718 | 719 | } |
| r14896 | r14897 | |
| 726 | 727 | { |
| 727 | 728 | for (x = 0; x < 16; x++) |
| 728 | 729 | { |
| 729 | UINT8 dat = m_cfb_ram[offs + x + y * 16]; | |
| 730 | UINT8 dat = m_cfb_ram.target()[offs + x + y * 16]; | |
| 730 | 731 | m_lookup_ram[lookup_offs + x + y * 16] = dat; |
| 731 | 732 | } |
| 732 | 733 | } |
| r14896 | r14897 | |
| 983 | 984 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 984 | 985 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE("share1") |
| 985 | 986 | AM_RANGE(0xd800, 0xd800) AM_READ(cfb_zpu_int_req_clr) |
| 986 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_ | |
| 987 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_ | |
| 987 | 988 | AM_RANGE(0xe800, 0xefff) AM_RAM |
| 988 | 989 | ADDRESS_MAP_END |
| 989 | 990 | |
| r14896 | r14897 | |
| 1014 | 1015 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE("share1") |
| 1015 | 1016 | AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("bank1") /* GFX roms */ |
| 1016 | 1017 | AM_RANGE(0x4000, 0x4003) AM_WRITE(vcu_video_reg_w) |
| 1017 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_ | |
| 1018 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_ | |
| 1018 | 1019 | AM_RANGE(0xa000, 0xa7ff) AM_READ(vcu_set_cmd_param_r) /* VCU command and parameters LOAD */ |
| 1019 | 1020 | AM_RANGE(0xc000, 0xdfff) AM_READ(vcu_set_gfx_addr_r) /* gfx LOAD (blit) */ |
| 1020 | 1021 | AM_RANGE(0xe000, 0xffff) AM_READ(vcu_set_clr_addr_r) /* palette? LOAD */ |
| r14896 | r14897 | |
|---|---|---|
| 325 | 325 | coin_counter_w(machine(), 0, (data & 1) >> 0); |
| 326 | 326 | coin_counter_w(machine(), 1, (data & 2) >> 1); |
| 327 | 327 | |
| 328 | flip_screen_set(m | |
| 328 | flip_screen_set(m | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | WRITE16_MEMBER(armedf_state::terrafb_io_w) |
| r14896 | r14897 | |
| 339 | 339 | coin_counter_w(machine(), 0, (data & 1) >> 0); |
| 340 | 340 | coin_counter_w(machine(), 1, (data & 2) >> 1); |
| 341 | 341 | |
| 342 | flip_screen_set(m | |
| 342 | flip_screen_set(m | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | WRITE16_MEMBER(armedf_state::bootleg_io_w) |
| r14896 | r14897 | |
| 355 | 355 | coin_counter_w(machine(), 0, (data & 1) >> 0); |
| 356 | 356 | coin_counter_w(machine(), 1, (data & 2) >> 1); |
| 357 | 357 | |
| 358 | flip_screen_set(m | |
| 358 | flip_screen_set(m | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | WRITE16_MEMBER(armedf_state::sound_command_w) |
| 362 | 362 | { |
| 363 | 363 | if (ACCESSING_BITS_0_7) |
| 364 | soundlatch_w(space, 0, ((data & 0x7f) << 1) | 1); | |
| 364 | soundlatch_byte_w(space, 0, ((data & 0x7f) << 1) | 1); | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | READ8_MEMBER(armedf_state::soundlatch_clear_r) |
| 368 | 368 | { |
| 369 | soundlatch_clear_w(space, 0, 0); | |
| 369 | soundlatch_clear_byte_w(space, 0, 0); | |
| 370 | 370 | return 0; |
| 371 | 371 | } |
| 372 | 372 | |
| r14896 | r14897 | |
| 392 | 392 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 393 | 393 | AM_RANGE(0x060000, 0x0603ff) AM_RAM AM_SHARE("spriteram") |
| 394 | 394 | AM_RANGE(0x060400, 0x063fff) AM_RAM |
| 395 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 395 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 396 | 396 | AM_RANGE(0x068000, 0x069fff) AM_READWRITE8(nb1414m4_text_videoram_r,nb1414m4_text_videoram_w,0x00ff) |
| 397 | 397 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM |
| 398 | 398 | AM_RANGE(0x06c000, 0x06cfff) AM_RAM AM_BASE(m_spr_pal_clut) |
| r14896 | r14897 | |
| 423 | 423 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 424 | 424 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_SHARE("spriteram") |
| 425 | 425 | AM_RANGE(0x061000, 0x063fff) AM_RAM |
| 426 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 426 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 427 | 427 | AM_RANGE(0x068000, 0x069fff) AM_READWRITE8(nb1414m4_text_videoram_r,nb1414m4_text_videoram_w,0x00ff) |
| 428 | 428 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM |
| 429 | 429 | AM_RANGE(0x06c000, 0x06cfff) AM_RAM AM_BASE(m_spr_pal_clut) |
| r14896 | r14897 | |
| 445 | 445 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 446 | 446 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_SHARE("spriteram") |
| 447 | 447 | AM_RANGE(0x061000, 0x063fff) AM_RAM |
| 448 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 448 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 449 | 449 | AM_RANGE(0x068000, 0x069fff) AM_READWRITE8(nb1414m4_text_videoram_r,nb1414m4_text_videoram_w,0x00ff) |
| 450 | 450 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM |
| 451 | 451 | AM_RANGE(0x06c000, 0x06cfff) AM_RAM AM_BASE(m_spr_pal_clut) |
| r14896 | r14897 | |
| 478 | 478 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 479 | 479 | AM_RANGE(0x060000, 0x060fff) AM_RAM AM_SHARE("spriteram") |
| 480 | 480 | AM_RANGE(0x061000, 0x063fff) AM_RAM |
| 481 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 481 | AM_RANGE(0x064000, 0x064fff) AM_RAM_WRITE(paletteram | |
| 482 | 482 | AM_RANGE(0x068000, 0x069fff) AM_READWRITE8(nb1414m4_text_videoram_r,nb1414m4_text_videoram_w,0x00ff) |
| 483 | 483 | AM_RANGE(0x06a000, 0x06a9ff) AM_RAM |
| 484 | 484 | AM_RANGE(0x06c000, 0x06cfff) AM_RAM AM_BASE(m_spr_pal_clut) |
| r14896 | r14897 | |
| 503 | 503 | AM_RANGE(0x066000, 0x066fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(m_bg_videoram) |
| 504 | 504 | AM_RANGE(0x067000, 0x067fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(m_fg_videoram) |
| 505 | 505 | AM_RANGE(0x068000, 0x069fff) AM_READWRITE8(armedf_text_videoram_r,armedf_text_videoram_w,0x00ff) |
| 506 | AM_RANGE(0x06a000, 0x06afff) AM_RAM_WRITE(paletteram | |
| 506 | AM_RANGE(0x06a000, 0x06afff) AM_RAM_WRITE(paletteram | |
| 507 | 507 | AM_RANGE(0x06b000, 0x06bfff) AM_RAM AM_BASE(m_spr_pal_clut) |
| 508 | 508 | AM_RANGE(0x06c000, 0x06c001) AM_READ_PORT("P1") |
| 509 | 509 | AM_RANGE(0x06c002, 0x06c003) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 678 | 678 | AM_RANGE(0x086000, 0x086fff) AM_RAM_WRITE(armedf_bg_videoram_w) AM_BASE(m_bg_videoram) |
| 679 | 679 | AM_RANGE(0x087000, 0x087fff) AM_RAM_WRITE(armedf_fg_videoram_w) AM_BASE(m_fg_videoram) |
| 680 | 680 | AM_RANGE(0x088000, 0x089fff) AM_READWRITE8(armedf_text_videoram_r,armedf_text_videoram_w,0x00ff) |
| 681 | AM_RANGE(0x08a000, 0x08afff) AM_RAM_WRITE(paletteram | |
| 681 | AM_RANGE(0x08a000, 0x08afff) AM_RAM_WRITE(paletteram | |
| 682 | 682 | AM_RANGE(0x08b000, 0x08bfff) AM_RAM AM_BASE(m_spr_pal_clut) |
| 683 | 683 | AM_RANGE(0x08c000, 0x08c001) AM_READ_PORT("P1") |
| 684 | 684 | AM_RANGE(0x08c002, 0x08c003) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 758 | 758 | AM_RANGE(0x2, 0x2) AM_DEVWRITE_LEGACY("dac1", dac_signed_w) |
| 759 | 759 | AM_RANGE(0x3, 0x3) AM_DEVWRITE_LEGACY("dac2", dac_signed_w) |
| 760 | 760 | AM_RANGE(0x4, 0x4) AM_READ(soundlatch_clear_r) |
| 761 | AM_RANGE(0x6, 0x6) AM_READ(soundlatch_r) | |
| 761 | AM_RANGE(0x6, 0x6) AM_READ(soundlatch_byte_r) | |
| 762 | 762 | ADDRESS_MAP_END |
| 763 | 763 | |
| 764 | 764 |
| r14896 | r14897 | |
|---|---|---|
| 780 | 780 | AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r) /* IN2 */ |
| 781 | 781 | AM_RANGE(0x7d00, 0x7d07) AM_DEVWRITE_LEGACY("ls259.6h", latch8_bit0_w) /* Sound signals */ |
| 782 | 782 | |
| 783 | AM_RANGE(0x7d80, 0x7d80) AM_READ_PORT("DSW0") AM_WRITE | |
| 783 | AM_RANGE(0x7d80, 0x7d80) AM_READ_PORT("DSW0") AM_WRITE | |
| 784 | 784 | AM_RANGE(0x7d81, 0x7d81) AM_WRITE(radarscp_grid_enable_w) |
| 785 | 785 | AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w) |
| 786 | 786 | AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w) /* 2 PSL Signal */ |
| r14896 | r14897 | |
| 805 | 805 | AM_RANGE(0x7d00, 0x7d00) AM_READ(dkongjr_in2_r) /* IN2 */ |
| 806 | 806 | AM_RANGE(0x7d00, 0x7d07) AM_DEVWRITE_LEGACY("ls259.6h",latch8_bit0_w) /* Sound addrs */ |
| 807 | 807 | |
| 808 | AM_RANGE(0x7d80, 0x7d80) AM_READ_PORT("DSW0") AM_WRITE | |
| 808 | AM_RANGE(0x7d80, 0x7d80) AM_READ_PORT("DSW0") AM_WRITE | |
| 809 | 809 | AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w) |
| 810 | 810 | AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w) /* 2 PSL Signal */ |
| 811 | 811 | AM_RANGE(0x7d84, 0x7d84) AM_WRITE(nmi_mask_w) |
| r14896 | r14897 | |
| 859 | 859 | AM_RANGE(0x1480, 0x1480) AM_READ_PORT("IN1") |
| 860 | 860 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x007f) AM_READ(dkong_in2_r) /* IN2 */ |
| 861 | 861 | AM_RANGE(0x1500, 0x1507) AM_DEVWRITE_LEGACY("ls259.6h", latch8_bit0_w) /* Sound signals */ |
| 862 | AM_RANGE(0x1580, 0x1580) AM_READ_PORT("DSW0") AM_WRITE | |
| 862 | AM_RANGE(0x1580, 0x1580) AM_READ_PORT("DSW0") AM_WRITE | |
| 863 | 863 | AM_RANGE(0x1582, 0x1582) AM_WRITE(dkong_flipscreen_w) |
| 864 | 864 | AM_RANGE(0x1583, 0x1583) AM_WRITE(dkong_spritebank_w) /* 2 PSL Signal */ |
| 865 | 865 | AM_RANGE(0x1584, 0x1584) AM_NOP /* Possibly still interrupt enable */ |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | 21 | acefruit_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | : driver_device(mconfig, type, tag) { } | |
| 22 | : driver_device(mconfig, type, tag) , | |
| 23 | m_videoram(*this, "videoram"), | |
| 24 | m_colorram(*this, "colorram"), | |
| 25 | m_spriteram(*this, "spriteram"){ } | |
| 23 | 26 | |
| 24 | UINT8 *m_spriteram; | |
| 25 | UINT8 *m_colorram; | |
| 26 | UINT8 *m_videoram; | |
| 27 | required_shared_ptr<UINT8> m_videoram; | |
| 28 | required_shared_ptr<UINT8> m_colorram; | |
| 29 | required_shared_ptr<UINT8> m_spriteram; | |
| 27 | 30 | emu_timer *m_refresh_timer; |
| 28 | 31 | DECLARE_WRITE8_MEMBER(acefruit_colorram_w); |
| 29 | 32 | DECLARE_WRITE8_MEMBER(acefruit_coin_w); |
| r14896 | r14897 | |
| 46 | 49 | for( col = 0; col < 32; col++ ) |
| 47 | 50 | { |
| 48 | 51 | int tile_index = ( col * 32 ) + row; |
| 49 | int color = state->m_colorram[ tile_index ]; | |
| 52 | int color = state->m_colorram.target()[ tile_index ]; | |
| 50 | 53 | |
| 51 | 54 | switch( color ) |
| 52 | 55 | { |
| r14896 | r14897 | |
| 101 | 104 | for( col = 0; col < 32; col++ ) |
| 102 | 105 | { |
| 103 | 106 | int tile_index = ( col * 32 ) + row; |
| 104 | int code = state->m_videoram[ tile_index ]; | |
| 105 | int color = state->m_colorram[ tile_index ]; | |
| 107 | int code = state->m_videoram.target()[ tile_index ]; | |
| 108 | int color = state->m_colorram.target()[ tile_index ]; | |
| 106 | 109 | |
| 107 | 110 | if( color < 0x4 ) |
| 108 | 111 | { |
| r14896 | r14897 | |
| 118 | 121 | |
| 119 | 122 | for( x = 0; x < 16; x++ ) |
| 120 | 123 | { |
| 121 | int sprite = ( state->m_spriteram[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf; | |
| 124 | int sprite = ( state->m_spriteram.target()[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf; | |
| 122 | 125 | const UINT8 *gfxdata = gfx_element_get_data(gfx, sprite); |
| 123 | 126 | |
| 124 | 127 | for( y = 0; y < 8; y++ ) |
| r14896 | r14897 | |
| 225 | 228 | |
| 226 | 229 | WRITE8_MEMBER(acefruit_state::acefruit_colorram_w) |
| 227 | 230 | { |
| 228 | m_colorram[ offset ] = data & 0xf; | |
| 231 | m_colorram.target()[ offset ] = data & 0xf; | |
| 229 | 232 | } |
| 230 | 233 | |
| 231 | 234 | WRITE8_MEMBER(acefruit_state::acefruit_coin_w) |
| r14896 | r14897 | |
| 284 | 287 | static ADDRESS_MAP_START( acefruit_map, AS_PROGRAM, 8, acefruit_state ) |
| 285 | 288 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 286 | 289 | AM_RANGE(0x2000, 0x20ff) AM_RAM AM_SHARE("nvram") |
| 287 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(m_videoram) | |
| 288 | AM_RANGE(0x4400, 0x47ff) AM_RAM_WRITE(acefruit_colorram_w) AM_BASE(m_colorram) | |
| 290 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("videoram") | |
| 291 | AM_RANGE(0x4400, 0x47ff) AM_RAM_WRITE(acefruit_colorram_w) AM_SHARE("colorram") | |
| 289 | 292 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0") |
| 290 | 293 | AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1") |
| 291 | 294 | AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 294 | 297 | AM_RANGE(0x8005, 0x8005) AM_READ_PORT("IN5") |
| 295 | 298 | AM_RANGE(0x8006, 0x8006) AM_READ_PORT("IN6") |
| 296 | 299 | AM_RANGE(0x8007, 0x8007) AM_READ_PORT("IN7") |
| 297 | AM_RANGE(0x6000, 0x6005) AM_RAM AM_ | |
| 300 | AM_RANGE(0x6000, 0x6005) AM_RAM AM_ | |
| 298 | 301 | AM_RANGE(0xa000, 0xa001) AM_WRITE(acefruit_lamp_w) |
| 299 | 302 | AM_RANGE(0xa002, 0xa003) AM_WRITE(acefruit_coin_w) |
| 300 | 303 | AM_RANGE(0xa004, 0xa004) AM_WRITE(acefruit_solenoid_w) |
| r14896 | r14897 | |
|---|---|---|
| 65 | 65 | AM_RANGE(0xc080, 0xc080) AM_WRITENOP // ? 0 |
| 66 | 66 | AM_RANGE(0xc0c2, 0xc0c2) AM_WRITE(metlclsh_cause_irq) // cause irq on cpu #2 |
| 67 | 67 | AM_RANGE(0xc0c3, 0xc0c3) AM_WRITE(metlclsh_ack_nmi) // nmi ack |
| 68 | /**/AM_RANGE(0xc800, 0xc82f) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 69 | /**/AM_RANGE(0xcc00, 0xcc2f) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 68 | /**/AM_RANGE(0xc800, 0xc82f) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 69 | /**/AM_RANGE(0xcc00, 0xcc2f) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 70 | 70 | AM_RANGE(0xd000, 0xd001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w) |
| 71 | 71 | /**/AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(metlclsh_fgram_w) AM_BASE(m_fgram) |
| 72 | 72 | AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("ym2", ym3526_w ) |
| r14896 | r14897 | |
| 98 | 98 | |
| 99 | 99 | WRITE8_MEMBER(metlclsh_state::metlclsh_flipscreen_w) |
| 100 | 100 | { |
| 101 | flip_screen_set( | |
| 101 | flip_screen_set( | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | static ADDRESS_MAP_START( metlclsh_slave_map, AS_PROGRAM, 8, metlclsh_state ) |
| r14896 | r14897 | |
| 275 | 275 | { |
| 276 | 276 | metlclsh_state *state = machine.driver_data<metlclsh_state>(); |
| 277 | 277 | |
| 278 | flip_screen_set( | |
| 278 | state->flip_screen_set( | |
| 279 | 279 | |
| 280 | 280 | state->m_write_mask = 0; |
| 281 | 281 | state->m_gfxbank = 0; |
| r14896 | r14897 | |
|---|---|---|
| 163 | 163 | AM_RANGE(0xf840, 0xf840) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 164 | 164 | AM_RANGE(0xfa00, 0xfa00) AM_WRITE(goldstar_fa00_w) |
| 165 | 165 | AM_RANGE(0xfb00, 0xfb00) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 166 | AM_RANGE(0xfd00, 0xfdff) AM_RAM_WRITE(paletteram_BBGGGRRR_w) AM_SHARE("paletteram") | |
| 166 | AM_RANGE(0xfd00, 0xfdff) AM_RAM_WRITE(paletteram_BBGGGRRR_byte_w) AM_SHARE("paletteram") | |
| 167 | 167 | AM_RANGE(0xfe00, 0xfe00) AM_READWRITE(protection_r,protection_w) |
| 168 | 168 | ADDRESS_MAP_END |
| 169 | 169 | |
| r14896 | r14897 | |
| 522 | 522 | /* newer / more capable hw */ |
| 523 | 523 | static ADDRESS_MAP_START( unkch_map, AS_PROGRAM, 8, goldstar_state ) |
| 524 | 524 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 525 | AM_RANGE(0xc000, 0xc1ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_SHARE("paletteram") | |
| 526 | AM_RANGE(0xc800, 0xc9ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_SHARE("paletteram2") | |
| 525 | AM_RANGE(0xc000, 0xc1ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 526 | AM_RANGE(0xc800, 0xc9ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 527 | 527 | |
| 528 | 528 | AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("nvram") |
| 529 | 529 |
| r14896 | r14897 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | WRITE16_MEMBER(dbz_state::dbz_sound_command_w) |
| 99 | 99 | { |
| 100 | soundlatch_w(space, 0, data >> 8); | |
| 100 | soundlatch_byte_w(space, 0, data >> 8); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | WRITE16_MEMBER(dbz_state::dbz_sound_cause_nmi) |
| r14896 | r14897 | |
| 120 | 120 | AM_RANGE(0x498000, 0x49ffff) AM_DEVREAD_LEGACY("k056832", k056832_rom_word_8000_r) // code near a60 in dbz2, subroutine at 730 in dbz |
| 121 | 121 | AM_RANGE(0x4a0000, 0x4a0fff) AM_DEVREADWRITE_LEGACY("k053246", k053247_word_r, k053247_word_w) |
| 122 | 122 | AM_RANGE(0x4a1000, 0x4a3fff) AM_RAM |
| 123 | AM_RANGE(0x4a8000, 0x4abfff) AM_RAM_WRITE(paletteram | |
| 123 | AM_RANGE(0x4a8000, 0x4abfff) AM_RAM_WRITE(paletteram | |
| 124 | 124 | AM_RANGE(0x4c0000, 0x4c0001) AM_DEVREAD_LEGACY("k053246", k053246_word_r) |
| 125 | 125 | AM_RANGE(0x4c0000, 0x4c0007) AM_DEVWRITE_LEGACY("k053246", k053246_word_w) |
| 126 | 126 | AM_RANGE(0x4c4000, 0x4c4007) AM_DEVWRITE_LEGACY("k053246", k053246_word_w) |
| r14896 | r14897 | |
| 154 | 154 | AM_RANGE(0x8000, 0xbfff) AM_RAM |
| 155 | 155 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 156 | 156 | AM_RANGE(0xd000, 0xd002) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 157 | AM_RANGE(0xe000, 0xe001) AM_READ(soundlatch_r) | |
| 157 | AM_RANGE(0xe000, 0xe001) AM_READ(soundlatch_byte_r) | |
| 158 | 158 | ADDRESS_MAP_END |
| 159 | 159 | |
| 160 | 160 | static ADDRESS_MAP_START( dbz_sound_io_map, AS_IO, 8, dbz_state ) |
| r14896 | r14897 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | public: |
| 45 | 45 | skylncr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 46 | : driver_device(mconfig, type, tag) { } | |
| 46 | : driver_device(mconfig, type, tag) , | |
| 47 | m_videoram(*this, "videoram"), | |
| 48 | m_colorram(*this, "colorram"), | |
| 49 | m_reeltiles_1_ram(*this, "reeltiles_1_ram"), | |
| 50 | m_reeltiles_2_ram(*this, "reeltiles_2_ram"), | |
| 51 | m_reeltiles_3_ram(*this, "reeltiles_3_ram"), | |
| 52 | m_reeltiles_4_ram(*this, "reeltiles_4_ram"), | |
| 53 | m_reeltileshigh_1_ram(*this, "reeltileshigh_1_ram"), | |
| 54 | m_reeltileshigh_2_ram(*this, "reeltileshigh_2_ram"), | |
| 55 | m_reeltileshigh_3_ram(*this, "reeltileshigh_3_ram"), | |
| 56 | m_reeltileshigh_4_ram(*this, "reeltileshigh_4_ram"), | |
| 57 | m_reelscroll1(*this, "reelscroll1"), | |
| 58 | m_reelscroll2(*this, "reelscroll2"), | |
| 59 | m_reelscroll3(*this, "reelscroll3"), | |
| 60 | m_reelscroll4(*this, "reelscroll4"){ } | |
| 47 | 61 | |
| 48 | 62 | tilemap_t *m_tmap; |
| 49 | UINT8 *m_videoram; | |
| 50 | UINT8 *m_colorram; | |
| 51 | UINT8* m_reeltiles_1_ram; | |
| 52 | UINT8* m_reeltiles_2_ram; | |
| 53 | UINT8* m_reeltiles_3_ram; | |
| 54 | UINT8* m_reeltiles_4_ram; | |
| 55 | UINT8* m_reeltileshigh_1_ram; | |
| 56 | UINT8* m_reeltileshigh_2_ram; | |
| 57 | UINT8* m_reeltileshigh_3_ram; | |
| 58 | UINT8* m_reeltileshigh_4_ram; | |
| 63 | required_shared_ptr<UINT8> m_videoram; | |
| 64 | required_shared_ptr<UINT8> m_colorram; | |
| 65 | required_shared_ptr<UINT8> m_reeltiles_1_ram; | |
| 66 | required_shared_ptr<UINT8> m_reeltiles_2_ram; | |
| 67 | required_shared_ptr<UINT8> m_reeltiles_3_ram; | |
| 68 | required_shared_ptr<UINT8> m_reeltiles_4_ram; | |
| 69 | required_shared_ptr<UINT8> m_reeltileshigh_1_ram; | |
| 70 | required_shared_ptr<UINT8> m_reeltileshigh_2_ram; | |
| 71 | required_shared_ptr<UINT8> m_reeltileshigh_3_ram; | |
| 72 | required_shared_ptr<UINT8> m_reeltileshigh_4_ram; | |
| 59 | 73 | tilemap_t *m_reel_1_tilemap; |
| 60 | 74 | tilemap_t *m_reel_2_tilemap; |
| 61 | 75 | tilemap_t *m_reel_3_tilemap; |
| 62 | 76 | tilemap_t *m_reel_4_tilemap; |
| 63 | UINT8* m_reelscroll1; | |
| 64 | UINT8* m_reelscroll2; | |
| 65 | UINT8* m_reelscroll3; | |
| 66 | UINT8* m_reelscroll4; | |
| 77 | required_shared_ptr<UINT8> m_reelscroll1; | |
| 78 | required_shared_ptr<UINT8> m_reelscroll2; | |
| 79 | required_shared_ptr<UINT8> m_reelscroll3; | |
| 80 | required_shared_ptr<UINT8> m_reelscroll4; | |
| 67 | 81 | UINT8 m_nmi_enable; |
| 68 | 82 | int m_color; |
| 69 | 83 | int m_color2; |
| r14896 | r14897 | |
| 96 | 110 | |
| 97 | 111 | WRITE8_MEMBER(skylncr_state::skylncr_videoram_w) |
| 98 | 112 | { |
| 99 | m_videoram[offset] = data; | |
| 113 | m_videoram.target()[offset] = data; | |
| 100 | 114 | m_tmap->mark_tile_dirty(offset); |
| 101 | 115 | } |
| 102 | 116 | |
| 103 | 117 | WRITE8_MEMBER(skylncr_state::skylncr_colorram_w) |
| 104 | 118 | { |
| 105 | m_colorram[offset] = data; | |
| 119 | m_colorram.target()[offset] = data; | |
| 106 | 120 | m_tmap->mark_tile_dirty(offset); |
| 107 | 121 | } |
| 108 | 122 | |
| r14896 | r14897 | |
| 110 | 124 | static TILE_GET_INFO( get_tile_info ) |
| 111 | 125 | { |
| 112 | 126 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 113 | UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8); | |
| 127 | UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8); | |
| 114 | 128 | SET_TILE_INFO(0, code, 0, TILE_FLIPYX( 0 )); |
| 115 | 129 | } |
| 116 | 130 | |
| 117 | 131 | static TILE_GET_INFO( get_reel_1_tile_info ) |
| 118 | 132 | { |
| 119 | 133 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 120 | UINT16 code = state->m_reeltiles_1_ram[ tile_index ] + (state->m_reeltileshigh_1_ram[ tile_index ] << 8); | |
| 134 | UINT16 code = state->m_reeltiles_1_ram.target()[ tile_index ] + (state->m_reeltileshigh_1_ram.target()[ tile_index ] << 8); | |
| 121 | 135 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 122 | 136 | } |
| 123 | 137 | |
| 124 | 138 | static TILE_GET_INFO( get_reel_2_tile_info ) |
| 125 | 139 | { |
| 126 | 140 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 127 | UINT16 code = state->m_reeltiles_2_ram[ tile_index ] + (state->m_reeltileshigh_2_ram[ tile_index ] << 8); | |
| 141 | UINT16 code = state->m_reeltiles_2_ram.target()[ tile_index ] + (state->m_reeltileshigh_2_ram.target()[ tile_index ] << 8); | |
| 128 | 142 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 129 | 143 | } |
| 130 | 144 | |
| 131 | 145 | static TILE_GET_INFO( get_reel_3_tile_info ) |
| 132 | 146 | { |
| 133 | 147 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 134 | UINT16 code = state->m_reeltiles_3_ram[ tile_index ] + (state->m_reeltileshigh_3_ram[ tile_index ] << 8); | |
| 148 | UINT16 code = state->m_reeltiles_3_ram.target()[ tile_index ] + (state->m_reeltileshigh_3_ram.target()[ tile_index ] << 8); | |
| 135 | 149 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 136 | 150 | } |
| 137 | 151 | |
| 138 | 152 | static TILE_GET_INFO( get_reel_4_tile_info ) |
| 139 | 153 | { |
| 140 | 154 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 141 | UINT16 code = state->m_reeltiles_4_ram[ tile_index ] + (state->m_reeltileshigh_4_ram[ tile_index ] << 8); | |
| 155 | UINT16 code = state->m_reeltiles_4_ram.target()[ tile_index ] + (state->m_reeltileshigh_4_ram.target()[ tile_index ] << 8); | |
| 142 | 156 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 143 | 157 | } |
| 144 | 158 | |
| r14896 | r14897 | |
| 182 | 196 | |
| 183 | 197 | for (i= 0;i < 64;i++) |
| 184 | 198 | { |
| 185 | state->m_reel_2_tilemap->set_scrolly(i, state->m_reelscroll2[i]); | |
| 186 | state->m_reel_3_tilemap->set_scrolly(i, state->m_reelscroll3[i]); | |
| 187 | state->m_reel_4_tilemap->set_scrolly(i, state->m_reelscroll4[i]); | |
| 199 | state->m_reel_2_tilemap->set_scrolly(i, state->m_reelscroll2.target()[i]); | |
| 200 | state->m_reel_3_tilemap->set_scrolly(i, state->m_reelscroll3.target()[i]); | |
| 201 | state->m_reel_4_tilemap->set_scrolly(i, state->m_reelscroll4.target()[i]); | |
| 188 | 202 | } |
| 189 | 203 | |
| 190 | 204 | state->m_reel_2_tilemap->draw(bitmap, visible1, 0, 0); |
| r14896 | r14897 | |
| 198 | 212 | |
| 199 | 213 | WRITE8_MEMBER(skylncr_state::reeltiles_1_w) |
| 200 | 214 | { |
| 201 | m_reeltiles_1_ram[offset] = data; | |
| 215 | m_reeltiles_1_ram.target()[offset] = data; | |
| 202 | 216 | m_reel_1_tilemap->mark_tile_dirty(offset); |
| 203 | 217 | } |
| 204 | 218 | |
| 205 | 219 | WRITE8_MEMBER(skylncr_state::reeltiles_2_w) |
| 206 | 220 | { |
| 207 | m_reeltiles_2_ram[offset] = data; | |
| 221 | m_reeltiles_2_ram.target()[offset] = data; | |
| 208 | 222 | m_reel_2_tilemap->mark_tile_dirty(offset); |
| 209 | 223 | } |
| 210 | 224 | |
| 211 | 225 | WRITE8_MEMBER(skylncr_state::reeltiles_3_w) |
| 212 | 226 | { |
| 213 | m_reeltiles_3_ram[offset] = data; | |
| 227 | m_reeltiles_3_ram.target()[offset] = data; | |
| 214 | 228 | m_reel_3_tilemap->mark_tile_dirty(offset); |
| 215 | 229 | } |
| 216 | 230 | |
| 217 | 231 | WRITE8_MEMBER(skylncr_state::reeltiles_4_w) |
| 218 | 232 | { |
| 219 | m_reeltiles_4_ram[offset] = data; | |
| 233 | m_reeltiles_4_ram.target()[offset] = data; | |
| 220 | 234 | m_reel_4_tilemap->mark_tile_dirty(offset); |
| 221 | 235 | } |
| 222 | 236 | |
| 223 | 237 | WRITE8_MEMBER(skylncr_state::reeltileshigh_1_w) |
| 224 | 238 | { |
| 225 | m_reeltileshigh_1_ram[offset] = data; | |
| 239 | m_reeltileshigh_1_ram.target()[offset] = data; | |
| 226 | 240 | m_reel_1_tilemap->mark_tile_dirty(offset); |
| 227 | 241 | } |
| 228 | 242 | |
| 229 | 243 | WRITE8_MEMBER(skylncr_state::reeltileshigh_2_w) |
| 230 | 244 | { |
| 231 | m_reeltileshigh_2_ram[offset] = data; | |
| 245 | m_reeltileshigh_2_ram.target()[offset] = data; | |
| 232 | 246 | m_reel_2_tilemap->mark_tile_dirty(offset); |
| 233 | 247 | } |
| 234 | 248 | |
| 235 | 249 | WRITE8_MEMBER(skylncr_state::reeltileshigh_3_w) |
| 236 | 250 | { |
| 237 | m_reeltileshigh_3_ram[offset] = data; | |
| 251 | m_reeltileshigh_3_ram.target()[offset] = data; | |
| 238 | 252 | m_reel_3_tilemap->mark_tile_dirty(offset); |
| 239 | 253 | } |
| 240 | 254 | |
| 241 | 255 | WRITE8_MEMBER(skylncr_state::reeltileshigh_4_w) |
| 242 | 256 | { |
| 243 | m_reeltileshigh_4_ram[offset] = data; | |
| 257 | m_reeltileshigh_4_ram.target()[offset] = data; | |
| 244 | 258 | m_reel_4_tilemap->mark_tile_dirty(offset); |
| 245 | 259 | } |
| 246 | 260 | |
| r14896 | r14897 | |
| 295 | 309 | |
| 296 | 310 | WRITE8_MEMBER(skylncr_state::reelscroll1_w) |
| 297 | 311 | { |
| 298 | m_reelscroll1[offset] = data; | |
| 312 | m_reelscroll1.target()[offset] = data; | |
| 299 | 313 | } |
| 300 | 314 | |
| 301 | 315 | WRITE8_MEMBER(skylncr_state::reelscroll2_w) |
| 302 | 316 | { |
| 303 | m_reelscroll2[offset] = data; | |
| 317 | m_reelscroll2.target()[offset] = data; | |
| 304 | 318 | } |
| 305 | 319 | |
| 306 | 320 | WRITE8_MEMBER(skylncr_state::reelscroll3_w) |
| 307 | 321 | { |
| 308 | m_reelscroll3[offset] = data; | |
| 322 | m_reelscroll3.target()[offset] = data; | |
| 309 | 323 | } |
| 310 | 324 | |
| 311 | 325 | WRITE8_MEMBER(skylncr_state::reelscroll4_w) |
| 312 | 326 | { |
| 313 | m_reelscroll4[offset] = data; | |
| 327 | m_reelscroll4.target()[offset] = data; | |
| 314 | 328 | } |
| 315 | 329 | |
| 316 | 330 | |
| r14896 | r14897 | |
| 363 | 377 | |
| 364 | 378 | AM_RANGE(0xaa55, 0xaa55) AM_READ(ret_ff ) |
| 365 | 379 | |
| 366 | AM_RANGE(0xb000, 0xb03f) AM_RAM_WRITE(reelscroll1_w) AM_ | |
| 380 | AM_RANGE(0xb000, 0xb03f) AM_RAM_WRITE(reelscroll1_w) AM_ | |
| 367 | 381 | AM_RANGE(0xb040, 0xb07f) AM_RAM_WRITE(reelscroll1_w) |
| 368 | 382 | AM_RANGE(0xb080, 0xb0bf) AM_RAM_WRITE(reelscroll1_w) |
| 369 | 383 | AM_RANGE(0xb0c0, 0xb0ff) AM_RAM_WRITE(reelscroll1_w) |
| r14896 | r14897 | |
| 372 | 386 | AM_RANGE(0xb180, 0xb1bf) AM_RAM_WRITE(reelscroll1_w) |
| 373 | 387 | AM_RANGE(0xb1c0, 0xb1ff) AM_RAM_WRITE(reelscroll1_w) |
| 374 | 388 | |
| 375 | AM_RANGE(0xb200, 0xb23f) AM_RAM_WRITE(reelscroll2_w) AM_ | |
| 389 | AM_RANGE(0xb200, 0xb23f) AM_RAM_WRITE(reelscroll2_w) AM_ | |
| 376 | 390 | AM_RANGE(0xb240, 0xb27f) AM_RAM_WRITE(reelscroll2_w) |
| 377 | 391 | AM_RANGE(0xb280, 0xb2bf) AM_RAM_WRITE(reelscroll2_w) |
| 378 | 392 | AM_RANGE(0xb2c0, 0xb2ff) AM_RAM_WRITE(reelscroll2_w) |
| r14896 | r14897 | |
| 381 | 395 | AM_RANGE(0xb380, 0xb3bf) AM_RAM_WRITE(reelscroll2_w) |
| 382 | 396 | AM_RANGE(0xb3c0, 0xb3ff) AM_RAM_WRITE(reelscroll2_w) |
| 383 | 397 | |
| 384 | AM_RANGE(0xb400, 0xb43f) AM_RAM_WRITE(reelscroll3_w) AM_ | |
| 398 | AM_RANGE(0xb400, 0xb43f) AM_RAM_WRITE(reelscroll3_w) AM_ | |
| 385 | 399 | AM_RANGE(0xb440, 0xb47f) AM_RAM_WRITE(reelscroll3_w) |
| 386 | 400 | AM_RANGE(0xb480, 0xb4bf) AM_RAM_WRITE(reelscroll3_w) |
| 387 | 401 | AM_RANGE(0xb4c0, 0xb4ff) AM_RAM_WRITE(reelscroll3_w) |
| r14896 | r14897 | |
| 390 | 404 | AM_RANGE(0xb580, 0xb5bf) AM_RAM_WRITE(reelscroll3_w) |
| 391 | 405 | AM_RANGE(0xb5c0, 0xb5ff) AM_RAM_WRITE(reelscroll3_w) |
| 392 | 406 | |
| 393 | AM_RANGE(0xb600, 0xb63f) AM_RAM_WRITE(reelscroll4_w) AM_ | |
| 407 | AM_RANGE(0xb600, 0xb63f) AM_RAM_WRITE(reelscroll4_w) AM_ | |
| 394 | 408 | AM_RANGE(0xb640, 0xb67f) AM_RAM_WRITE(reelscroll4_w) |
| 395 | 409 | AM_RANGE(0xb680, 0xb6bf) AM_RAM_WRITE(reelscroll4_w) |
| 396 | 410 | AM_RANGE(0xb6c0, 0xb6ff) AM_RAM_WRITE(reelscroll4_w) |
| r14896 | r14897 | |
|---|---|---|
| 135 | 135 | { |
| 136 | 136 | if (ACCESSING_BITS_0_7) |
| 137 | 137 | { |
| 138 | soundlatch_w(space, offset, data & 0xff); | |
| 138 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 139 | 139 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 140 | 140 | } |
| 141 | 141 | } |
| r14896 | r14897 | |
| 146 | 146 | AM_RANGE(0x50000, 0x50fff) AM_RAM AM_BASE(m_spvideoram) |
| 147 | 147 | AM_RANGE(0x60000, 0x67fff) AM_RAM AM_BASE(m_fgvideoram) |
| 148 | 148 | AM_RANGE(0x70000, 0x77fff) AM_RAM AM_BASE(m_bgvideoram) |
| 149 | AM_RANGE(0x80000, 0x827ff) AM_RAM_WRITE(paletteram | |
| 149 | AM_RANGE(0x80000, 0x827ff) AM_RAM_WRITE(paletteram | |
| 150 | 150 | AM_RANGE(0x90000, 0x90001) AM_READ_PORT("IN0") |
| 151 | 151 | AM_RANGE(0x90010, 0x90011) AM_READ_PORT("IN1") |
| 152 | 152 | AM_RANGE(0x90020, 0x90021) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 193 | 193 | AM_RANGE(0xf810, 0xf811) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 194 | 194 | |
| 195 | 195 | AM_RANGE(0xfc00, 0xfc00) AM_READNOP AM_WRITENOP /* irq ack ?? */ |
| 196 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 196 | AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r) | |
| 197 | 197 | ADDRESS_MAP_END |
| 198 | 198 | |
| 199 | 199 |
| r14896 | r14897 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | if (ACCESSING_BITS_0_7) |
| 115 | 115 | { |
| 116 | soundlatch_w(space, 0, data & 0xff); | |
| 116 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 117 | 117 | device_set_input_line(m_soundcpu, INPUT_LINE_NMI, PULSE_LINE); |
| 118 | 118 | } |
| 119 | 119 | } |
| r14896 | r14897 | |
| 151 | 151 | |
| 152 | 152 | if (ACCESSING_BITS_0_7) |
| 153 | 153 | { |
| 154 | soundlatch_w(space, 0, data & 0xff); | |
| 154 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 155 | 155 | device_set_input_line(m_soundcpu, 0, HOLD_LINE); |
| 156 | 156 | } |
| 157 | 157 | } |
| r14896 | r14897 | |
| 422 | 422 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 423 | 423 | AM_RANGE(0x8000, 0xbfff) AM_READ(tturfbl_soundbank_r) |
| 424 | 424 | AM_RANGE(0xe000, 0xe000) AM_WRITE(tturfbl_soundbank_w) |
| 425 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r) | |
| 425 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) | |
| 426 | 426 | AM_RANGE(0xf000, 0xf000) AM_WRITE(tturfbl_msm5205_data_w) |
| 427 | 427 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 428 | 428 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 438 | 438 | |
| 439 | 439 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_bootleg_state ) |
| 440 | 440 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 441 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r) | |
| 441 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) | |
| 442 | 442 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 443 | 443 | ADDRESS_MAP_END |
| 444 | 444 | |
| 445 | 445 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, segas1x_bootleg_state ) |
| 446 | 446 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 447 | 447 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 448 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) | |
| 448 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) | |
| 449 | 449 | ADDRESS_MAP_END |
| 450 | 450 | |
| 451 | 451 | |
| r14896 | r14897 | |
| 453 | 453 | static ADDRESS_MAP_START( sound_7759_map, AS_PROGRAM, 8, segas1x_bootleg_state ) |
| 454 | 454 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 455 | 455 | AM_RANGE(0x8000, 0xdfff) AM_ROMBANK("bank1") |
| 456 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r) | |
| 456 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) | |
| 457 | 457 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 458 | 458 | ADDRESS_MAP_END |
| 459 | 459 | |
| r14896 | r14897 | |
| 473 | 473 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 474 | 474 | AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY("7759", upd7759_bank_w) |
| 475 | 475 | AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("7759", upd7759_port_w) |
| 476 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) | |
| 476 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) | |
| 477 | 477 | ADDRESS_MAP_END |
| 478 | 478 | |
| 479 | 479 | |
| r14896 | r14897 | |
| 532 | 532 | */ |
| 533 | 533 | static ADDRESS_MAP_START( fpointbl_sound_map, AS_PROGRAM, 8, segas1x_bootleg_state ) |
| 534 | 534 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 535 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 535 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 536 | 536 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 537 | 537 | ADDRESS_MAP_END |
| 538 | 538 | |
| r14896 | r14897 | |
| 1056 | 1056 | AM_RANGE(0x80, 0x83) AM_DEVREADWRITE_LEGACY("3438.0", ym3438_r, ym3438_w) |
| 1057 | 1057 | AM_RANGE(0x90, 0x93) AM_DEVREADWRITE_LEGACY("3438.1", ym3438_r, ym3438_w) |
| 1058 | 1058 | AM_RANGE(0xa0, 0xa0) AM_WRITE(sys18_soundbank_w) |
| 1059 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) | |
| 1059 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) | |
| 1060 | 1060 | ADDRESS_MAP_END |
| 1061 | 1061 | |
| 1062 | 1062 | |
| r14896 | r14897 | |
| 1107 | 1107 | |
| 1108 | 1108 | if (ACCESSING_BITS_0_7) |
| 1109 | 1109 | { |
| 1110 | soundlatch_w(space, 0, data & 0xff); | |
| 1110 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 1111 | 1111 | device_set_input_line(m_soundcpu, 0, HOLD_LINE); |
| 1112 | 1112 | } |
| 1113 | 1113 | } |
| r14896 | r14897 | |
| 1230 | 1230 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1231 | 1231 | AM_RANGE(0x8000, 0xbfff) AM_READ(shdancbl_soundbank_r) |
| 1232 | 1232 | AM_RANGE(0xc000, 0xc00f) AM_WRITENOP |
| 1233 | AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_r) | |
| 1233 | AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_byte_r) | |
| 1234 | 1234 | AM_RANGE(0xc800, 0xc800) AM_WRITE(shdancbl_msm5205_data_w) |
| 1235 | 1235 | AM_RANGE(0xcc00, 0xcc03) AM_DEVREADWRITE_LEGACY("3438.0", ym3438_r, ym3438_w) |
| 1236 | 1236 | AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE_LEGACY("3438.1", ym3438_r, ym3438_w) |
| r14896 | r14897 | |
|---|---|---|
| 88 | 88 | { |
| 89 | 89 | public: |
| 90 | 90 | nyny_state(const machine_config &mconfig, device_type type, const char *tag) |
| 91 | : driver_device(mconfig, type, tag) { } | |
| 91 | : driver_device(mconfig, type, tag) , | |
| 92 | m_videoram1(*this, "videoram1"), | |
| 93 | m_colorram1(*this, "colorram1"), | |
| 94 | m_videoram2(*this, "videoram2"), | |
| 95 | m_colorram2(*this, "colorram2"){ } | |
| 92 | 96 | |
| 93 | 97 | /* memory pointers */ |
| 94 | UINT8 * m_videoram1; | |
| 95 | UINT8 * m_videoram2; | |
| 96 | UINT8 * m_colorram1; | |
| 97 | UINT8 * m_colorram2; | |
| 98 | required_shared_ptr<UINT8> m_videoram1; | |
| 99 | required_shared_ptr<UINT8> m_colorram1; | |
| 100 | required_shared_ptr<UINT8> m_videoram2; | |
| 101 | required_shared_ptr<UINT8> m_colorram2; | |
| 98 | 102 | |
| 99 | 103 | /* video-related */ |
| 100 | 104 | int m_flipscreen; |
| r14896 | r14897 | |
| 323 | 327 | if (state->m_flipscreen) |
| 324 | 328 | offs = offs ^ 0x9fff; |
| 325 | 329 | |
| 326 | data1 = state->m_videoram1[offs]; | |
| 327 | data2 = state->m_videoram2[offs]; | |
| 328 | color1 = state->m_colorram1[offs] & 0x07; | |
| 329 | color2 = state->m_colorram2[offs] & 0x07; | |
| 330 | data1 = state->m_videoram1.target()[offs]; | |
| 331 | data2 = state->m_videoram2.target()[offs]; | |
| 332 | color1 = state->m_colorram1.target()[offs] & 0x07; | |
| 333 | color2 = state->m_colorram2.target()[offs] & 0x07; | |
| 330 | 334 | |
| 331 | 335 | for (i = 0; i < 8; i++) |
| 332 | 336 | { |
| r14896 | r14897 | |
| 442 | 446 | WRITE8_MEMBER(nyny_state::audio_1_command_w) |
| 443 | 447 | { |
| 444 | 448 | |
| 445 | soundlatch_w(space, 0, data); | |
| 449 | soundlatch_byte_w(space, 0, data); | |
| 446 | 450 | device_set_input_line(m_audiocpu, M6800_IRQ_LINE, HOLD_LINE); |
| 447 | 451 | } |
| 448 | 452 | |
| r14896 | r14897 | |
| 450 | 454 | WRITE8_MEMBER(nyny_state::audio_1_answer_w) |
| 451 | 455 | { |
| 452 | 456 | |
| 453 | soundlatch3_w(space, 0, data); | |
| 457 | soundlatch3_byte_w(space, 0, data); | |
| 454 | 458 | device_set_input_line(m_maincpu, M6809_IRQ_LINE, HOLD_LINE); |
| 455 | 459 | } |
| 456 | 460 | |
| r14896 | r14897 | |
| 495 | 499 | WRITE8_MEMBER(nyny_state::audio_2_command_w) |
| 496 | 500 | { |
| 497 | 501 | |
| 498 | soundlatch2_w(space, 0, (data & 0x60) >> 5); | |
| 502 | soundlatch2_byte_w(space, 0, (data & 0x60) >> 5); | |
| 499 | 503 | device_set_input_line(m_audiocpu2, M6800_IRQ_LINE, BIT(data, 7) ? CLEAR_LINE : ASSERT_LINE); |
| 500 | 504 | } |
| 501 | 505 | |
| r14896 | r14897 | |
| 529 | 533 | |
| 530 | 534 | |
| 531 | 535 | static ADDRESS_MAP_START( nyny_main_map, AS_PROGRAM, 8, nyny_state ) |
| 532 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(m_videoram1) | |
| 533 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE(m_colorram1) | |
| 534 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(m_videoram2) | |
| 535 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE(m_colorram2) | |
| 536 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("videoram1") | |
| 537 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("colorram1") | |
| 538 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("videoram2") | |
| 539 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_SHARE("colorram2") | |
| 536 | 540 | AM_RANGE(0x8000, 0x9fff) AM_RAM |
| 537 | 541 | AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_SHARE("nvram") /* SRAM (coin counter, shown when holding F2) */ |
| 538 | 542 | AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 539 | 543 | AM_RANGE(0xa101, 0xa101) AM_MIRROR(0x00fe) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 540 | 544 | AM_RANGE(0xa200, 0xa20f) AM_MIRROR(0x00f0) AM_READWRITE(nyny_pia_1_2_r, nyny_pia_1_2_w) |
| 541 | AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x00ff) AM_READ(soundlatch3_r) AM_WRITE(audio_1_command_w) | |
| 545 | AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x00ff) AM_READ(soundlatch3_byte_r) AM_WRITE(audio_1_command_w) | |
| 542 | 546 | AM_RANGE(0xa400, 0xa7ff) AM_NOP |
| 543 | 547 | AM_RANGE(0xa800, 0xbfff) AM_ROM |
| 544 | 548 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| r14896 | r14897 | |
| 550 | 554 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 551 | 555 | AM_RANGE(0x0000, 0x007f) AM_RAM /* internal RAM */ |
| 552 | 556 | AM_RANGE(0x0080, 0x0fff) AM_NOP |
| 553 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_READ(soundlatch_r) AM_WRITE(audio_1_answer_w) | |
| 557 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_READ(soundlatch_byte_r) AM_WRITE(audio_1_answer_w) | |
| 554 | 558 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0fff) AM_READ_PORT("SW3") |
| 555 | 559 | AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0ffc) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 556 | 560 | AM_RANGE(0x3000, 0x3001) AM_MIRROR(0x0ffc) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w) |
| r14896 | r14897 | |
| 567 | 571 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 568 | 572 | AM_RANGE(0x0000, 0x007f) AM_RAM /* internal RAM */ |
| 569 | 573 | AM_RANGE(0x0080, 0x0fff) AM_NOP |
| 570 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_READ(soundlatch2_r) | |
| 574 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_READ(soundlatch2_byte_r) | |
| 571 | 575 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0ffe) AM_DEVREAD_LEGACY("ay3", ay8910_r) |
| 572 | 576 | AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x0ffe) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w) |
| 573 | 577 | AM_RANGE(0x3000, 0x6fff) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 34 | 34 | { |
| 35 | 35 | public: |
| 36 | 36 | limenko_state(const machine_config &mconfig, device_type type, const char *tag) |
| 37 | : driver_device(mconfig, type, tag) { } | |
| 37 | : driver_device(mconfig, type, tag) , | |
| 38 | m_mainram(*this, "mainram"), | |
| 39 | m_fg_videoram(*this, "fg_videoram"), | |
| 40 | m_md_videoram(*this, "md_videoram"), | |
| 41 | m_bg_videoram(*this, "bg_videoram"), | |
| 42 | m_spriteram(*this, "spriteram"), | |
| 43 | m_spriteram2(*this, "spriteram2"), | |
| 44 | m_videoreg(*this, "videoreg"){ } | |
| 38 | 45 | |
| 39 | UINT32 *m_spriteram; | |
| 40 | UINT32 *m_spriteram2; | |
| 41 | size_t m_spriteram_size; | |
| 46 | required_shared_ptr<UINT32> m_mainram; | |
| 47 | required_shared_ptr<UINT32> m_fg_videoram; | |
| 48 | required_shared_ptr<UINT32> m_md_videoram; | |
| 49 | required_shared_ptr<UINT32> m_bg_videoram; | |
| 50 | required_shared_ptr<UINT32> m_spriteram; | |
| 51 | required_shared_ptr<UINT32> m_spriteram2; | |
| 52 | required_shared_ptr<UINT32> m_videoreg; | |
| 42 | 53 | tilemap_t *m_bg_tilemap; |
| 43 | 54 | tilemap_t *m_md_tilemap; |
| 44 | 55 | tilemap_t *m_fg_tilemap; |
| 45 | UINT32 *m_bg_videoram; | |
| 46 | UINT32 *m_md_videoram; | |
| 47 | UINT32 *m_fg_videoram; | |
| 48 | UINT32 *m_videoreg; | |
| 49 | UINT32 *m_mainram; | |
| 50 | 56 | int m_spriteram_bit; |
| 51 | 57 | bitmap_ind16 m_sprites_bitmap; |
| 52 | 58 | bitmap_ind8 m_sprites_bitmap_pri; |
| r14896 | r14897 | |
| 101 | 107 | |
| 102 | 108 | WRITE32_MEMBER(limenko_state::bg_videoram_w) |
| 103 | 109 | { |
| 104 | COMBINE_DATA(&m_bg_videoram[offset]); | |
| 110 | COMBINE_DATA(&m_bg_videoram.target()[offset]); | |
| 105 | 111 | m_bg_tilemap->mark_tile_dirty(offset); |
| 106 | 112 | } |
| 107 | 113 | |
| 108 | 114 | WRITE32_MEMBER(limenko_state::md_videoram_w) |
| 109 | 115 | { |
| 110 | COMBINE_DATA(&m_md_videoram[offset]); | |
| 116 | COMBINE_DATA(&m_md_videoram.target()[offset]); | |
| 111 | 117 | m_md_tilemap->mark_tile_dirty(offset); |
| 112 | 118 | } |
| 113 | 119 | |
| 114 | 120 | WRITE32_MEMBER(limenko_state::fg_videoram_w) |
| 115 | 121 | { |
| 116 | COMBINE_DATA(&m_fg_videoram[offset]); | |
| 122 | COMBINE_DATA(&m_fg_videoram.target()[offset]); | |
| 117 | 123 | m_fg_tilemap->mark_tile_dirty(offset); |
| 118 | 124 | } |
| 119 | 125 | |
| 120 | 126 | WRITE32_MEMBER(limenko_state::spotty_soundlatch_w) |
| 121 | 127 | { |
| 122 | soundlatch_w(space, 0, (data >> 16) & 0xff); | |
| 128 | soundlatch_byte_w(space, 0, (data >> 16) & 0xff); | |
| 123 | 129 | } |
| 124 | 130 | |
| 125 | 131 | CUSTOM_INPUT_MEMBER(limenko_state::spriteram_bit_r) |
| r14896 | r14897 | |
| 149 | 155 | } |
| 150 | 156 | |
| 151 | 157 | // buffer the next number of sprites to draw |
| 152 | m_prev_sprites_count = (m_videoreg[0] & 0x1ff0000) >> 16; | |
| 158 | m_prev_sprites_count = (m_videoreg.target()[0] & 0x1ff0000) >> 16; | |
| 153 | 159 | } |
| 154 | 160 | |
| 155 | 161 | /***************************************************************************************************** |
| r14896 | r14897 | |
| 157 | 163 | *****************************************************************************************************/ |
| 158 | 164 | |
| 159 | 165 | static ADDRESS_MAP_START( limenko_map, AS_PROGRAM, 32, limenko_state ) |
| 160 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_ | |
| 166 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_ | |
| 161 | 167 | AM_RANGE(0x40000000, 0x403fffff) AM_ROM AM_REGION("user2",0) |
| 162 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(m_fg_videoram) | |
| 163 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_BASE(m_md_videoram) | |
| 164 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(m_bg_videoram) | |
| 165 | AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 166 | AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_BASE(m_spriteram2) | |
| 168 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram") | |
| 169 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_SHARE("md_videoram") | |
| 170 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram") | |
| 171 | AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_SHARE("spriteram") | |
| 172 | AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_SHARE("spriteram2") | |
| 167 | 173 | AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM_WRITE(limenko_paletteram_w) AM_SHARE("paletteram") |
| 168 | 174 | AM_RANGE(0x8001e000, 0x8001ebff) AM_RAM // ? not used |
| 169 | AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_ | |
| 175 | AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_ | |
| 170 | 176 | AM_RANGE(0x8003e000, 0x8003e003) AM_WRITE(spriteram_buffer_w) |
| 171 | 177 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION("user1",0) |
| 172 | 178 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 184 | 190 | /* Spotty memory map */ |
| 185 | 191 | |
| 186 | 192 | static ADDRESS_MAP_START( spotty_map, AS_PROGRAM, 32, limenko_state ) |
| 187 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_ | |
| 193 | AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_ | |
| 188 | 194 | AM_RANGE(0x40002000, 0x400024d3) AM_RAM //? |
| 189 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(m_fg_videoram) | |
| 190 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_BASE(m_md_videoram) | |
| 191 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(m_bg_videoram) | |
| 192 | AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 193 | AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_BASE(m_spriteram2) | |
| 195 | AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram") | |
| 196 | AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_SHARE("md_videoram") | |
| 197 | AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram") | |
| 198 | AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_SHARE("spriteram") | |
| 199 | AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_SHARE("spriteram2") | |
| 194 | 200 | AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM_WRITE(limenko_paletteram_w) AM_SHARE("paletteram") |
| 195 | 201 | AM_RANGE(0x8001e000, 0x8001ebff) AM_RAM // ? not used |
| 196 | AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_ | |
| 202 | AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_ | |
| 197 | 203 | AM_RANGE(0x8003e000, 0x8003e003) AM_WRITE(spriteram_buffer_w) |
| 198 | 204 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("user1",0) |
| 199 | 205 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 222 | 228 | // check m_spotty_sound_cmd bits... |
| 223 | 229 | |
| 224 | 230 | if(m_spotty_sound_cmd == 0xf7) |
| 225 | return soundlatch_r(space,0); | |
| 231 | return soundlatch_byte_r(space,0); | |
| 226 | 232 | else |
| 227 | 233 | return machine().device<okim6295_device>("oki")->read(space,0); |
| 228 | 234 | } |
| r14896 | r14897 | |
| 239 | 245 | static TILE_GET_INFO( get_bg_tile_info ) |
| 240 | 246 | { |
| 241 | 247 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 242 | int tile = state->m_bg_videoram[tile_index] & 0x7ffff; | |
| 243 | int color = (state->m_bg_videoram[tile_index]>>28) & 0xf; | |
| 248 | int tile = state->m_bg_videoram.target()[tile_index] & 0x7ffff; | |
| 249 | int color = (state->m_bg_videoram.target()[tile_index]>>28) & 0xf; | |
| 244 | 250 | SET_TILE_INFO(0,tile,color,0); |
| 245 | 251 | } |
| 246 | 252 | |
| 247 | 253 | static TILE_GET_INFO( get_md_tile_info ) |
| 248 | 254 | { |
| 249 | 255 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 250 | int tile = state->m_md_videoram[tile_index] & 0x7ffff; | |
| 251 | int color = (state->m_md_videoram[tile_index]>>28) & 0xf; | |
| 256 | int tile = state->m_md_videoram.target()[tile_index] & 0x7ffff; | |
| 257 | int color = (state->m_md_videoram.target()[tile_index]>>28) & 0xf; | |
| 252 | 258 | SET_TILE_INFO(0,tile,color,0); |
| 253 | 259 | } |
| 254 | 260 | |
| 255 | 261 | static TILE_GET_INFO( get_fg_tile_info ) |
| 256 | 262 | { |
| 257 | 263 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 258 | int tile = state->m_fg_videoram[tile_index] & 0x7ffff; | |
| 259 | int color = (state->m_fg_videoram[tile_index]>>28) & 0xf; | |
| 264 | int tile = state->m_fg_videoram.target()[tile_index] & 0x7ffff; | |
| 265 | int color = (state->m_fg_videoram.target()[tile_index]>>28) & 0xf; | |
| 260 | 266 | SET_TILE_INFO(0,tile,color,0); |
| 261 | 267 | } |
| 262 | 268 | |
| r14896 | r14897 | |
| 459 | 465 | static SCREEN_UPDATE_IND16( limenko ) |
| 460 | 466 | { |
| 461 | 467 | limenko_state *state = screen.machine().driver_data<limenko_state>(); |
| 462 | // state->m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?) | |
| 468 | // state->m_videoreg.target()[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?) | |
| 463 | 469 | |
| 464 | 470 | screen.machine().priority_bitmap.fill(0, cliprect); |
| 465 | 471 | |
| 466 | state->m_bg_tilemap->enable(state->m_videoreg[0] & 4); | |
| 467 | state->m_md_tilemap->enable(state->m_videoreg[0] & 2); | |
| 468 | state->m_fg_tilemap->enable(state->m_videoreg[0] & 1); | |
| 472 | state->m_bg_tilemap->enable(state->m_videoreg.target()[0] & 4); | |
| 473 | state->m_md_tilemap->enable(state->m_videoreg.target()[0] & 2); | |
| 474 | state->m_fg_tilemap->enable(state->m_videoreg.target()[0] & 1); | |
| 469 | 475 | |
| 470 | state->m_bg_tilemap->set_scrolly(0, state->m_videoreg[3] & 0xffff); | |
| 471 | state->m_md_tilemap->set_scrolly(0, state->m_videoreg[2] & 0xffff); | |
| 472 | state->m_fg_tilemap->set_scrolly(0, state->m_videoreg[1] & 0xffff); | |
| 476 | state->m_bg_tilemap->set_scrolly(0, state->m_videoreg.target()[3] & 0xffff); | |
| 477 | state->m_md_tilemap->set_scrolly(0, state->m_videoreg.target()[2] & 0xffff); | |
| 478 | state->m_fg_tilemap->set_scrolly(0, state->m_videoreg.target()[1] & 0xffff); | |
| 473 | 479 | |
| 474 | state->m_bg_tilemap->set_scrollx(0, (state->m_videoreg[3] & 0xffff0000) >> 16); | |
| 475 | state->m_md_tilemap->set_scrollx(0, (state->m_videoreg[2] & 0xffff0000) >> 16); | |
| 476 | state->m_fg_tilemap->set_scrollx(0, (state->m_videoreg[1] & 0xffff0000) >> 16); | |
| 480 | state->m_bg_tilemap->set_scrollx(0, (state->m_videoreg.target()[3] & 0xffff0000) >> 16); | |
| 481 | state->m_md_tilemap->set_scrollx(0, (state->m_videoreg.target()[2] & 0xffff0000) >> 16); | |
| 482 | state->m_fg_tilemap->set_scrollx(0, (state->m_videoreg.target()[1] & 0xffff0000) >> 16); | |
| 477 | 483 | |
| 478 | 484 | state->m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 479 | 485 | state->m_md_tilemap->draw(bitmap, cliprect, 0,0); |
| 480 | 486 | state->m_fg_tilemap->draw(bitmap, cliprect, 0,1); |
| 481 | 487 | |
| 482 | if(state->m_videoreg[0] & 8) | |
| 488 | if(state->m_videoreg.target()[0] & 8) | |
| 483 | 489 | copy_sprites(screen.machine(), bitmap, state->m_sprites_bitmap, screen.machine().priority_bitmap, cliprect); |
| 484 | 490 | |
| 485 | 491 | return 0; |
| r14896 | r14897 | |
| 1000 | 1006 | machine().firstcpu->eat_cycles(50); |
| 1001 | 1007 | } |
| 1002 | 1008 | |
| 1003 | return m_mainram[0xe2784/4]; | |
| 1009 | return m_mainram.target()[0xe2784/4]; | |
| 1004 | 1010 | } |
| 1005 | 1011 | |
| 1006 | 1012 | READ32_MEMBER(limenko_state::legendoh_speedup_r) |
| r14896 | r14897 | |
| 1010 | 1016 | machine().firstcpu->eat_cycles(50); |
| 1011 | 1017 | } |
| 1012 | 1018 | |
| 1013 | return m_mainram[0x32ab0/4]; | |
| 1019 | return m_mainram.target()[0x32ab0/4]; | |
| 1014 | 1020 | } |
| 1015 | 1021 | |
| 1016 | 1022 | READ32_MEMBER(limenko_state::sb2003_speedup_r) |
| r14896 | r14897 | |
| 1020 | 1026 | machine().firstcpu->eat_cycles(50); |
| 1021 | 1027 | } |
| 1022 | 1028 | |
| 1023 | return m_mainram[0x135800/4]; | |
| 1029 | return m_mainram.target()[0x135800/4]; | |
| 1024 | 1030 | } |
| 1025 | 1031 | |
| 1026 | 1032 | READ32_MEMBER(limenko_state::spotty_speedup_r) |
| r14896 | r14897 | |
| 1030 | 1036 | machine().firstcpu->eat_cycles(50); |
| 1031 | 1037 | } |
| 1032 | 1038 | |
| 1033 | return m_mainram[0x6626c/4]; | |
| 1039 | return m_mainram.target()[0x6626c/4]; | |
| 1034 | 1040 | } |
| 1035 | 1041 | |
| 1036 | 1042 | static DRIVER_INIT( dynabomb ) |
| r14896 | r14897 | |
|---|---|---|
| 17 | 17 | m_dmdcpu(*this, "dmdcpu"), |
| 18 | 18 | m_mc6845(*this, "mc6845"), |
| 19 | 19 | m_decobsmt(*this, "decobsmt") |
| 20 | { } | |
| 20 | , | |
| 21 | m_vram(*this, "vram"){ } | |
| 21 | 22 | |
| 22 | 23 | required_device<cpu_device> m_maincpu; |
| 23 | 24 | required_device<cpu_device> m_dmdcpu; |
| r14896 | r14897 | |
| 29 | 30 | UINT8 m_dmd_status; |
| 30 | 31 | UINT8 m_dmd_busy; |
| 31 | 32 | |
| 32 | ||
| 33 | required_shared_ptr<UINT8> | |
| 33 | 34 | |
| 34 | 35 | DECLARE_WRITE8_MEMBER(dmd_latch_w); |
| 35 | 36 | DECLARE_READ8_MEMBER(dmd_latch_r); |
| r14896 | r14897 | |
| 157 | 158 | |
| 158 | 159 | static ADDRESS_MAP_START( whitestar_dmd_map, AS_PROGRAM, 8, whitestar_state ) |
| 159 | 160 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 160 | AM_RANGE(0x2000, 0x2fff) AM_RAM AM_ | |
| 161 | AM_RANGE(0x2000, 0x2fff) AM_RAM AM_ | |
| 161 | 162 | AM_RANGE(0x3000, 0x3000) AM_DEVREADWRITE("mc6845", mc6845_device, register_r, address_w) |
| 162 | 163 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("mc6845", mc6845_device, register_w) |
| 163 | 164 | AM_RANGE(0x3002, 0x3002) AM_WRITE(dmd_bank_w) |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | WRITE16_MEMBER(prehisle_state::prehisle_sound16_w) |
| 21 | 21 | { |
| 22 | soundlatch_w(space, 0, data & 0xff); | |
| 22 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 23 | 23 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 24 | 24 | } |
| 25 | 25 | |
| r14896 | r14897 | |
| 31 | 31 | AM_RANGE(0x090000, 0x0907ff) AM_RAM_WRITE(prehisle_fg_videoram16_w) AM_BASE(m_videoram) |
| 32 | 32 | AM_RANGE(0x0a0000, 0x0a07ff) AM_RAM AM_BASE(m_spriteram) |
| 33 | 33 | AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(prehisle_bg_videoram16_w) AM_BASE(m_bg_videoram16) |
| 34 | AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(paletteram | |
| 34 | AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(paletteram | |
| 35 | 35 | AM_RANGE(0x0e0000, 0x0e00ff) AM_READ(prehisle_control16_r) |
| 36 | 36 | AM_RANGE(0x0f0070, 0x0ff071) AM_WRITE(prehisle_sound16_w) |
| 37 | 37 | AM_RANGE(0x0f0000, 0x0ff0ff) AM_WRITE(prehisle_control16_w) |
| r14896 | r14897 | |
| 54 | 54 | static ADDRESS_MAP_START( prehisle_sound_map, AS_PROGRAM, 8, prehisle_state ) |
| 55 | 55 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 56 | 56 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 57 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 57 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 58 | 58 | AM_RANGE(0xf800, 0xf800) AM_WRITENOP // ??? |
| 59 | 59 | ADDRESS_MAP_END |
| 60 | 60 |
| r14896 | r14897 | |
|---|---|---|
| 3357 | 3357 | ROM_START( sc4cfqpsg ) |
| 3358 | 3358 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 3359 | 3359 | ROM_LOAD16_BYTE( "95420324.lo", 0x00001, 0x080000, CRC(14f2328e) SHA1(95a05b37e21ce3c729f2000baeb1308008ad13c2) ) |
| 3360 | ROM_LOAD16_BYTE( "95420325.hi", 0x00000, 0x080000, | |
| 3360 | ROM_LOAD16_BYTE( "95420325.hi", 0x00000, 0x080000, CRC( | |
| 3361 | 3361 | sc_cfqps_others |
| 3362 | 3362 | ROM_END |
| 3363 | 3363 | |
| r14896 | r14897 | |
| 16309 | 16309 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16310 | 16310 | ROM_LOAD16_BYTE( "95402217.lo", 0x00001, 0x080000, CRC(5f86e26e) SHA1(293d3700844dcfaf2a5c6e9a4ee817893e11cf1b) ) |
| 16311 | 16311 | ROM_LOAD16_BYTE( "95402218.hi", 0x00000, 0x080000, CRC(72792a3e) SHA1(efbf3fcf7f7b40424c8b7fa46d35c9bb484fe431) ) |
| 16312 | | |
| 16312 | SOUND_95004150_CRAZY_FRUITS_PR6982 | |
| 16313 | 16313 | ROM_END |
| 16314 | 16314 | |
| 16315 | 16315 | ROM_START( sc4czfra ) |
| 16316 | 16316 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16317 | 16317 | ROM_LOAD16_BYTE( "95406394.lo", 0x00001, 0x080000, CRC(c07a8695) SHA1(3670e547530452f21a937f34072d812f25a480ce) ) |
| 16318 | 16318 | ROM_LOAD16_BYTE( "95406395.hi", 0x00000, 0x080000, CRC(e469252b) SHA1(a7861f3d215c70b57263501af158f86257bf37c0) ) |
| 16319 | | |
| 16319 | PR1152_CRAZY_FRUITS_SOUNDS11 | |
| 16320 | 16320 | ROM_END |
| 16321 | 16321 | |
| 16322 | 16322 | ROM_START( sc4czfrb ) |
| r14896 | r14897 | |
| 16337 | 16337 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16338 | 16338 | ROM_LOAD16_BYTE( "95401701.lo", 0x00001, 0x080000, CRC(5c09007e) SHA1(d69290225f08ed5dcf0204bd96f7f09a73c2f243) ) |
| 16339 | 16339 | ROM_LOAD16_BYTE( "95401702.hi", 0x00000, 0x080000, NO_DUMP ) |
| 16340 | | |
| 16340 | SOUND_95004150_CRAZY_FRUITS_PR6982 | |
| 16341 | 16341 | ROM_END |
| 16342 | 16342 | |
| 16343 | 16343 | |
| r14896 | r14897 | |
| 16361 | 16361 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16362 | 16362 | ROM_LOAD16_BYTE( "95418430.lo", 0x00001, 0x080000, CRC(16632394) SHA1(76fc5f14d2b0895959580979d9973094fa10c63a) ) |
| 16363 | 16363 | ROM_LOAD16_BYTE( "95418431.hi", 0x00000, 0x080000, CRC(25e91233) SHA1(8814c4f48299f07e1836ff4e86ceead5fc91e7c9) ) |
| 16364 | | |
| 16364 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16365 | 16365 | ROM_END |
| 16366 | 16366 | |
| 16367 | 16367 | |
| r14896 | r14897 | |
| 16369 | 16369 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16370 | 16370 | ROM_LOAD16_BYTE( "95418628.lo", 0x00001, 0x080000, CRC(534e6f8b) SHA1(8b89b691eac6415344e5e91a6682cd2030ffba6e) ) |
| 16371 | 16371 | ROM_LOAD16_BYTE( "95418629.hi", 0x00000, 0x080000, NO_DUMP ) |
| 16372 | | |
| 16372 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16373 | 16373 | ROM_END |
| 16374 | 16374 | |
| 16375 | 16375 | |
| r14896 | r14897 | |
| 16377 | 16377 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16378 | 16378 | ROM_LOAD16_BYTE( "95419430.lo", 0x00001, 0x080000, CRC(1a510dfc) SHA1(e4620c76a56539e93d90d7f9729b4daab2278256) ) |
| 16379 | 16379 | ROM_LOAD16_BYTE( "95419431.hi", 0x00000, 0x080000, CRC(d4f546b5) SHA1(10d9df4dec30f9f1a9ffecd8c74de491a20ddf56) ) |
| 16380 | | |
| 16380 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16381 | 16381 | ROM_END |
| 16382 | 16382 | |
| 16383 | 16383 | |
| r14896 | r14897 | |
| 16386 | 16386 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16387 | 16387 | ROM_LOAD16_BYTE( "95419628.lo", 0x00001, 0x080000, CRC(5a6f07e9) SHA1(db21ee37d9a4fd421593fc9eb8ef27bad6788c4e) ) |
| 16388 | 16388 | ROM_LOAD16_BYTE( "95419629.hi", 0x00000, 0x080000, CRC(cdf330d0) SHA1(aa5030ae3ec64ce4ead9688e51bfcd8ff1bbf543) ) |
| 16389 | | |
| 16389 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16390 | 16390 | ROM_END |
| 16391 | 16391 | |
| 16392 | 16392 | |
| r14896 | r14897 | |
| 16394 | 16394 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16395 | 16395 | ROM_LOAD16_BYTE( "95422036.lo", 0x00001, 0x080000, CRC(b1d048dc) SHA1(bde75f8797ebd668eb8c9cf6c05da562874df540) ) |
| 16396 | 16396 | ROM_LOAD16_BYTE( "95422037.hi", 0x00000, 0x080000, CRC(2d881f97) SHA1(aec94590f8cd7d21b386804b05bd53c9dee17968) ) |
| 16397 | | |
| 16397 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16398 | 16398 | ROM_END |
| 16399 | 16399 | |
| 16400 | 16400 | ROM_START( sc4dnde ) |
| 16401 | 16401 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16402 | 16402 | ROM_LOAD16_BYTE( "95422866.lo", 0x00001, 0x080000, CRC(9fd063d1) SHA1(6e7dc034c2b6da609b5f200e4ede20faecf1104c) ) |
| 16403 | 16403 | ROM_LOAD16_BYTE( "95422867.hi", 0x00000, 0x080000, CRC(982b5826) SHA1(46be9e735c16300553a4b37d6d98ff97cdb43aed) ) |
| 16404 | | |
| 16404 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16405 | 16405 | ROM_END |
| 16406 | 16406 | |
| 16407 | 16407 | ROM_START( sc4dndf ) |
| 16408 | 16408 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16409 | 16409 | ROM_LOAD16_BYTE( "95422890.lo", 0x00001, 0x080000, CRC(ae29311c) SHA1(1bdd12b2cd2e96d4704da044b251fdb111ee0cb1) ) |
| 16410 | 16410 | ROM_LOAD16_BYTE( "95422891.hi", 0x00000, 0x080000, CRC(d79559eb) SHA1(ef5f27b5b84bf1072f1b5a13ee17143a06515712) ) |
| 16411 | | |
| 16411 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16412 | 16412 | ROM_END |
| 16413 | 16413 | |
| 16414 | 16414 | ROM_START( sc4dndg ) |
| 16415 | 16415 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16416 | 16416 | ROM_LOAD16_BYTE( "95423036.lo", 0x00001, 0x080000, CRC(e484b7fb) SHA1(6489fe890ca6cfeb4eb2043253c6bd0bab185724) ) |
| 16417 | 16417 | ROM_LOAD16_BYTE( "95423037.hi", 0x00000, 0x080000, CRC(e2c36879) SHA1(8978ed2c7c1510b62eedb0353e435b89b648670a) ) |
| 16418 | | |
| 16418 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16419 | 16419 | ROM_END |
| 16420 | 16420 | |
| 16421 | 16421 | ROM_START( sc4dndh ) |
| 16422 | 16422 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16423 | 16423 | ROM_LOAD16_BYTE( "95423866.lo", 0x00001, 0x080000, CRC(f99b2b86) SHA1(f04e154c1887d4225075802e3618261bf444ae26) ) |
| 16424 | 16424 | ROM_LOAD16_BYTE( "95423867.hi", 0x00000, 0x080000, CRC(fe6b1130) SHA1(2de60e150829acde7f7f3453fd5397ed549ab421) ) |
| 16425 | | |
| 16425 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16426 | 16426 | ROM_END |
| 16427 | 16427 | |
| 16428 | 16428 | ROM_START( sc4dndi ) |
| 16429 | 16429 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16430 | 16430 | ROM_LOAD16_BYTE( "95423890.lo", 0x00001, 0x080000, CRC(9b6d3415) SHA1(b14bc3ede63184f7d3be0703e7170f85671350d5) ) |
| 16431 | 16431 | ROM_LOAD16_BYTE( "95423891.hi", 0x00000, 0x080000, CRC(58c37a50) SHA1(09fde3c464bab08b95e2609cde64cf2fc4ddce7e) ) |
| 16432 | | |
| 16432 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16433 | 16433 | ROM_END |
| 16434 | 16434 | |
| 16435 | 16435 | ROM_START( sc4dndj ) |
| 16436 | 16436 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16437 | 16437 | ROM_LOAD16_BYTE( "95426154.lo", 0x00001, 0x080000, CRC(17169e09) SHA1(e9e6752ab858c1d14253d27842c269c8e9e6fb5f) ) |
| 16438 | 16438 | ROM_LOAD16_BYTE( "95426155.hi", 0x00000, 0x080000, CRC(7eb7893e) SHA1(a97f35be2d494da19dcb6f4b235a83d46fabba3e) ) |
| 16439 | | |
| 16439 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16440 | 16440 | ROM_END |
| 16441 | 16441 | |
| 16442 | 16442 | ROM_START( sc4dndk ) |
| 16443 | 16443 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16444 | 16444 | ROM_LOAD16_BYTE( "95426170.lo", 0x00001, 0x080000, CRC(99951add) SHA1(640401c6b412dd0d2a186a134e4fb77c92001614) ) |
| 16445 | 16445 | ROM_LOAD16_BYTE( "95426171.hi", 0x00000, 0x080000, CRC(eb65bbe5) SHA1(f8c384086a335a02985ed938b405fffd4aa37bbb) ) |
| 16446 | | |
| 16446 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16447 | 16447 | ROM_END |
| 16448 | 16448 | |
| 16449 | 16449 | ROM_START( sc4dndl ) |
| 16450 | 16450 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16451 | 16451 | ROM_LOAD16_BYTE( "95427154.lo", 0x00001, 0x080000, CRC(745ac559) SHA1(3fff27727fdf6b34f4500bc42dacacb9a807e848) ) |
| 16452 | 16452 | ROM_LOAD16_BYTE( "95427155.hi", 0x00000, 0x080000, CRC(15a28fd8) SHA1(4fe2fb60d447bfcc4996643badcf5440b76a951d) ) |
| 16453 | | |
| 16453 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16454 | 16454 | ROM_END |
| 16455 | 16455 | |
| 16456 | 16456 | ROM_START( sc4dndm ) |
| 16457 | 16457 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16458 | 16458 | ROM_LOAD16_BYTE( "95427170.lo", 0x00001, 0x080000, CRC(65cf387c) SHA1(3436e81927c00551d3eaa7d21922187ac9b93bf5) ) |
| 16459 | 16459 | ROM_LOAD16_BYTE( "95427171.hi", 0x00000, 0x080000, CRC(f4021af5) SHA1(15eb7c36da5ab02a14021ec02af5861431bb318b) ) |
| 16460 | | |
| 16460 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16461 | 16461 | ROM_END |
| 16462 | 16462 | |
| 16463 | 16463 | ROM_START( sc4dndn ) |
| 16464 | 16464 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16465 | 16465 | ROM_LOAD16_BYTE( "95422038.lo", 0x00001, 0x080000, CRC(c75da829) SHA1(b240a1aa1056c3227a23ae1df37eacece7832a97) ) |
| 16466 | 16466 | ROM_LOAD16_BYTE( "95422039.hi", 0x00000, 0x080000, CRC(c9c8661b) SHA1(c8ad798e4807da659015a9925cdb0eb6e837a9af) ) |
| 16467 | | |
| 16467 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16468 | 16468 | ROM_END |
| 16469 | 16469 | |
| 16470 | 16470 | ROM_START( sc4dndo ) |
| 16471 | 16471 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16472 | 16472 | ROM_LOAD16_BYTE( "95423038.lo", 0x00001, 0x080000, CRC(00adce65) SHA1(917a882f6e28198795ee056914433dd1ce361803) ) |
| 16473 | 16473 | ROM_LOAD16_BYTE( "95423039.hi", 0x00000, 0x080000, CRC(556af108) SHA1(7a88c1311ab7aa7773dd6b70a3891ebbe2d340d1) ) |
| 16474 | | |
| 16474 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16475 | 16475 | ROM_END |
| 16476 | 16476 | |
| 16477 | 16477 | ROM_START( sc4dndcs ) |
| 16478 | 16478 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16479 | 16479 | ROM_LOAD16_BYTE( "95418528.lo", 0x00001, 0x080000, CRC(d0192ab5) SHA1(b1e98d901ea0ea0010f02e76c296418da775a8c6) ) |
| 16480 | 16480 | ROM_LOAD16_BYTE( "95418529.hi", 0x00000, 0x080000, CRC(10ce1fa8) SHA1(a207f8c1b4fa40f95f5c3cba64648f87efa5d903) ) |
| 16481 | | |
| 16481 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16482 | 16482 | ROM_END |
| 16483 | 16483 | |
| 16484 | 16484 | ROM_START( sc4dndcsa ) |
| 16485 | 16485 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16486 | 16486 | ROM_LOAD16_BYTE( "95418752.lo", 0x00001, 0x080000, CRC(ea381dee) SHA1(e68557b00fbbac86d7c153470050da0980751fa1) ) |
| 16487 | 16487 | ROM_LOAD16_BYTE( "95418753.hi", 0x00000, 0x080000, CRC(de953115) SHA1(98443f633997be3e7a8c43e6692a9dd0c4fcf0b1) ) |
| 16488 | | |
| 16488 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16489 | 16489 | ROM_END |
| 16490 | 16490 | |
| 16491 | 16491 | ROM_START( sc4dndcsb ) |
| 16492 | 16492 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16493 | 16493 | ROM_LOAD16_BYTE( "95419528.lo", 0x00001, 0x080000, CRC(0498ed27) SHA1(cab277385393410dbe54a72f7f778d67aeb42ba1) ) |
| 16494 | 16494 | ROM_LOAD16_BYTE( "95419529.hi", 0x00000, 0x080000, CRC(524a6e36) SHA1(0f8639a83eefcb3cf8f7541a2a77e984cf1688d5) ) |
| 16495 | | |
| 16495 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16496 | 16496 | ROM_END |
| 16497 | 16497 | |
| 16498 | 16498 | ROM_START( sc4dndcsc ) |
| 16499 | 16499 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| 16500 | 16500 | ROM_LOAD16_BYTE( "95419752.lo", 0x00001, 0x080000, CRC(c06b60aa) SHA1(b40e4412db1f57511e0b2586fd65df56874a23bb) ) |
| 16501 | 16501 | ROM_LOAD16_BYTE( "95419753.hi", 0x00000, 0x080000, CRC(76da2127) SHA1(2a06c5fb329a6045671f92073c2e1dd78dc79769) ) |
| 16502 | | |
| 16502 | PR1907_DEAL_OR_NO_DEAL_SOUNDS11 | |
| 16503 | 16503 | ROM_END |
| 16504 | 16504 | |
| 16505 | 16505 | |
| r14896 | r14897 | |
| 22089 | 22089 | sc_dndbe_others |
| 22090 | 22090 | ROM_END |
| 22091 | 22091 | |
| 22092 | /* | |
| 22093 | ROM_START( sc4dndbea ) | |
| 22094 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) | |
| 22095 | ROM_LOAD16_BYTE( "95418410.lo", 0x00001, 0x080000, CRC(ddd534d0) SHA1(1c8acd74d79fc7f169ed54e2d603100775610e5a) ) | |
| 22096 | ROM_LOAD16_BYTE( "95418411.hi", 0x00000, 0x080000, CRC(5346fd2a) SHA1(ada8ed84a173bf3f68af0a2e1b92dbfe94f2d6c9) ) | |
| 22097 | sc_dndbe_others | |
| 22098 | ROM_END | |
| 22099 | */ | |
| 22100 | 22092 | |
| 22101 | 22093 | ROM_START( sc4dndbeb ) |
| 22102 | 22094 | ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | WRITE8_MEMBER(actfancr_state::actfancr_sound_w) |
| 57 | 57 | { |
| 58 | soundlatch_w(space, 0, data & 0xff); | |
| 58 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 59 | 59 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 60 | 60 | } |
| 61 | 61 | |
| r14896 | r14897 | |
| 82 | 82 | AM_RANGE(0x072000, 0x0727ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w) |
| 83 | 83 | AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("spriteram") |
| 84 | 84 | AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w) |
| 85 | AM_RANGE(0x120000, 0x1205ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 85 | AM_RANGE(0x120000, 0x1205ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 86 | 86 | AM_RANGE(0x130000, 0x130000) AM_READ_PORT("P1") |
| 87 | 87 | AM_RANGE(0x130001, 0x130001) AM_READ_PORT("P2") |
| 88 | 88 | AM_RANGE(0x130002, 0x130002) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 105 | 105 | AM_RANGE(0x100000, 0x100001) AM_WRITE(actfancr_sound_w) |
| 106 | 106 | AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w) |
| 107 | 107 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_SHARE("spriteram") |
| 108 | AM_RANGE(0x130000, 0x1305ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 108 | AM_RANGE(0x130000, 0x1305ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 109 | 109 | AM_RANGE(0x140000, 0x140001) AM_READNOP /* Value doesn't matter */ |
| 110 | 110 | AM_RANGE(0x1f0000, 0x1f3fff) AM_RAM AM_BASE(m_main_ram) /* Main ram */ |
| 111 | 111 | AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(triothep_control_r, triothep_control_select_w) |
| r14896 | r14897 | |
| 118 | 118 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 119 | 119 | AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 120 | 120 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3812_w) |
| 121 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 121 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 122 | 122 | AM_RANGE(0x3800, 0x3800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 123 | 123 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 124 | 124 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 798 | 798 | WRITE16_MEMBER(model1_state::p_w) |
| 799 | 799 | { |
| 800 | 800 | UINT16 old = m_generic_paletteram_16[offset]; |
| 801 | paletteram | |
| 801 | paletteram | |
| 802 | 802 | if(0 && m_generic_paletteram_16[offset] != old) |
| 803 | 803 | logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(&space.device())); |
| 804 | 804 | } |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | { |
| 51 | 51 | public: |
| 52 | 52 | poo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | : driver_device(mconfig, type, tag) { } | |
| 53 | : driver_device(mconfig, type, tag) , | |
| 54 | m_sprites(*this, "sprites"), | |
| 55 | m_scrolly(*this, "scrolly"), | |
| 56 | m_vram(*this, "vram"){ } | |
| 54 | 57 | |
| 55 | UINT8 *m_vram; | |
| 56 | UINT8 *m_scrolly; | |
| 57 | UINT8 *m_sprites; | |
| 58 | required_shared_ptr<UINT8> m_sprites; | |
| 59 | required_shared_ptr<UINT8> m_scrolly; | |
| 60 | required_shared_ptr<UINT8> m_vram; | |
| 58 | 61 | UINT8 m_vram_colbank; |
| 59 | 62 | DECLARE_READ8_MEMBER(unk_inp_r); |
| 60 | 63 | DECLARE_READ8_MEMBER(unk_inp2_r); |
| r14896 | r14897 | |
| 83 | 86 | { |
| 84 | 87 | for (y=0;y<32;y++) |
| 85 | 88 | { |
| 86 | int tile = state->m_vram[count+0x000] | ((state->m_vram[count+0x400] & 3) <<8); | |
| 87 | int color = (state->m_vram[count+0x400] & 0x38) >> 3; | |
| 88 | int scrolly = (state->m_scrolly[x*4]); | |
| 89 | int tile = state->m_vram.target()[count+0x000] | ((state->m_vram.target()[count+0x400] & 3) <<8); | |
| 90 | int color = (state->m_vram.target()[count+0x400] & 0x38) >> 3; | |
| 91 | int scrolly = (state->m_scrolly.target()[x*4]); | |
| 89 | 92 | |
| 90 | 93 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color+state->m_vram_colbank,0,0,x*8,256-(y*8)+scrolly); |
| 91 | 94 | drawgfx_opaque(bitmap,cliprect,gfx,tile,color+state->m_vram_colbank,0,0,x*8,0-(y*8)+scrolly); |
| r14896 | r14897 | |
| 99 | 102 | |
| 100 | 103 | for(i=0;i<0x80;i+=4) |
| 101 | 104 | { |
| 102 | spr_offs = state->m_sprites[i+2] | (state->m_sprites[i+3] & 3) << 8; | |
| 103 | y = state->m_sprites[i+0]+8; | |
| 104 | x = state->m_sprites[i+1]; | |
| 105 | col = (state->m_sprites[i+3] & 0xf8) >> 3; | |
| 105 | spr_offs = state->m_sprites.target()[i+2] | (state->m_sprites.target()[i+3] & 3) << 8; | |
| 106 | y = state->m_sprites.target()[i+0]+8; | |
| 107 | x = state->m_sprites.target()[i+1]; | |
| 108 | col = (state->m_sprites.target()[i+3] & 0xf8) >> 3; | |
| 106 | 109 | fx = 0; |
| 107 | 110 | fy = 0; |
| 108 | 111 | |
| r14896 | r14897 | |
| 142 | 145 | /* soundlatch write */ |
| 143 | 146 | WRITE8_MEMBER(poo_state::sound_cmd_w) |
| 144 | 147 | { |
| 145 | soundlatch_w(space, 0, (data & 0xff)); | |
| 148 | soundlatch_byte_w(space, 0, (data & 0xff)); | |
| 146 | 149 | cputag_set_input_line(machine(), "subcpu", 0, HOLD_LINE); |
| 147 | 150 | } |
| 148 | 151 | |
| r14896 | r14897 | |
| 158 | 161 | AM_RANGE(0x9000, 0x97ff) AM_RAM |
| 159 | 162 | AM_RANGE(0x9800, 0x9801) AM_READ(unk_inp_r) //AM_WRITE(unk_w ) |
| 160 | 163 | |
| 161 | AM_RANGE(0xb000, 0xb07f) AM_RAM AM_BASE(m_sprites) | |
| 162 | AM_RANGE(0xb080, 0xb0ff) AM_RAM AM_BASE(m_scrolly) | |
| 164 | AM_RANGE(0xb000, 0xb07f) AM_RAM AM_SHARE("sprites") | |
| 165 | AM_RANGE(0xb080, 0xb0ff) AM_RAM AM_SHARE("scrolly") | |
| 163 | 166 | |
| 164 | 167 | AM_RANGE(0xb400, 0xb400) AM_WRITE(sound_cmd_w) |
| 165 | 168 | |
| r14896 | r14897 | |
| 171 | 174 | |
| 172 | 175 | AM_RANGE(0xb700, 0xb700) AM_WRITE(poo_vregs_w) |
| 173 | 176 | |
| 174 | AM_RANGE(0xb800, 0xbfff) AM_RAM AM_ | |
| 177 | AM_RANGE(0xb800, 0xbfff) AM_RAM AM_ | |
| 175 | 178 | |
| 176 | 179 | ADDRESS_MAP_END |
| 177 | 180 | |
| r14896 | r14897 | |
| 322 | 325 | { |
| 323 | 326 | AY8910_LEGACY_OUTPUT, |
| 324 | 327 | AY8910_DEFAULT_LOADS, |
| 325 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 328 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 326 | 329 | DEVCB_DRIVER_MEMBER(poo_state, timer_r), |
| 327 | 330 | DEVCB_NULL, |
| 328 | 331 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 334 | 334 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 335 | 335 | AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_BASE(m_workram) /* work ram */ |
| 336 | 336 | AM_RANGE(0x180000, 0x183fff) AM_RAM AM_SHARE("nvram") /* backup ram */ |
| 337 | AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(paletteram | |
| 337 | AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(paletteram | |
| 338 | 338 | AM_RANGE(0x300000, 0x30003f) AM_DEVWRITE_LEGACY("k056832", k056832_word_w) /* video reg */ |
| 339 | 339 | AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8_LEGACY("k053252", k053252_r, k053252_w,0x00ff) /* ccu */ |
| 340 | 340 | AM_RANGE(0x330000, 0x330001) AM_READ_PORT("SENSOR") /* battery power & service sw */ |
| r14896 | r14897 | |
| 357 | 357 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 358 | 358 | AM_RANGE(0x100000, 0x110fff) AM_RAM AM_BASE(m_workram) /* work ram */ |
| 359 | 359 | AM_RANGE(0x180000, 0x183fff) AM_RAM AM_SHARE("nvram") /* backup ram */ |
| 360 | AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(paletteram | |
| 360 | AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(paletteram | |
| 361 | 361 | AM_RANGE(0x300000, 0x30003f) AM_DEVWRITE_LEGACY("k056832", k056832_word_w) /* video reg */ |
| 362 | 362 | AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8_LEGACY("k053252", k053252_r, k053252_w,0xff00) /* ccu */ |
| 363 | 363 | AM_RANGE(0x330000, 0x330001) AM_READ_PORT("SENSOR") /* battery power & service */ |
| r14896 | r14897 | |
|---|---|---|
| 292 | 292 | WRITE16_MEMBER(cps_state::cps1_soundlatch_w) |
| 293 | 293 | { |
| 294 | 294 | if (ACCESSING_BITS_0_7) |
| 295 | soundlatch_w(space, 0, data & 0xff); | |
| 295 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | WRITE16_MEMBER(cps_state::cps1_soundlatch2_w) |
| 299 | 299 | { |
| 300 | 300 | if (ACCESSING_BITS_0_7) |
| 301 | soundlatch2_w(space, 0, data & 0xff); | |
| 301 | soundlatch2_byte_w(space, 0, data & 0xff); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | WRITE16_MEMBER(cps_state::cps1_coinctrl_w) |
| r14896 | r14897 | |
| 582 | 582 | AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 583 | 583 | AM_RANGE(0xf004, 0xf004) AM_WRITE(cps1_snd_bankswitch_w) |
| 584 | 584 | AM_RANGE(0xf006, 0xf006) AM_DEVWRITE_LEGACY("oki", cps1_oki_pin7_w) /* controls pin 7 of OKI chip */ |
| 585 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_r) /* Sound command */ | |
| 586 | AM_RANGE(0xf00a, 0xf00a) AM_READ(soundlatch2_r) /* Sound timer fade */ | |
| 585 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_byte_r) /* Sound command */ | |
| 586 | AM_RANGE(0xf00a, 0xf00a) AM_READ(soundlatch2_byte_r) /* Sound timer fade */ | |
| 587 | 587 | ADDRESS_MAP_END |
| 588 | 588 | |
| 589 | 589 | static ADDRESS_MAP_START( qsound_main_map, AS_PROGRAM, 16, cps_state ) |
| r14896 | r14897 | |
|---|---|---|
| 129 | 129 | AM_RANGE(0x800180, 0x800181) AM_WRITE(yunsun16_sound_bank_w) // Sound |
| 130 | 130 | AM_RANGE(0x800188, 0x800189) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound |
| 131 | 131 | AM_RANGE(0x8001fe, 0x8001ff) AM_WRITENOP // ? 0 (during int) |
| 132 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(paletteram | |
| 132 | AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(paletteram | |
| 133 | 133 | AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(yunsun16_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 134 | 134 | AM_RANGE(0x90c000, 0x90ffff) AM_RAM_WRITE(yunsun16_vram_0_w) AM_BASE(m_vram_0) // Layer 0 |
| 135 | 135 | AM_RANGE(0x910000, 0x910fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| r14896 | r14897 | |
| 147 | 147 | */ |
| 148 | 148 | if ((data & 0xff) != 0x3a) |
| 149 | 149 | { |
| 150 | soundlatch_w(space, 0, data & 0xff); | |
| 150 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 151 | 151 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 152 | 152 | } |
| 153 | 153 | } |
| r14896 | r14897 | |
| 176 | 176 | static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, yunsun16_state ) |
| 177 | 177 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 178 | 178 | AM_RANGE(0x10, 0x11) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w ) |
| 179 | AM_RANGE(0x18, 0x18) AM_READ(soundlatch_r ) // From Main CPU | |
| 179 | AM_RANGE(0x18, 0x18) AM_READ(soundlatch_byte_r ) // From Main CPU | |
| 180 | 180 | AM_RANGE(0x1c, 0x1c) AM_DEVREADWRITE("oki", okim6295_device, read, write) // M6295 |
| 181 | 181 | ADDRESS_MAP_END |
| 182 | 182 |
| r14896 | r14897 | |
|---|---|---|
| 180 | 180 | { |
| 181 | 181 | // 0x90 triggers a jump to non-existant address(development system?) and must be filtered |
| 182 | 182 | case 0x00: |
| 183 | if (data != 0x90) soundlatch_w(space, 0, data); | |
| 183 | if (data != 0x90) soundlatch_byte_w(space, 0, data); | |
| 184 | 184 | break; |
| 185 | 185 | |
| 186 | 186 | // explosion sound trigger(analog?) |
| r14896 | r14897 | |
| 227 | 227 | AM_RANGE(0xd000, 0xd3ff) AM_BASE(m_videoram2) /* Fallthrough */ |
| 228 | 228 | AM_RANGE(0xd400, 0xd7ff) AM_BASE(m_colorram2) |
| 229 | 229 | AM_RANGE(0xd800, 0xd83f) AM_BASE(m_attributesram2) |
| 230 | AM_RANGE(0xd840, 0xd85f) AM_BASE(m_spriteram2 | |
| 230 | AM_RANGE(0xd840, 0xd85f) AM_BASE_SIZE(m_spriteram2, | |
| 231 | 231 | AM_RANGE(0xd000, 0xd85f) AM_RAM |
| 232 | 232 | AM_RANGE(0xe000, 0xe3ff) AM_BASE(m_videoram) /* Fallthrough */ |
| 233 | 233 | AM_RANGE(0xe400, 0xe7ff) AM_RAM |
| r14896 | r14897 | |
| 261 | 261 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, wiz_state ) |
| 262 | 262 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 263 | 263 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 264 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Stinger/Scion */ | |
| 264 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Stinger/Scion */ | |
| 265 | 265 | AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("8910.3", ay8910_address_data_w) |
| 266 | 266 | AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_data_w) |
| 267 | 267 | AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("8910.2", ay8910_address_data_w) /* Wiz only */ |
| 268 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Wiz */ | |
| 268 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Wiz */ | |
| 269 | 269 | ADDRESS_MAP_END |
| 270 | 270 | |
| 271 | 271 | static ADDRESS_MAP_START( stinger_sound_map, AS_PROGRAM, 8, wiz_state ) |
| 272 | 272 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 273 | 273 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 274 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Stinger/Scion */ | |
| 274 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Stinger/Scion */ | |
| 275 | 275 | AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("8910.1", ay8910_address_data_w) |
| 276 | 276 | AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("8910.2", ay8910_address_data_w) /* Wiz only */ |
| 277 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Wiz */ | |
| 277 | AM_RANGE(0x7000, 0x7000) AM_READ(soundlatch_byte_r) AM_WRITE(wiz_sound_nmi_mask_w) /* Wiz */ | |
| 278 | 278 | ADDRESS_MAP_END |
| 279 | 279 | |
| 280 | 280 |
| r14896 | r14897 | |
|---|---|---|
| 89 | 89 | { |
| 90 | 90 | AY8910_LEGACY_OUTPUT, |
| 91 | 91 | AY8910_DEFAULT_LOADS, |
| 92 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 92 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 93 | 93 | DEVCB_HANDLER(frogger_portB_r), |
| 94 | 94 | DEVCB_NULL, |
| 95 | 95 | DEVCB_NULL |
| r14896 | r14897 | |
| 122 | 122 | AM_RANGE(0x8c00, 0x8fff) AM_RAM_WRITE(galaxold_videoram_w) /* mirror */ |
| 123 | 123 | AM_RANGE(0x8c00, 0x8fff) AM_READ(galaxold_videoram_r) /* mirror */ |
| 124 | 124 | AM_RANGE(0x9000, 0x903f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 125 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 126 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 125 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 126 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 127 | 127 | AM_RANGE(0x9080, 0x90ff) AM_RAM |
| 128 | 128 | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 129 | 129 | AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| r14896 | r14897 | |
| 139 | 139 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 140 | 140 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 141 | 141 | AM_RANGE(0x8800, 0x883f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 142 | AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 143 | AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 142 | AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 143 | AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 144 | 144 | AM_RANGE(0x8880, 0x88ff) AM_RAM |
| 145 | 145 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 146 | 146 | AM_RANGE(0x9400, 0x97ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) /* mirror */ |
| r14896 | r14897 | |
| 160 | 160 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 161 | 161 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 162 | 162 | AM_RANGE(0x9000, 0x903f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 163 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 164 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 163 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 164 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 165 | 165 | AM_RANGE(0x9080, 0x90ff) AM_RAM |
| 166 | 166 | AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_flip_screen_x_w) |
| 167 | 167 | AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_nmi_enable_w) |
| r14896 | r14897 | |
| 177 | 177 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 178 | 178 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 179 | 179 | AM_RANGE(0x9000, 0x903f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 180 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 181 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 180 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 181 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 182 | 182 | AM_RANGE(0x9080, 0x90ff) AM_RAM |
| 183 | 183 | AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w) |
| 184 | 184 | AM_RANGE(0xa802, 0xa802) AM_WRITENOP /* coin counters */ |
| r14896 | r14897 | |
| 195 | 195 | AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 196 | 196 | AM_RANGE(0x8c00, 0x8fff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) /* mirror */ |
| 197 | 197 | AM_RANGE(0x9000, 0x903f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 198 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 199 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 198 | AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 199 | AM_RANGE(0x9060, 0x907f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 200 | 200 | AM_RANGE(0x9080, 0x90ff) AM_RAM |
| 201 | 201 | AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 202 | 202 | AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| r14896 | r14897 | |
| 225 | 225 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 226 | 226 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE(scobra_soundram_r, scobra_soundram_w) |
| 227 | 227 | AM_RANGE(0x8000, 0x83ff) AM_WRITENOP AM_BASE(m_soundram) /* only here to initialize pointer */ |
| 228 | AM_RANGE(0x9000, 0x9fff) AM_WRITE | |
| 228 | AM_RANGE(0x9000, 0x9fff) AM_WRITE | |
| 229 | 229 | ADDRESS_MAP_END |
| 230 | 230 | |
| 231 | 231 | |
| 232 | 232 | static ADDRESS_MAP_START( hustlerb_sound_map, AS_PROGRAM, 8, scobra_state ) |
| 233 | 233 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 234 | AM_RANGE(0x6000, 0x6fff) AM_WRITE | |
| 234 | AM_RANGE(0x6000, 0x6fff) AM_WRITE | |
| 235 | 235 | AM_RANGE(0x8000, 0x8fff) AM_RAM_READ(scobra_soundram_r) AM_BASE(m_soundram) /* only here to initialize pointer */ |
| 236 | 236 | ADDRESS_MAP_END |
| 237 | 237 | |
| r14896 | r14897 | |
| 247 | 247 | static ADDRESS_MAP_START( hustler_sound_map, AS_PROGRAM, 8, scobra_state ) |
| 248 | 248 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 249 | 249 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 250 | AM_RANGE(0x6000, 0x6fff) AM_WRITE | |
| 250 | AM_RANGE(0x6000, 0x6fff) AM_WRITE | |
| 251 | 251 | ADDRESS_MAP_END |
| 252 | 252 | |
| 253 | 253 | static ADDRESS_MAP_START( hustler_sound_io_map, AS_IO, 8, scobra_state ) |
| r14896 | r14897 | |
| 647 | 647 | { |
| 648 | 648 | AY8910_LEGACY_OUTPUT, |
| 649 | 649 | AY8910_DEFAULT_LOADS, |
| 650 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 650 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 651 | 651 | DEVCB_HANDLER(scramble_portB_r), |
| 652 | 652 | DEVCB_NULL, |
| 653 | 653 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 15 | 15 | { |
| 16 | 16 | public: |
| 17 | 17 | drtomy_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | : driver_device(mconfig, type, tag) { } | |
| 18 | : driver_device(mconfig, type, tag) , | |
| 19 | m_videoram_fg(*this, "videorafg"), | |
| 20 | m_videoram_bg(*this, "videorabg"), | |
| 21 | m_spriteram(*this, "spriteram"){ } | |
| 19 | 22 | |
| 20 | 23 | /* memory pointers */ |
| 21 | UINT16 * m_spriteram; | |
| 22 | UINT16 * m_videoram_bg; | |
| 23 | UINT16 * m_videoram_fg; | |
| 24 | required_shared_ptr<UINT16> m_videoram_fg; | |
| 25 | required_shared_ptr<UINT16> m_videoram_bg; | |
| 26 | required_shared_ptr<UINT16> m_spriteram; | |
| 24 | 27 | // UINT16 * m_paletteram16; // currently this uses generic palette handling |
| 25 | 28 | |
| 26 | 29 | /* video-related */ |
| r14896 | r14897 | |
| 38 | 41 | static TILE_GET_INFO( get_tile_info_fg ) |
| 39 | 42 | { |
| 40 | 43 | drtomy_state *state = machine.driver_data<drtomy_state>(); |
| 41 | int code = state->m_videoram_fg[tile_index] & 0xfff; | |
| 42 | int color = (state->m_videoram_fg[tile_index] & 0xf000) >> 12; | |
| 44 | int code = state->m_videoram_fg.target()[tile_index] & 0xfff; | |
| 45 | int color = (state->m_videoram_fg.target()[tile_index] & 0xf000) >> 12; | |
| 43 | 46 | SET_TILE_INFO(2, code, color, 0); |
| 44 | 47 | } |
| 45 | 48 | |
| r14896 | r14897 | |
| 47 | 50 | static TILE_GET_INFO( get_tile_info_bg ) |
| 48 | 51 | { |
| 49 | 52 | drtomy_state *state = machine.driver_data<drtomy_state>(); |
| 50 | int code = state->m_videoram_bg[tile_index] & 0xfff; | |
| 51 | int color = (state->m_videoram_bg[tile_index] & 0xf000) >> 12; | |
| 53 | int code = state->m_videoram_bg.target()[tile_index] & 0xfff; | |
| 54 | int color = (state->m_videoram_bg.target()[tile_index] & 0xf000) >> 12; | |
| 52 | 55 | SET_TILE_INFO(1, code, color, 0); |
| 53 | 56 | } |
| 54 | 57 | |
| r14896 | r14897 | |
| 81 | 84 | |
| 82 | 85 | for (i = 3; i < 0x1000 / 2; i += 4) |
| 83 | 86 | { |
| 84 | int sx = state->m_spriteram[i + 2] & 0x01ff; | |
| 85 | int sy = (240 - (state->m_spriteram[i] & 0x00ff)) & 0x00ff; | |
| 86 | int number = state->m_spriteram[i + 3]; | |
| 87 | int color = (state->m_spriteram[i + 2] & 0x1e00) >> 9; | |
| 88 | int attr = (state->m_spriteram[i] & 0xfe00) >> 9; | |
| 87 | int sx = state->m_spriteram.target()[i + 2] & 0x01ff; | |
| 88 | int sy = (240 - (state->m_spriteram.target()[i] & 0x00ff)) & 0x00ff; | |
| 89 | int number = state->m_spriteram.target()[i + 3]; | |
| 90 | int color = (state->m_spriteram.target()[i + 2] & 0x1e00) >> 9; | |
| 91 | int attr = (state->m_spriteram.target()[i] & 0xfe00) >> 9; | |
| 89 | 92 | |
| 90 | 93 | int xflip = attr & 0x20; |
| 91 | 94 | int yflip = attr & 0x40; |
| r14896 | r14897 | |
| 137 | 140 | |
| 138 | 141 | WRITE16_MEMBER(drtomy_state::drtomy_vram_fg_w) |
| 139 | 142 | { |
| 140 | COMBINE_DATA(&m_videoram_fg[offset]); | |
| 143 | COMBINE_DATA(&m_videoram_fg.target()[offset]); | |
| 141 | 144 | m_tilemap_fg->mark_tile_dirty(offset); |
| 142 | 145 | } |
| 143 | 146 | |
| 144 | 147 | WRITE16_MEMBER(drtomy_state::drtomy_vram_bg_w) |
| 145 | 148 | { |
| 146 | COMBINE_DATA(&m_videoram_bg[offset]); | |
| 149 | COMBINE_DATA(&m_videoram_bg.target()[offset]); | |
| 147 | 150 | m_tilemap_bg->mark_tile_dirty(offset); |
| 148 | 151 | } |
| 149 | 152 | |
| r14896 | r14897 | |
| 162 | 165 | |
| 163 | 166 | static ADDRESS_MAP_START( drtomy_map, AS_PROGRAM, 16, drtomy_state ) |
| 164 | 167 | AM_RANGE(0x000000, 0x03ffff) AM_ROM /* ROM */ |
| 165 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(drtomy_vram_fg_w) AM_BASE(m_videoram_fg) /* Video RAM FG */ | |
| 166 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(drtomy_vram_bg_w) AM_BASE(m_videoram_bg) /* Video RAM BG */ | |
| 167 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") /* Palette */ | |
| 168 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ | |
| 168 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(drtomy_vram_fg_w) AM_SHARE("videorafg") /* Video RAM FG */ | |
| 169 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(drtomy_vram_bg_w) AM_SHARE("videorabg") /* Video RAM BG */ | |
| 170 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") /* Palette */ | |
| 171 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("spriteram") /* Sprite RAM */ | |
| 169 | 172 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW1") |
| 170 | 173 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW2") |
| 171 | 174 | AM_RANGE(0x700004, 0x700005) AM_READ_PORT("P1") |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | { |
| 88 | 88 | public: |
| 89 | 89 | calorie_state(const machine_config &mconfig, device_type type, const char *tag) |
| 90 | : driver_device(mconfig, type, tag) { } | |
| 90 | : driver_device(mconfig, type, tag) , | |
| 91 | m_fg_ram(*this, "fg_ram"), | |
| 92 | m_sprites(*this, "sprites"){ } | |
| 91 | 93 | |
| 92 | 94 | /* memory pointers */ |
| 93 | UINT8 * m_fg_ram; | |
| 94 | UINT8 * m_sprites; | |
| 95 | required_shared_ptr<UINT8> m_fg_ram; | |
| 96 | required_shared_ptr<UINT8> m_sprites; | |
| 95 | 97 | // UINT8 * m_paletteram; // currently this uses generic palette handling |
| 96 | 98 | |
| 97 | 99 | /* video-related */ |
| r14896 | r14897 | |
| 127 | 129 | static TILE_GET_INFO( get_fg_tile_info ) |
| 128 | 130 | { |
| 129 | 131 | calorie_state *state = machine.driver_data<calorie_state>(); |
| 130 | int code = ((state->m_fg_ram[tile_index + 0x400] & 0x30) << 4) | state->m_fg_ram[tile_index]; | |
| 131 | int color = state->m_fg_ram[tile_index + 0x400] & 0x0f; | |
| 132 | int code = ((state->m_fg_ram.target()[tile_index + 0x400] & 0x30) << 4) | state->m_fg_ram.target()[tile_index]; | |
| 133 | int color = state->m_fg_ram.target()[tile_index + 0x400] & 0x0f; | |
| 132 | 134 | |
| 133 | SET_TILE_INFO(0, code, color, TILE_FLIPYX((state->m_fg_ram[tile_index + 0x400] & 0xc0) >> 6)); | |
| 135 | SET_TILE_INFO(0, code, color, TILE_FLIPYX((state->m_fg_ram.target()[tile_index + 0x400] & 0xc0) >> 6)); | |
| 134 | 136 | } |
| 135 | 137 | |
| 136 | 138 | |
| r14896 | r14897 | |
| 164 | 166 | { |
| 165 | 167 | int xpos, ypos, tileno, color, flipx, flipy; |
| 166 | 168 | |
| 167 | tileno = state->m_sprites[x + 0]; | |
| 168 | color = state->m_sprites[x + 1] & 0x0f; | |
| 169 | flipx = state->m_sprites[x + 1] & 0x40; | |
| 169 | tileno = state->m_sprites.target()[x + 0]; | |
| 170 | color = state->m_sprites.target()[x + 1] & 0x0f; | |
| 171 | flipx = state->m_sprites.target()[x + 1] & 0x40; | |
| 170 | 172 | flipy = 0; |
| 171 | ypos = 0xff - state->m_sprites[x + 2]; | |
| 172 | xpos = state->m_sprites[x + 3]; | |
| 173 | ypos = 0xff - state->m_sprites.target()[x + 2]; | |
| 174 | xpos = state->m_sprites.target()[x + 3]; | |
| 173 | 175 | |
| 174 | if (flip_screen | |
| 176 | if (state->flip_screen | |
| 175 | 177 | { |
| 176 | if (state->m_sprites[x + 1] & 0x10) | |
| 178 | if (state->m_sprites.target()[x + 1] & 0x10) | |
| 177 | 179 | ypos = 0xff - ypos + 32; |
| 178 | 180 | else |
| 179 | 181 | ypos = 0xff - ypos + 16; |
| r14896 | r14897 | |
| 183 | 185 | flipy = !flipy; |
| 184 | 186 | } |
| 185 | 187 | |
| 186 | if (state->m_sprites[x + 1] & 0x10) | |
| 188 | if (state->m_sprites.target()[x + 1] & 0x10) | |
| 187 | 189 | { |
| 188 | 190 | /* 32x32 sprites */ |
| 189 | 191 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0); |
| r14896 | r14897 | |
| 205 | 207 | |
| 206 | 208 | WRITE8_MEMBER(calorie_state::fg_ram_w) |
| 207 | 209 | { |
| 208 | m_fg_ram[offset] = data; | |
| 210 | m_fg_ram.target()[offset] = data; | |
| 209 | 211 | m_fg_tilemap->mark_tile_dirty(offset & 0x3ff); |
| 210 | 212 | } |
| 211 | 213 | |
| r14896 | r14897 | |
| 219 | 221 | |
| 220 | 222 | WRITE8_MEMBER(calorie_state::calorie_flipscreen_w) |
| 221 | 223 | { |
| 222 | flip_screen_set( | |
| 224 | flip_screen_set( | |
| 223 | 225 | } |
| 224 | 226 | |
| 225 | 227 | READ8_MEMBER(calorie_state::calorie_soundlatch_r) |
| 226 | 228 | { |
| 227 | UINT8 latch = soundlatch_r(space, 0); | |
| 228 | soundlatch_clear_w(space, 0, 0); | |
| 229 | UINT8 latch = soundlatch_byte_r(space, 0); | |
| 230 | soundlatch_clear_byte_w(space, 0, 0); | |
| 229 | 231 | return latch; |
| 230 | 232 | } |
| 231 | 233 | |
| r14896 | r14897 | |
| 244 | 246 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 245 | 247 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 246 | 248 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 247 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(fg_ram_w) AM_BASE(m_fg_ram) | |
| 248 | AM_RANGE(0xd800, 0xdbff) AM_RAM AM_BASE(m_sprites) | |
| 249 | AM_RANGE(0xdc00, 0xdcff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 249 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(fg_ram_w) AM_SHARE("fg_ram") | |
| 250 | AM_RANGE(0xd800, 0xdbff) AM_RAM AM_SHARE("sprites") | |
| 251 | AM_RANGE(0xdc00, 0xdcff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 250 | 252 | AM_RANGE(0xde00, 0xde00) AM_WRITE(bg_bank_w) |
| 251 | 253 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("P1") |
| 252 | 254 | AM_RANGE(0xf001, 0xf001) AM_READ_PORT("P2") |
| 253 | 255 | AM_RANGE(0xf002, 0xf002) AM_READ_PORT("SYSTEM") |
| 254 | 256 | AM_RANGE(0xf004, 0xf004) AM_READ_PORT("DSW1") AM_WRITE(calorie_flipscreen_w) |
| 255 | 257 | AM_RANGE(0xf005, 0xf005) AM_READ_PORT("DSW2") |
| 256 | AM_RANGE(0xf800, 0xf800) AM_WRITE(soundlatch_w) | |
| 258 | AM_RANGE(0xf800, 0xf800) AM_WRITE(soundlatch_byte_w) | |
| 257 | 259 | ADDRESS_MAP_END |
| 258 | 260 | |
| 259 | 261 |
| r14896 | r14897 | |
|---|---|---|
| 297 | 297 | |
| 298 | 298 | required_device<cpu_device> m_maincpu; |
| 299 | 299 | required_device<cpu_device> m_mcu; |
| 300 | DECLARE_WRITE32_MEMBER(keycus_w); | |
| 301 | DECLARE_READ32_MEMBER(keycus_c406_r); | |
| 302 | DECLARE_READ32_MEMBER(keycus_c409_r); | |
| 303 | DECLARE_READ32_MEMBER(keycus_c410_r); | |
| 304 | DECLARE_READ32_MEMBER(keycus_c411_r); | |
| 305 | DECLARE_READ32_MEMBER(keycus_c430_r); | |
| 306 | DECLARE_READ32_MEMBER(keycus_c431_r); | |
| 307 | DECLARE_READ32_MEMBER(keycus_c432_r); | |
| 308 | DECLARE_READ32_MEMBER(keycus_c442_r); | |
| 309 | DECLARE_READ32_MEMBER(keycus_c443_r); | |
| 310 | DECLARE_WRITE32_MEMBER(bankswitch_rom32_w); | |
| 311 | DECLARE_WRITE32_MEMBER(bankswitch_rom64_upper_w); | |
| 312 | DECLARE_WRITE32_MEMBER(bankswitch_rom64_w); | |
| 313 | DECLARE_WRITE32_MEMBER(lightgun_w); | |
| 314 | DECLARE_READ32_MEMBER(lightgun_r); | |
| 315 | DECLARE_READ16_MEMBER(c76_shared_r); | |
| 316 | DECLARE_WRITE16_MEMBER(c76_shared_w); | |
| 317 | DECLARE_READ16_MEMBER(c76_inputs_r); | |
| 318 | DECLARE_READ8_MEMBER(dac7_r); | |
| 319 | DECLARE_READ8_MEMBER(dac6_r); | |
| 320 | DECLARE_READ8_MEMBER(dac5_r); | |
| 321 | DECLARE_READ8_MEMBER(dac4_r); | |
| 322 | DECLARE_READ8_MEMBER(dac3_r); | |
| 323 | DECLARE_READ8_MEMBER(dac2_r); | |
| 324 | DECLARE_READ8_MEMBER(dac1_r); | |
| 325 | DECLARE_READ8_MEMBER(dac0_r); | |
| 326 | DECLARE_READ8_MEMBER(pocketrc_gas_r); | |
| 327 | DECLARE_READ8_MEMBER(pocketrc_steer_r); | |
| 328 | DECLARE_READ16_MEMBER(c76_speedup_r); | |
| 329 | DECLARE_WRITE16_MEMBER(c76_speedup_w); | |
| 300 | 330 | }; |
| 301 | 331 | |
| 302 | 332 | INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) |
| r14896 | r14897 | |
| 312 | 342 | } |
| 313 | 343 | } |
| 314 | 344 | |
| 315 | ||
| 345 | ||
| 316 | 346 | { |
| 317 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 318 | 347 | |
| 319 | verboselog( space->machine(), 1, "keycus_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 320 | COMBINE_DATA( &state->m_keycus[ offset ] ); | |
| 348 | verboselog( machine(), 1, "keycus_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 349 | COMBINE_DATA( &m_keycus[ offset ] ); | |
| 321 | 350 | } |
| 322 | 351 | |
| 323 | 352 | /* tekken 2 */ |
| 324 | ||
| 353 | ||
| 325 | 354 | { |
| 326 | 355 | /* todo: verify behaviour */ |
| 327 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 328 | UINT32 *namcos11_keycus = state->m_keycus; | |
| 356 | UINT32 *namcos11_keycus = m_keycus; | |
| 329 | 357 | UINT32 data; |
| 330 | 358 | |
| 331 | 359 | data = namcos11_keycus[ offset ]; |
| r14896 | r14897 | |
| 339 | 367 | ( ( namcos11_keycus[ 1 ] >> 8 ) & 0xf ); |
| 340 | 368 | break; |
| 341 | 369 | } |
| 342 | verboselog( | |
| 370 | verboselog( | |
| 343 | 371 | return data; |
| 344 | 372 | } |
| 345 | 373 | |
| 346 | 374 | /* soul edge */ |
| 347 | ||
| 375 | ||
| 348 | 376 | { |
| 349 | 377 | /* todo: verify behaviour */ |
| 350 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 351 | 378 | UINT32 data; |
| 352 | 379 | |
| 353 | data = | |
| 380 | data = | |
| 354 | 381 | switch( offset ) |
| 355 | 382 | { |
| 356 | 383 | case 3: |
| 357 | 384 | data = ( data & 0x0000ffff ) | 0x000f0000; |
| 358 | 385 | break; |
| 359 | 386 | } |
| 360 | verboselog( | |
| 387 | verboselog( | |
| 361 | 388 | return data; |
| 362 | 389 | } |
| 363 | 390 | |
| 364 | 391 | /* dunk mania */ |
| 365 | ||
| 392 | ||
| 366 | 393 | { |
| 367 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 368 | UINT32 *namcos11_keycus = state->m_keycus; | |
| 394 | UINT32 *namcos11_keycus = m_keycus; | |
| 369 | 395 | UINT32 data; |
| 370 | 396 | UINT32 n_value; |
| 371 | 397 | |
| r14896 | r14897 | |
| 393 | 419 | ( ( ( n_value / 10000 ) % 10 ) << 16 ); |
| 394 | 420 | break; |
| 395 | 421 | } |
| 396 | verboselog( | |
| 422 | verboselog( | |
| 397 | 423 | return data; |
| 398 | 424 | } |
| 399 | 425 | |
| 400 | 426 | /* prime goal ex */ |
| 401 | ||
| 427 | ||
| 402 | 428 | { |
| 403 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 404 | UINT32 *namcos11_keycus = state->m_keycus; | |
| 429 | UINT32 *namcos11_keycus = m_keycus; | |
| 405 | 430 | UINT32 data; |
| 406 | 431 | UINT32 n_value; |
| 407 | 432 | |
| r14896 | r14897 | |
| 428 | 453 | break; |
| 429 | 454 | } |
| 430 | 455 | |
| 431 | verboselog( | |
| 456 | verboselog( | |
| 432 | 457 | return data; |
| 433 | 458 | } |
| 434 | 459 | |
| 435 | 460 | /* xevious 3d/g */ |
| 436 | ||
| 461 | ||
| 437 | 462 | { |
| 438 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 439 | UINT32 *namcos11_keycus = state->m_keycus; | |
| 463 | UINT32 *namcos11_keycus = m_keycus; | |
| 440 | 464 | UINT32 data; |
| 441 | 465 | UINT16 n_value; |
| 442 | 466 | |
| r14896 | r14897 | |
| 464 | 488 | ( ( ( n_value / 1 ) % 10 ) << 16 ); |
| 465 | 489 | break; |
| 466 | 490 | } |
| 467 | verboselog( | |
| 491 | verboselog( | |
| 468 | 492 | return data; |
| 469 | 493 | } |
| 470 | 494 | |
| 471 | 495 | /* dancing eyes */ |
| 472 | ||
| 496 | ||
| 473 | 497 | { |
| 474 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 475 | UINT32 *namcos11_keycus = state->m_keycus; | |
| 498 | UINT32 *namcos11_keycus = m_keycus; | |
| 476 | 499 | UINT32 data; |
| 477 | 500 | UINT16 n_value; |
| 478 | 501 | |
| r14896 | r14897 | |
| 498 | 521 | data = ( data & 0xffff0000 ) | ( ( n_value / 10000 ) % 10 ); |
| 499 | 522 | break; |
| 500 | 523 | } |
| 501 | verboselog( | |
| 524 | verboselog( | |
| 502 | 525 | return data; |
| 503 | 526 | } |
| 504 | 527 | |
| 505 | 528 | /* pocket racer */ |
| 506 | ||
| 529 | ||
| 507 | 530 | { |
| 508 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 509 | UINT32 *namcos11_keycus = state->m_keycus; | |
| 531 | UINT32 *namcos11_keycus = m_keycus; | |
| 510 | 532 | UINT32 data; |
| 511 | 533 | UINT16 n_value; |
| 512 | 534 | |
| r14896 | r14897 | |
| 533 | 555 | break; |
| 534 | 556 | } |
| 535 | 557 | |
| 536 | verboselog( | |
| 558 | verboselog( | |
| 537 | 559 | return data; |
| 538 | 560 | } |
| 539 | 561 | |
| 540 | 562 | /* star sweep */ |
| 541 | ||
| 563 | ||
| 542 | 564 | { |
| 543 | 565 | /* todo: verify behaviour */ |
| 544 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 545 | 566 | UINT32 data; |
| 546 | 567 | |
| 547 | data = | |
| 568 | data = | |
| 548 | 569 | |
| 549 | 570 | switch( offset ) |
| 550 | 571 | { |
| r14896 | r14897 | |
| 555 | 576 | } |
| 556 | 577 | break; |
| 557 | 578 | } |
| 558 | verboselog( | |
| 579 | verboselog( | |
| 559 | 580 | return data; |
| 560 | 581 | } |
| 561 | 582 | |
| 562 | 583 | /* kosodate quiz my angel 3 / point blank 2 */ |
| 563 | ||
| 584 | ||
| 564 | 585 | { |
| 565 | 586 | /* todo: verify behaviour */ |
| 566 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 567 | 587 | UINT32 data; |
| 568 | 588 | |
| 569 | data = | |
| 589 | data = | |
| 570 | 590 | |
| 571 | 591 | switch( offset ) |
| 572 | 592 | { |
| r14896 | r14897 | |
| 589 | 609 | } |
| 590 | 610 | break; |
| 591 | 611 | } |
| 592 | verboselog( | |
| 612 | verboselog( | |
| 593 | 613 | return data; |
| 594 | 614 | } |
| 595 | 615 | |
| r14896 | r14897 | |
| 600 | 620 | |
| 601 | 621 | static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" }; |
| 602 | 622 | |
| 603 | ||
| 623 | ||
| 604 | 624 | { |
| 605 | verboselog( | |
| 625 | verboselog( | |
| 606 | 626 | |
| 607 | 627 | if( ACCESSING_BITS_0_15 ) |
| 608 | 628 | { |
| 609 | bankswitch_rom8( space, bankname[offset * 2], data & 0xffff ); | |
| 629 | bankswitch_rom8( &space, bankname[offset * 2], data & 0xffff ); | |
| 610 | 630 | } |
| 611 | 631 | if( ACCESSING_BITS_16_31 ) |
| 612 | 632 | { |
| 613 | bankswitch_rom8( space, bankname[offset * 2 + 1], data >> 16 ); | |
| 633 | bankswitch_rom8( &space, bankname[offset * 2 + 1], data >> 16 ); | |
| 614 | 634 | } |
| 615 | 635 | } |
| 616 | 636 | |
| 617 | ||
| 637 | ||
| 618 | 638 | { |
| 619 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 620 | 639 | |
| 621 | verboselog( | |
| 640 | verboselog( | |
| 622 | 641 | |
| 623 | 642 | if( ACCESSING_BITS_0_15 ) |
| 624 | 643 | { |
| 625 | | |
| 644 | | |
| 626 | 645 | } |
| 627 | 646 | if( ACCESSING_BITS_16_31 ) |
| 628 | 647 | { |
| 629 | | |
| 648 | | |
| 630 | 649 | } |
| 631 | 650 | } |
| 632 | 651 | |
| r14896 | r14897 | |
| 638 | 657 | memory_set_bank( space->machine(), bank, ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ state->m_n_bankoffset ) ); |
| 639 | 658 | } |
| 640 | 659 | |
| 641 | ||
| 660 | ||
| 642 | 661 | { |
| 643 | verboselog( | |
| 662 | verboselog( | |
| 644 | 663 | |
| 645 | 664 | if( ACCESSING_BITS_0_15 ) |
| 646 | 665 | { |
| 647 | bankswitch_rom64( space, bankname[offset * 2], data & 0xffff ); | |
| 666 | bankswitch_rom64( &space, bankname[offset * 2], data & 0xffff ); | |
| 648 | 667 | } |
| 649 | 668 | if( ACCESSING_BITS_16_31 ) |
| 650 | 669 | { |
| 651 | bankswitch_rom64( space, bankname[offset * 2 + 1], data >> 16 ); | |
| 670 | bankswitch_rom64( &space, bankname[offset * 2 + 1], data >> 16 ); | |
| 652 | 671 | } |
| 653 | 672 | } |
| 654 | 673 | |
| 655 | ||
| 674 | ||
| 656 | 675 | { |
| 657 | 676 | if( ACCESSING_BITS_0_15 ) |
| 658 | 677 | { |
| r14896 | r14897 | |
| 661 | 680 | output_set_value( "recoil0", !( data & 0x02 ) ); |
| 662 | 681 | output_set_value( "recoil1", !( data & 0x01 ) ); |
| 663 | 682 | |
| 664 | verboselog( | |
| 683 | verboselog( | |
| 665 | 684 | } |
| 666 | 685 | if( ACCESSING_BITS_16_31 ) |
| 667 | 686 | { |
| 668 | verboselog( | |
| 687 | verboselog( | |
| 669 | 688 | } |
| 670 | 689 | } |
| 671 | 690 | |
| 672 | ||
| 691 | ||
| 673 | 692 | { |
| 674 | 693 | UINT32 data = 0; |
| 675 | 694 | switch( offset ) |
| 676 | 695 | { |
| 677 | 696 | case 0: |
| 678 | data = input_port_read( | |
| 697 | data = input_port_read( | |
| 679 | 698 | break; |
| 680 | 699 | case 1: |
| 681 | data = ( input_port_read( | |
| 700 | data = ( input_port_read( | |
| 682 | 701 | break; |
| 683 | 702 | case 2: |
| 684 | data = input_port_read( | |
| 703 | data = input_port_read( | |
| 685 | 704 | break; |
| 686 | 705 | case 3: |
| 687 | data = ( input_port_read( | |
| 706 | data = ( input_port_read( | |
| 688 | 707 | break; |
| 689 | 708 | } |
| 690 | verboselog( | |
| 709 | verboselog( | |
| 691 | 710 | return data; |
| 692 | 711 | } |
| 693 | 712 | |
| 694 | 713 | static ADDRESS_MAP_START( namcos11_map, AS_PROGRAM, 32, namcos11_state ) |
| 695 | 714 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE("share1") /* ram */ |
| 696 | 715 | AM_RANGE(0x1fa04000, 0x1fa0ffff) AM_RAM AM_BASE(m_sharedram) /* shared ram with C76 */ |
| 697 | AM_RANGE(0x1fa20000, 0x1fa2ffff) AM_WRITE | |
| 716 | AM_RANGE(0x1fa20000, 0x1fa2ffff) AM_WRITE | |
| 698 | 717 | AM_RANGE(0x1fa30000, 0x1fa30fff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */ |
| 699 | 718 | AM_RANGE(0x1fb00000, 0x1fb00003) AM_WRITENOP /* ?? */ |
| 700 | 719 | AM_RANGE(0x1fbf6000, 0x1fbf6003) AM_WRITENOP /* ?? */ |
| r14896 | r14897 | |
| 706 | 725 | AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP |
| 707 | 726 | ADDRESS_MAP_END |
| 708 | 727 | |
| 709 | ||
| 728 | ||
| 710 | 729 | { |
| 711 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 712 | UINT16 *share16 = (UINT16 *)state->m_sharedram; | |
| 730 | UINT16 *share16 = (UINT16 *)m_sharedram; | |
| 713 | 731 | |
| 714 | 732 | return share16[offset]; |
| 715 | 733 | } |
| 716 | 734 | |
| 717 | ||
| 735 | ||
| 718 | 736 | { |
| 719 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 720 | UINT16 *share16 = (UINT16 *)state->m_sharedram; | |
| 737 | UINT16 *share16 = (UINT16 *)m_sharedram; | |
| 721 | 738 | |
| 722 | 739 | COMBINE_DATA(&share16[offset]); |
| 723 | 740 | } |
| 724 | 741 | |
| 725 | ||
| 742 | ||
| 726 | 743 | { |
| 727 | // logerror("'c76' Read port %d @ %06X\n", offset, cpu_get_pc(&space | |
| 744 | // logerror("'c76' Read port %d @ %06X\n", offset, cpu_get_pc(&space. | |
| 728 | 745 | |
| 729 | 746 | switch (offset) |
| 730 | 747 | { |
| 731 | 748 | case 0: |
| 732 | return input_port_read( | |
| 749 | return input_port_read( | |
| 733 | 750 | |
| 734 | 751 | case 1: |
| 735 | return input_port_read( | |
| 752 | return input_port_read( | |
| 736 | 753 | |
| 737 | 754 | case 2: |
| 738 | return input_port_read( | |
| 755 | return input_port_read( | |
| 739 | 756 | |
| 740 | 757 | case 3: |
| 741 | return input_port_read( | |
| 758 | return input_port_read( | |
| 742 | 759 | } |
| 743 | 760 | |
| 744 | 761 | return 0xff; |
| r14896 | r14897 | |
| 746 | 763 | |
| 747 | 764 | ADDRESS_MAP_START( c76_map, AS_PROGRAM, 16, namcos11_state ) |
| 748 | 765 | AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE("c352", c352_device, read, write) |
| 749 | AM_RANGE(0x001000, 0x001007) AM_READ_LEGACY(c76_inputs_r ) | |
| 750 | AM_RANGE(0x004000, 0x00bfff) AM_READWRITE_LEGACY(c76_shared_r, c76_shared_w ) | |
| 766 | AM_RANGE(0x001000, 0x001007) AM_READ(c76_inputs_r ) | |
| 767 | AM_RANGE(0x004000, 0x00bfff) AM_READWRITE(c76_shared_r, c76_shared_w ) | |
| 751 | 768 | AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c76", 0x40000) |
| 752 | 769 | AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("c76", 0) |
| 753 | 770 | AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("c76", 0) |
| r14896 | r14897 | |
| 756 | 773 | AM_RANGE(0x301000, 0x301001) AM_WRITENOP |
| 757 | 774 | ADDRESS_MAP_END |
| 758 | 775 | |
| 759 | ||
| 776 | ||
| 760 | 777 | { |
| 761 | return input_port_read_safe( | |
| 778 | return input_port_read_safe( | |
| 762 | 779 | } |
| 763 | 780 | |
| 764 | ||
| 781 | ||
| 765 | 782 | { |
| 766 | return (input_port_read_safe( | |
| 783 | return (input_port_read_safe( | |
| 767 | 784 | } |
| 768 | 785 | |
| 769 | ||
| 786 | ||
| 770 | 787 | { |
| 771 | return (input_port_read_safe( | |
| 788 | return (input_port_read_safe( | |
| 772 | 789 | } |
| 773 | 790 | |
| 774 | ||
| 791 | ||
| 775 | 792 | { |
| 776 | return (input_port_read_safe( | |
| 793 | return (input_port_read_safe( | |
| 777 | 794 | } |
| 778 | 795 | |
| 779 | ||
| 796 | ||
| 780 | 797 | { |
| 781 | return (input_port_read_safe( | |
| 798 | return (input_port_read_safe( | |
| 782 | 799 | } |
| 783 | 800 | |
| 784 | ||
| 801 | ||
| 785 | 802 | { |
| 786 | return (input_port_read_safe( | |
| 803 | return (input_port_read_safe( | |
| 787 | 804 | } |
| 788 | 805 | |
| 789 | ||
| 806 | ||
| 790 | 807 | { |
| 791 | return (input_port_read_safe( | |
| 808 | return (input_port_read_safe( | |
| 792 | 809 | } |
| 793 | 810 | |
| 794 | ||
| 811 | ||
| 795 | 812 | { |
| 796 | return (input_port_read_safe( | |
| 813 | return (input_port_read_safe( | |
| 797 | 814 | } |
| 798 | 815 | |
| 799 | ||
| 816 | ||
| 800 | 817 | { |
| 801 | return input_port_read( | |
| 818 | return input_port_read( | |
| 802 | 819 | } |
| 803 | 820 | |
| 804 | ||
| 821 | ||
| 805 | 822 | { |
| 806 | return input_port_read( | |
| 823 | return input_port_read( | |
| 807 | 824 | } |
| 808 | 825 | |
| 809 | 826 | ADDRESS_MAP_START( c76_io_map, AS_IO, 8, namcos11_state ) |
| 810 | AM_RANGE(M37710_ADC7_L, M37710_ADC7_L) AM_READ_LEGACY(dac7_r) | |
| 811 | AM_RANGE(M37710_ADC6_L, M37710_ADC6_L) AM_READ_LEGACY(dac6_r) | |
| 812 | AM_RANGE(M37710_ADC5_L, M37710_ADC5_L) AM_READ_LEGACY(dac5_r) | |
| 813 | AM_RANGE(M37710_ADC4_L, M37710_ADC4_L) AM_READ_LEGACY(dac4_r) | |
| 814 | AM_RANGE(M37710_ADC3_L, M37710_ADC3_L) AM_READ_LEGACY(dac3_r) | |
| 815 | AM_RANGE(M37710_ADC2_L, M37710_ADC2_L) AM_READ_LEGACY(dac2_r) | |
| 816 | AM_RANGE(M37710_ADC1_L, M37710_ADC1_L) AM_READ_LEGACY(dac1_r) | |
| 817 | AM_RANGE(M37710_ADC0_L, M37710_ADC0_L) AM_READ_LEGACY(dac0_r) | |
| 827 | AM_RANGE(M37710_ADC7_L, M37710_ADC7_L) AM_READ(dac7_r) | |
| 828 | AM_RANGE(M37710_ADC6_L, M37710_ADC6_L) AM_READ(dac6_r) | |
| 829 | AM_RANGE(M37710_ADC5_L, M37710_ADC5_L) AM_READ(dac5_r) | |
| 830 | AM_RANGE(M37710_ADC4_L, M37710_ADC4_L) AM_READ(dac4_r) | |
| 831 | AM_RANGE(M37710_ADC3_L, M37710_ADC3_L) AM_READ(dac3_r) | |
| 832 | AM_RANGE(M37710_ADC2_L, M37710_ADC2_L) AM_READ(dac2_r) | |
| 833 | AM_RANGE(M37710_ADC1_L, M37710_ADC1_L) AM_READ(dac1_r) | |
| 834 | AM_RANGE(M37710_ADC0_L, M37710_ADC0_L) AM_READ(dac0_r) | |
| 818 | 835 | |
| 819 | 836 | AM_RANGE(M37710_ADC0_H, M37710_ADC7_H) AM_READNOP |
| 820 | 837 | ADDRESS_MAP_END |
| 821 | 838 | |
| 822 | ||
| 839 | ||
| 823 | 840 | { |
| 824 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 825 | 841 | |
| 826 | if ((cpu_get_pc(&space | |
| 842 | if ((cpu_get_pc(&space. | |
| 827 | 843 | { |
| 828 | device_spin_until_interrupt(&space | |
| 844 | device_spin_until_interrupt(&space. | |
| 829 | 845 | } |
| 830 | 846 | |
| 831 | return | |
| 847 | return | |
| 832 | 848 | } |
| 833 | 849 | |
| 834 | ||
| 850 | ||
| 835 | 851 | { |
| 836 | namcos11_state *state = space->machine().driver_data<namcos11_state>(); | |
| 837 | 852 | |
| 838 | COMBINE_DATA(& | |
| 853 | COMBINE_DATA(& | |
| 839 | 854 | } |
| 840 | 855 | |
| 841 | 856 | static void namcos11_init_common(running_machine &machine, int n_daughterboard) |
| r14896 | r14897 | |
| 847 | 862 | if (C76_SPEEDUP) |
| 848 | 863 | { |
| 849 | 864 | state->save_item( NAME(state->m_su_83) ); |
| 850 | machine.device("c76")->memory().space(AS_PROGRAM)->install_ | |
| 865 | machine.device("c76")->memory().space(AS_PROGRAM)->install_ | |
| 851 | 866 | } |
| 852 | 867 | |
| 853 | 868 | if (!n_daughterboard) |
| r14896 | r14897 | |
| 878 | 893 | |
| 879 | 894 | if (n_daughterboard == 32) |
| 880 | 895 | { |
| 881 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 896 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 882 | 897 | } |
| 883 | 898 | if (n_daughterboard == 64) |
| 884 | 899 | { |
| 885 | 900 | state->m_n_bankoffset = 0; |
| 886 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 901 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 887 | 902 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x1fa10020, 0x1fa1002f); |
| 888 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 903 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 889 | 904 | state->save_item( NAME(state->m_n_bankoffset) ); |
| 890 | 905 | } |
| 891 | 906 | } |
| r14896 | r14897 | |
| 897 | 912 | |
| 898 | 913 | static DRIVER_INIT( tekken2 ) |
| 899 | 914 | { |
| 900 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c406_r) ); | |
| 915 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 916 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c406_r),state)); | |
| 901 | 917 | namcos11_init_common(machine, 32); |
| 902 | 918 | } |
| 903 | 919 | |
| 904 | 920 | static DRIVER_INIT( souledge ) |
| 905 | 921 | { |
| 906 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c409_r) ); | |
| 922 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 923 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c409_r),state)); | |
| 907 | 924 | namcos11_init_common(machine, 32); |
| 908 | 925 | } |
| 909 | 926 | |
| 910 | 927 | static DRIVER_INIT( dunkmnia ) |
| 911 | 928 | { |
| 912 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c410_r) ); | |
| 929 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 930 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c410_r),state)); | |
| 913 | 931 | namcos11_init_common(machine, 32); |
| 914 | 932 | } |
| 915 | 933 | |
| 916 | 934 | static DRIVER_INIT( primglex ) |
| 917 | 935 | { |
| 918 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c411_r) ); | |
| 936 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 937 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c411_r),state)); | |
| 919 | 938 | namcos11_init_common(machine, 32); |
| 920 | 939 | } |
| 921 | 940 | |
| 922 | 941 | static DRIVER_INIT( xevi3dg ) |
| 923 | 942 | { |
| 924 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c430_r) ); | |
| 943 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 944 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c430_r),state)); | |
| 925 | 945 | namcos11_init_common(machine, 32); |
| 926 | 946 | } |
| 927 | 947 | |
| 928 | 948 | static DRIVER_INIT( danceyes ) |
| 929 | 949 | { |
| 930 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c431_r) ); | |
| 950 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 951 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c431_r),state)); | |
| 931 | 952 | namcos11_init_common(machine, 32); |
| 932 | 953 | } |
| 933 | 954 | |
| 934 | 955 | static DRIVER_INIT( pocketrc ) |
| 935 | 956 | { |
| 936 | machine.device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC0_L, FUNC(pocketrc_steer_r)); | |
| 937 | machine.device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC1_L, M37710_ADC1_L, FUNC(pocketrc_gas_r)); | |
| 957 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 958 | machine.device("c76")->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC0_L, read8_delegate(FUNC(namcos11_state::pocketrc_steer_r),state)); | |
| 959 | machine.device("c76")->memory().space(AS_IO)->install_read_handler(M37710_ADC1_L, M37710_ADC1_L, read8_delegate(FUNC(namcos11_state::pocketrc_gas_r),state)); | |
| 938 | 960 | |
| 939 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 961 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 940 | 962 | namcos11_init_common(machine, 32); |
| 941 | 963 | } |
| 942 | 964 | |
| 943 | 965 | static DRIVER_INIT( starswep ) |
| 944 | 966 | { |
| 945 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c442_r) ); | |
| 967 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 968 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c442_r),state)); | |
| 946 | 969 | namcos11_init_common(machine, 0); |
| 947 | 970 | } |
| 948 | 971 | |
| 949 | 972 | static DRIVER_INIT( myangel3 ) |
| 950 | 973 | { |
| 951 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c443_r) ); | |
| 974 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 975 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c443_r),state)); | |
| 952 | 976 | namcos11_init_common(machine, 64); |
| 953 | 977 | } |
| 954 | 978 | |
| 955 | 979 | static DRIVER_INIT( ptblank2ua ) |
| 956 | 980 | { |
| 957 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(keycus_c443_r) ); | |
| 981 | namcos11_state *state = machine.driver_data<namcos11_state>(); | |
| 982 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler( 0x1fa20000, 0x1fa2ffff, read32_delegate(FUNC(namcos11_state::keycus_c443_r),state)); | |
| 958 | 983 | namcos11_init_common(machine, 64); |
| 959 | 984 | |
| 960 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f788000, 0x1f788003, FUNC(lightgun_w) ); | |
| 961 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1f780000, 0x1f78000f, FUNC(lightgun_r) ); | |
| 985 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1f788000, 0x1f788003, write32_delegate(FUNC(namcos11_state::lightgun_w),state)); | |
| 986 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler (0x1f780000, 0x1f78000f, read32_delegate(FUNC(namcos11_state::lightgun_r),state)); | |
| 962 | 987 | } |
| 963 | 988 | |
| 964 | 989 | static MACHINE_RESET( namcos11 ) |
| r14896 | r14897 | |
|---|---|---|
| 176 | 176 | WRITE16_MEMBER(lethalj_state::ripribit_control_w) |
| 177 | 177 | { |
| 178 | 178 | coin_counter_w(machine(), 0, data & 1); |
| 179 | ticket_dispenser_ | |
| 179 | machine().device<ticket_dispenser_ | |
| 180 | 180 | output_set_lamp_value(0, (data >> 2) & 1); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | 184 | WRITE16_MEMBER(lethalj_state::cfarm_control_w) |
| 185 | 185 | { |
| 186 | ticket_dispenser_ | |
| 186 | machine().device<ticket_dispenser_ | |
| 187 | 187 | output_set_lamp_value(0, (data >> 2) & 1); |
| 188 | 188 | output_set_lamp_value(1, (data >> 3) & 1); |
| 189 | 189 | output_set_lamp_value(2, (data >> 4) & 1); |
| r14896 | r14897 | |
| 193 | 193 | |
| 194 | 194 | WRITE16_MEMBER(lethalj_state::cclownz_control_w) |
| 195 | 195 | { |
| 196 | ticket_dispenser_ | |
| 196 | machine().device<ticket_dispenser_ | |
| 197 | 197 | output_set_lamp_value(0, (data >> 2) & 1); |
| 198 | 198 | output_set_lamp_value(1, (data >> 4) & 1); |
| 199 | 199 | output_set_lamp_value(2, (data >> 5) & 1); |
| r14896 | r14897 | |
| 404 | 404 | PORT_START("IN0") |
| 405 | 405 | PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 406 | 406 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 407 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 407 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 408 | 408 | PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 409 | 409 | |
| 410 | 410 | PORT_START("IN1") |
| r14896 | r14897 | |
| 491 | 491 | PORT_DIPSETTING( 0x0000, "10" ) |
| 492 | 492 | |
| 493 | 493 | PORT_START("IN1") |
| 494 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 494 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 495 | 495 | PORT_BIT( 0x0006, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 496 | 496 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 497 | 497 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| r14896 | r14897 | |
| 542 | 542 | |
| 543 | 543 | PORT_START("IN1") |
| 544 | 544 | PORT_BIT( 0x0f0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, lethalj_state,cclownz_paddle, NULL) |
| 545 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 545 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 546 | 546 | PORT_BIT( 0x0060, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 547 | 547 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 548 | 548 | PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r14896 | r14897 | |
| 598 | 598 | MCFG_CPU_CONFIG(tms_config) |
| 599 | 599 | MCFG_CPU_PROGRAM_MAP(lethalj_map) |
| 600 | 600 | |
| 601 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 601 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH) | |
| 602 | 602 | |
| 603 | 603 | /* video hardware */ |
| 604 | 604 | MCFG_SCREEN_ADD("screen", RASTER) |
| r14896 | r14897 | |
|---|---|---|
| 531 | 531 | static const pia6821_interface pia_interface = |
| 532 | 532 | { |
| 533 | 533 | DEVCB_NULL, /* port A in */ |
| 534 | DEVCB_DEVICE_LINE("ticket", ticket_dispenser_line_r), /* port B in */ | |
| 534 | DEVCB_DEVICE_LINE_MEMBER("ticket", ticket_dispenser_device, line_r), /* port B in */ | |
| 535 | 535 | DEVCB_NULL, /* line CA1 in */ |
| 536 | 536 | DEVCB_NULL, /* line CB1 in */ |
| 537 | 537 | DEVCB_NULL, /* line CA2 in */ |
| r14896 | r14897 | |
| 755 | 755 | /* bit 5 controls the coin counter */ |
| 756 | 756 | /* bit 6 controls the diagnostic sound LED */ |
| 757 | 757 | m_pia_portb_data = data; |
| 758 | ticket_dispenser_ | |
| 758 | machine().device<ticket_dispenser_ | |
| 759 | 759 | coin_counter_w(machine(), 0, (data & 0x20) >> 5); |
| 760 | 760 | } |
| 761 | 761 | |
| r14896 | r14897 | |
| 770 | 770 | /* bit 6 controls the diagnostic sound LED */ |
| 771 | 771 | /* bit 7 controls the ticket dispenser */ |
| 772 | 772 | state->m_pia_portb_data = data; |
| 773 | ticket_dispenser_w(device->machine(). | |
| 773 | device->machine().device<ticket_dispenser_device>("ticket")->write(*device->machine().memory().first_spac | |
| 774 | 774 | coin_counter_w(device->machine(), 0, (data & 0x20) >> 5); |
| 775 | 775 | } |
| 776 | 776 | |
| r14896 | r14897 | |
| 1687 | 1687 | MCFG_MACHINE_RESET(itech8) |
| 1688 | 1688 | MCFG_NVRAM_ADD_RANDOM_FILL("nvram") |
| 1689 | 1689 | |
| 1690 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 1690 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 1691 | 1691 | |
| 1692 | 1692 | /* video hardware */ |
| 1693 | 1693 | MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) |
| r14896 | r14897 | |
|---|---|---|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | ||
| 464 | ||
| 465 | 465 | { |
| 466 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 467 | 466 | /* the latched D0 bit here goes to the CLEAR line on the interrupt flip-flop */ |
| 468 | | |
| 467 | | |
| 469 | 468 | |
| 470 | 469 | /* if CLEAR is held low, we must make sure the interrupt signal is clear */ |
| 471 | if (!state->m_irq_enabled) | |
| 472 | device_set_input_line(&space->device(), state->m_irq_line, CLEAR_LINE); | |
| 470 | if (!m_irq_enabled) | |
| 471 | device_set_input_line(&space.device(), m_irq_line, CLEAR_LINE); | |
| 473 | 472 | } |
| 474 | 473 | |
| 475 | 474 | /************************************* |
| r14896 | r14897 | |
| 478 | 477 | * |
| 479 | 478 | *************************************/ |
| 480 | 479 | |
| 481 | ||
| 480 | ||
| 482 | 481 | { |
| 483 | 482 | /* offset 0 = 1P START LAMP */ |
| 484 | 483 | /* offset 1 = 2P START LAMP */ |
| 485 | set_led_status( | |
| 484 | set_led_status( | |
| 486 | 485 | } |
| 487 | 486 | |
| 488 | 487 | |
| 489 | ||
| 488 | ||
| 490 | 489 | { |
| 491 | 490 | /* many variants and bootlegs don't have this */ |
| 492 | coin_lockout_global_w( | |
| 491 | coin_lockout_global_w( | |
| 493 | 492 | } |
| 494 | 493 | |
| 495 | 494 | |
| 496 | ||
| 495 | ||
| 497 | 496 | { |
| 498 | coin_counter_w( | |
| 497 | coin_counter_w( | |
| 499 | 498 | } |
| 500 | 499 | |
| 501 | 500 | |
| 502 | ||
| 501 | ||
| 503 | 502 | { |
| 504 | coin_counter_w( | |
| 503 | coin_counter_w( | |
| 505 | 504 | } |
| 506 | 505 | |
| 507 | 506 | |
| r14896 | r14897 | |
| 512 | 511 | * |
| 513 | 512 | *************************************/ |
| 514 | 513 | |
| 515 | ||
| 514 | ||
| 516 | 515 | { |
| 517 | 516 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 518 | 517 | UINT8 result = 0xff; |
| 519 | if (offset & 0x20) result &= ay8910_r(space->machine().device("8910.1"), 0); | |
| 520 | if (offset & 0x80) result &= ay8910_r(space->machine().device("8910.0"), 0); | |
| 518 | if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), 0); | |
| 519 | if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), 0); | |
| 521 | 520 | return result; |
| 522 | 521 | } |
| 523 | 522 | |
| 524 | 523 | |
| 525 | ||
| 524 | ||
| 526 | 525 | { |
| 527 | 526 | /* AV 4,5 ==> AY8910 #2 */ |
| 528 | 527 | /* the decoding here is very simplistic, and you can address two simultaneously */ |
| 529 | 528 | if (offset & 0x10) |
| 530 | ay8910_address_w( | |
| 529 | ay8910_address_w( | |
| 531 | 530 | else if (offset & 0x20) |
| 532 | ay8910_data_w( | |
| 531 | ay8910_data_w( | |
| 533 | 532 | /* AV6,7 ==> AY8910 #1 */ |
| 534 | 533 | if (offset & 0x40) |
| 535 | ay8910_address_w( | |
| 534 | ay8910_address_w( | |
| 536 | 535 | else if (offset & 0x80) |
| 537 | ay8910_data_w( | |
| 536 | ay8910_data_w( | |
| 538 | 537 | } |
| 539 | 538 | |
| 540 | 539 | |
| r14896 | r14897 | |
| 589 | 588 | } |
| 590 | 589 | |
| 591 | 590 | |
| 592 | ||
| 591 | ||
| 593 | 592 | { |
| 594 | device_t *discrete = | |
| 593 | device_t *discrete = | |
| 595 | 594 | static const char *const ayname[2] = { "8910.0", "8910.1" }; |
| 596 | 595 | int which, chan; |
| 597 | 596 | |
| r14896 | r14897 | |
| 599 | 598 | /* AV0 .. AV5 ==> AY8910 #2 */ |
| 600 | 599 | /* AV6 .. AV11 ==> AY8910 #1 */ |
| 601 | 600 | for (which = 0; which < 2; which++) |
| 602 | if ( | |
| 601 | if ( | |
| 603 | 602 | for (chan = 0; chan < 3; chan++) |
| 604 | 603 | { |
| 605 | 604 | UINT8 bits = (offset >> (2 * chan + 6 * (1 - which))) & 3; |
| r14896 | r14897 | |
| 639 | 638 | DEVCB_NULL, /* Port A read */ |
| 640 | 639 | DEVCB_NULL, /* Port B read */ |
| 641 | 640 | DEVCB_INPUT_PORT("IN3"), /* Port C read */ |
| 642 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), /* Port A write */ | |
| 641 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ | |
| 643 | 642 | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 644 | 643 | DEVCB_HANDLER(konami_portc_1_w) /* Port C write */ |
| 645 | 644 | }; |
| r14896 | r14897 | |
| 652 | 651 | * |
| 653 | 652 | *************************************/ |
| 654 | 653 | |
| 655 | ||
| 654 | ||
| 656 | 655 | { |
| 657 | 656 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 658 | 657 | UINT8 result = 0xff; |
| 659 | if (offset & 0x0100) result &= ppi8255_r(space->machine().device("ppi8255_0"), offset & 3); | |
| 660 | if (offset & 0x0200) result &= ppi8255_r(space->machine().device("ppi8255_1"), offset & 3); | |
| 658 | if (offset & 0x0100) result &= ppi8255_r(machine().device("ppi8255_0"), offset & 3); | |
| 659 | if (offset & 0x0200) result &= ppi8255_r(machine().device("ppi8255_1"), offset & 3); | |
| 661 | 660 | return result; |
| 662 | 661 | } |
| 663 | 662 | |
| 664 | 663 | |
| 665 | ||
| 664 | ||
| 666 | 665 | { |
| 667 | 666 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 668 | if (offset & 0x0100) ppi8255_w(space->machine().device("ppi8255_0"), offset & 3, data); | |
| 669 | if (offset & 0x0200) ppi8255_w(space->machine().device("ppi8255_1"), offset & 3, data); | |
| 667 | if (offset & 0x0100) ppi8255_w(machine().device("ppi8255_0"), offset & 3, data); | |
| 668 | if (offset & 0x0200) ppi8255_w(machine().device("ppi8255_1"), offset & 3, data); | |
| 670 | 669 | } |
| 671 | 670 | |
| 672 | 671 | |
| r14896 | r14897 | |
| 742 | 741 | DEVCB_NULL, /* Port A read */ |
| 743 | 742 | DEVCB_NULL, /* Port B read */ |
| 744 | 743 | DEVCB_HANDLER(scramble_protection_r), /* Port C read */ |
| 745 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), /* Port A write */ | |
| 744 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ | |
| 746 | 745 | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 747 | 746 | DEVCB_HANDLER(scramble_protection_w) /* Port C write */ |
| 748 | 747 | }; |
| r14896 | r14897 | |
| 755 | 754 | * |
| 756 | 755 | *************************************/ |
| 757 | 756 | |
| 758 | ||
| 757 | ||
| 759 | 758 | { |
| 760 | cputag_set_input_line( | |
| 759 | cputag_set_input_line( | |
| 761 | 760 | } |
| 762 | 761 | |
| 763 | 762 | |
| r14896 | r14897 | |
| 765 | 764 | { |
| 766 | 765 | galaxian_state *state = device->machine().driver_data<galaxian_state>(); |
| 767 | 766 | cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE); |
| 768 | return state->soundlatch_r(*device->machine().device("audiocpu")->memory().space(AS_PROGRAM), 0); | |
| 767 | return state->soundlatch_byte_r(*device->machine().device("audiocpu")->memory().space(AS_PROGRAM), 0); | |
| 769 | 768 | } |
| 770 | 769 | |
| 771 | 770 | |
| r14896 | r14897 | |
| 776 | 775 | * |
| 777 | 776 | *************************************/ |
| 778 | 777 | |
| 779 | ||
| 778 | ||
| 780 | 779 | { |
| 781 | 780 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 782 | 781 | UINT8 result = 0xff; |
| 783 | if (offset & 0x04) result &= ppi8255_r( | |
| 782 | if (offset & 0x04) result &= ppi8255_r( | |
| 784 | 783 | return result; |
| 785 | 784 | } |
| 786 | 785 | |
| 787 | 786 | |
| 788 | ||
| 787 | ||
| 789 | 788 | { |
| 790 | 789 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 791 | if (offset & 0x04) ppi8255_w(space->machine().device("ppi8255_2"), offset & 3, data); | |
| 792 | if (offset & 0x10) dac_signed_data_w(space->machine().device("dac"), data); | |
| 790 | if (offset & 0x04) ppi8255_w(machine().device("ppi8255_2"), offset & 3, data); | |
| 791 | if (offset & 0x10) dac_signed_data_w(machine().device("dac"), data); | |
| 793 | 792 | } |
| 794 | 793 | |
| 795 | 794 | |
| r14896 | r14897 | |
| 808 | 807 | |
| 809 | 808 | static const ppi8255_interface sfx_ppi8255_2_intf = |
| 810 | 809 | { |
| 811 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_r), /* Port A read */ | |
| 810 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r), /* Port A read */ | |
| 812 | 811 | DEVCB_NULL, /* Port B read */ |
| 813 | 812 | DEVCB_NULL, /* Port C read */ |
| 814 | 813 | DEVCB_NULL, /* Port A write */ |
| r14896 | r14897 | |
| 834 | 833 | The data(code) in the extra RAM is later jumped/called to in many parts of the game. |
| 835 | 834 | */ |
| 836 | 835 | |
| 837 | ||
| 836 | ||
| 838 | 837 | { |
| 839 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 840 | return state->m_protection_result; | |
| 838 | return m_protection_result; | |
| 841 | 839 | } |
| 842 | 840 | |
| 843 | 841 | |
| r14896 | r14897 | |
| 899 | 897 | * |
| 900 | 898 | *************************************/ |
| 901 | 899 | |
| 902 | ||
| 900 | ||
| 903 | 901 | { |
| 904 | 902 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 905 | 903 | UINT8 result = 0xff; |
| 906 | if (offset & 0x1000) result &= ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 1) & 3); | |
| 907 | if (offset & 0x2000) result &= ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 1) & 3); | |
| 904 | if (offset & 0x1000) result &= ppi8255_r(machine().device("ppi8255_1"), (offset >> 1) & 3); | |
| 905 | if (offset & 0x2000) result &= ppi8255_r(machine().device("ppi8255_0"), (offset >> 1) & 3); | |
| 908 | 906 | return result; |
| 909 | 907 | } |
| 910 | 908 | |
| 911 | 909 | |
| 912 | ||
| 910 | ||
| 913 | 911 | { |
| 914 | 912 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 915 | if (offset & 0x1000) ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 1) & 3, data); | |
| 916 | if (offset & 0x2000) ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 1) & 3, data); | |
| 913 | if (offset & 0x1000) ppi8255_w(machine().device("ppi8255_1"), (offset >> 1) & 3, data); | |
| 914 | if (offset & 0x2000) ppi8255_w(machine().device("ppi8255_0"), (offset >> 1) & 3, data); | |
| 917 | 915 | } |
| 918 | 916 | |
| 919 | 917 | |
| 920 | ||
| 918 | ||
| 921 | 919 | { |
| 922 | 920 | /* the decoding here is very simplistic */ |
| 923 | 921 | UINT8 result = 0xff; |
| 924 | if (offset & 0x40) result &= ay8910_r( | |
| 922 | if (offset & 0x40) result &= ay8910_r( | |
| 925 | 923 | return result; |
| 926 | 924 | } |
| 927 | 925 | |
| 928 | 926 | |
| 929 | ||
| 927 | ||
| 930 | 928 | { |
| 931 | 929 | /* the decoding here is very simplistic */ |
| 932 | 930 | /* AV6,7 ==> AY8910 #1 */ |
| 933 | 931 | if (offset & 0x40) |
| 934 | ay8910_data_w( | |
| 932 | ay8910_data_w( | |
| 935 | 933 | else if (offset & 0x80) |
| 936 | ay8910_address_w( | |
| 934 | ay8910_address_w( | |
| 937 | 935 | } |
| 938 | 936 | |
| 939 | 937 | |
| r14896 | r14897 | |
| 945 | 943 | } |
| 946 | 944 | |
| 947 | 945 | |
| 948 | ||
| 946 | ||
| 949 | 947 | { |
| 950 | cputag_set_input_line( | |
| 948 | cputag_set_input_line( | |
| 951 | 949 | } |
| 952 | 950 | |
| 953 | 951 | |
| r14896 | r14897 | |
| 958 | 956 | * |
| 959 | 957 | *************************************/ |
| 960 | 958 | |
| 961 | ||
| 959 | ||
| 962 | 960 | { |
| 963 | 961 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 964 | 962 | UINT8 result = 0xff; |
| 965 | if (offset & 0x1000) result &= ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 3) & 3); | |
| 966 | if (offset & 0x2000) result &= ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 3) & 3); | |
| 963 | if (offset & 0x1000) result &= ppi8255_r(machine().device("ppi8255_0"), (offset >> 3) & 3); | |
| 964 | if (offset & 0x2000) result &= ppi8255_r(machine().device("ppi8255_1"), (offset >> 3) & 3); | |
| 967 | 965 | return result; |
| 968 | 966 | } |
| 969 | 967 | |
| 970 | 968 | |
| 971 | ||
| 969 | ||
| 972 | 970 | { |
| 973 | 971 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 974 | if (offset & 0x1000) ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 3) & 3, data); | |
| 975 | if (offset & 0x2000) ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 3) & 3, data); | |
| 972 | if (offset & 0x1000) ppi8255_w(machine().device("ppi8255_0"), (offset >> 3) & 3, data); | |
| 973 | if (offset & 0x2000) ppi8255_w(machine().device("ppi8255_1"), (offset >> 3) & 3, data); | |
| 976 | 974 | } |
| 977 | 975 | |
| 978 | 976 | |
| r14896 | r14897 | |
| 983 | 981 | * |
| 984 | 982 | *************************************/ |
| 985 | 983 | |
| 986 | static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 4) & 3); } | |
| 987 | static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 4) & 3); } | |
| 988 | static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 4) & 3, data); } | |
| 989 | static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 4) & 3, data); } | |
| 984 | READ8_MEMBER(galaxian_state::turtles_ppi8255_0_r){ return ppi8255_r(machine().device("ppi8255_0"), (offset >> 4) & 3); } | |
| 985 | READ8_MEMBER(galaxian_state::turtles_ppi8255_1_r){ return ppi8255_r(machine().device("ppi8255_1"), (offset >> 4) & 3); } | |
| 986 | WRITE8_MEMBER(galaxian_state::turtles_ppi8255_0_w){ ppi8255_w(machine().device("ppi8255_0"), (offset >> 4) & 3, data); } | |
| 987 | WRITE8_MEMBER(galaxian_state::turtles_ppi8255_1_w){ ppi8255_w(machine().device("ppi8255_1"), (offset >> 4) & 3, data); } | |
| 990 | 988 | |
| 991 | 989 | |
| 992 | 990 | |
| r14896 | r14897 | |
| 996 | 994 | * |
| 997 | 995 | *************************************/ |
| 998 | 996 | |
| 999 | ||
| 997 | ||
| 1000 | 998 | { |
| 1001 | 999 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 1002 | 1000 | UINT8 result = 0xff; |
| 1003 | if (offset & 0x08) result &= ay8910_r(space->machine().device("8910.2"), 0); | |
| 1004 | if (offset & 0x20) result &= ay8910_r(space->machine().device("8910.1"), 0); | |
| 1005 | if (offset & 0x80) result &= ay8910_r(space->machine().device("8910.0"), 0); | |
| 1001 | if (offset & 0x08) result &= ay8910_r(machine().device("8910.2"), 0); | |
| 1002 | if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), 0); | |
| 1003 | if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), 0); | |
| 1006 | 1004 | return result; |
| 1007 | 1005 | } |
| 1008 | 1006 | |
| 1009 | 1007 | |
| 1010 | ||
| 1008 | ||
| 1011 | 1009 | { |
| 1012 | 1010 | /* the decoding here is very simplistic, and you can address all six simultaneously */ |
| 1013 | if (offset & 0x04) ay8910_address_w(space->machine().device("8910.2"), 0, data); | |
| 1014 | if (offset & 0x08) ay8910_data_w(space->machine().device("8910.2"), 0, data); | |
| 1015 | if (offset & 0x10) ay8910_address_w(space->machine().device("8910.1"), 0, data); | |
| 1016 | if (offset & 0x20) ay8910_data_w(space->machine().device("8910.1"), 0, data); | |
| 1017 | if (offset & 0x40) ay8910_address_w(space->machine().device("8910.0"), 0, data); | |
| 1018 | if (offset & 0x80) ay8910_data_w(space->machine().device("8910.0"), 0, data); | |
| 1011 | if (offset & 0x04) ay8910_address_w(machine().device("8910.2"), 0, data); | |
| 1012 | if (offset & 0x08) ay8910_data_w(machine().device("8910.2"), 0, data); | |
| 1013 | if (offset & 0x10) ay8910_address_w(machine().device("8910.1"), 0, data); | |
| 1014 | if (offset & 0x20) ay8910_data_w(machine().device("8910.1"), 0, data); | |
| 1015 | if (offset & 0x40) ay8910_address_w(machine().device("8910.0"), 0, data); | |
| 1016 | if (offset & 0x80) ay8910_data_w(machine().device("8910.0"), 0, data); | |
| 1019 | 1017 | } |
| 1020 | 1018 | |
| 1021 | 1019 | |
| r14896 | r14897 | |
| 1050 | 1048 | } |
| 1051 | 1049 | } |
| 1052 | 1050 | |
| 1053 | ||
| 1051 | ||
| 1054 | 1052 | { |
| 1055 | device_t *digitalker = | |
| 1053 | device_t *digitalker = | |
| 1056 | 1054 | return digitalker_0_intr_r(digitalker); |
| 1057 | 1055 | } |
| 1058 | 1056 | |
| r14896 | r14897 | |
| 1068 | 1066 | DEVCB_NULL, /* Port A read */ |
| 1069 | 1067 | DEVCB_NULL, /* Port B read */ |
| 1070 | 1068 | DEVCB_HANDLER(scorpion_protection_r), /* Port C read */ |
| 1071 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_w), /* Port A write */ | |
| 1069 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w), /* Port A write */ | |
| 1072 | 1070 | DEVCB_HANDLER(konami_sound_control_w), /* Port B write */ |
| 1073 | 1071 | DEVCB_HANDLER(scorpion_protection_w) /* Port C write */ |
| 1074 | 1072 | }; |
| r14896 | r14897 | |
| 1117 | 1115 | * |
| 1118 | 1116 | *************************************/ |
| 1119 | 1117 | |
| 1120 | ||
| 1118 | ||
| 1121 | 1119 | { |
| 1122 | memory_set_bank(space->machine(), "bank1", data & 1); | |
| 1123 | memory_set_bank(space->machine(), "bank2", ~data & 1); | |
| 1120 | memory_set_bank(machine(), "bank1", data & 1); | |
| 1121 | memory_set_bank(machine(), "bank2", ~data & 1); | |
| 1124 | 1122 | } |
| 1125 | 1123 | |
| 1126 | 1124 | |
| 1127 | ||
| 1125 | ||
| 1128 | 1126 | { |
| 1129 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1130 | 1127 | switch (offset & 0x300) |
| 1131 | 1128 | { |
| 1132 | 1129 | case 0x000: |
| r14896 | r14897 | |
| 1134 | 1131 | /* bit 0 = WRITE */ |
| 1135 | 1132 | /* bit 1 = C/D */ |
| 1136 | 1133 | if ((offset & 1) != 0) |
| 1137 | ay8910_data_address_w( | |
| 1134 | ay8910_data_address_w( | |
| 1138 | 1135 | break; |
| 1139 | 1136 | |
| 1140 | 1137 | case 0x100: |
| 1141 | 1138 | /* data latch */ |
| 1142 | | |
| 1139 | | |
| 1143 | 1140 | break; |
| 1144 | 1141 | |
| 1145 | 1142 | case 0x200: |
| r14896 | r14897 | |
| 1185 | 1182 | } |
| 1186 | 1183 | |
| 1187 | 1184 | |
| 1188 | ||
| 1185 | ||
| 1189 | 1186 | { |
| 1190 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1191 | state->m_kingball_speech_dip = data; | |
| 1187 | m_kingball_speech_dip = data; | |
| 1192 | 1188 | } |
| 1193 | 1189 | |
| 1194 | 1190 | |
| 1195 | ||
| 1191 | ||
| 1196 | 1192 | { |
| 1197 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1198 | state->m_kingball_sound = (state->m_kingball_sound & ~0x01) | data; | |
| 1193 | m_kingball_sound = (m_kingball_sound & ~0x01) | data; | |
| 1199 | 1194 | } |
| 1200 | 1195 | |
| 1201 | 1196 | |
| 1202 | ||
| 1197 | ||
| 1203 | 1198 | { |
| 1204 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1205 | state->m_kingball_sound = (state->m_kingball_sound & ~0x02) | (data << 1); | |
| 1206 | state->soundlatch_w(*space, 0, state->m_kingball_sound | 0xf0); | |
| 1199 | m_kingball_sound = (m_kingball_sound & ~0x02) | (data << 1); | |
| 1200 | soundlatch_byte_w(*&space, 0, m_kingball_sound | 0xf0); | |
| 1207 | 1201 | } |
| 1208 | 1202 | |
| 1209 | 1203 | |
| r14896 | r14897 | |
| 1220 | 1214 | * |
| 1221 | 1215 | *************************************/ |
| 1222 | 1216 | |
| 1223 | ||
| 1217 | ||
| 1224 | 1218 | { |
| 1225 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1226 | state->m_mshuttle_ay8910_cs = data & 1; | |
| 1219 | m_mshuttle_ay8910_cs = data & 1; | |
| 1227 | 1220 | } |
| 1228 | 1221 | |
| 1229 | 1222 | |
| 1230 | ||
| 1223 | ||
| 1231 | 1224 | { |
| 1232 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1233 | if (!state->m_mshuttle_ay8910_cs) | |
| 1234 | ay8910_address_w(space->machine().device("aysnd"), offset, data); | |
| 1225 | if (!m_mshuttle_ay8910_cs) | |
| 1226 | ay8910_address_w(machine().device("aysnd"), offset, data); | |
| 1235 | 1227 | } |
| 1236 | 1228 | |
| 1237 | 1229 | |
| 1238 | ||
| 1230 | ||
| 1239 | 1231 | { |
| 1240 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1241 | if (!state->m_mshuttle_ay8910_cs) | |
| 1242 | ay8910_data_w(space->machine().device("aysnd"), offset, data); | |
| 1232 | if (!m_mshuttle_ay8910_cs) | |
| 1233 | ay8910_data_w(machine().device("aysnd"), offset, data); | |
| 1243 | 1234 | } |
| 1244 | 1235 | |
| 1245 | 1236 | |
| 1246 | ||
| 1237 | ||
| 1247 | 1238 | { |
| 1248 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1249 | if (!state->m_mshuttle_ay8910_cs) | |
| 1250 | return ay8910_r(space->machine().device("aysnd"), offset); | |
| 1239 | if (!m_mshuttle_ay8910_cs) | |
| 1240 | return ay8910_r(machine().device("aysnd"), offset); | |
| 1251 | 1241 | return 0xff; |
| 1252 | 1242 | } |
| 1253 | 1243 | |
| r14896 | r14897 | |
| 1259 | 1249 | * |
| 1260 | 1250 | *************************************/ |
| 1261 | 1251 | |
| 1262 | ||
| 1252 | ||
| 1263 | 1253 | { |
| 1264 | 1254 | switch (offset) |
| 1265 | 1255 | { |
| r14896 | r14897 | |
| 1269 | 1259 | case 0x0235: return 0x02; |
| 1270 | 1260 | case 0x0311: return 0xff; /* not checked */ |
| 1271 | 1261 | } |
| 1272 | logerror("Unknown protection read. Offset: %04X PC=%04X\n",0xb000+offset,cpu_get_pc(&space | |
| 1262 | logerror("Unknown protection read. Offset: %04X PC=%04X\n",0xb000+offset,cpu_get_pc(&space. | |
| 1273 | 1263 | return 0xff; |
| 1274 | 1264 | } |
| 1275 | 1265 | |
| r14896 | r14897 | |
| 1281 | 1271 | * |
| 1282 | 1272 | *************************************/ |
| 1283 | 1273 | |
| 1284 | ||
| 1274 | ||
| 1285 | 1275 | { |
| 1286 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 1287 | state->soundlatch_w(*space, 0, data); | |
| 1288 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 1276 | soundlatch_byte_w(*&space, 0, data); | |
| 1277 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 1289 | 1278 | } |
| 1290 | 1279 | |
| 1291 | 1280 | |
| r14896 | r14897 | |
| 1295 | 1284 | } |
| 1296 | 1285 | |
| 1297 | 1286 | |
| 1298 | ||
| 1287 | ||
| 1299 | 1288 | { |
| 1300 | switch (cpu_get_pc(&space | |
| 1289 | switch (cpu_get_pc(&space. | |
| 1301 | 1290 | { |
| 1302 | 1291 | case 0x0f15: return 0xf5; |
| 1303 | 1292 | case 0x0f8f: return 0x7c; |
| r14896 | r14897 | |
| 1306 | 1295 | case 0x10f1: return 0xaa; |
| 1307 | 1296 | case 0x1402: return 0xaa; |
| 1308 | 1297 | default: |
| 1309 | logerror("Unknown protection read. PC=%04X\n",cpu_get_pc(&space | |
| 1298 | logerror("Unknown protection read. PC=%04X\n",cpu_get_pc(&space. | |
| 1310 | 1299 | } |
| 1311 | 1300 | |
| 1312 | 1301 | return 0; |
| r14896 | r14897 | |
| 1320 | 1309 | * |
| 1321 | 1310 | *************************************/ |
| 1322 | 1311 | |
| 1323 | ||
| 1312 | ||
| 1324 | 1313 | { |
| 1325 | 1314 | return 0xaa; |
| 1326 | 1315 | } |
| 1327 | 1316 | |
| 1328 | 1317 | |
| 1329 | ||
| 1318 | ||
| 1330 | 1319 | { |
| 1331 | 1320 | return 0x8c; |
| 1332 | 1321 | } |
| 1333 | 1322 | |
| 1334 | 1323 | |
| 1335 | ||
| 1324 | ||
| 1336 | 1325 | { |
| 1337 | 1326 | return 0xaa; |
| 1338 | 1327 | } |
| r14896 | r14897 | |
| 1438 | 1427 | AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1439 | 1428 | AM_RANGE(0x5800, 0x58ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1440 | 1429 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0") |
| 1441 | AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(start_lamp_w) | |
| 1442 | AM_RANGE(0x6002, 0x6002) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(coin_lock_w) | |
| 1443 | AM_RANGE(0x6003, 0x6003) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1430 | AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x07f8) AM_WRITE(start_lamp_w) | |
| 1431 | AM_RANGE(0x6002, 0x6002) AM_MIRROR(0x07f8) AM_WRITE(coin_lock_w) | |
| 1432 | AM_RANGE(0x6003, 0x6003) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) | |
| 1444 | 1433 | //AM_RANGE(0x6004, 0x6007) AM_MIRROR(0x07f8) AM_DEVWRITE_LEGACY(GAL_AUDIO, galaxian_lfo_freq_w) |
| 1445 | 1434 | AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1") |
| 1446 | 1435 | //AM_RANGE(0x6800, 0x6807) AM_MIRROR(0x07f8) AM_DEVWRITE_LEGACY(GAL_AUDIO, galaxian_sound_w) |
| 1447 | 1436 | AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2") |
| 1448 | AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x07f8) AM_WRITE | |
| 1437 | AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x07f8) AM_WRITE | |
| 1449 | 1438 | AM_RANGE(0x7004, 0x7004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w) |
| 1450 | 1439 | AM_RANGE(0x7006, 0x7006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w) |
| 1451 | 1440 | AM_RANGE(0x7007, 0x7007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w) |
| r14896 | r14897 | |
| 1474 | 1463 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1475 | 1464 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0") |
| 1476 | 1465 | AM_RANGE(0xa000, 0xa002) AM_MIRROR(0x07f8) AM_WRITE(galaxian_gfxbank_w) |
| 1477 | AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x07f8) AM_WRITE | |
| 1466 | AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x07f8) AM_WRITE | |
| 1478 | 1467 | // AM_RANGE(0xa004, 0xa007) AM_MIRROR(0x07f8) AM_DEVWRITE_LEGACY(GAL_AUDIO, galaxian_lfo_freq_w) |
| 1479 | 1468 | AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1") |
| 1480 | 1469 | // AM_RANGE(0xa800, 0xa807) AM_MIRROR(0x07f8) AM_DEVWRITE_LEGACY(GAL_AUDIO, galaxian_sound_w) |
| 1481 | 1470 | AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2") |
| 1482 | AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07f8) AM_WRITE | |
| 1471 | AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07f8) AM_WRITE | |
| 1483 | 1472 | AM_RANGE(0xb004, 0xb004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w) |
| 1484 | 1473 | AM_RANGE(0xb006, 0xb006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w) |
| 1485 | 1474 | AM_RANGE(0xb007, 0xb007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w) |
| r14896 | r14897 | |
| 1506 | 1495 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0") |
| 1507 | 1496 | AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1") |
| 1508 | 1497 | AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2") |
| 1509 | AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07f8) AM_WRITE | |
| 1498 | AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x07f8) AM_WRITE | |
| 1510 | 1499 | AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r) |
| 1511 | 1500 | AM_RANGE(0xfffe, 0xfffe) AM_NOP //? |
| 1512 | 1501 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1527 | 1516 | AM_RANGE(0xe800, 0xe800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1") |
| 1528 | 1517 | AM_RANGE(0xe800, 0xe807) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(galaxian_sound_w) |
| 1529 | 1518 | AM_RANGE(0xf000, 0xf000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2") |
| 1530 | AM_RANGE(0xf001, 0xf001) AM_MIRROR(0x07f8) AM_WRITE | |
| 1519 | AM_RANGE(0xf001, 0xf001) AM_MIRROR(0x07f8) AM_WRITE | |
| 1531 | 1520 | AM_RANGE(0xf004, 0xf004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w) |
| 1532 | 1521 | AM_RANGE(0xf006, 0xf006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w) |
| 1533 | 1522 | AM_RANGE(0xf007, 0xf007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w) |
| r14896 | r14897 | |
| 1544 | 1533 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 1545 | 1534 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1546 | 1535 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1547 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(irq_enable_w) | |
| 1548 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1536 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w) | |
| 1537 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) | |
| 1549 | 1538 | AM_RANGE(0x6803, 0x6803) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_enable_w) |
| 1550 | 1539 | AM_RANGE(0x6804, 0x6804) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w) |
| 1551 | 1540 | AM_RANGE(0x6805, 0x6805) AM_MIRROR(0x07f8) //POUT2 |
| 1552 | 1541 | AM_RANGE(0x6806, 0x6806) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w) |
| 1553 | 1542 | AM_RANGE(0x6807, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w) |
| 1554 | 1543 | AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r) |
| 1555 | AM_RANGE(0x8000, 0xffff) AM_READWRITE | |
| 1544 | AM_RANGE(0x8000, 0xffff) AM_READWRITE | |
| 1556 | 1545 | ADDRESS_MAP_END |
| 1557 | 1546 | |
| 1558 | 1547 | |
| r14896 | r14897 | |
| 1565 | 1554 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x4700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1566 | 1555 | AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 1567 | 1556 | AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 1568 | AM_RANGE(0xa801, 0xa801) AM_MIRROR(0x47f8) AM_WRITE_LEGACY(irq_enable_w) | |
| 1569 | AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x47f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1557 | AM_RANGE(0xa801, 0xa801) AM_MIRROR(0x47f8) AM_WRITE(irq_enable_w) | |
| 1558 | AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x47f8) AM_WRITE(coin_count_0_w) | |
| 1570 | 1559 | AM_RANGE(0xa803, 0xa803) AM_MIRROR(0x47f8) AM_WRITE(scramble_background_enable_w) |
| 1571 | 1560 | AM_RANGE(0xa804, 0xa804) AM_MIRROR(0x47f8) AM_WRITE(galaxian_stars_enable_w) |
| 1572 | 1561 | AM_RANGE(0xa805, 0xa805) AM_MIRROR(0x47f8) /* POUT2 */ |
| r14896 | r14897 | |
| 1581 | 1570 | AM_RANGE(0x0000, 0x03ff) AM_ROM |
| 1582 | 1571 | AM_RANGE(0x0400, 0x0bff) AM_RAM |
| 1583 | 1572 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1584 | AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x01f8) AM_WRITE_LEGACY(irq_enable_w) | |
| 1585 | AM_RANGE(0x1002, 0x1002) AM_MIRROR(0x01f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1573 | AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x01f8) AM_WRITE(irq_enable_w) | |
| 1574 | AM_RANGE(0x1002, 0x1002) AM_MIRROR(0x01f8) AM_WRITE(coin_count_0_w) | |
| 1586 | 1575 | AM_RANGE(0x1003, 0x1003) AM_MIRROR(0x01f8) AM_WRITE(scramble_background_enable_w) |
| 1587 | 1576 | AM_RANGE(0x1004, 0x1004) AM_MIRROR(0x01f8) AM_WRITE(galaxian_stars_enable_w) |
| 1588 | 1577 | AM_RANGE(0x1005, 0x1005) AM_MIRROR(0x01f8) //POUT2 |
| r14896 | r14897 | |
| 1603 | 1592 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1604 | 1593 | AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1605 | 1594 | AM_RANGE(0x2400, 0x2403) AM_MIRROR(0x01fc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 1606 | AM_RANGE(0x2601, 0x2601) AM_MIRROR(0x01f8) AM_WRITE_LEGACY(irq_enable_w) | |
| 1607 | AM_RANGE(0x2602, 0x2602) AM_MIRROR(0x01f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1595 | AM_RANGE(0x2601, 0x2601) AM_MIRROR(0x01f8) AM_WRITE(irq_enable_w) | |
| 1596 | AM_RANGE(0x2602, 0x2602) AM_MIRROR(0x01f8) AM_WRITE(coin_count_0_w) | |
| 1608 | 1597 | AM_RANGE(0x2603, 0x2603) AM_MIRROR(0x01f8) AM_WRITE(scramble_background_enable_w) |
| 1609 | 1598 | AM_RANGE(0x2604, 0x2604) AM_MIRROR(0x01f8) AM_WRITE(galaxian_stars_enable_w) |
| 1610 | 1599 | AM_RANGE(0x2605, 0x2605) AM_MIRROR(0x01f8) //POUT2 |
| r14896 | r14897 | |
| 1625 | 1614 | AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r) |
| 1626 | 1615 | AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1627 | 1616 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1628 | AM_RANGE(0xb808, 0xb808) AM_MIRROR(0x07e3) AM_WRITE | |
| 1617 | AM_RANGE(0xb808, 0xb808) AM_MIRROR(0x07e3) AM_WRITE | |
| 1629 | 1618 | AM_RANGE(0xb80c, 0xb80c) AM_MIRROR(0x07e3) AM_WRITE(galaxian_flip_screen_y_w) |
| 1630 | 1619 | AM_RANGE(0xb810, 0xb810) AM_MIRROR(0x07e3) AM_WRITE(galaxian_flip_screen_x_w) |
| 1631 | AM_RANGE(0xb818, 0xb818) AM_MIRROR(0x07e3) AM_WRITE_LEGACY(coin_count_0_w) /* IOPC7 */ | |
| 1632 | AM_RANGE(0xb81c, 0xb81c) AM_MIRROR(0x07e3) AM_WRITE_LEGACY(coin_count_1_w) /* POUT1 */ | |
| 1633 | AM_RANGE(0xc000, 0xffff) AM_READWRITE_LEGACY(frogger_ppi8255_r, frogger_ppi8255_w) | |
| 1620 | AM_RANGE(0xb818, 0xb818) AM_MIRROR(0x07e3) AM_WRITE(coin_count_0_w) /* IOPC7 */ | |
| 1621 | AM_RANGE(0xb81c, 0xb81c) AM_MIRROR(0x07e3) AM_WRITE(coin_count_1_w) /* POUT1 */ | |
| 1622 | AM_RANGE(0xc000, 0xffff) AM_READWRITE(frogger_ppi8255_r, frogger_ppi8255_w) | |
| 1634 | 1623 | ADDRESS_MAP_END |
| 1635 | 1624 | |
| 1636 | 1625 | |
| r14896 | r14897 | |
| 1642 | 1631 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x4400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1643 | 1632 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x4700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1644 | 1633 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_red_w) |
| 1645 | AM_RANGE(0xa008, 0xa008) AM_MIRROR(0x47c7) AM_WRITE | |
| 1634 | AM_RANGE(0xa008, 0xa008) AM_MIRROR(0x47c7) AM_WRITE | |
| 1646 | 1635 | AM_RANGE(0xa010, 0xa010) AM_MIRROR(0x47c7) AM_WRITE(galaxian_flip_screen_y_w) |
| 1647 | 1636 | AM_RANGE(0xa018, 0xa018) AM_MIRROR(0x47c7) AM_WRITE(galaxian_flip_screen_x_w) |
| 1648 | 1637 | AM_RANGE(0xa020, 0xa020) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_green_w) |
| 1649 | 1638 | AM_RANGE(0xa028, 0xa028) AM_MIRROR(0x47c7) AM_WRITE(scramble_background_blue_w) |
| 1650 | AM_RANGE(0xa030, 0xa030) AM_MIRROR(0x47c7) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1651 | AM_RANGE(0xa038, 0xa038) AM_MIRROR(0x47c7) AM_WRITE_LEGACY(coin_count_1_w) | |
| 1639 | AM_RANGE(0xa030, 0xa030) AM_MIRROR(0x47c7) AM_WRITE(coin_count_0_w) | |
| 1640 | AM_RANGE(0xa038, 0xa038) AM_MIRROR(0x47c7) AM_WRITE(coin_count_1_w) | |
| 1652 | 1641 | AM_RANGE(0xa800, 0xa800) AM_MIRROR(0x47ff) AM_READ(watchdog_reset_r) |
| 1653 | AM_RANGE(0xb000, 0xb03f) AM_MIRROR(0x47cf) AM_READWRITE_LEGACY(turtles_ppi8255_0_r, turtles_ppi8255_0_w) | |
| 1654 | AM_RANGE(0xb800, 0xb83f) AM_MIRROR(0x47cf) AM_READWRITE_LEGACY(turtles_ppi8255_1_r, turtles_ppi8255_1_w) | |
| 1642 | AM_RANGE(0xb000, 0xb03f) AM_MIRROR(0x47cf) AM_READWRITE(turtles_ppi8255_0_r, turtles_ppi8255_0_w) | |
| 1643 | AM_RANGE(0xb800, 0xb83f) AM_MIRROR(0x47cf) AM_READWRITE(turtles_ppi8255_1_r, turtles_ppi8255_1_w) | |
| 1655 | 1644 | ADDRESS_MAP_END |
| 1656 | 1645 | |
| 1657 | 1646 | |
| r14896 | r14897 | |
| 1663 | 1652 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1664 | 1653 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1665 | 1654 | AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_red_w) |
| 1666 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(irq_enable_w) | |
| 1667 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1655 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w) | |
| 1656 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) | |
| 1668 | 1657 | AM_RANGE(0x6803, 0x6803) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_blue_w) |
| 1669 | 1658 | AM_RANGE(0x6804, 0x6804) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w) |
| 1670 | 1659 | AM_RANGE(0x6805, 0x6805) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_green_w) |
| 1671 | 1660 | AM_RANGE(0x6806, 0x6806) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w) |
| 1672 | 1661 | AM_RANGE(0x6807, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w) |
| 1673 | 1662 | AM_RANGE(0x7000, 0x7fff) AM_ROM |
| 1674 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE | |
| 1663 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE | |
| 1675 | 1664 | AM_RANGE(0xc000, 0xefff) AM_ROM |
| 1676 | 1665 | ADDRESS_MAP_END |
| 1677 | 1666 | |
| r14896 | r14897 | |
| 1683 | 1672 | AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1684 | 1673 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1685 | 1674 | AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_red_w) |
| 1686 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(irq_enable_w) | |
| 1687 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1675 | AM_RANGE(0x6801, 0x6801) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w) | |
| 1676 | AM_RANGE(0x6802, 0x6802) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) | |
| 1688 | 1677 | AM_RANGE(0x6803, 0x6803) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_blue_w) |
| 1689 | 1678 | AM_RANGE(0x6804, 0x6804) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w) |
| 1690 | 1679 | AM_RANGE(0x6805, 0x6805) AM_MIRROR(0x07f8) AM_WRITE(scramble_background_green_w) |
| 1691 | 1680 | AM_RANGE(0x6806, 0x6806) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w) |
| 1692 | 1681 | AM_RANGE(0x6807, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w) |
| 1693 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE | |
| 1682 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE | |
| 1694 | 1683 | AM_RANGE(0xc000, 0xd7ff) AM_ROM |
| 1695 | AM_RANGE(0xd800, 0xd800) AM_READ | |
| 1684 | AM_RANGE(0xd800, 0xd800) AM_READ | |
| 1696 | 1685 | ADDRESS_MAP_END |
| 1697 | 1686 | |
| 1698 | 1687 | |
| r14896 | r14897 | |
| 1717 | 1706 | AM_RANGE(0x6002, 0x6006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_gfxbank_w) |
| 1718 | 1707 | AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1") |
| 1719 | 1708 | AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2") |
| 1720 | AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(irq_enable_w) | |
| 1721 | AM_RANGE(0x7002, 0x7002) AM_MIRROR(0x07f8) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1709 | AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w) | |
| 1710 | AM_RANGE(0x7002, 0x7002) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w) | |
| 1722 | 1711 | AM_RANGE(0x7004, 0x7004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w) |
| 1723 | 1712 | AM_RANGE(0x7006, 0x7006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w) |
| 1724 | 1713 | AM_RANGE(0x7007, 0x7007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w) |
| 1725 | 1714 | AM_RANGE(0x8000, 0xafff) AM_ROM |
| 1726 | AM_RANGE(0xb000, 0xbfff) AM_READ | |
| 1715 | AM_RANGE(0xb000, 0xbfff) AM_READ | |
| 1727 | 1716 | ADDRESS_MAP_END |
| 1728 | 1717 | |
| 1729 | 1718 | |
| r14896 | r14897 | |
| 1734 | 1723 | AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1735 | 1724 | AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1736 | 1725 | AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x07f1) AM_WRITE(galaxian_flip_screen_x_w) |
| 1737 | AM_RANGE(0xa804, 0xa804) AM_MIRROR(0x07f1) AM_WRITE | |
| 1726 | AM_RANGE(0xa804, 0xa804) AM_MIRROR(0x07f1) AM_WRITE | |
| 1738 | 1727 | AM_RANGE(0xa806, 0xa806) AM_MIRROR(0x07f1) AM_WRITE(galaxian_flip_screen_y_w) |
| 1739 | AM_RANGE(0xa808, 0xa808) AM_MIRROR(0x07f1) AM_WRITE_LEGACY(coin_count_1_w) | |
| 1740 | AM_RANGE(0xa80e, 0xa80e) AM_MIRROR(0x07f1) AM_WRITE_LEGACY(coin_count_0_w) | |
| 1728 | AM_RANGE(0xa808, 0xa808) AM_MIRROR(0x07f1) AM_WRITE(coin_count_1_w) | |
| 1729 | AM_RANGE(0xa80e, 0xa80e) AM_MIRROR(0x07f1) AM_WRITE(coin_count_0_w) | |
| 1741 | 1730 | AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r) |
| 1742 | AM_RANGE(0xc000, 0xffff) AM_READWRITE | |
| 1731 | AM_RANGE(0xc000, 0xffff) AM_READWRITE | |
| 1743 | 1732 | ADDRESS_MAP_END |
| 1744 | 1733 | |
| 1745 | 1734 | |
| r14896 | r14897 | |
| 1751 | 1740 | AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_BASE(m_videoram) |
| 1752 | 1741 | AM_RANGE(0x9800, 0x98ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") |
| 1753 | 1742 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| 1754 | AM_RANGE(0xa000, 0xa000) AM_WRITE | |
| 1743 | AM_RANGE(0xa000, 0xa000) AM_WRITE | |
| 1755 | 1744 | AM_RANGE(0xa001, 0xa001) AM_WRITE(galaxian_stars_enable_w) |
| 1756 | 1745 | AM_RANGE(0xa002, 0xa002) AM_WRITE(galaxian_flip_screen_xy_w) |
| 1757 | 1746 | AM_RANGE(0xa004, 0xa004) AM_WRITE_LEGACY(cclimber_sample_trigger_w) |
| 1758 | AM_RANGE(0xa007, 0xa007) AM_WRITE | |
| 1747 | AM_RANGE(0xa007, 0xa007) AM_WRITE | |
| 1759 | 1748 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") |
| 1760 | 1749 | AM_RANGE(0xa800, 0xa800) AM_WRITE_LEGACY(cclimber_sample_rate_w) |
| 1761 | 1750 | AM_RANGE(0xb000, 0xb000) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 1766 | 1755 | static ADDRESS_MAP_START( mshuttle_portmap, AS_IO, 8, galaxian_state ) |
| 1767 | 1756 | ADDRESS_MAP_UNMAP_HIGH |
| 1768 | 1757 | ADDRESS_MAP_GLOBAL_MASK(0x0f) |
| 1769 | AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(mshuttle_ay8910_control_w) | |
| 1770 | AM_RANGE(0x09, 0x09) AM_WRITE_LEGACY(mshuttle_ay8910_data_w) | |
| 1771 | AM_RANGE(0x0c, 0x0c) AM_READ_LEGACY(mshuttle_ay8910_data_r) | |
| 1758 | AM_RANGE(0x08, 0x08) AM_WRITE(mshuttle_ay8910_control_w) | |
| 1759 | AM_RANGE(0x09, 0x09) AM_WRITE(mshuttle_ay8910_data_w) | |
| 1760 | AM_RANGE(0x0c, 0x0c) AM_READ(mshuttle_ay8910_data_r) | |
| 1772 | 1761 | ADDRESS_MAP_END |
| 1773 | 1762 | |
| 1774 | 1763 | |
| 1775 | ||
| 1764 | ||
| 1776 | 1765 | { |
| 1777 | 1766 | logerror("tenspot_unk_6000_w %02x\n",data); |
| 1778 | 1767 | } |
| 1779 | 1768 | |
| 1780 | ||
| 1769 | ||
| 1781 | 1770 | { |
| 1782 | 1771 | logerror("tenspot_unk_8000_w %02x\n",data); |
| 1783 | 1772 | } |
| 1784 | 1773 | |
| 1785 | ||
| 1774 | ||
| 1786 | 1775 | { |
| 1787 | 1776 | logerror("tenspot_unk_e000_w %02x\n",data); |
| 1788 | 1777 | } |
| r14896 | r14897 | |
| 1792 | 1781 | AM_RANGE(0x0000, 0x07ff) AM_ROM |
| 1793 | 1782 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 1794 | 1783 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("SELECT2") |
| 1795 | AM_RANGE(0x6000, 0x6000) AM_WRITE | |
| 1784 | AM_RANGE(0x6000, 0x6000) AM_WRITE | |
| 1796 | 1785 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SELECT") |
| 1797 | AM_RANGE(0x8000, 0x8000) AM_WRITE | |
| 1786 | AM_RANGE(0x8000, 0x8000) AM_WRITE | |
| 1798 | 1787 | AM_RANGE(0xa000, 0xa03f) AM_RAM |
| 1799 | AM_RANGE(0xe000, 0xe000) AM_WRITE | |
| 1788 | AM_RANGE(0xe000, 0xe000) AM_WRITE | |
| 1800 | 1789 | ADDRESS_MAP_END |
| 1801 | 1790 | |
| 1802 | 1791 | /************************************* |
| r14896 | r14897 | |
| 1810 | 1799 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 1811 | 1800 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 1812 | 1801 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x1c00) AM_RAM |
| 1813 | AM_RANGE(0x6000, 0x6fff) AM_MIRROR(0x1000) AM_WRITE | |
| 1802 | AM_RANGE(0x6000, 0x6fff) AM_MIRROR(0x1000) AM_WRITE | |
| 1814 | 1803 | ADDRESS_MAP_END |
| 1815 | 1804 | |
| 1816 | 1805 | static ADDRESS_MAP_START( frogger_sound_portmap, AS_IO, 8, galaxian_state ) |
| 1817 | 1806 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1818 | AM_RANGE(0x00, 0xff) AM_READWRITE | |
| 1807 | AM_RANGE(0x00, 0xff) AM_READWRITE | |
| 1819 | 1808 | ADDRESS_MAP_END |
| 1820 | 1809 | |
| 1821 | 1810 | |
| r14896 | r14897 | |
| 1823 | 1812 | static ADDRESS_MAP_START( konami_sound_map, AS_PROGRAM, 8, galaxian_state ) |
| 1824 | 1813 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 1825 | 1814 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x6c00) AM_RAM |
| 1826 | AM_RANGE(0x9000, 0x9fff) AM_MIRROR(0x6000) AM_WRITE | |
| 1815 | AM_RANGE(0x9000, 0x9fff) AM_MIRROR(0x6000) AM_WRITE | |
| 1827 | 1816 | ADDRESS_MAP_END |
| 1828 | 1817 | |
| 1829 | 1818 | static ADDRESS_MAP_START( konami_sound_portmap, AS_IO, 8, galaxian_state ) |
| 1830 | 1819 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1831 | AM_RANGE(0x00, 0xff) AM_READWRITE | |
| 1820 | AM_RANGE(0x00, 0xff) AM_READWRITE | |
| 1832 | 1821 | ADDRESS_MAP_END |
| 1833 | 1822 | |
| 1834 | 1823 | |
| r14896 | r14897 | |
| 1842 | 1831 | static ADDRESS_MAP_START( checkman_sound_portmap, AS_IO, 8, galaxian_state ) |
| 1843 | 1832 | ADDRESS_MAP_UNMAP_HIGH |
| 1844 | 1833 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1845 | AM_RANGE(0x03, 0x03) AM_READ(soundlatch_r) | |
| 1834 | AM_RANGE(0x03, 0x03) AM_READ(soundlatch_byte_r) | |
| 1846 | 1835 | AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 1847 | 1836 | AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 1848 | 1837 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1869 | 1858 | static ADDRESS_MAP_START( kingball_sound_portmap, AS_IO, 8, galaxian_state ) |
| 1870 | 1859 | ADDRESS_MAP_UNMAP_HIGH |
| 1871 | 1860 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1872 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_READ(soundlatch_r) AM_DEVWRITE_LEGACY("dac", kingball_dac_w) | |
| 1861 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_READ(soundlatch_byte_r) AM_DEVWRITE_LEGACY("dac", kingball_dac_w) | |
| 1873 | 1862 | ADDRESS_MAP_END |
| 1874 | 1863 | |
| 1875 | 1864 | |
| r14896 | r14897 | |
| 1881 | 1870 | |
| 1882 | 1871 | static ADDRESS_MAP_START( sfx_sample_portmap, AS_IO, 8, galaxian_state ) |
| 1883 | 1872 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1884 | AM_RANGE(0x00, 0xff) AM_READWRITE | |
| 1873 | AM_RANGE(0x00, 0xff) AM_READWRITE | |
| 1885 | 1874 | ADDRESS_MAP_END |
| 1886 | 1875 | |
| 1887 | 1876 | |
| r14896 | r14897 | |
| 1974 | 1963 | { |
| 1975 | 1964 | AY8910_DISCRETE_OUTPUT, |
| 1976 | 1965 | {RES_K(5.1), RES_K(5.1), RES_K(5.1)}, |
| 1977 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 1966 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 1978 | 1967 | DEVCB_HANDLER(frogger_sound_timer_r), |
| 1979 | 1968 | DEVCB_NULL, |
| 1980 | 1969 | DEVCB_NULL |
| r14896 | r14897 | |
| 1984 | 1973 | { |
| 1985 | 1974 | AY8910_DISCRETE_OUTPUT, |
| 1986 | 1975 | {RES_K(5.1), RES_K(5.1), RES_K(5.1)}, |
| 1987 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 1976 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 1988 | 1977 | DEVCB_HANDLER(konami_sound_timer_r), |
| 1989 | 1978 | DEVCB_NULL, |
| 1990 | 1979 | DEVCB_NULL |
| r14896 | r14897 | |
| 2026 | 2015 | AY8910_DEFAULT_LOADS, |
| 2027 | 2016 | DEVCB_NULL, |
| 2028 | 2017 | DEVCB_NULL, |
| 2029 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_w), | |
| 2018 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_w), | |
| 2030 | 2019 | DEVCB_HANDLER(sfx_sample_control_w) |
| 2031 | 2020 | }; |
| 2032 | 2021 | |
| r14896 | r14897 | |
| 2044 | 2033 | { |
| 2045 | 2034 | AY8910_LEGACY_OUTPUT, |
| 2046 | 2035 | AY8910_DEFAULT_LOADS, |
| 2047 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 2036 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 2048 | 2037 | DEVCB_NULL, |
| 2049 | 2038 | DEVCB_NULL, |
| 2050 | 2039 | DEVCB_NULL |
| r14896 | r14897 | |
| 2918 | 2907 | space->set_decrypted_region(0x0000, 0x7fff, decrypt); |
| 2919 | 2908 | } |
| 2920 | 2909 | |
| 2921 | ||
| 2910 | ||
| 2922 | 2911 | { |
| 2923 | 2912 | // printf("artic_gfxbank_w %02x\n",data); |
| 2924 | 2913 | } |
| 2925 | 2914 | |
| 2926 | 2915 | static DRIVER_INIT( pacmanbl ) |
| 2927 | 2916 | { |
| 2917 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 2928 | 2918 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 2929 | 2919 | |
| 2930 | 2920 | /* same as galaxian... */ |
| 2931 | 2921 | DRIVER_INIT_CALL(galaxian); |
| 2932 | 2922 | |
| 2933 | 2923 | /* ...but coin lockout disabled/disconnected */ |
| 2934 | space->install_ | |
| 2924 | space->install_ | |
| 2935 | 2925 | } |
| 2936 | 2926 | |
| 2937 | ||
| 2927 | ||
| 2938 | 2928 | { |
| 2939 | galaxian_state *state = space->machine().driver_data<galaxian_state>(); | |
| 2940 | 2929 | char tmp[64]; |
| 2941 | sprintf(tmp,"IN2_GAME%d", state->m_tenspot_current_game); | |
| 2942 | return input_port_read_safe(space->machine(), tmp, 0x00); | |
| 2930 | sprintf(tmp,"IN2_GAME%d", m_tenspot_current_game); | |
| 2931 | return input_port_read_safe(machine(), tmp, 0x00); | |
| 2943 | 2932 | } |
| 2944 | 2933 | |
| 2945 | 2934 | |
| r14896 | r14897 | |
| 3003 | 2992 | |
| 3004 | 2993 | DRIVER_INIT_CALL(galaxian); |
| 3005 | 2994 | |
| 3006 | space->install_ | |
| 2995 | space->install_ | |
| 3007 | 2996 | |
| 3008 | 2997 | state->m_tenspot_current_game = 0; |
| 3009 | 2998 | |
| 3010 | 2999 | tenspot_set_game_bank(machine, state->m_tenspot_current_game, 0); |
| 3011 | 3000 | |
| 3012 | space->install_ | |
| 3001 | space->install_ | |
| 3013 | 3002 | } |
| 3014 | 3003 | |
| 3015 | 3004 | |
| r14896 | r14897 | |
| 3049 | 3038 | memory_set_bankptr(machine, "bank3", machine.region("maincpu")->base() + 0x0000); |
| 3050 | 3039 | |
| 3051 | 3040 | /* handler for doing the swaps */ |
| 3052 | space->install_legacy_write_handler(0x7002, 0x7002, 0, 0x07f8, FUNC(zigzag_bankswap_w)); | |
| 3053 | zigzag_bankswap_w(space, 0, 0); | |
| 3041 | space->install_write_handler(0x7002, 0x7002, 0, 0x07f8, write8_delegate(FUNC(galaxian_state::zigzag_bankswap_w),state)); | |
| 3042 | state->zigzag_bankswap_w(*space, 0, 0); | |
| 3054 | 3043 | |
| 3055 | 3044 | /* coin lockout disabled */ |
| 3056 | 3045 | space->unmap_write(0x6002, 0x6002, 0, 0x7f8); |
| r14896 | r14897 | |
| 3059 | 3048 | unmap_galaxian_sound(machine, 0x6000); |
| 3060 | 3049 | |
| 3061 | 3050 | /* install our AY-8910 handler */ |
| 3062 | space->install_ | |
| 3051 | space->install_ | |
| 3063 | 3052 | } |
| 3064 | 3053 | |
| 3065 | 3054 | |
| r14896 | r14897 | |
| 3074 | 3063 | { |
| 3075 | 3064 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3076 | 3065 | address_space *iospace = machine.device("maincpu")->memory().space(AS_IO); |
| 3066 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 3077 | 3067 | |
| 3078 | 3068 | /* video extensions */ |
| 3079 | 3069 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); |
| 3080 | 3070 | |
| 3081 | 3071 | /* move the interrupt enable from $b000 to $b001 */ |
| 3082 | 3072 | space->unmap_write(0xb000, 0xb000, 0, 0x7f8); |
| 3083 | space->install_ | |
| 3073 | space->install_ | |
| 3084 | 3074 | |
| 3085 | 3075 | /* attach the sound command handler */ |
| 3086 | iospace->install_ | |
| 3076 | iospace->install_ | |
| 3087 | 3077 | |
| 3088 | 3078 | /* decrypt program code */ |
| 3089 | 3079 | decode_checkman(machine); |
| r14896 | r14897 | |
| 3092 | 3082 | |
| 3093 | 3083 | static DRIVER_INIT( checkmaj ) |
| 3094 | 3084 | { |
| 3085 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 3095 | 3086 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3096 | 3087 | |
| 3097 | 3088 | /* video extensions */ |
| 3098 | 3089 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 3099 | 3090 | |
| 3100 | 3091 | /* attach the sound command handler */ |
| 3101 | space->install_ | |
| 3092 | space->install_ | |
| 3102 | 3093 | |
| 3103 | 3094 | /* for the title screen */ |
| 3104 | space->install_ | |
| 3095 | space->install_ | |
| 3105 | 3096 | } |
| 3106 | 3097 | |
| 3107 | 3098 | |
| 3108 | 3099 | static DRIVER_INIT( dingo ) |
| 3109 | 3100 | { |
| 3101 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 3110 | 3102 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3111 | 3103 | |
| 3112 | 3104 | /* video extensions */ |
| 3113 | 3105 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 3114 | 3106 | |
| 3115 | 3107 | /* attach the sound command handler */ |
| 3116 | space->install_ | |
| 3108 | space->install_ | |
| 3117 | 3109 | |
| 3118 | space->install_legacy_read_handler(0x3000, 0x3000, FUNC(dingo_3000_r)); | |
| 3119 | space->install_legacy_read_handler(0x3035, 0x3035, FUNC(dingo_3035_r)); | |
| 3110 | space->install_read_handler(0x3000, 0x3000, read8_delegate(FUNC(galaxian_state::dingo_3000_r),state)); | |
| 3111 | space->install_read_handler(0x3035, 0x3035, read8_delegate(FUNC(galaxian_state::dingo_3035_r),state)); | |
| 3120 | 3112 | } |
| 3121 | 3113 | |
| 3122 | 3114 | |
| 3123 | 3115 | static DRIVER_INIT( dingoe ) |
| 3124 | 3116 | { |
| 3117 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 3125 | 3118 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3126 | 3119 | address_space *iospace = machine.device("maincpu")->memory().space(AS_IO); |
| 3127 | 3120 | |
| r14896 | r14897 | |
| 3130 | 3123 | |
| 3131 | 3124 | /* move the interrupt enable from $b000 to $b001 */ |
| 3132 | 3125 | space->unmap_write(0xb000, 0xb000, 0, 0x7f8); |
| 3133 | space->install_ | |
| 3126 | space->install_ | |
| 3134 | 3127 | |
| 3135 | 3128 | /* attach the sound command handler */ |
| 3136 | iospace->install_ | |
| 3129 | iospace->install_ | |
| 3137 | 3130 | |
| 3138 | space->install_ | |
| 3131 | space->install_ | |
| 3139 | 3132 | |
| 3140 | 3133 | /* decrypt program code */ |
| 3141 | 3134 | decode_dingoe(machine); |
| r14896 | r14897 | |
| 3299 | 3292 | /* video extensions */ |
| 3300 | 3293 | common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); |
| 3301 | 3294 | |
| 3302 | space->install_legacy_write_handler(0xb000, 0xb000, 0, 0x7f8, FUNC(kingball_sound1_w)); | |
| 3303 | space->install_legacy_write_handler(0xb001, 0xb001, 0, 0x7f8, FUNC(irq_enable_w)); | |
| 3304 | space->install_legacy_write_handler(0xb002, 0xb002, 0, 0x7f8, FUNC(kingball_sound2_w)); | |
| 3305 | space->install_legacy_write_handler(0xb003, 0xb003, 0, 0x7f8, FUNC(kingball_speech_dip_w)); | |
| 3295 | space->install_write_handler(0xb000, 0xb000, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_sound1_w),state)); | |
| 3296 | space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),state)); | |
| 3297 | space->install_write_handler(0xb002, 0xb002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_sound2_w),state)); | |
| 3298 | space->install_write_handler(0xb003, 0xb003, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_speech_dip_w),state)); | |
| 3306 | 3299 | |
| 3307 | 3300 | state_save_register_global(machine, state->m_kingball_speech_dip); |
| 3308 | 3301 | state_save_register_global(machine, state->m_kingball_sound); |
| r14896 | r14897 | |
| 3311 | 3304 | |
| 3312 | 3305 | static DRIVER_INIT( scorpnmc ) |
| 3313 | 3306 | { |
| 3307 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 3314 | 3308 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3315 | 3309 | |
| 3316 | 3310 | /* video extensions */ |
| r14896 | r14897 | |
| 3318 | 3312 | |
| 3319 | 3313 | /* move the interrupt enable from $b000 to $b001 */ |
| 3320 | 3314 | space->unmap_write(0xb000, 0xb000, 0, 0x7f8); |
| 3321 | space->install_ | |
| 3315 | space->install_ | |
| 3322 | 3316 | |
| 3323 | 3317 | /* extra ROM */ |
| 3324 | 3318 | space->install_rom(0x5000, 0x67ff, machine.region("maincpu")->base() + 0x5000); |
| r14896 | r14897 | |
| 3332 | 3326 | |
| 3333 | 3327 | static DRIVER_INIT( thepitm ) |
| 3334 | 3328 | { |
| 3329 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 3335 | 3330 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3336 | 3331 | |
| 3337 | 3332 | /* video extensions */ |
| r14896 | r14897 | |
| 3339 | 3334 | |
| 3340 | 3335 | /* move the interrupt enable from $b000 to $b001 */ |
| 3341 | 3336 | space->unmap_write(0xb000, 0xb000, 0, 0x7f8); |
| 3342 | space->install_ | |
| 3337 | space->install_ | |
| 3343 | 3338 | |
| 3344 | 3339 | /* disable the stars */ |
| 3345 | 3340 | space->unmap_write(0xb004, 0xb004, 0, 0x07f8); |
| r14896 | r14897 | |
| 3390 | 3385 | space->install_read_port(0x8001, 0x8001, 0, 0xffc, "IN1"); |
| 3391 | 3386 | space->install_read_port(0x8002, 0x8002, 0, 0xffc, "IN2"); |
| 3392 | 3387 | space->install_read_port(0x8003, 0x8003, 0, 0xffc, "IN3"); |
| 3393 | space->install_write_handler(0x8000, 0x8000, 0, 0xfff, write8_delegate(FUNC(galaxian_state::soundlatch_w),state)); | |
| 3394 | space->install_legacy_write_handler(0x9000, 0x9000, 0, 0xfff, FUNC(explorer_sound_control_w)); | |
| 3388 | space->install_write_handler(0x8000, 0x8000, 0, 0xfff, write8_delegate(FUNC(galaxian_state::soundlatch_byte_w),state)); | |
| 3389 | space->install_write_handler(0x9000, 0x9000, 0, 0xfff, write8_delegate(FUNC(galaxian_state::explorer_sound_control_w),state)); | |
| 3395 | 3390 | } |
| 3396 | 3391 | |
| 3397 | 3392 | |
| r14896 | r14897 | |
| 3460 | 3455 | /* video extensions */ |
| 3461 | 3456 | common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info); |
| 3462 | 3457 | |
| 3463 | space->install_write_handler(0xa800, 0xa800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::soundlatch_w),state)); | |
| 3464 | space->install_legacy_write_handler(0xb001, 0xb001, 0, 0x7f8, FUNC(froggrmc_sound_control_w)); | |
| 3458 | space->install_write_handler(0xa800, 0xa800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::soundlatch_byte_w),state)); | |
| 3459 | space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::froggrmc_sound_control_w),state)); | |
| 3465 | 3460 | |
| 3466 | 3461 | /* actually needs 2k of RAM */ |
| 3467 | 3462 | space->install_ram(0x8000, 0x87ff); |
| r14896 | r14897 | |
| 3500 | 3495 | |
| 3501 | 3496 | static DRIVER_INIT( scorpion ) |
| 3502 | 3497 | { |
| 3498 | galaxian_state *state = machine.driver_data<galaxian_state>(); | |
| 3503 | 3499 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 3504 | 3500 | |
| 3505 | 3501 | common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); |
| 3506 | 3502 | |
| 3507 | 3503 | /* hook up AY8910 */ |
| 3508 | machine.device("audiocpu")->memory().space(AS_IO)->install_ | |
| 3504 | machine.device("audiocpu")->memory().space(AS_IO)->install_ | |
| 3509 | 3505 | |
| 3510 | 3506 | /* extra ROM */ |
| 3511 | 3507 | space->install_read_bank(0x5800, 0x67ff, "bank1"); |
| r14896 | r14897 | |
| 3514 | 3510 | /* no background related */ |
| 3515 | 3511 | // space->nop_write(0x6803, 0x6803); |
| 3516 | 3512 | |
| 3517 | machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_ | |
| 3513 | machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_ | |
| 3518 | 3514 | /* |
| 3519 | 3515 | { |
| 3520 | 3516 | const UINT8 *rom = machine.region("speech")->base(); |
| r14896 | r14897 | |
|---|---|---|
| 493 | 493 | AM_RANGE(0xa0c000, 0xa0ffff) AM_RAM // more tilemap? |
| 494 | 494 | AM_RANGE(0xa10000, 0xa1000f) AM_WRITEONLY AM_BASE(m_scrram) /* Scroll Registers */ |
| 495 | 495 | AM_RANGE(0xb00000, 0xb007ff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* Sprites */ |
| 496 | AM_RANGE(0xc00000, 0xc007ff) AM_RAM_WRITE(paletteram | |
| 496 | AM_RANGE(0xc00000, 0xc007ff) AM_RAM_WRITE(paletteram | |
| 497 | 497 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 498 | 498 | ADDRESS_MAP_END |
| 499 | 499 |
| r14896 | r14897 | |
|---|---|---|
| 89 | 89 | AM_RANGE(0x300008, 0x300009) AM_WRITE(othldrby_vreg_addr_w) |
| 90 | 90 | AM_RANGE(0x30000c, 0x30000d) AM_READ_PORT("VBLANK") |
| 91 | 91 | AM_RANGE(0x30000c, 0x30000f) AM_WRITE(othldrby_vreg_w) |
| 92 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 92 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 93 | 93 | AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 94 | 94 | AM_RANGE(0x700000, 0x700001) AM_READ(othldrby_scanline_r) |
| 95 | 95 | AM_RANGE(0x700004, 0x700005) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
|---|---|---|
| 253 | 253 | { |
| 254 | 254 | if (ACCESSING_BITS_0_7) |
| 255 | 255 | { |
| 256 | soundlatch_w(space, 0, data&0xff); | |
| 256 | soundlatch_byte_w(space, 0, data&0xff); | |
| 257 | 257 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 258 | 258 | } |
| 259 | 259 | } |
| r14896 | r14897 | |
| 335 | 335 | AM_RANGE(0x0b4000, 0x0b5fff) AM_RAM /* service mode */ |
| 336 | 336 | AM_RANGE(0x0b8000, 0x0b8003) AM_WRITEONLY AM_BASE(m_pf1_scroll_data) |
| 337 | 337 | AM_RANGE(0x0b8008, 0x0b800b) AM_WRITEONLY AM_BASE(m_pf2_scroll_data) |
| 338 | AM_RANGE(0x0d0000, 0x0d0fff) AM_RAM_WRITE(paletteram | |
| 338 | AM_RANGE(0x0d0000, 0x0d0fff) AM_RAM_WRITE(paletteram | |
| 339 | 339 | AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("COINS") /* Coins */ |
| 340 | 340 | AM_RANGE(0x0e0002, 0x0e0003) AM_READ_PORT("IN0") /* Player 1 & 2 */ |
| 341 | 341 | AM_RANGE(0x0e0004, 0x0e0005) AM_READ_PORT("IN1") /* Player 3 */ |
| r14896 | r14897 | |
| 362 | 362 | AM_RANGE(0x0b8000, 0x0b8003) AM_WRITEONLY AM_BASE(m_pf1_scroll_data) |
| 363 | 363 | AM_RANGE(0x0c0000, 0x0c3fff) AM_RAM_WRITE(bbusters_pf2_w) AM_BASE(m_pf2_data) |
| 364 | 364 | AM_RANGE(0x0c8000, 0x0c8003) AM_WRITEONLY AM_BASE(m_pf2_scroll_data) |
| 365 | AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(paletteram | |
| 365 | AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(paletteram | |
| 366 | 366 | AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("IN0") |
| 367 | 367 | AM_RANGE(0x0e0002, 0x0e0003) AM_READ_PORT("DSW1") |
| 368 | 368 | AM_RANGE(0x0e0004, 0x0e0007) AM_READ(mechatt_gun_r) |
| r14896 | r14897 | |
| 376 | 376 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, bbusters_state ) |
| 377 | 377 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 378 | 378 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 379 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) AM_WRITE(sound_status_w) | |
| 379 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) AM_WRITE(sound_status_w) | |
| 380 | 380 | ADDRESS_MAP_END |
| 381 | 381 | |
| 382 | 382 | static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, bbusters_state ) |
| r14896 | r14897 | |
|---|---|---|
| 127 | 127 | * |
| 128 | 128 | *************************************/ |
| 129 | 129 | |
| 130 | ||
| 130 | ||
| 131 | 131 | { |
| 132 | 132 | /* bit layout in this register: |
| 133 | 133 | |
| r14896 | r14897 | |
| 138 | 138 | /* lower byte being modified? */ |
| 139 | 139 | if (ACCESSING_BITS_0_7) |
| 140 | 140 | { |
| 141 | okim6295_device *oki = | |
| 141 | okim6295_device *oki = | |
| 142 | 142 | oki->set_bank_base((data & 0x80) ? 0x40000 : 0x00000); |
| 143 | atarigen_set_oki6295_vol( | |
| 143 | atarigen_set_oki6295_vol( | |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
| r14896 | r14897 | |
| 167 | 167 | AM_RANGE(0x640022, 0x640023) AM_READ_PORT("TRACKY2") |
| 168 | 168 | AM_RANGE(0x640024, 0x640025) AM_READ_PORT("TRACKX1") |
| 169 | 169 | AM_RANGE(0x640026, 0x640027) AM_READ_PORT("TRACKY1") |
| 170 | AM_RANGE(0x640040, 0x64004f) AM_WRITE | |
| 170 | AM_RANGE(0x640040, 0x64004f) AM_WRITE | |
| 171 | 171 | AM_RANGE(0x640060, 0x64006f) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 172 | 172 | AM_RANGE(0x641000, 0x641fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 173 | 173 | AM_RANGE(0x642000, 0x642001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00) |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER(flstory_state::sound_command_w) |
| 47 | 47 | { |
| 48 | soundlatch_w(space, 0, data); | |
| 48 | soundlatch_byte_w(space, 0, data); | |
| 49 | 49 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 50 | 50 | } |
| 51 | 51 | |
| r14896 | r14897 | |
| 444 | 444 | AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE_LEGACY("msm", msm5232_w) |
| 445 | 445 | AM_RANGE(0xcc00, 0xcc00) AM_DEVWRITE_LEGACY("msm", sound_control_0_w) |
| 446 | 446 | AM_RANGE(0xce00, 0xce00) AM_DEVWRITE_LEGACY("msm", sound_control_1_w) |
| 447 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r) AM_WRITE(to_main_w) | |
| 447 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w) | |
| 448 | 448 | AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read*/ |
| 449 | 449 | AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w) |
| 450 | 450 | AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE_LEGACY("dac", dac_w) /* signed 8-bit DAC & unknown read */ |
| r14896 | r14897 | |
|---|---|---|
| 95 | 95 | if (ACCESSING_BITS_0_7) |
| 96 | 96 | { |
| 97 | 97 | m_pending_command = 1; |
| 98 | soundlatch_w(space, offset, data & 0xff); | |
| 98 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 99 | 99 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 100 | 100 | } |
| 101 | 101 | } |
| r14896 | r14897 | |
| 134 | 134 | // AM_RANGE(0xff3000, 0xff3001) AM_WRITENOP // sprite buffer trigger? |
| 135 | 135 | AM_RANGE(0xff8000, 0xff8fff) AM_DEVREADWRITE_LEGACY("k053936", k053936_linectrl_r, k053936_linectrl_w) |
| 136 | 136 | AM_RANGE(0xff9000, 0xff9001) AM_WRITE(sound_command_w) |
| 137 | AM_RANGE(0xffa000, 0xffafff) AM_RAM_WRITE(paletteram | |
| 137 | AM_RANGE(0xffa000, 0xffafff) AM_RAM_WRITE(paletteram | |
| 138 | 138 | AM_RANGE(0xffd000, 0xffd01f) AM_DEVWRITE_LEGACY("k053936", k053936_ctrl_w) |
| 139 | 139 | AM_RANGE(0xffe000, 0xffe001) AM_WRITE(suprslam_bank_w) |
| 140 | 140 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 154 | 154 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, suprslam_state ) |
| 155 | 155 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 156 | 156 | AM_RANGE(0x00, 0x00) AM_WRITE(suprslam_sh_bankswitch_w) |
| 157 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) AM_WRITE(pending_command_clear_w) | |
| 157 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w) | |
| 158 | 158 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 159 | 159 | ADDRESS_MAP_END |
| 160 | 160 |
| r14896 | r14897 | |
|---|---|---|
| 332 | 332 | static ADDRESS_MAP_START( sfkick_io_map, AS_IO, 8, sfkick_state ) |
| 333 | 333 | ADDRESS_MAP_UNMAP_HIGH |
| 334 | 334 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 335 | AM_RANGE( 0xa0, 0xa7) AM_WRITE(soundlatch_w ) | |
| 335 | AM_RANGE( 0xa0, 0xa7) AM_WRITE(soundlatch_byte_w ) | |
| 336 | 336 | AM_RANGE( 0x98, 0x9b) AM_DEVREADWRITE( "v9938", v9938_device, read, write) |
| 337 | 337 | AM_RANGE( 0xa8, 0xab) AM_DEVREADWRITE_LEGACY("ppi8255", ppi8255_r, ppi8255_w) |
| 338 | 338 | AM_RANGE( 0xb4, 0xb5) AM_RAM /* loopback ? req by sfkicka (MSX Bios leftover)*/ |
| r14896 | r14897 | |
| 345 | 345 | |
| 346 | 346 | static ADDRESS_MAP_START( sfkick_sound_io_map, AS_IO, 8, sfkick_state ) |
| 347 | 347 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 348 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 348 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 349 | 349 | AM_RANGE(0x04, 0x05) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 350 | 350 | ADDRESS_MAP_END |
| 351 | 351 |
| r14896 | r14897 | |
|---|---|---|
| 201 | 201 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, atetris_state ) |
| 202 | 202 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 203 | 203 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_BASE(m_videoram) |
| 204 | AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_SHARE("paletteram") | |
| 204 | AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram") | |
| 205 | 205 | AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram") |
| 206 | 206 | AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_DEVREADWRITE_LEGACY("pokey1", pokey_r, pokey_w) |
| 207 | 207 | AM_RANGE(0x2810, 0x281f) AM_MIRROR(0x03e0) AM_DEVREADWRITE_LEGACY("pokey2", pokey_r, pokey_w) |
| r14896 | r14897 | |
| 218 | 218 | static ADDRESS_MAP_START( atetrisb2_map, AS_PROGRAM, 8, atetris_state ) |
| 219 | 219 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 220 | 220 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_BASE(m_videoram) |
| 221 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_SHARE("paletteram") | |
| 221 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram") | |
| 222 | 222 | AM_RANGE(0x2400, 0x25ff) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram") |
| 223 | 223 | AM_RANGE(0x2802, 0x2802) AM_DEVWRITE_LEGACY("sn1", sn76496_w) |
| 224 | 224 | AM_RANGE(0x2804, 0x2804) AM_DEVWRITE_LEGACY("sn2", sn76496_w) |
| r14896 | r14897 | |
|---|---|---|
| 111 | 111 | { |
| 112 | 112 | public: |
| 113 | 113 | bmcbowl_state(const machine_config &mconfig, device_type type, const char *tag) |
| 114 | : driver_device(mconfig, type, tag) { } | |
| 114 | : driver_device(mconfig, type, tag) , | |
| 115 | m_stats_ram(*this, "stats_ram"), | |
| 116 | m_vid1(*this, "vid1"), | |
| 117 | m_vid2(*this, "vid2"){ } | |
| 115 | 118 | |
| 116 | UINT16 *m_vid1; | |
| 117 | UINT16 *m_vid2; | |
| 119 | required_shared_ptr<UINT8> m_stats_ram; | |
| 120 | required_shared_ptr<UINT16> m_vid1; | |
| 121 | required_shared_ptr<UINT16> m_vid2; | |
| 118 | 122 | UINT8 *m_bmc_colorram; |
| 119 | UINT8 *m_stats_ram; | |
| 120 | size_t m_stats_ram_size; | |
| 121 | 123 | int m_clr_offset; |
| 122 | 124 | int m_bmc_input; |
| 123 | 125 | DECLARE_READ16_MEMBER(bmc_random_read); |
| r14896 | r14897 | |
| 152 | 154 | { |
| 153 | 155 | for (x=0;x<280;x+=2) |
| 154 | 156 | { |
| 155 | pixdat = state->m_vid2[0x8000+z]; | |
| 157 | pixdat = state->m_vid2.target()[0x8000+z]; | |
| 156 | 158 | |
| 157 | 159 | if(pixdat&0xff) |
| 158 | 160 | bitmap.pix16(y, x+1) = (pixdat&0xff); |
| 159 | 161 | if(pixdat>>8) |
| 160 | 162 | bitmap.pix16(y, x) = (pixdat>>8); |
| 161 | 163 | |
| 162 | pixdat = state->m_vid2[z]; | |
| 164 | pixdat = state->m_vid2.target()[z]; | |
| 163 | 165 | |
| 164 | 166 | if(pixdat&0xff) |
| 165 | 167 | bitmap.pix16(y, x+1) = (pixdat&0xff); |
| 166 | 168 | if(pixdat>>8) |
| 167 | 169 | bitmap.pix16(y, x) = (pixdat>>8); |
| 168 | 170 | |
| 169 | pixdat = state->m_vid1[0x8000+z]; | |
| 171 | pixdat = state->m_vid1.target()[0x8000+z]; | |
| 170 | 172 | |
| 171 | 173 | if(pixdat&0xff) |
| 172 | 174 | bitmap.pix16(y, x+1) = (pixdat&0xff); |
| 173 | 175 | if(pixdat>>8) |
| 174 | 176 | bitmap.pix16(y, x) = (pixdat>>8); |
| 175 | 177 | |
| 176 | pixdat = state->m_vid1[z]; | |
| 178 | pixdat = state->m_vid1.target()[z]; | |
| 177 | 179 | |
| 178 | 180 | if(pixdat&0xff) |
| 179 | 181 | bitmap.pix16(y, x+1) = (pixdat&0xff); |
| r14896 | r14897 | |
| 295 | 297 | { |
| 296 | 298 | int i; |
| 297 | 299 | for (i=0; i<table_len; i++) |
| 298 | state->m_stats_ram[address+2*i]=table[i]; | |
| 300 | state->m_stats_ram.target()[address+2*i]=table[i]; | |
| 299 | 301 | } |
| 300 | 302 | #endif |
| 301 | 303 | |
| r14896 | r14897 | |
| 305 | 307 | int i; |
| 306 | 308 | |
| 307 | 309 | if (read_or_write) |
| 308 | file->write(state->m_stats_ram, state->m_stats_ram | |
| 310 | file->write(state->m_stats_ram, state->m_stats_ram.bytes()); | |
| 309 | 311 | else |
| 310 | 312 | |
| 311 | 313 | #ifdef NVRAM_HACK |
| 312 | for (i = 0; i < state->m_stats_ram_size; i++) | |
| 313 | state->m_stats_ram[i] = 0xff; | |
| 314 | for (i = 0; i < state->m_stats_ram.bytes(); i++) | |
| 315 | state->m_stats_ram.target()[i] = 0xff; | |
| 314 | 316 | |
| 315 | 317 | init_stats(state,bmc_nv1,ARRAY_LENGTH(bmc_nv1),0); |
| 316 | 318 | init_stats(state,bmc_nv2,ARRAY_LENGTH(bmc_nv2),0x3b0); |
| 317 | 319 | init_stats(state,bmc_nv3,ARRAY_LENGTH(bmc_nv3),0xfe2); |
| 318 | 320 | #else |
| 319 | 321 | if (file) |
| 320 | file->read(state->m_stats_ram, state->m_stats_ram | |
| 322 | file->read(state->m_stats_ram, state->m_stats_ram.bytes()); | |
| 321 | 323 | else |
| 322 | 324 | |
| 323 | for (i = 0; i < state->m_stats_ram_size; i++) | |
| 324 | state->m_stats_ram[i] = 0xff; | |
| 325 | for (i = 0; i < state->m_stats_ram.bytes(); i++) | |
| 326 | state->m_stats_ram.target()[i] = 0xff; | |
| 325 | 327 | #endif |
| 326 | 328 | |
| 327 | 329 | } |
| r14896 | r14897 | |
| 343 | 345 | AM_RANGE(0x092800, 0x092803) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_address_w, 0xff00) |
| 344 | 346 | AM_RANGE(0x092802, 0x092803) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0xff00) |
| 345 | 347 | AM_RANGE(0x093802, 0x093803) AM_READ_PORT("IN0") |
| 346 | AM_RANGE(0x095000, 0x095fff) AM_RAM AM_ | |
| 348 | AM_RANGE(0x095000, 0x095fff) AM_RAM AM_ | |
| 347 | 349 | AM_RANGE(0x097000, 0x097001) AM_READNOP |
| 348 | 350 | AM_RANGE(0x140000, 0x1bffff) AM_ROM |
| 349 | AM_RANGE(0x1c0000, 0x1effff) AM_RAM AM_ | |
| 351 | AM_RANGE(0x1c0000, 0x1effff) AM_RAM AM_ | |
| 350 | 352 | AM_RANGE(0x1f0000, 0x1fffff) AM_RAM |
| 351 | AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_ | |
| 353 | AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_ | |
| 352 | 354 | |
| 353 | 355 | AM_RANGE(0x28c000, 0x28c001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00) |
| 354 | 356 |
| r14896 | r14897 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | DECLARE_WRITE_LINE_MEMBER(microtouch_out); |
| 109 | 109 | DECLARE_WRITE_LINE_MEMBER(microtouch_in); |
| 110 | DECLARE_WRITE8_MEMBER(pcat_nit_rombank_w); | |
| 111 | DECLARE_READ8_MEMBER(pcat_nit_io_r); | |
| 110 | 112 | }; |
| 111 | 113 | |
| 112 | 114 | WRITE_LINE_MEMBER(pcat_nit_state::microtouch_out) |
| r14896 | r14897 | |
| 145 | 147 | * |
| 146 | 148 | *************************************/ |
| 147 | 149 | |
| 148 | ||
| 150 | ||
| 149 | 151 | { |
| 150 | pcat_nit_state *state = space->machine().driver_data<pcat_nit_state>(); | |
| 151 | logerror( "rom bank #%02x at PC=%08X\n", data, cpu_get_pc(&space->device()) ); | |
| 152 | logerror( "rom bank #%02x at PC=%08X\n", data, cpu_get_pc(&space.device()) ); | |
| 152 | 153 | if ( data & 0x40 ) |
| 153 | 154 | { |
| 154 | 155 | // rom bank |
| 155 | space->install_read_bank(0x000d8000, 0x000dffff, "rombank" ); | |
| 156 | space->unmap_write(0x000d8000, 0x000dffff); | |
| 156 | space.install_read_bank(0x000d8000, 0x000dffff, "rombank" ); | |
| 157 | space.unmap_write(0x000d8000, 0x000dffff); | |
| 157 | 158 | |
| 158 | 159 | if ( data & 0x80 ) |
| 159 | 160 | { |
| 160 | memory_set_bank( | |
| 161 | memory_set_bank( | |
| 161 | 162 | } |
| 162 | 163 | else |
| 163 | 164 | { |
| 164 | memory_set_bank( | |
| 165 | memory_set_bank( | |
| 165 | 166 | } |
| 166 | 167 | } |
| 167 | 168 | else |
| 168 | 169 | { |
| 169 | 170 | // nvram bank |
| 170 | space | |
| 171 | space. | |
| 171 | 172 | |
| 172 | space | |
| 173 | space. | |
| 173 | 174 | |
| 174 | memory_set_bankptr( | |
| 175 | memory_set_bankptr( | |
| 175 | 176 | |
| 176 | 177 | } |
| 177 | 178 | } |
| r14896 | r14897 | |
| 181 | 182 | AM_RANGE(0x000a0000, 0x000bffff) AM_RAM |
| 182 | 183 | AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0) AM_WRITENOP |
| 183 | 184 | AM_RANGE(0x000d0000, 0x000d3fff) AM_RAM AM_REGION("disk_bios", 0) |
| 184 | AM_RANGE(0x000d7000, 0x000d7003) AM_WRITE8 | |
| 185 | AM_RANGE(0x000d7000, 0x000d7003) AM_WRITE8 | |
| 185 | 186 | AM_RANGE(0x000d8000, 0x000dffff) AM_ROMBANK("rombank") |
| 186 | 187 | AM_RANGE(0x000f0000, 0x000fffff) AM_RAM AM_REGION("bios", 0 ) |
| 187 | 188 | AM_RANGE(0xffff0000, 0xffffffff) AM_ROM AM_REGION("bios", 0 ) |
| 188 | 189 | ADDRESS_MAP_END |
| 189 | 190 | |
| 190 | ||
| 191 | ||
| 191 | 192 | { |
| 192 | 193 | switch(offset) |
| 193 | 194 | { |
| 194 | 195 | case 0: /* 278 */ |
| 195 | 196 | return 0xff; |
| 196 | 197 | case 1: /* 279 */ |
| 197 | return input_port_read( | |
| 198 | return input_port_read( | |
| 198 | 199 | case 7: /* 27f dips */ |
| 199 | 200 | return 0xff; |
| 200 | 201 | default: |
| r14896 | r14897 | |
| 204 | 205 | |
| 205 | 206 | static ADDRESS_MAP_START( pcat_nit_io, AS_IO, 32, pcat_nit_state ) |
| 206 | 207 | AM_IMPORT_FROM(pcat32_io_common) |
| 207 | AM_RANGE(0x0278, 0x027f) AM_READ8 | |
| 208 | AM_RANGE(0x0278, 0x027f) AM_READ8 | |
| 208 | 209 | AM_RANGE(0x0280, 0x0283) AM_READNOP |
| 209 | 210 | AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ns16450_0", ns16450_device, ins8250_r, ins8250_w, 0xffffffff) |
| 210 | 211 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 129 | 129 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") |
| 130 | 130 | AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("discrete", blockade_sound_freq_w) |
| 131 | 131 | AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2") |
| 132 | AM_RANGE(0x04, 0x04) AM_WRITE_LEGACY(blockade_env_on_w) | |
| 133 | AM_RANGE(0x08, 0x08) AM_WRITE_LEGACY(blockade_env_off_w) | |
| 132 | AM_RANGE(0x04, 0x04) AM_WRITE(blockade_env_on_w) | |
| 133 | AM_RANGE(0x08, 0x08) AM_WRITE(blockade_env_off_w) | |
| 134 | 134 | ADDRESS_MAP_END |
| 135 | 135 | |
| 136 | 136 |
| r14896 | r14897 | |
|---|---|---|
| 256 | 256 | |
| 257 | 257 | WRITE16_MEMBER(lordgun_state::lordgun_soundlatch_w) |
| 258 | 258 | { |
| 259 | if (ACCESSING_BITS_0_7) soundlatch_w (space, 0, (data >> 0) & 0xff); | |
| 260 | if (ACCESSING_BITS_8_15) soundlatch2_w(space, 0, (data >> 8) & 0xff); | |
| 259 | if (ACCESSING_BITS_0_7) soundlatch_byte_w (space, 0, (data >> 0) & 0xff); | |
| 260 | if (ACCESSING_BITS_8_15) soundlatch2_byte_w(space, 0, (data >> 8) & 0xff); | |
| 261 | 261 | |
| 262 | 262 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 263 | 263 | } |
| r14896 | r14897 | |
| 343 | 343 | static ADDRESS_MAP_START( lordgun_soundio_map, AS_IO, 8, lordgun_state ) |
| 344 | 344 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w ) |
| 345 | 345 | AM_RANGE(0x2000, 0x2000) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 346 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_r ) | |
| 347 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r ) | |
| 346 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_byte_r ) | |
| 347 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r ) | |
| 348 | 348 | AM_RANGE(0x5000, 0x5000) AM_READNOP |
| 349 | 349 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("oki", lordgun_okibank_w ) |
| 350 | 350 | ADDRESS_MAP_END |
| 351 | 351 | |
| 352 | 352 | |
| 353 | 353 | static ADDRESS_MAP_START( aliencha_soundio_map, AS_IO, 8, lordgun_state ) |
| 354 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_r ) | |
| 355 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r ) | |
| 354 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch2_byte_r ) | |
| 355 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r ) | |
| 356 | 356 | AM_RANGE(0x5000, 0x5000) AM_WRITENOP // writes 03 then 07 at end of NMI |
| 357 | 357 | AM_RANGE(0x7000, 0x7000) AM_DEVREAD_LEGACY("ymf", ymf278b_r) |
| 358 | 358 | AM_RANGE(0x7000, 0x7005) AM_DEVWRITE_LEGACY("ymf", ymf278b_w) |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | { |
| 40 | 40 | if (ACCESSING_BITS_8_15) |
| 41 | 41 | { |
| 42 | soundlatch_w(space, offset, data >> 8); | |
| 42 | soundlatch_byte_w(space, offset, data >> 8); | |
| 43 | 43 | device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); |
| 44 | 44 | } |
| 45 | 45 | } |
| r14896 | r14897 | |
| 52 | 52 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSWB") |
| 53 | 53 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSWA") |
| 54 | 54 | AM_RANGE(0x084000, 0x084001) AM_WRITE(sound_w) |
| 55 | AM_RANGE(0x088000, 0x0881ff) AM_RAM_WRITE(paletteram | |
| 55 | AM_RANGE(0x088000, 0x0881ff) AM_RAM_WRITE(paletteram | |
| 56 | 56 | AM_RANGE(0x098000, 0x098001) AM_RAM /* Watchdog? */ |
| 57 | 57 | AM_RANGE(0x09ce00, 0x09ffff) AM_RAM_WRITE(tilemap_w) AM_SHARE("videoram") |
| 58 | 58 | AM_RANGE(0x0b4000, 0x0b4001) AM_WRITE(tilebank_w) |
| r14896 | r14897 | |
| 64 | 64 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 65 | 65 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 66 | 66 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 67 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 67 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 68 | 68 | ADDRESS_MAP_END |
| 69 | 69 | |
| 70 | 70 |
| r14896 | r14897 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | WRITE16_MEMBER(lemmings_state::lemmings_sound_w) |
| 81 | 81 | { |
| 82 | soundlatch_w(space, 0, data & 0xff); | |
| 82 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 83 | 83 | device_set_input_line(m_audiocpu, 1, HOLD_LINE); |
| 84 | 84 | } |
| 85 | 85 | |
| r14896 | r14897 | |
| 114 | 114 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 115 | 115 | AM_RANGE(0x0800, 0x0801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) |
| 116 | 116 | AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 117 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_r) AM_WRITE(lemmings_sound_ack_w) | |
| 117 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r) AM_WRITE(lemmings_sound_ack_w) | |
| 118 | 118 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 119 | 119 | ADDRESS_MAP_END |
| 120 | 120 |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | WRITE8_MEMBER(espial_state::espial_master_soundlatch_w) |
| 103 | 103 | { |
| 104 | soundlatch_w(space, offset, data); | |
| 104 | soundlatch_byte_w(space, offset, data); | |
| 105 | 105 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 106 | 106 | } |
| 107 | 107 | |
| r14896 | r14897 | |
| 113 | 113 | AM_RANGE(0x6082, 0x6082) AM_READ_PORT("DSW1") |
| 114 | 114 | AM_RANGE(0x6083, 0x6083) AM_READ_PORT("IN1") |
| 115 | 115 | AM_RANGE(0x6084, 0x6084) AM_READ_PORT("IN2") |
| 116 | AM_RANGE(0x6090, 0x6090) AM_READ(soundlatch2_r) AM_WRITE(espial_master_soundlatch_w) | |
| 116 | AM_RANGE(0x6090, 0x6090) AM_READ(soundlatch2_byte_r) AM_WRITE(espial_master_soundlatch_w) | |
| 117 | 117 | AM_RANGE(0x7000, 0x7000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w) |
| 118 | 118 | AM_RANGE(0x7100, 0x7100) AM_WRITE(espial_master_interrupt_mask_w) |
| 119 | 119 | AM_RANGE(0x7200, 0x7200) AM_WRITE(espial_flipscreen_w) |
| r14896 | r14897 | |
| 138 | 138 | AM_RANGE(0x6082, 0x6082) AM_READ_PORT("DSW1") |
| 139 | 139 | AM_RANGE(0x6083, 0x6083) AM_READ_PORT("IN1") |
| 140 | 140 | AM_RANGE(0x6084, 0x6084) AM_READ_PORT("IN2") |
| 141 | AM_RANGE(0x6090, 0x6090) AM_READ(soundlatch2_r) AM_WRITE(espial_master_soundlatch_w) | |
| 141 | AM_RANGE(0x6090, 0x6090) AM_READ(soundlatch2_byte_r) AM_WRITE(espial_master_soundlatch_w) | |
| 142 | 142 | AM_RANGE(0x7000, 0x7000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w) |
| 143 | 143 | AM_RANGE(0x7100, 0x7100) AM_WRITE(espial_master_interrupt_mask_w) |
| 144 | 144 | AM_RANGE(0x7200, 0x7200) AM_WRITE(espial_flipscreen_w) |
| r14896 | r14897 | |
| 156 | 156 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 157 | 157 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 158 | 158 | AM_RANGE(0x4000, 0x4000) AM_WRITE(espial_sound_nmi_mask_w) |
| 159 | AM_RANGE(0x6000, 0x6000) AM_READWRITE(soundlatch_r, soundlatch2_w) | |
| 159 | AM_RANGE(0x6000, 0x6000) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) | |
| 160 | 160 | ADDRESS_MAP_END |
| 161 | 161 | |
| 162 | 162 | static ADDRESS_MAP_START( espial_sound_io_map, AS_IO, 8, espial_state ) |
| r14896 | r14897 | |
|---|---|---|
| 287 | 287 | { |
| 288 | 288 | segag80r_state *state = device->machine().driver_data<segag80r_state>(); |
| 289 | 289 | address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 290 | state->soundlatch_w(*space, 0, data); | |
| 290 | state->soundlatch_byte_w(*space, 0, data); | |
| 291 | 291 | cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 292 | 292 | device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); |
| 293 | 293 | } |
| r14896 | r14897 | |
| 383 | 383 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x1800) AM_RAM |
| 384 | 384 | AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("sn1", sindbadm_SN76496_w) |
| 385 | 385 | AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("sn2", sindbadm_SN76496_w) |
| 386 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1fff) AM_READ(soundlatch_r) | |
| 386 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1fff) AM_READ(soundlatch_byte_r) | |
| 387 | 387 | ADDRESS_MAP_END |
| 388 | 388 | |
| 389 | 389 | |
| r14896 | r14897 | |
| 1443 | 1443 | iospace->install_legacy_write_handler(*speech, 0x3b, 0x3b, FUNC(sega_speech_control_w)); |
| 1444 | 1444 | |
| 1445 | 1445 | /* install Astro Blaster sound board */ |
| 1446 | iospace->install_ | |
| 1446 | iospace->install_ | |
| 1447 | 1447 | } |
| 1448 | 1448 | |
| 1449 | 1449 | |
| r14896 | r14897 | |
| 1474 | 1474 | iospace->install_readwrite_handler(0x08, 0x0f, read8_delegate(FUNC(segag80r_state::spaceod_back_port_r),state), write8_delegate(FUNC(segag80r_state::spaceod_back_port_w),state)); |
| 1475 | 1475 | |
| 1476 | 1476 | /* install Space Odyssey sound board */ |
| 1477 | iospace->install_ | |
| 1477 | iospace->install_ | |
| 1478 | 1478 | |
| 1479 | 1479 | /* install our wacky mangled ports */ |
| 1480 | 1480 | iospace->install_read_handler(0xf8, 0xfb, read8_delegate(FUNC(segag80r_state::spaceod_mangled_ports_r),state)); |
| r14896 | r14897 | |
|---|---|---|
| 89 | 89 | { |
| 90 | 90 | public: |
| 91 | 91 | magic10_state(const machine_config &mconfig, device_type type, const char *tag) |
| 92 | : driver_device(mconfig, type, tag) { } | |
| 92 | : driver_device(mconfig, type, tag) , | |
| 93 | m_layer0_videoram(*this, "layer0_videoram"), | |
| 94 | m_layer1_videoram(*this, "layer1_videoram"), | |
| 95 | m_layer2_videoram(*this, "layer2_videoram"), | |
| 96 | m_vregs(*this, "vregs"){ } | |
| 93 | 97 | |
| 94 | 98 | tilemap_t *m_layer0_tilemap; |
| 95 | 99 | tilemap_t *m_layer1_tilemap; |
| 96 | 100 | tilemap_t *m_layer2_tilemap; |
| 97 | UINT16 *m_layer0_videoram; | |
| 98 | UINT16 *m_layer1_videoram; | |
| 99 | UINT16 *m_layer2_videoram; | |
| 101 | required_shared_ptr<UINT16> m_layer0_videoram; | |
| 102 | required_shared_ptr<UINT16> m_layer1_videoram; | |
| 103 | required_shared_ptr<UINT16> m_layer2_videoram; | |
| 100 | 104 | int m_layer2_offset[2]; |
| 101 | UINT16 | |
| 105 | required_shared_ptr<UINT16> | |
| 102 | 106 | UINT16 m_magic102_ret; |
| 103 | 107 | DECLARE_WRITE16_MEMBER(layer0_videoram_w); |
| 104 | 108 | DECLARE_WRITE16_MEMBER(layer1_videoram_w); |
| r14896 | r14897 | |
| 117 | 121 | |
| 118 | 122 | WRITE16_MEMBER(magic10_state::layer0_videoram_w) |
| 119 | 123 | { |
| 120 | COMBINE_DATA(&m_layer0_videoram[offset]); | |
| 124 | COMBINE_DATA(&m_layer0_videoram.target()[offset]); | |
| 121 | 125 | m_layer0_tilemap->mark_tile_dirty(offset >> 1); |
| 122 | 126 | } |
| 123 | 127 | |
| 124 | 128 | WRITE16_MEMBER(magic10_state::layer1_videoram_w) |
| 125 | 129 | { |
| 126 | COMBINE_DATA(&m_layer1_videoram[offset]); | |
| 130 | COMBINE_DATA(&m_layer1_videoram.target()[offset]); | |
| 127 | 131 | m_layer1_tilemap->mark_tile_dirty(offset >> 1); |
| 128 | 132 | } |
| 129 | 133 | |
| 130 | 134 | WRITE16_MEMBER(magic10_state::layer2_videoram_w) |
| 131 | 135 | { |
| 132 | COMBINE_DATA(&m_layer2_videoram[offset]); | |
| 136 | COMBINE_DATA(&m_layer2_videoram.target()[offset]); | |
| 133 | 137 | m_layer2_tilemap->mark_tile_dirty(offset >> 1); |
| 134 | 138 | } |
| 135 | 139 | |
| r14896 | r14897 | |
| 146 | 150 | SET_TILE_INFO |
| 147 | 151 | ( |
| 148 | 152 | 1, |
| 149 | state->m_layer0_videoram[tile_index * 2], | |
| 150 | state->m_layer0_videoram[tile_index * 2 + 1] & 0x0f, | |
| 151 | TILE_FLIPYX((state->m_layer0_videoram[tile_index * 2 + 1] & 0xc0) >> 6) | |
| 153 | state->m_layer0_videoram.target()[tile_index * 2], | |
| 154 | state->m_layer0_videoram.target()[tile_index * 2 + 1] & 0x0f, | |
| 155 | TILE_FLIPYX((state->m_layer0_videoram.target()[tile_index * 2 + 1] & 0xc0) >> 6) | |
| 152 | 156 | ); |
| 153 | 157 | } |
| 154 | 158 | |
| r14896 | r14897 | |
| 158 | 162 | SET_TILE_INFO |
| 159 | 163 | ( |
| 160 | 164 | 1, |
| 161 | state->m_layer1_videoram[tile_index * 2], | |
| 162 | state->m_layer1_videoram[tile_index * 2 + 1] & 0x0f, | |
| 163 | TILE_FLIPYX((state->m_layer1_videoram[tile_index * 2 + 1] & 0xc0) >> 6) | |
| 165 | state->m_layer1_videoram.target()[tile_index * 2], | |
| 166 | state->m_layer1_videoram.target()[tile_index * 2 + 1] & 0x0f, | |
| 167 | TILE_FLIPYX((state->m_layer1_videoram.target()[tile_index * 2 + 1] & 0xc0) >> 6) | |
| 164 | 168 | ); |
| 165 | 169 | } |
| 166 | 170 | |
| r14896 | r14897 | |
| 170 | 174 | SET_TILE_INFO |
| 171 | 175 | ( |
| 172 | 176 | 0, |
| 173 | state->m_layer2_videoram[tile_index * 2], | |
| 174 | state->m_layer2_videoram[tile_index * 2 + 1] & 0x0f, | |
| 177 | state->m_layer2_videoram.target()[tile_index * 2], | |
| 178 | state->m_layer2_videoram.target()[tile_index * 2 + 1] & 0x0f, | |
| 175 | 179 | 0 |
| 176 | 180 | ); |
| 177 | 181 | } |
| r14896 | r14897 | |
| 199 | 203 | 4 and 6 are y/x global register writes. |
| 200 | 204 | 0 and 2 are y/x writes for the scrolling layer. |
| 201 | 205 | */ |
| 202 | state->m_layer1_tilemap->set_scrolly(0, (state->m_vregs[0/2] - state->m_vregs[4/2])+0); | |
| 203 | state->m_layer1_tilemap->set_scrollx(0, (state->m_vregs[2/2] - state->m_vregs[6/2])+4); | |
| 206 | state->m_layer1_tilemap->set_scrolly(0, (state->m_vregs.target()[0/2] - state->m_vregs.target()[4/2])+0); | |
| 207 | state->m_layer1_tilemap->set_scrollx(0, (state->m_vregs.target()[2/2] - state->m_vregs.target()[6/2])+4); | |
| 204 | 208 | |
| 205 | 209 | state->m_layer0_tilemap->draw(bitmap, cliprect, 0, 0); |
| 206 | 210 | state->m_layer1_tilemap->draw(bitmap, cliprect, 0, 0); |
| r14896 | r14897 | |
| 288 | 292 | |
| 289 | 293 | static ADDRESS_MAP_START( magic10_map, AS_PROGRAM, 16, magic10_state ) |
| 290 | 294 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 291 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(m_layer1_videoram) | |
| 292 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(m_layer0_videoram) | |
| 293 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(m_layer2_videoram) | |
| 295 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_SHARE("layer1_videoram") | |
| 296 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_SHARE("layer0_videoram") | |
| 297 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_SHARE("layer2_videoram") | |
| 294 | 298 | AM_RANGE(0x200000, 0x2007ff) AM_RAM AM_SHARE("nvram") |
| 295 | 299 | AM_RANGE(0x300000, 0x3001ff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 296 | 300 | AM_RANGE(0x400000, 0x400001) AM_READ_PORT("INPUTS") |
| r14896 | r14897 | |
| 298 | 302 | AM_RANGE(0x400008, 0x400009) AM_WRITE(magic10_out_w) |
| 299 | 303 | AM_RANGE(0x40000a, 0x40000b) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 300 | 304 | AM_RANGE(0x40000e, 0x40000f) AM_WRITENOP |
| 301 | AM_RANGE(0x400080, 0x400087) AM_RAM AM_ | |
| 305 | AM_RANGE(0x400080, 0x400087) AM_RAM AM_ | |
| 302 | 306 | AM_RANGE(0x600000, 0x603fff) AM_RAM |
| 303 | 307 | ADDRESS_MAP_END |
| 304 | 308 | |
| 305 | 309 | static ADDRESS_MAP_START( magic10a_map, AS_PROGRAM, 16, magic10_state ) |
| 306 | 310 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 307 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(m_layer1_videoram) | |
| 308 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(m_layer0_videoram) | |
| 309 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(m_layer2_videoram) | |
| 311 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_SHARE("layer1_videoram") | |
| 312 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_SHARE("layer0_videoram") | |
| 313 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_SHARE("layer2_videoram") | |
| 310 | 314 | AM_RANGE(0x200000, 0x2007ff) AM_RAM AM_SHARE("nvram") |
| 311 | 315 | AM_RANGE(0x300000, 0x3001ff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 312 | 316 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("INPUTS") |
| r14896 | r14897 | |
| 314 | 318 | AM_RANGE(0x500008, 0x500009) AM_WRITE(magic10_out_w) |
| 315 | 319 | AM_RANGE(0x50000a, 0x50000b) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 316 | 320 | AM_RANGE(0x50000e, 0x50000f) AM_WRITENOP |
| 317 | AM_RANGE(0x500080, 0x500087) AM_RAM AM_ | |
| 321 | AM_RANGE(0x500080, 0x500087) AM_RAM AM_ | |
| 318 | 322 | AM_RANGE(0x600000, 0x603fff) AM_RAM |
| 319 | 323 | ADDRESS_MAP_END |
| 320 | 324 | |
| 321 | 325 | static ADDRESS_MAP_START( magic102_map, AS_PROGRAM, 16, magic10_state ) |
| 322 | 326 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 323 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(m_layer1_videoram) | |
| 324 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(m_layer0_videoram) | |
| 325 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(m_layer2_videoram) | |
| 327 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_SHARE("layer1_videoram") | |
| 328 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_SHARE("layer0_videoram") | |
| 329 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_SHARE("layer2_videoram") | |
| 326 | 330 | AM_RANGE(0x200000, 0x2007ff) AM_RAM AM_SHARE("nvram") |
| 327 | 331 | AM_RANGE(0x400000, 0x4001ff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 328 | 332 | AM_RANGE(0x500000, 0x500001) AM_READ(magic102_r) |
| r14896 | r14897 | |
| 334 | 338 | AM_RANGE(0x500002, 0x50001f) AM_WRITENOP |
| 335 | 339 | AM_RANGE(0x600000, 0x603fff) AM_RAM |
| 336 | 340 | AM_RANGE(0x700000, 0x700001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 337 | AM_RANGE(0x700080, 0x700087) AM_RAM AM_ | |
| 341 | AM_RANGE(0x700080, 0x700087) AM_RAM AM_ | |
| 338 | 342 | ADDRESS_MAP_END |
| 339 | 343 | |
| 340 | 344 | static ADDRESS_MAP_START( hotslot_map, AS_PROGRAM, 16, magic10_state ) |
| 341 | 345 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 342 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(m_layer1_videoram) | |
| 343 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(m_layer0_videoram) | |
| 344 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(m_layer2_videoram) | |
| 346 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_SHARE("layer1_videoram") | |
| 347 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_SHARE("layer0_videoram") | |
| 348 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_SHARE("layer2_videoram") | |
| 345 | 349 | AM_RANGE(0x200000, 0x2007ff) AM_RAM AM_SHARE("nvram") |
| 346 | 350 | AM_RANGE(0x400000, 0x4001ff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 347 | 351 | AM_RANGE(0x500004, 0x500005) AM_READWRITE(hotslot_copro_r, hotslot_copro_w) // copro comm |
| r14896 | r14897 | |
| 353 | 357 | AM_RANGE(0x50001a, 0x50001d) AM_WRITENOP |
| 354 | 358 | AM_RANGE(0x600000, 0x603fff) AM_RAM |
| 355 | 359 | AM_RANGE(0x70000a, 0x70000b) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 356 | AM_RANGE(0x700080, 0x700087) AM_RAM AM_ | |
| 360 | AM_RANGE(0x700080, 0x700087) AM_RAM AM_ | |
| 357 | 361 | ADDRESS_MAP_END |
| 358 | 362 | |
| 359 | 363 | static ADDRESS_MAP_START( sgsafari_map, AS_PROGRAM, 16, magic10_state ) |
| 360 | 364 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 361 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(m_layer1_videoram) | |
| 362 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(m_layer0_videoram) | |
| 363 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(m_layer2_videoram) | |
| 365 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_SHARE("layer1_videoram") | |
| 366 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_SHARE("layer0_videoram") | |
| 367 | AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_SHARE("layer2_videoram") | |
| 364 | 368 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("nvram") |
| 365 | 369 | AM_RANGE(0x300000, 0x3001ff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 366 | 370 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW1") |
| 367 | 371 | AM_RANGE(0x500008, 0x500009) AM_WRITE(magic10_out_w) |
| 368 | 372 | AM_RANGE(0x50000a, 0x50000b) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 369 | 373 | AM_RANGE(0x50000e, 0x50000f) AM_READ_PORT("IN0") |
| 370 | AM_RANGE(0x500080, 0x500087) AM_RAM AM_ | |
| 374 | AM_RANGE(0x500080, 0x500087) AM_RAM AM_ | |
| 371 | 375 | AM_RANGE(0x600000, 0x603fff) AM_RAM |
| 372 | 376 | ADDRESS_MAP_END |
| 373 | 377 | /* |
| r14896 | r14897 | |
|---|---|---|
| 193 | 193 | WRITE16_MEMBER(tmnt_state::tmnt_sound_command_w) |
| 194 | 194 | { |
| 195 | 195 | if (ACCESSING_BITS_0_7) |
| 196 | soundlatch_w(space, 0, data & 0xff); | |
| 196 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | static READ8_DEVICE_HANDLER( punkshot_sound_r ) |
| r14896 | r14897 | |
| 214 | 214 | |
| 215 | 215 | READ16_MEMBER(tmnt_state::prmrsocr_sound_r) |
| 216 | 216 | { |
| 217 | return soundlatch3_r(space, 0); | |
| 217 | return soundlatch3_byte_r(space, 0); | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | WRITE16_MEMBER(tmnt_state::prmrsocr_sound_cmd_w) |
| r14896 | r14897 | |
| 223 | 223 | { |
| 224 | 224 | data &= 0xff; |
| 225 | 225 | if (offset == 0) |
| 226 | soundlatch_w(space, 0, data); | |
| 226 | soundlatch_byte_w(space, 0, data); | |
| 227 | 227 | else |
| 228 | soundlatch2_w(space, 0, data); | |
| 228 | soundlatch2_byte_w(space, 0, data); | |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| r14896 | r14897 | |
| 621 | 621 | static ADDRESS_MAP_START( punkshot_main_map, AS_PROGRAM, 16, tmnt_state ) |
| 622 | 622 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 623 | 623 | AM_RANGE(0x080000, 0x083fff) AM_RAM /* main RAM */ |
| 624 | AM_RANGE(0x090000, 0x090fff) AM_RAM_WRITE(paletteram | |
| 624 | AM_RANGE(0x090000, 0x090fff) AM_RAM_WRITE(paletteram | |
| 625 | 625 | AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("DSW1/DSW2") |
| 626 | 626 | AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("COINS/DSW3") |
| 627 | 627 | AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P3/P4") |
| r14896 | r14897 | |
| 640 | 640 | |
| 641 | 641 | static ADDRESS_MAP_START( lgtnfght_main_map, AS_PROGRAM, 16, tmnt_state ) |
| 642 | 642 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 643 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(paletteram | |
| 643 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(paletteram | |
| 644 | 644 | AM_RANGE(0x090000, 0x093fff) AM_RAM /*main RAM */ |
| 645 | 645 | AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("COINS") |
| 646 | 646 | AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 671 | 671 | AM_RANGE(0x180000, 0x183fff) AM_DEVREADWRITE_LEGACY("k052109", k052109_word_r, k052109_word_w) |
| 672 | 672 | AM_RANGE(0x204000, 0x207fff) AM_RAM /* main RAM */ |
| 673 | 673 | AM_RANGE(0x300000, 0x303fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_BASE(m_spriteram) |
| 674 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 674 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 675 | 675 | AM_RANGE(0x500000, 0x50003f) AM_DEVREADWRITE_LEGACY("k054000", k054000_lsb_r, k054000_lsb_w) |
| 676 | 676 | AM_RANGE(0x680000, 0x68001f) AM_READWRITE(k053244_word_noA1_r, k053244_word_noA1_w) |
| 677 | 677 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 713 | 713 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 714 | 714 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */ |
| 715 | 715 | AM_RANGE(0x104000, 0x107fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_BASE(m_spriteram) |
| 716 | AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE(paletteram | |
| 716 | AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE(paletteram | |
| 717 | 717 | AM_RANGE(0x10c000, 0x10cfff) AM_DEVREADWRITE_LEGACY("k053936", k053936_linectrl_r, k053936_linectrl_w) /* 053936? */ |
| 718 | 718 | AM_RANGE(0x110000, 0x11001f) AM_WRITE(k053244_word_noA1_w) /* duplicate! */ |
| 719 | 719 | AM_RANGE(0x114000, 0x11401f) AM_DEVREADWRITE_LEGACY("k053245", k053244_lsb_r, k053244_lsb_w) /* duplicate! */ |
| r14896 | r14897 | |
| 737 | 737 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 738 | 738 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */ |
| 739 | 739 | AM_RANGE(0x104000, 0x107fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_BASE(m_spriteram) |
| 740 | AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE(paletteram | |
| 740 | AM_RANGE(0x108000, 0x108fff) AM_RAM_WRITE(paletteram | |
| 741 | 741 | AM_RANGE(0x10c000, 0x10cfff) AM_DEVREADWRITE_LEGACY("k053936", k053936_linectrl_r, k053936_linectrl_w) |
| 742 | 742 | AM_RANGE(0x110000, 0x11001f) AM_WRITE(k053244_word_noA1_w) /* duplicate! */ |
| 743 | 743 | AM_RANGE(0x114000, 0x11401f) AM_DEVREADWRITE_LEGACY("k053245", k053244_lsb_r, k053244_lsb_w) /* duplicate! */ |
| r14896 | r14897 | |
| 999 | 999 | static ADDRESS_MAP_START( tmnt2_main_map, AS_PROGRAM, 16, tmnt_state ) |
| 1000 | 1000 | AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_BASE(m_tmnt2_rom) |
| 1001 | 1001 | AM_RANGE(0x104000, 0x107fff) AM_RAM AM_BASE(m_sunset_104000) /* main RAM */ |
| 1002 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram | |
| 1002 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram | |
| 1003 | 1003 | AM_RANGE(0x180000, 0x183fff) AM_RAM_WRITE(k053245_scattered_word_w) AM_BASE(m_spriteram) // k053245_scattered_word_r |
| 1004 | 1004 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("P1") |
| 1005 | 1005 | AM_RANGE(0x1c0002, 0x1c0003) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 1025 | 1025 | static ADDRESS_MAP_START( ssriders_main_map, AS_PROGRAM, 16, tmnt_state ) |
| 1026 | 1026 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 1027 | 1027 | AM_RANGE(0x104000, 0x107fff) AM_RAM /* main RAM */ |
| 1028 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram | |
| 1028 | AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(paletteram | |
| 1029 | 1029 | AM_RANGE(0x180000, 0x183fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_BASE(m_spriteram) |
| 1030 | 1030 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("P1") |
| 1031 | 1031 | AM_RANGE(0x1c0002, 0x1c0003) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 1051 | 1051 | static ADDRESS_MAP_START( sunsetbl_main_map, AS_PROGRAM, 16, tmnt_state ) |
| 1052 | 1052 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 1053 | 1053 | AM_RANGE(0x104000, 0x107fff) AM_RAM /* main RAM */ |
| 1054 | AM_RANGE(0x14c000, 0x14cfff) AM_RAM_WRITE(paletteram | |
| 1054 | AM_RANGE(0x14c000, 0x14cfff) AM_RAM_WRITE(paletteram | |
| 1055 | 1055 | AM_RANGE(0x14e700, 0x14e71f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w) |
| 1056 | 1056 | AM_RANGE(0x180000, 0x183fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_BASE(m_spriteram) |
| 1057 | 1057 | AM_RANGE(0x184000, 0x18ffff) AM_RAM |
| r14896 | r14897 | |
| 1077 | 1077 | static ADDRESS_MAP_START( thndrx2_main_map, AS_PROGRAM, 16, tmnt_state ) |
| 1078 | 1078 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 1079 | 1079 | AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */ |
| 1080 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 1080 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 1081 | 1081 | AM_RANGE(0x300000, 0x30001f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w) |
| 1082 | 1082 | AM_RANGE(0x400000, 0x400003) AM_DEVREAD8_LEGACY("k053260", punkshot_sound_r, 0x00ff) /* K053260 */ |
| 1083 | 1083 | AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8_LEGACY("k053260", k053260_w, 0x00ff) |
| r14896 | r14897 | |
| 1096 | 1096 | static ADDRESS_MAP_START( mia_audio_map, AS_PROGRAM, 8, tmnt_state ) |
| 1097 | 1097 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1098 | 1098 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 1099 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 1099 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 1100 | 1100 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) |
| 1101 | 1101 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1102 | 1102 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1106 | 1106 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1107 | 1107 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 1108 | 1108 | AM_RANGE(0x9000, 0x9000) AM_READWRITE(tmnt_sres_r, tmnt_sres_w) /* title music & UPD7759C reset */ |
| 1109 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 1109 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 1110 | 1110 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) |
| 1111 | 1111 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1112 | 1112 | AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w) |
| r14896 | r14897 | |
| 1174 | 1174 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 1175 | 1175 | AM_RANGE(0xe000, 0xe0ff) AM_DEVREADWRITE("k054539", k054539_device, read, write) |
| 1176 | 1176 | AM_RANGE(0xe100, 0xe12f) AM_READWRITE(k054539_ctrl_r, k054539_ctrl_w) |
| 1177 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_w) | |
| 1178 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 1179 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 1177 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_byte_w) | |
| 1178 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r) | |
| 1179 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_byte_r) | |
| 1180 | 1180 | AM_RANGE(0xf800, 0xf800) AM_WRITE(prmrsocr_audio_bankswitch_w) |
| 1181 | 1181 | ADDRESS_MAP_END |
| 1182 | 1182 |
| r14896 | r14897 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | WRITE8_MEMBER( zodiack_state::master_soundlatch_w ) |
| 128 | 128 | { |
| 129 | soundlatch_w(space, offset, data); | |
| 129 | soundlatch_byte_w(space, offset, data); | |
| 130 | 130 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 131 | 131 | } |
| 132 | 132 | |
| r14896 | r14897 | |
| 146 | 146 | AM_RANGE(0x6082, 0x6082) AM_READ_PORT("DSW1") |
| 147 | 147 | AM_RANGE(0x6083, 0x6083) AM_READ_PORT("IN0") |
| 148 | 148 | AM_RANGE(0x6084, 0x6084) AM_READ_PORT("IN1") |
| 149 | AM_RANGE(0x6090, 0x6090) AM_READWRITE(soundlatch_r, master_soundlatch_w) | |
| 149 | AM_RANGE(0x6090, 0x6090) AM_READWRITE(soundlatch_byte_r, master_soundlatch_w) | |
| 150 | 150 | AM_RANGE(0x7000, 0x7000) AM_READNOP AM_WRITE(watchdog_reset_w) /* NOP??? */ |
| 151 | 151 | AM_RANGE(0x7100, 0x7100) AM_WRITE(nmi_mask_w) |
| 152 | 152 | AM_RANGE(0x7200, 0x7200) AM_WRITE(flipscreen_w) |
| r14896 | r14897 | |
| 163 | 163 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 164 | 164 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 165 | 165 | AM_RANGE(0x4000, 0x4000) AM_WRITE(sound_nmi_enable_w) |
| 166 | AM_RANGE(0x6000, 0x6000) AM_READWRITE(soundlatch_r, soundlatch_w) | |
| 166 | AM_RANGE(0x6000, 0x6000) AM_READWRITE(soundlatch_byte_r, soundlatch_byte_w) | |
| 167 | 167 | ADDRESS_MAP_END |
| 168 | 168 | |
| 169 | 169 | static ADDRESS_MAP_START( io_map, AS_IO, 8, zodiack_state ) |
| r14896 | r14897 | |
|---|---|---|
| 1271 | 1271 | AM_RANGE(0x0f800, 0x0ffff) AM_RAM /* Stack area */ |
| 1272 | 1272 | |
| 1273 | 1273 | AM_RANGE(0x10000, 0x1efff) AM_RAM |
| 1274 | AM_RANGE(0x1f000, 0x1ffff) AM_RAM AM_WRITE(paletteram | |
| 1274 | AM_RANGE(0x1f000, 0x1ffff) AM_RAM AM_WRITE(paletteram | |
| 1275 | 1275 | |
| 1276 | 1276 | AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("mainbank") |
| 1277 | 1277 | AM_RANGE(0x40000, 0xfffff) AM_ROM AM_REGION("mainprg", 0x40000) |
| r14896 | r14897 | |
| 1308 | 1308 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(raiden2_foreground_w) AM_BASE(fore_data) |
| 1309 | 1309 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(raiden2_midground_w) AM_BASE(mid_data) |
| 1310 | 1310 | AM_RANGE(0x0d000, 0x0dfff) AM_RAM_WRITE(raiden2_text_w) AM_BASE(text_data) |
| 1311 | AM_RANGE(0x0e000, 0x0efff) AM_RAM AM_WRITE(paletteram | |
| 1311 | AM_RANGE(0x0e000, 0x0efff) AM_RAM AM_WRITE(paletteram | |
| 1312 | 1312 | AM_RANGE(0x0f000, 0x0ffff) AM_RAM AM_BASE(sprites) |
| 1313 | 1313 | AM_RANGE(0x10000, 0x1ffff) AM_RAM |
| 1314 | 1314 | |
| r14896 | r14897 | |
| 1338 | 1338 | AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(raiden2_foreground_w) AM_BASE(fore_data) |
| 1339 | 1339 | AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(raiden2_midground_w) AM_BASE(mid_data) |
| 1340 | 1340 | AM_RANGE(0x0d000, 0x0dfff) AM_RAM_WRITE(raiden2_text_w) AM_BASE(text_data) |
| 1341 | AM_RANGE(0x0e000, 0x0efff) AM_RAM AM_WRITE(paletteram | |
| 1341 | AM_RANGE(0x0e000, 0x0efff) AM_RAM AM_WRITE(paletteram | |
| 1342 | 1342 | AM_RANGE(0x0f000, 0x0ffff) AM_RAM AM_BASE(sprites) |
| 1343 | 1343 | |
| 1344 | 1344 | AM_RANGE(0x10000, 0x1ffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 9 | 9 | { |
| 10 | 10 | public: |
| 11 | 11 | mogura_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | : driver_device(mconfig, type, tag) { } | |
| 12 | : driver_device(mconfig, type, tag) , | |
| 13 | m_gfxram(*this, "gfxram"), | |
| 14 | m_tileram(*this, "tileram"){ } | |
| 13 | 15 | |
| 14 | 16 | /* memory pointers */ |
| 15 | UINT8 * m_tileram; | |
| 16 | UINT8 * m_gfxram; | |
| 17 | required_shared_ptr<UINT8> m_gfxram; | |
| 18 | required_shared_ptr<UINT8> m_tileram; | |
| 17 | 19 | |
| 18 | 20 | /* video-related */ |
| 19 | 21 | tilemap_t *m_tilemap; |
| r14896 | r14897 | |
| 63 | 65 | static TILE_GET_INFO( get_mogura_tile_info ) |
| 64 | 66 | { |
| 65 | 67 | mogura_state *state = machine.driver_data<mogura_state>(); |
| 66 | int code = state->m_tileram[tile_index]; | |
| 67 | int attr = state->m_tileram[tile_index + 0x800]; | |
| 68 | int code = state->m_tileram.target()[tile_index]; | |
| 69 | int attr = state->m_tileram.target()[tile_index + 0x800]; | |
| 68 | 70 | |
| 69 | 71 | SET_TILE_INFO( |
| 70 | 72 | 0, |
| r14896 | r14897 | |
| 77 | 79 | static VIDEO_START( mogura ) |
| 78 | 80 | { |
| 79 | 81 | mogura_state *state = machine.driver_data<mogura_state>(); |
| 80 | gfx_element_set_source(machine.gfx[0], state->m_gfxram); | |
| 82 | gfx_element_set_source(machine.gfx[0], state->m_gfxram.target()); | |
| 81 | 83 | state->m_tilemap = tilemap_create(machine, get_mogura_tile_info, tilemap_scan_rows, 8, 8, 64, 32); |
| 82 | 84 | } |
| 83 | 85 | |
| r14896 | r14897 | |
| 102 | 104 | |
| 103 | 105 | WRITE8_MEMBER(mogura_state::mogura_tileram_w) |
| 104 | 106 | { |
| 105 | m_tileram[offset] = data; | |
| 107 | m_tileram.target()[offset] = data; | |
| 106 | 108 | m_tilemap->mark_tile_dirty(offset & 0x7ff); |
| 107 | 109 | } |
| 108 | 110 | |
| r14896 | r14897 | |
| 115 | 117 | |
| 116 | 118 | WRITE8_MEMBER(mogura_state::mogura_gfxram_w) |
| 117 | 119 | { |
| 118 | m_gfxram[offset] = data ; | |
| 120 | m_gfxram.target()[offset] = data ; | |
| 119 | 121 | |
| 120 | 122 | gfx_element_mark_dirty(machine().gfx[0], offset / 16); |
| 121 | 123 | } |
| r14896 | r14897 | |
| 124 | 126 | static ADDRESS_MAP_START( mogura_map, AS_PROGRAM, 8, mogura_state ) |
| 125 | 127 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 126 | 128 | AM_RANGE(0xc000, 0xdfff) AM_RAM // main ram |
| 127 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(mogura_gfxram_w) AM_BASE(m_gfxram) // ram based characters | |
| 128 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(mogura_tileram_w) AM_BASE(m_tileram) // tilemap | |
| 129 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(mogura_gfxram_w) AM_SHARE("gfxram") // ram based characters | |
| 130 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(mogura_tileram_w) AM_SHARE("tileram") // tilemap | |
| 129 | 131 | ADDRESS_MAP_END |
| 130 | 132 | |
| 131 | 133 | static ADDRESS_MAP_START( mogura_io_map, AS_IO, 8, mogura_state ) |
| r14896 | r14897 | |
|---|---|---|
| 117 | 117 | { |
| 118 | 118 | public: |
| 119 | 119 | ddealer_state(const machine_config &mconfig, device_type type, const char *tag) |
| 120 | : driver_device(mconfig, type, tag) { } | |
| 120 | : driver_device(mconfig, type, tag) , | |
| 121 | m_vregs(*this, "vregs"), | |
| 122 | m_left_fg_vram_top(*this, "left_fg_vratop"), | |
| 123 | m_right_fg_vram_top(*this, "right_fg_vratop"), | |
| 124 | m_left_fg_vram_bottom(*this, "left_fg_vrabottom"), | |
| 125 | m_right_fg_vram_bottom(*this, "right_fg_vrabottom"), | |
| 126 | m_back_vram(*this, "back_vram"), | |
| 127 | m_work_ram(*this, "work_ram"), | |
| 128 | m_mcu_shared_ram(*this, "mcu_shared_ram"){ } | |
| 121 | 129 | |
| 122 | 130 | /* memory pointers */ |
| 123 | UINT16 * m_mcu_shared_ram; | |
| 124 | UINT16 * m_work_ram; | |
| 125 | UINT16 * m_back_vram; | |
| 126 | UINT16 * m_left_fg_vram_top; | |
| 127 | UINT16 * m_right_fg_vram_top; | |
| 128 | UINT16 * m_left_fg_vram_bottom; | |
| 129 | UINT16 * m_right_fg_vram_bottom; | |
| 130 | UINT16 * m_vregs; | |
| 131 | required_shared_ptr<UINT16> m_vregs; | |
| 132 | required_shared_ptr<UINT16> m_left_fg_vram_top; | |
| 133 | required_shared_ptr<UINT16> m_right_fg_vram_top; | |
| 134 | required_shared_ptr<UINT16> m_left_fg_vram_bottom; | |
| 135 | required_shared_ptr<UINT16> m_right_fg_vram_bottom; | |
| 136 | required_shared_ptr<UINT16> m_back_vram; | |
| 137 | required_shared_ptr<UINT16> m_work_ram; | |
| 138 | required_shared_ptr<UINT16> m_mcu_shared_ram; | |
| 131 | 139 | // UINT16 * m_paletteram16; // currently this uses generic palette handling |
| 132 | 140 | |
| 133 | 141 | /* video-related */ |
| r14896 | r14897 | |
| 155 | 163 | static TILE_GET_INFO( get_back_tile_info ) |
| 156 | 164 | { |
| 157 | 165 | ddealer_state *state = machine.driver_data<ddealer_state>(); |
| 158 | int code = state->m_back_vram[tile_index]; | |
| 166 | int code = state->m_back_vram.target()[tile_index]; | |
| 159 | 167 | SET_TILE_INFO( |
| 160 | 168 | 0, |
| 161 | 169 | code & 0xfff, |
| r14896 | r14897 | |
| 268 | 276 | |
| 269 | 277 | if (!state->m_flipscreen) |
| 270 | 278 | { |
| 271 | if (state->m_vregs[0xcc / 2] & 0x80) | |
| 279 | if (state->m_vregs.target()[0xcc / 2] & 0x80) | |
| 272 | 280 | { |
| 273 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 274 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 281 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 282 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 275 | 283 | } |
| 276 | 284 | else |
| 277 | 285 | { |
| 278 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 286 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 279 | 287 | } |
| 280 | 288 | } |
| 281 | 289 | else |
| 282 | 290 | { |
| 283 | if (state->m_vregs[0xcc / 2] & 0x80) | |
| 291 | if (state->m_vregs.target()[0xcc / 2] & 0x80) | |
| 284 | 292 | { |
| 285 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 286 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 293 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 294 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 287 | 295 | } |
| 288 | 296 | else |
| 289 | 297 | { |
| 290 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 298 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); | |
| 291 | 299 | } |
| 292 | 300 | |
| 293 | 301 | } |
| r14896 | r14897 | |
| 306 | 314 | if (state->m_coin_input & 0x01)//coin 1 |
| 307 | 315 | { |
| 308 | 316 | if((state->m_input_pressed & 0x01) == 0) |
| 309 | state->m_mcu_shared_ram[0x000 / 2]++; | |
| 317 | state->m_mcu_shared_ram.target()[0x000 / 2]++; | |
| 310 | 318 | state->m_input_pressed = (state->m_input_pressed & 0xfe) | 1; |
| 311 | 319 | } |
| 312 | 320 | else |
| r14896 | r14897 | |
| 315 | 323 | if (state->m_coin_input & 0x02)//coin 2 |
| 316 | 324 | { |
| 317 | 325 | if ((state->m_input_pressed & 0x02) == 0) |
| 318 | state->m_mcu_shared_ram[0x000 / 2]++; | |
| 326 | state->m_mcu_shared_ram.target()[0x000 / 2]++; | |
| 319 | 327 | state->m_input_pressed = (state->m_input_pressed & 0xfd) | 2; |
| 320 | 328 | } |
| 321 | 329 | else |
| r14896 | r14897 | |
| 324 | 332 | if (state->m_coin_input & 0x04)//service 1 |
| 325 | 333 | { |
| 326 | 334 | if ((state->m_input_pressed & 0x04) == 0) |
| 327 | state->m_mcu_shared_ram[0x000 / 2]++; | |
| 335 | state->m_mcu_shared_ram.target()[0x000 / 2]++; | |
| 328 | 336 | state->m_input_pressed = (state->m_input_pressed & 0xfb) | 4; |
| 329 | 337 | } |
| 330 | 338 | else |
| r14896 | r14897 | |
| 332 | 340 | |
| 333 | 341 | /*0x104/2 is some sort of "start-lock",i.e. used on the girl selection. |
| 334 | 342 | Without it,the game "steals" one credit if you press the start button on that.*/ |
| 335 | if (state->m_mcu_shared_ram[0x000 / 2] > 0 && state->m_work_ram[0x104 / 2] & 1) | |
| 343 | if (state->m_mcu_shared_ram.target()[0x000 / 2] > 0 && state->m_work_ram.target()[0x104 / 2] & 1) | |
| 336 | 344 | { |
| 337 | 345 | if (state->m_coin_input & 0x08)//start 1 |
| 338 | 346 | { |
| 339 | if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram[0x100 / 2] & 1))) | |
| 340 | state->m_mcu_shared_ram[0x000 / 2]--; | |
| 347 | if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram.target()[0x100 / 2] & 1))) | |
| 348 | state->m_mcu_shared_ram.target()[0x000 / 2]--; | |
| 341 | 349 | state->m_input_pressed = (state->m_input_pressed & 0xf7) | 8; |
| 342 | 350 | } |
| 343 | 351 | else |
| r14896 | r14897 | |
| 345 | 353 | |
| 346 | 354 | if (state->m_coin_input & 0x10)//start 2 |
| 347 | 355 | { |
| 348 | if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram[0x100 / 2] & 2))) | |
| 349 | state->m_mcu_shared_ram[0x000 / 2]--; | |
| 356 | if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram.target()[0x100 / 2] & 2))) | |
| 357 | state->m_mcu_shared_ram.target()[0x000 / 2]--; | |
| 350 | 358 | state->m_input_pressed = (state->m_input_pressed & 0xef) | 0x10; |
| 351 | 359 | } |
| 352 | 360 | else |
| r14896 | r14897 | |
| 354 | 362 | } |
| 355 | 363 | |
| 356 | 364 | /*random number generators,controls order of cards*/ |
| 357 | state->m_mcu_shared_ram[0x10 / 2] = timer.machine().rand() & 0xffff; | |
| 358 | state->m_mcu_shared_ram[0x12 / 2] = timer.machine().rand() & 0xffff; | |
| 359 | state->m_mcu_shared_ram[0x14 / 2] = timer.machine().rand() & 0xffff; | |
| 360 | state->m_mcu_shared_ram[0x16 / 2] = timer.machine().rand() & 0xffff; | |
| 365 | state->m_mcu_shared_ram.target()[0x10 / 2] = timer.machine().rand() & 0xffff; | |
| 366 | state->m_mcu_shared_ram.target()[0x12 / 2] = timer.machine().rand() & 0xffff; | |
| 367 | state->m_mcu_shared_ram.target()[0x14 / 2] = timer.machine().rand() & 0xffff; | |
| 368 | state->m_mcu_shared_ram.target()[0x16 / 2] = timer.machine().rand() & 0xffff; | |
| 361 | 369 | } |
| 362 | 370 | |
| 363 | 371 | |
| 364 | 372 | |
| 365 | 373 | WRITE16_MEMBER(ddealer_state::back_vram_w) |
| 366 | 374 | { |
| 367 | COMBINE_DATA(&m_back_vram[offset]); | |
| 375 | COMBINE_DATA(&m_back_vram.target()[offset]); | |
| 368 | 376 | m_back_tilemap->mark_tile_dirty(offset); |
| 369 | 377 | } |
| 370 | 378 | |
| 371 | 379 | |
| 372 | 380 | WRITE16_MEMBER(ddealer_state::ddealer_vregs_w) |
| 373 | 381 | { |
| 374 | COMBINE_DATA(&m_vregs[offset]); | |
| 382 | COMBINE_DATA(&m_vregs.target()[offset]); | |
| 375 | 383 | } |
| 376 | 384 | |
| 377 | 385 | /****************************************************************************************************** |
| r14896 | r14897 | |
| 381 | 389 | ******************************************************************************************************/ |
| 382 | 390 | |
| 383 | 391 | #define PROT_JSR(_offs_,_protvalue_,_pc_) \ |
| 384 | if(m_mcu_shared_ram[(_offs_)/2] == _protvalue_) \ | |
| 392 | if(m_mcu_shared_ram.target()[(_offs_)/2] == _protvalue_) \ | |
| 385 | 393 | { \ |
| 386 | m_mcu_shared_ram[(_offs_)/2] = 0xffff; /*(MCU job done)*/ \ | |
| 387 | m_mcu_shared_ram[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\ | |
| 388 | m_mcu_shared_ram[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\ | |
| 389 | m_mcu_shared_ram[(_offs_+6-0x10)/2] = _pc_; /*LO-DWORD*/\ | |
| 394 | m_mcu_shared_ram.target()[(_offs_)/2] = 0xffff; /*(MCU job done)*/ \ | |
| 395 | m_mcu_shared_ram.target()[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\ | |
| 396 | m_mcu_shared_ram.target()[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\ | |
| 397 | m_mcu_shared_ram.target()[(_offs_+6-0x10)/2] = _pc_; /*LO-DWORD*/\ | |
| 390 | 398 | } \ |
| 391 | 399 | |
| 392 | 400 | #define PROT_INPUT(_offs_,_protvalue_,_protinput_,_input_) \ |
| 393 | if(m_mcu_shared_ram[_offs_] == _protvalue_) \ | |
| 401 | if(m_mcu_shared_ram.target()[_offs_] == _protvalue_) \ | |
| 394 | 402 | {\ |
| 395 | m_mcu_shared_ram[_protinput_] = ((_input_ & 0xffff0000)>>16);\ | |
| 396 | m_mcu_shared_ram[_protinput_+1] = (_input_ & 0x0000ffff);\ | |
| 403 | m_mcu_shared_ram.target()[_protinput_] = ((_input_ & 0xffff0000)>>16);\ | |
| 404 | m_mcu_shared_ram.target()[_protinput_+1] = (_input_ & 0x0000ffff);\ | |
| 397 | 405 | } |
| 398 | 406 | |
| 399 | 407 | WRITE16_MEMBER(ddealer_state::ddealer_mcu_shared_w) |
| 400 | 408 | { |
| 401 | COMBINE_DATA(&m_mcu_shared_ram[offset]); | |
| 409 | COMBINE_DATA(&m_mcu_shared_ram.target()[offset]); | |
| 402 | 410 | |
| 403 | 411 | switch(offset) |
| 404 | 412 | { |
| r14896 | r14897 | |
| 430 | 438 | case 0x4fe/2: PROT_JSR(0x4fe,0x8018,0x9818); break; |
| 431 | 439 | /*Start-up vector,I think that only the first ram address can be written by the main CPU,or it is a whole sequence.*/ |
| 432 | 440 | case 0x000/2: |
| 433 | if (m_mcu_shared_ram[0x000 / 2] == 0x60fe) | |
| 441 | if (m_mcu_shared_ram.target()[0x000 / 2] == 0x60fe) | |
| 434 | 442 | { |
| 435 | m_mcu_shared_ram[0x000 / 2] = 0x0000;//coin counter | |
| 436 | m_mcu_shared_ram[0x002 / 2] = 0x0000;//coin counter "decimal point" | |
| 437 | m_mcu_shared_ram[0x004 / 2] = 0x4ef9; | |
| 443 | m_mcu_shared_ram.target()[0x000 / 2] = 0x0000;//coin counter | |
| 444 | m_mcu_shared_ram.target()[0x002 / 2] = 0x0000;//coin counter "decimal point" | |
| 445 | m_mcu_shared_ram.target()[0x004 / 2] = 0x4ef9; | |
| 438 | 446 | } |
| 439 | 447 | break; |
| 440 | 448 | case 0x002/2: |
| 441 | 449 | case 0x004/2: |
| 442 | if (m_mcu_shared_ram[0x002 / 2] == 0x0000 && m_mcu_shared_ram[0x004 / 2] == 0x0214) | |
| 443 | m_mcu_shared_ram[0x004 / 2] = 0x4ef9; | |
| 450 | if (m_mcu_shared_ram.target()[0x002 / 2] == 0x0000 && m_mcu_shared_ram.target()[0x004 / 2] == 0x0214) | |
| 451 | m_mcu_shared_ram.target()[0x004 / 2] = 0x4ef9; | |
| 444 | 452 | break; |
| 445 | 453 | case 0x008/2: |
| 446 | if (m_mcu_shared_ram[0x008 / 2] == 0x000f) | |
| 447 | m_mcu_shared_ram[0x008 / 2] = 0x0604; | |
| 454 | if (m_mcu_shared_ram.target()[0x008 / 2] == 0x000f) | |
| 455 | m_mcu_shared_ram.target()[0x008 / 2] = 0x0604; | |
| 448 | 456 | break; |
| 449 | 457 | case 0x00c/2: |
| 450 | if (m_mcu_shared_ram[0x00c / 2] == 0x000f) | |
| 451 | m_mcu_shared_ram[0x00c / 2] = 0x0000; | |
| 458 | if (m_mcu_shared_ram.target()[0x00c / 2] == 0x000f) | |
| 459 | m_mcu_shared_ram.target()[0x00c / 2] = 0x0000; | |
| 452 | 460 | break; |
| 453 | 461 | } |
| 454 | 462 | } |
| r14896 | r14897 | |
| 460 | 468 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
| 461 | 469 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("UNK") |
| 462 | 470 | AM_RANGE(0x084000, 0x084003) AM_DEVWRITE8_LEGACY("ymsnd", ym2203_w, 0x00ff) // ym ? |
| 463 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") // palette ram | |
| 464 | AM_RANGE(0x08c000, 0x08cfff) AM_RAM_WRITE(ddealer_vregs_w) AM_BASE(m_vregs) // palette ram | |
| 471 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") // palette ram | |
| 472 | AM_RANGE(0x08c000, 0x08cfff) AM_RAM_WRITE(ddealer_vregs_w) AM_SHARE("vregs") // palette ram | |
| 465 | 473 | |
| 466 | 474 | /* this might actually be 1 tilemap with some funky rowscroll / columnscroll enabled, I'm not sure */ |
| 467 | AM_RANGE(0x090000, 0x090fff) AM_RAM AM_BASE(m_left_fg_vram_top) | |
| 468 | AM_RANGE(0x091000, 0x091fff) AM_RAM AM_BASE(m_right_fg_vram_top) | |
| 469 | AM_RANGE(0x092000, 0x092fff) AM_RAM AM_BASE(m_left_fg_vram_bottom) | |
| 470 | AM_RANGE(0x093000, 0x093fff) AM_RAM AM_BASE(m_right_fg_vram_bottom) | |
| 475 | AM_RANGE(0x090000, 0x090fff) AM_RAM AM_SHARE("left_fg_vratop") | |
| 476 | AM_RANGE(0x091000, 0x091fff) AM_RAM AM_SHARE("right_fg_vratop") | |
| 477 | AM_RANGE(0x092000, 0x092fff) AM_RAM AM_SHARE("left_fg_vrabottom") | |
| 478 | AM_RANGE(0x093000, 0x093fff) AM_RAM AM_SHARE("right_fg_vrabottom") | |
| 471 | 479 | //AM_RANGE(0x094000, 0x094001) AM_NOP // always 0? |
| 472 | 480 | AM_RANGE(0x098000, 0x098001) AM_WRITE(ddealer_flipscreen_w) |
| 473 | AM_RANGE(0x09c000, 0x09cfff) AM_RAM_WRITE(back_vram_w) AM_BASE(m_back_vram) // bg tilemap | |
| 474 | AM_RANGE(0x0f0000, 0x0fdfff) AM_RAM AM_BASE(m_work_ram) | |
| 475 | AM_RANGE(0x0fe000, 0x0fefff) AM_RAM_WRITE(ddealer_mcu_shared_w) AM_BASE(m_mcu_shared_ram) | |
| 481 | AM_RANGE(0x09c000, 0x09cfff) AM_RAM_WRITE(back_vram_w) AM_SHARE("back_vram") // bg tilemap | |
| 482 | AM_RANGE(0x0f0000, 0x0fdfff) AM_RAM AM_SHARE("work_ram") | |
| 483 | AM_RANGE(0x0fe000, 0x0fefff) AM_RAM_WRITE(ddealer_mcu_shared_w) AM_SHARE("mcu_shared_ram") | |
| 476 | 484 | AM_RANGE(0x0ff000, 0x0fffff) AM_RAM |
| 477 | 485 | ADDRESS_MAP_END |
| 478 | 486 |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | public: |
| 23 | 23 | berzerk_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | : driver_device(mconfig, type, tag) { } | |
| 24 | : driver_device(mconfig, type, tag) , | |
| 25 | m_videoram(*this, "videoram"), | |
| 26 | m_colorram(*this, "colorram"){ } | |
| 25 | 27 | |
| 26 | UINT8 *m_videoram; | |
| 27 | size_t m_videoram_size; | |
| 28 | UINT8 *m_colorram; | |
| 28 | required_shared_ptr<UINT8> m_videoram; | |
| 29 | required_shared_ptr<UINT8> m_colorram; | |
| 29 | 30 | UINT8 m_magicram_control; |
| 30 | 31 | UINT8 m_last_shift_data; |
| 31 | 32 | UINT8 m_intercept; |
| r14896 | r14897 | |
| 362 | 363 | { |
| 363 | 364 | UINT8 alu_output; |
| 364 | 365 | |
| 365 | UINT8 current_video_data = m_videoram[offset]; | |
| 366 | UINT8 current_video_data = m_videoram.target()[offset]; | |
| 366 | 367 | |
| 367 | 368 | /* shift data towards LSB. MSB bits are filled by data from last_shift_data. |
| 368 | 369 | The shifter consists of 5 74153 devices @ 7A, 8A, 9A, 10A and 11A, |
| r14896 | r14897 | |
| 389 | 390 | alu_output = (TTL74181_read(LS181_10C, TTL74181_OUTPUT_F0, 4) << 4) | |
| 390 | 391 | (TTL74181_read(LS181_12C, TTL74181_OUTPUT_F0, 4) << 0); |
| 391 | 392 | |
| 392 | m_videoram[offset] = alu_output ^ 0xff; | |
| 393 | m_videoram.target()[offset] = alu_output ^ 0xff; | |
| 393 | 394 | |
| 394 | 395 | /* save data for next time */ |
| 395 | 396 | m_last_shift_data = data & 0x7f; |
| r14896 | r14897 | |
| 460 | 461 | |
| 461 | 462 | get_pens(screen.machine(), pens); |
| 462 | 463 | |
| 463 | for (offs = 0; offs < state->m_videoram | |
| 464 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 464 | 465 | { |
| 465 | 466 | int i; |
| 466 | 467 | |
| 467 | UINT8 data = state->m_videoram[offs]; | |
| 468 | UINT8 color = state->m_colorram[((offs >> 2) & 0x07e0) | (offs & 0x001f)]; | |
| 468 | UINT8 data = state->m_videoram.target()[offs]; | |
| 469 | UINT8 color = state->m_colorram.target()[((offs >> 2) & 0x07e0) | (offs & 0x001f)]; | |
| 469 | 470 | |
| 470 | 471 | UINT8 y = offs >> 5; |
| 471 | 472 | UINT8 x = offs << 3; |
| r14896 | r14897 | |
| 597 | 598 | AM_RANGE(0x0000, 0x07ff) AM_ROM |
| 598 | 599 | AM_RANGE(0x0800, 0x0bff) AM_MIRROR(0x0400) AM_RAM AM_SHARE("nvram") |
| 599 | 600 | AM_RANGE(0x1000, 0x3fff) AM_ROM |
| 600 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 601 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 601 | 602 | AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(magicram_w) AM_SHARE("share1") |
| 602 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_ | |
| 603 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_ | |
| 603 | 604 | AM_RANGE(0xc000, 0xffff) AM_NOP |
| 604 | 605 | ADDRESS_MAP_END |
| 605 | 606 | |
| 606 | 607 | |
| 607 | 608 | static ADDRESS_MAP_START( frenzy_map, AS_PROGRAM, 8, berzerk_state ) |
| 608 | 609 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 609 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 610 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 610 | 611 | AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(magicram_w) AM_SHARE("share1") |
| 611 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_ | |
| 612 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_ | |
| 612 | 613 | AM_RANGE(0xc000, 0xcfff) AM_ROM |
| 613 | 614 | AM_RANGE(0xf800, 0xfbff) AM_MIRROR(0x0400) AM_RAM AM_SHARE("nvram") |
| 614 | 615 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | DECLARE_WRITE_LINE_MEMBER(microtouch_out); |
| 97 | 97 | DECLARE_WRITE_LINE_MEMBER(microtouch_in); |
| 98 | DECLARE_READ8_MEMBER(magtouch_io_r); | |
| 99 | DECLARE_WRITE8_MEMBER(magtouch_io_w); | |
| 98 | 100 | }; |
| 99 | 101 | |
| 100 | 102 | |
| r14896 | r14897 | |
| 140 | 142 | * |
| 141 | 143 | *************************************/ |
| 142 | 144 | |
| 143 | ||
| 145 | ||
| 144 | 146 | { |
| 145 | 147 | switch(offset) |
| 146 | 148 | { |
| 147 | 149 | case 1: |
| 148 | return input_port_read( | |
| 150 | return input_port_read( | |
| 149 | 151 | default: |
| 150 | 152 | return 0; |
| 151 | 153 | } |
| 152 | 154 | } |
| 153 | 155 | |
| 154 | ||
| 156 | ||
| 155 | 157 | { |
| 156 | 158 | switch(offset) |
| 157 | 159 | { |
| 158 | 160 | case 6: |
| 159 | memory_set_bank( | |
| 161 | memory_set_bank( | |
| 160 | 162 | break; |
| 161 | 163 | } |
| 162 | 164 | } |
| r14896 | r14897 | |
| 173 | 175 | |
| 174 | 176 | static ADDRESS_MAP_START( magtouch_io, AS_IO, 32, magtouch_state ) |
| 175 | 177 | AM_IMPORT_FROM(pcat32_io_common) |
| 176 | AM_RANGE(0x02e0, 0x02e7) AM_READWRITE8 | |
| 178 | AM_RANGE(0x02e0, 0x02e7) AM_READWRITE8 | |
| 177 | 179 | AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ns16450_0", ns16450_device, ins8250_r, ins8250_w, 0xffffffff) |
| 178 | 180 | ADDRESS_MAP_END |
| 179 | 181 |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | { |
| 28 | 28 | public: |
| 29 | 29 | igs009_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | : driver_device(mconfig, type, tag) { } | |
| 30 | : driver_device(mconfig, type, tag) , | |
| 31 | m_bg_scroll(*this, "bg_scroll"), | |
| 32 | m_gp98_reel1_ram(*this, "gp98_reel1_ram"), | |
| 33 | m_gp98_reel2_ram(*this, "gp98_reel2_ram"), | |
| 34 | m_gp98_reel3_ram(*this, "gp98_reel3_ram"), | |
| 35 | m_gp98_reel4_ram(*this, "gp98_reel4_ram"), | |
| 36 | m_bg_scroll2(*this, "bg_scroll2"), | |
| 37 | m_fg_tile_ram(*this, "fg_tile_ram"), | |
| 38 | m_fg_color_ram(*this, "fg_color_ram"){ } | |
| 31 | 39 | |
| 40 | required_shared_ptr<UINT8> m_bg_scroll; | |
| 41 | required_shared_ptr<UINT8> m_gp98_reel1_ram; | |
| 42 | required_shared_ptr<UINT8> m_gp98_reel2_ram; | |
| 43 | required_shared_ptr<UINT8> m_gp98_reel3_ram; | |
| 44 | required_shared_ptr<UINT8> m_gp98_reel4_ram; | |
| 45 | required_shared_ptr<UINT8> m_bg_scroll2; | |
| 46 | required_shared_ptr<UINT8> m_fg_tile_ram; | |
| 47 | required_shared_ptr<UINT8> m_fg_color_ram; | |
| 32 | 48 | tilemap_t *m_gp98_reel1_tilemap; |
| 33 | UINT8 *m_gp98_reel1_ram; | |
| 34 | 49 | tilemap_t *m_gp98_reel2_tilemap; |
| 35 | UINT8 *m_gp98_reel2_ram; | |
| 36 | 50 | tilemap_t *m_gp98_reel3_tilemap; |
| 37 | UINT8 *m_gp98_reel3_ram; | |
| 38 | 51 | tilemap_t *m_gp98_reel4_tilemap; |
| 39 | UINT8 *m_gp98_reel4_ram; | |
| 40 | UINT8 *m_fg_tile_ram; | |
| 41 | UINT8 *m_fg_color_ram; | |
| 42 | UINT8 *m_bg_scroll; | |
| 43 | UINT8 *m_bg_scroll2; | |
| 44 | 52 | tilemap_t *m_fg_tilemap; |
| 45 | 53 | int m_video_enable; |
| 46 | 54 | int m_nmi_enable; |
| r14896 | r14897 | |
| 72 | 80 | |
| 73 | 81 | WRITE8_MEMBER(igs009_state::gp98_reel1_ram_w) |
| 74 | 82 | { |
| 75 | m_gp98_reel1_ram[offset] = data; | |
| 83 | m_gp98_reel1_ram.target()[offset] = data; | |
| 76 | 84 | m_gp98_reel1_tilemap->mark_tile_dirty(offset); |
| 77 | 85 | } |
| 78 | 86 | |
| 79 | 87 | static TILE_GET_INFO( get_jingbell_reel1_tile_info ) |
| 80 | 88 | { |
| 81 | 89 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 82 | int code = state->m_gp98_reel1_ram[tile_index]; | |
| 90 | int code = state->m_gp98_reel1_ram.target()[tile_index]; | |
| 83 | 91 | |
| 84 | 92 | SET_TILE_INFO( |
| 85 | 93 | 0, |
| r14896 | r14897 | |
| 92 | 100 | static TILE_GET_INFO( get_gp98_reel1_tile_info ) |
| 93 | 101 | { |
| 94 | 102 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 95 | int code = state->m_gp98_reel1_ram[tile_index]; | |
| 103 | int code = state->m_gp98_reel1_ram.target()[tile_index]; | |
| 96 | 104 | |
| 97 | 105 | SET_TILE_INFO( |
| 98 | 106 | 0, |
| r14896 | r14897 | |
| 104 | 112 | |
| 105 | 113 | WRITE8_MEMBER(igs009_state::gp98_reel2_ram_w) |
| 106 | 114 | { |
| 107 | m_gp98_reel2_ram[offset] = data; | |
| 115 | m_gp98_reel2_ram.target()[offset] = data; | |
| 108 | 116 | m_gp98_reel2_tilemap->mark_tile_dirty(offset); |
| 109 | 117 | } |
| 110 | 118 | |
| 111 | 119 | static TILE_GET_INFO( get_jingbell_reel2_tile_info ) |
| 112 | 120 | { |
| 113 | 121 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 114 | int code = state->m_gp98_reel2_ram[tile_index]; | |
| 122 | int code = state->m_gp98_reel2_ram.target()[tile_index]; | |
| 115 | 123 | |
| 116 | 124 | SET_TILE_INFO( |
| 117 | 125 | 0, |
| r14896 | r14897 | |
| 123 | 131 | static TILE_GET_INFO( get_gp98_reel2_tile_info ) |
| 124 | 132 | { |
| 125 | 133 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 126 | int code = state->m_gp98_reel2_ram[tile_index]; | |
| 134 | int code = state->m_gp98_reel2_ram.target()[tile_index]; | |
| 127 | 135 | |
| 128 | 136 | SET_TILE_INFO( |
| 129 | 137 | 0, |
| r14896 | r14897 | |
| 136 | 144 | |
| 137 | 145 | WRITE8_MEMBER(igs009_state::gp98_reel3_ram_w) |
| 138 | 146 | { |
| 139 | m_gp98_reel3_ram[offset] = data; | |
| 147 | m_gp98_reel3_ram.target()[offset] = data; | |
| 140 | 148 | m_gp98_reel3_tilemap->mark_tile_dirty(offset); |
| 141 | 149 | } |
| 142 | 150 | |
| 143 | 151 | static TILE_GET_INFO( get_jingbell_reel3_tile_info ) |
| 144 | 152 | { |
| 145 | 153 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 146 | int code = state->m_gp98_reel3_ram[tile_index]; | |
| 154 | int code = state->m_gp98_reel3_ram.target()[tile_index]; | |
| 147 | 155 | |
| 148 | 156 | SET_TILE_INFO( |
| 149 | 157 | 0, |
| r14896 | r14897 | |
| 155 | 163 | static TILE_GET_INFO( get_gp98_reel3_tile_info ) |
| 156 | 164 | { |
| 157 | 165 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 158 | int code = state->m_gp98_reel3_ram[tile_index]; | |
| 166 | int code = state->m_gp98_reel3_ram.target()[tile_index]; | |
| 159 | 167 | |
| 160 | 168 | SET_TILE_INFO( |
| 161 | 169 | 0, |
| r14896 | r14897 | |
| 168 | 176 | |
| 169 | 177 | WRITE8_MEMBER(igs009_state::gp98_reel4_ram_w) |
| 170 | 178 | { |
| 171 | m_gp98_reel4_ram[offset] = data; | |
| 179 | m_gp98_reel4_ram.target()[offset] = data; | |
| 172 | 180 | m_gp98_reel4_tilemap->mark_tile_dirty(offset); |
| 173 | 181 | } |
| 174 | 182 | |
| 175 | 183 | static TILE_GET_INFO( get_jingbell_reel4_tile_info ) |
| 176 | 184 | { |
| 177 | 185 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 178 | int code = state->m_gp98_reel4_ram[tile_index]; | |
| 186 | int code = state->m_gp98_reel4_ram.target()[tile_index]; | |
| 179 | 187 | |
| 180 | 188 | SET_TILE_INFO( |
| 181 | 189 | 0, |
| r14896 | r14897 | |
| 187 | 195 | static TILE_GET_INFO( get_gp98_reel4_tile_info ) |
| 188 | 196 | { |
| 189 | 197 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 190 | int code = state->m_gp98_reel4_ram[tile_index]; | |
| 198 | int code = state->m_gp98_reel4_ram.target()[tile_index]; | |
| 191 | 199 | |
| 192 | 200 | SET_TILE_INFO( |
| 193 | 201 | 0, |
| r14896 | r14897 | |
| 204 | 212 | |
| 205 | 213 | WRITE8_MEMBER(igs009_state::bg_scroll_w) |
| 206 | 214 | { |
| 207 | m_bg_scroll[offset] = data; | |
| 215 | m_bg_scroll.target()[offset] = data; | |
| 208 | 216 | // bg_tilemap->set_scrolly(offset,data); |
| 209 | 217 | } |
| 210 | 218 | |
| r14896 | r14897 | |
| 212 | 220 | static TILE_GET_INFO( get_fg_tile_info ) |
| 213 | 221 | { |
| 214 | 222 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 215 | int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8); | |
| 223 | int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8); | |
| 216 | 224 | SET_TILE_INFO(1, code, (4*(code >> 14)+3), 0); |
| 217 | 225 | } |
| 218 | 226 | |
| 219 | 227 | WRITE8_MEMBER(igs009_state::fg_tile_w) |
| 220 | 228 | { |
| 221 | m_fg_tile_ram[offset] = data; | |
| 229 | m_fg_tile_ram.target()[offset] = data; | |
| 222 | 230 | m_fg_tilemap->mark_tile_dirty(offset); |
| 223 | 231 | } |
| 224 | 232 | |
| 225 | 233 | WRITE8_MEMBER(igs009_state::fg_color_w) |
| 226 | 234 | { |
| 227 | m_fg_color_ram[offset] = data; | |
| 235 | m_fg_color_ram.target()[offset] = data; | |
| 228 | 236 | m_fg_tilemap->mark_tile_dirty(offset); |
| 229 | 237 | } |
| 230 | 238 | |
| r14896 | r14897 | |
| 290 | 298 | |
| 291 | 299 | for (i= 0;i < 0x80;i++) |
| 292 | 300 | { |
| 293 | state->m_gp98_reel1_tilemap->set_scrolly(i, state->m_bg_scroll[i]*2); | |
| 294 | state->m_gp98_reel2_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x80]*2); | |
| 295 | state->m_gp98_reel3_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x100]*2); | |
| 296 | state->m_gp98_reel4_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x180]*2); | |
| 301 | state->m_gp98_reel1_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i]*2); | |
| 302 | state->m_gp98_reel2_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x80]*2); | |
| 303 | state->m_gp98_reel3_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x100]*2); | |
| 304 | state->m_gp98_reel4_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x180]*2); | |
| 297 | 305 | } |
| 298 | 306 | |
| 299 | 307 | |
| r14896 | r14897 | |
| 302 | 310 | for (zz=0;zz<0x80-8;zz++) // -8 because of visible area (2*8 = 16) |
| 303 | 311 | { |
| 304 | 312 | rectangle clip; |
| 305 | int rowenable = state->m_bg_scroll2[zz]; | |
| 313 | int rowenable = state->m_bg_scroll2.target()[zz]; | |
| 306 | 314 | |
| 307 | 315 | /* draw top of screen */ |
| 308 | 316 | clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+2); |
| r14896 | r14897 | |
| 454 | 462 | |
| 455 | 463 | AM_RANGE( 0x1000, 0x11ff ) AM_RAM_WRITE(bg_scroll_w ) AM_BASE(m_bg_scroll ) |
| 456 | 464 | |
| 457 | AM_RANGE( 0x2000, 0x23ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 458 | AM_RANGE( 0x2400, 0x27ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 465 | AM_RANGE( 0x2000, 0x23ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 466 | AM_RANGE( 0x2400, 0x27ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 459 | 467 | |
| 460 | 468 | AM_RANGE( 0x3000, 0x33ff ) AM_RAM_WRITE(gp98_reel1_ram_w ) AM_BASE(m_gp98_reel1_ram ) |
| 461 | 469 | AM_RANGE( 0x3400, 0x37ff ) AM_RAM_WRITE(gp98_reel2_ram_w ) AM_BASE(m_gp98_reel2_ram ) |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | if (m_rambank & 1) |
| 65 | 65 | { |
| 66 | paletteram_xBBBBBGGGGGRRRRR_be_w(space,offset,data); | |
| 66 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space,offset,data); | |
| 67 | 67 | } |
| 68 | 68 | else if (m_rambank & 2) |
| 69 | 69 | { |
| r14896 | r14897 | |
| 383 | 383 | AM_RANGE(0x3f80, 0x3f80) AM_WRITE(bankswitch_w) |
| 384 | 384 | AM_RANGE(0x3f90, 0x3f90) AM_WRITE(spy_3f90_w) |
| 385 | 385 | AM_RANGE(0x3fa0, 0x3fa0) AM_WRITE(watchdog_reset_w) |
| 386 | AM_RANGE(0x3fb0, 0x3fb0) AM_WRITE(soundlatch_w) | |
| 386 | AM_RANGE(0x3fb0, 0x3fb0) AM_WRITE(soundlatch_byte_w) | |
| 387 | 387 | AM_RANGE(0x3fc0, 0x3fc0) AM_WRITE(spy_sh_irqtrigger_w) |
| 388 | 388 | AM_RANGE(0x3fd0, 0x3fd0) AM_READ_PORT("SYSTEM") |
| 389 | 389 | AM_RANGE(0x3fd1, 0x3fd1) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 402 | 402 | AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) |
| 403 | 403 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) |
| 404 | 404 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r,ym3812_w) |
| 405 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) | |
| 405 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) | |
| 406 | 406 | ADDRESS_MAP_END |
| 407 | 407 | |
| 408 | 408 |
| r14896 | r14897 | |
|---|---|---|
| 305 | 305 | |
| 306 | 306 | ***************************************************************************/ |
| 307 | 307 | |
| 308 | READ32_MEMBER(psikyo_state::paletteram32_dword_r) | |
| 309 | { | |
| 310 | return (m_generic_paletteram_16[offset * 2] << 16) | m_generic_paletteram_16[offset * 2 + 1]; | |
| 311 | } | |
| 312 | ||
| 313 | WRITE32_MEMBER(psikyo_state::paletteram32_xRRRRRGGGGGBBBBB_dword_w) | |
| 314 | { | |
| 315 | if (ACCESSING_BITS_16_31) | |
| 316 | paletteram16_xRRRRRGGGGGBBBBB_word_w(space, offset * 2, data >> 16, mem_mask >> 16); | |
| 317 | if (ACCESSING_BITS_0_15) | |
| 318 | paletteram16_xRRRRRGGGGGBBBBB_word_w(space, offset * 2 + 1, data, mem_mask); | |
| 319 | } | |
| 320 | ||
| 321 | 308 | static ADDRESS_MAP_START( psikyo_map, AS_PROGRAM, 32, psikyo_state ) |
| 322 | 309 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM (not all used) |
| 323 | 310 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites, buffered by two frames (list buffered + fb buffered) |
| 324 | AM_RANGE(0x600000, 0x601fff) AM_R | |
| 311 | AM_RANGE(0x600000, 0x601fff) AM_R | |
| 325 | 312 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(psikyo_vram_0_w) AM_BASE(m_vram_0) // Layer 0 |
| 326 | 313 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(psikyo_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 327 | 314 | AM_RANGE(0x804000, 0x807fff) AM_RAM AM_BASE(m_vregs) // RAM + Vregs |
| r14896 | r14897 | |
| 370 | 357 | AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(m_bootleg_spritebuffer) // RAM (it copies the spritelist here, the HW probably doesn't have automatic buffering like the originals? |
| 371 | 358 | |
| 372 | 359 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites, buffered by two frames (list buffered + fb buffered) |
| 373 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 360 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 374 | 361 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(psikyo_vram_0_w) AM_BASE(m_vram_0) // Layer 0 |
| 375 | 362 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(psikyo_vram_1_w) AM_BASE(m_vram_1) // Layer 1 |
| 376 | 363 | AM_RANGE(0x804000, 0x807fff) AM_RAM AM_BASE(m_vregs) // RAM + Vregs |
| r14896 | r14897 | |
| 1030 | 1017 | { |
| 1031 | 1018 | psikyo_state *state = machine.driver_data<psikyo_state>(); |
| 1032 | 1019 | |
| 1033 | state->m_generic_paletteram_16.allocate(0x1000); | |
| 1034 | ||
| 1035 | 1020 | state->m_audiocpu = machine.device("audiocpu"); |
| 1036 | 1021 | |
| 1037 | 1022 | state->save_item(NAME(state->m_soundlatch)); |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | { |
| 40 | 40 | public: |
| 41 | 41 | tapatune_state(const machine_config &mconfig, device_type type, const char *tag) |
| 42 | : driver_device(mconfig, type, tag) {} | |
| 42 | : driver_device(mconfig, type, tag), | |
| 43 | m_videoram(*this, "videoram") {} | |
| 43 | 44 | |
| 44 | 45 | UINT8 m_paletteram[0x300]; |
| 45 | 46 | UINT16 m_palette_write_address; |
| 46 | 47 | rgb_t m_pens[0x100]; |
| 47 | 48 | |
| 48 | UINT16 | |
| 49 | required_shared_ptr<UINT16> m_videoram; | |
| 49 | 50 | |
| 50 | 51 | UINT8 m_controls_mux; |
| 51 | 52 | UINT8 m_z80_to_68k_index; |
| r14896 | r14897 | |
| 128 | 129 | |
| 129 | 130 | static ADDRESS_MAP_START( tapatune_map, AS_PROGRAM, 16, tapatune_state ) |
| 130 | 131 | AM_RANGE(0x000000, 0x2fffff) AM_ROM // program rom and graphics roms |
| 131 | AM_RANGE(0x300000, 0x31ffff) AM_RAM AM_ | |
| 132 | AM_RANGE(0x300000, 0x31ffff) AM_RAM AM_ | |
| 132 | 133 | AM_RANGE(0x320000, 0x327fff) AM_RAM // workram |
| 133 | 134 | AM_RANGE(0x328000, 0x32ffff) AM_RAM |
| 134 | 135 | AM_RANGE(0x330000, 0x337fff) AM_RAM // ram used as system video buffer |
| r14896 | r14897 | |
| 285 | 286 | PORT_START("COINS") |
| 286 | 287 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) |
| 287 | 288 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) |
| 288 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 289 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 289 | 290 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 290 | 291 | |
| 291 | 292 | PORT_START("BUTTONS") |
| r14896 | r14897 | |
| 343 | 344 | |
| 344 | 345 | for (x = 0; x < x_count*4; x++) |
| 345 | 346 | { |
| 346 | UINT8 pix = ((UINT8*)state->m_videoram)[BYTE_XOR_BE(offs + x)]; | |
| 347 | UINT8 pix = ((UINT8*)state->m_videoram.target())[BYTE_XOR_BE(offs + x)]; | |
| 347 | 348 | dest[2*x] = pens[((pix >> 4) & 0x0f)]; |
| 348 | 349 | dest[2*x + 1] = pens[(pix & 0x0f)]; |
| 349 | 350 | } |
| r14896 | r14897 | |
| 397 | 398 | |
| 398 | 399 | MCFG_MC6845_ADD("crtc", H46505, 24000000/16, h46505_intf) /* H46505 */ |
| 399 | 400 | |
| 400 | MCFG_TICKET_DISPENSER_ADD("ticket", 100, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW) | |
| 401 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW) | |
| 401 | 402 | |
| 402 | 403 | /* sound hardware */ |
| 403 | 404 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| r14896 | r14897 | |
|---|---|---|
| 43 | 43 | dacholer_state(const machine_config &mconfig, device_type type, const char *tag) |
| 44 | 44 | : driver_device(mconfig, type, tag), |
| 45 | 45 | m_maincpu(*this,"maincpu"), |
| 46 | m_audiocpu(*this,"audiocpu") | |
| 47 | { } | |
| 46 | m_audiocpu(*this,"audiocpu"), | |
| 47 | m_bgvideoram(*this, "bgvideoram"), | |
| 48 | m_fgvideoram(*this, "fgvideoram"), | |
| 49 | m_spriteram(*this, "spriteram"){ } | |
| 48 | 50 | |
| 51 | /* devices */ | |
| 52 | required_device<cpu_device> m_maincpu; | |
| 53 | required_device<cpu_device> m_audiocpu; | |
| 49 | 54 | /* memory pointers */ |
| 50 | UINT8 * m_bgvideoram; | |
| 51 | UINT8 * m_fgvideoram; | |
| 52 | UINT8 * m_spriteram; | |
| 53 | size_t m_spriteram_size; | |
| 55 | required_shared_ptr<UINT8> m_bgvideoram; | |
| 56 | required_shared_ptr<UINT8> m_fgvideoram; | |
| 57 | required_shared_ptr<UINT8> m_spriteram; | |
| 54 | 58 | |
| 55 | 59 | /* video-related */ |
| 56 | 60 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 66 | 70 | UINT8 m_music_interrupt_enable; |
| 67 | 71 | UINT8 m_snd_ack; |
| 68 | 72 | |
| 69 | /* devices */ | |
| 70 | required_device<cpu_device> m_maincpu; | |
| 71 | required_device<cpu_device> m_audiocpu; | |
| 72 | 73 | DECLARE_WRITE8_MEMBER(bg_scroll_x_w); |
| 73 | 74 | DECLARE_WRITE8_MEMBER(bg_scroll_y_w); |
| 74 | 75 | DECLARE_WRITE8_MEMBER(background_w); |
| r14896 | r14897 | |
| 87 | 88 | static TILE_GET_INFO( get_bg_tile_info ) |
| 88 | 89 | { |
| 89 | 90 | dacholer_state *state = machine.driver_data<dacholer_state>(); |
| 90 | SET_TILE_INFO(1, state->m_bgvideoram[tile_index] + state->m_bg_bank * 0x100, 0, 0); | |
| 91 | SET_TILE_INFO(1, state->m_bgvideoram.target()[tile_index] + state->m_bg_bank * 0x100, 0, 0); | |
| 91 | 92 | } |
| 92 | 93 | |
| 93 | 94 | static TILE_GET_INFO( get_fg_tile_info ) |
| 94 | 95 | { |
| 95 | 96 | dacholer_state *state = machine.driver_data<dacholer_state>(); |
| 96 | SET_TILE_INFO(0, state->m_fgvideoram[tile_index], 0, 0); | |
| 97 | SET_TILE_INFO(0, state->m_fgvideoram.target()[tile_index], 0, 0); | |
| 97 | 98 | } |
| 98 | 99 | |
| 99 | 100 | static VIDEO_START( dacholer ) |
| r14896 | r14897 | |
| 120 | 121 | dacholer_state *state = machine.driver_data<dacholer_state>(); |
| 121 | 122 | int offs, code, attr, sx, sy, flipx, flipy; |
| 122 | 123 | |
| 123 | for (offs = 0; offs < state->m_spriteram | |
| 124 | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) | |
| 124 | 125 | { |
| 125 | code = state->m_spriteram[offs + 1]; | |
| 126 | attr = state->m_spriteram[offs + 2]; | |
| 126 | code = state->m_spriteram.target()[offs + 1]; | |
| 127 | attr = state->m_spriteram.target()[offs + 2]; | |
| 127 | 128 | |
| 128 | 129 | flipx = attr & 0x10; |
| 129 | 130 | flipy = attr & 0x20; |
| 130 | 131 | |
| 131 | sx = (state->m_spriteram[offs + 3] - 128) + 256 * (attr & 0x01); | |
| 132 | sy = 255 - state->m_spriteram[offs]; | |
| 132 | sx = (state->m_spriteram.target()[offs + 3] - 128) + 256 * (attr & 0x01); | |
| 133 | sy = 255 - state->m_spriteram.target()[offs]; | |
| 133 | 134 | |
| 134 | if (flip_screen | |
| 135 | if (state->flip_screen | |
| 135 | 136 | { |
| 136 | 137 | sx = 240 - sx; |
| 137 | 138 | sy = 240 - sy; |
| r14896 | r14897 | |
| 151 | 152 | { |
| 152 | 153 | dacholer_state *state = screen.machine().driver_data<dacholer_state>(); |
| 153 | 154 | |
| 154 | if (flip_screen | |
| 155 | if (state->flip_screen | |
| 155 | 156 | { |
| 156 | 157 | state->m_bg_tilemap->set_scrollx(0, 256 - state->m_scroll_x); |
| 157 | 158 | state->m_bg_tilemap->set_scrolly(0, 256 - state->m_scroll_y); |
| r14896 | r14897 | |
| 170 | 171 | |
| 171 | 172 | WRITE8_MEMBER(dacholer_state::background_w) |
| 172 | 173 | { |
| 173 | m_bgvideoram[offset] = data; | |
| 174 | m_bgvideoram.target()[offset] = data; | |
| 174 | 175 | m_bg_tilemap->mark_tile_dirty(offset); |
| 175 | 176 | } |
| 176 | 177 | |
| 177 | 178 | WRITE8_MEMBER(dacholer_state::foreground_w) |
| 178 | 179 | { |
| 179 | m_fgvideoram[offset] = data; | |
| 180 | m_fgvideoram.target()[offset] = data; | |
| 180 | 181 | m_fg_tilemap->mark_tile_dirty(offset); |
| 181 | 182 | } |
| 182 | 183 | |
| r14896 | r14897 | |
| 188 | 189 | m_bg_tilemap->mark_all_dirty(); |
| 189 | 190 | } |
| 190 | 191 | |
| 191 | flip_screen_set( | |
| 192 | flip_screen_set( | |
| 192 | 193 | |
| 193 | 194 | } |
| 194 | 195 | |
| r14896 | r14897 | |
| 203 | 204 | |
| 204 | 205 | WRITE8_MEMBER(dacholer_state::snd_w) |
| 205 | 206 | { |
| 206 | soundlatch_w(space, offset, data); | |
| 207 | soundlatch_byte_w(space, offset, data); | |
| 207 | 208 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 208 | 209 | } |
| 209 | 210 | |
| r14896 | r14897 | |
| 216 | 217 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, dacholer_state ) |
| 217 | 218 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 218 | 219 | AM_RANGE(0x8800, 0x97ff) AM_RAM |
| 219 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x400) AM_RAM_WRITE(background_w) AM_BASE(m_bgvideoram) | |
| 220 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(foreground_w) AM_BASE(m_fgvideoram) | |
| 221 | AM_RANGE(0xe000, 0xe0ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 220 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x400) AM_RAM_WRITE(background_w) AM_SHARE("bgvideoram") | |
| 221 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(foreground_w) AM_SHARE("fgvideoram") | |
| 222 | AM_RANGE(0xe000, 0xe0ff) AM_RAM AM_SHARE("spriteram") | |
| 222 | 223 | ADDRESS_MAP_END |
| 223 | 224 | |
| 224 | 225 | static ADDRESS_MAP_START( itaten_main_map, AS_PROGRAM, 8, dacholer_state ) |
| r14896 | r14897 | |
| 284 | 285 | |
| 285 | 286 | static ADDRESS_MAP_START( snd_io_map, AS_IO, 8, dacholer_state ) |
| 286 | 287 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 287 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_r, soundlatch_clear_w ) | |
| 288 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_byte_r, soundlatch_clear_byte_w ) | |
| 288 | 289 | AM_RANGE(0x04, 0x04) AM_WRITE(music_irq_w) |
| 289 | 290 | AM_RANGE(0x08, 0x08) AM_WRITE(snd_irq_w) |
| 290 | 291 | AM_RANGE(0x0c, 0x0c) AM_WRITE(snd_ack_w) |
| r14896 | r14897 | |
| 296 | 297 | |
| 297 | 298 | static ADDRESS_MAP_START( itaten_snd_io_map, AS_IO, 8, dacholer_state ) |
| 298 | 299 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 299 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_r, soundlatch_clear_w ) | |
| 300 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_byte_r, soundlatch_clear_byte_w ) | |
| 300 | 301 | AM_RANGE(0x86, 0x87) AM_DEVWRITE_LEGACY("ay1", ay8910_data_address_w) |
| 301 | 302 | AM_RANGE(0x8a, 0x8b) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w) |
| 302 | 303 | AM_RANGE(0x8e, 0x8f) AM_DEVWRITE_LEGACY("ay3", ay8910_data_address_w) |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | { |
| 68 | 68 | if (ACCESSING_BITS_0_7) |
| 69 | 69 | { |
| 70 | soundlatch_w(space, 0, data & 0xff); | |
| 70 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 71 | 71 | device_set_input_line(m_audio_cpu, 0, ASSERT_LINE); // Generate an IRQ |
| 72 | 72 | device_spin_until_time(&space.device(), attotime::from_usec(50)); // Allow the other CPU to reply |
| 73 | 73 | } |
| r14896 | r14897 | |
| 82 | 82 | static ADDRESS_MAP_START( multchmp_map, AS_PROGRAM, 16, esd16_state ) |
| 83 | 83 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 84 | 84 | AM_RANGE(0x100000, 0x10ffff) AM_RAM // RAM |
| 85 | AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(paletteram | |
| 85 | AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(paletteram | |
| 86 | 86 | /**/AM_RANGE(0x300000, 0x3007ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 87 | 87 | AM_RANGE(0x300800, 0x300807) AM_WRITE(esd16_spriteram_w) // Sprites (Mirrored) |
| 88 | 88 | /**/AM_RANGE(0x400000, 0x403fff) AM_RAM_WRITE(esd16_vram_0_w) AM_BASE(m_vram_0) // Layers |
| r14896 | r14897 | |
| 133 | 133 | static ADDRESS_MAP_START( hedpanic_map, AS_PROGRAM, 16, esd16_state ) |
| 134 | 134 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 135 | 135 | AM_RANGE(0x100000, 0x10ffff) AM_RAM // RAM |
| 136 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram | |
| 136 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram | |
| 137 | 137 | AM_RANGE(0x900000, 0x9007ff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 138 | 138 | AM_RANGE(0x900800, 0x900807) AM_WRITE(esd16_spriteram_w) // Sprites (Mirrored) |
| 139 | 139 | AM_RANGE(0xa00000, 0xa03fff) AM_WRITE(esd16_vram_0_w) AM_BASE(m_vram_0) // Layers |
| r14896 | r14897 | |
| 164 | 164 | AM_RANGE(0x300000, 0x303fff) AM_WRITE(esd16_vram_0_w) AM_BASE(m_vram_0) // Layers |
| 165 | 165 | AM_RANGE(0x320000, 0x323fff) AM_WRITE(esd16_vram_1_w) AM_BASE(m_vram_1) // |
| 166 | 166 | AM_RANGE(0x324000, 0x327fff) AM_WRITE(esd16_vram_1_w) AM_BASE(m_vram_1) // mirror? |
| 167 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 167 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram | |
| 168 | 168 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP // IRQ Ack |
| 169 | 169 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P1_P2") |
| 170 | 170 | AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 188 | 188 | |
| 189 | 189 | static ADDRESS_MAP_START( tangtang_map, AS_PROGRAM, 16, esd16_state ) |
| 190 | 190 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM |
| 191 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram | |
| 191 | AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(paletteram | |
| 192 | 192 | AM_RANGE(0x200000, 0x2007ff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, m_spriteram_size) // Sprites |
| 193 | 193 | AM_RANGE(0x200800, 0x200807) AM_WRITE(esd16_spriteram_w) // Sprites (Mirrored) |
| 194 | 194 | AM_RANGE(0x300000, 0x303fff) AM_WRITE(esd16_vram_0_w) AM_BASE(m_vram_0) // Layers |
| r14896 | r14897 | |
| 240 | 240 | |
| 241 | 241 | /* Clear IRQ only after reading the command, or some get lost */ |
| 242 | 242 | device_set_input_line(m_audio_cpu, 0, CLEAR_LINE); |
| 243 | return soundlatch_r(space, 0); | |
| 243 | return soundlatch_byte_r(space, 0); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | static ADDRESS_MAP_START( multchmp_sound_io_map, AS_IO, 8, esd16_state ) |
| r14896 | r14897 | |
|---|---|---|
| 689 | 689 | /* Motorola MPC105 PCI Bridge/Memory Controller */ |
| 690 | 690 | |
| 691 | 691 | |
| 692 | ||
| 692 | ||
| 693 | 693 | { |
| 694 | int device = state->m_pci_device; | |
| 695 | int reg = state->m_pci_reg; | |
| 694 | int device = m_pci_device; | |
| 695 | int reg = m_pci_reg; | |
| 696 | 696 | |
| 697 | 697 | switch(device) |
| 698 | 698 | { |
| r14896 | r14897 | |
| 708 | 708 | case 13: /* Real3D Controller chip */ |
| 709 | 709 | switch(reg) |
| 710 | 710 | { |
| 711 | case 0: return | |
| 711 | case 0: return | |
| 712 | 712 | default: |
| 713 | 713 | logerror("pci_device_get_reg: Real3D controller, unknown reg %02X", reg); |
| 714 | 714 | break; |
| r14896 | r14897 | |
| 742 | 742 | return 0; |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | ||
| 745 | ||
| 746 | 746 | { |
| 747 | int device = state->m_pci_device; | |
| 748 | int reg = state->m_pci_reg; | |
| 747 | int device = m_pci_device; | |
| 748 | int reg = m_pci_reg; | |
| 749 | 749 | |
| 750 | 750 | switch(device) |
| 751 | 751 | { |
| r14896 | r14897 | |
| 815 | 815 | } |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | ||
| 818 | ||
| 819 | 819 | { |
| 820 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 821 | 820 | if (ACCESSING_BITS_32_63) |
| 822 | 821 | { |
| 823 | return (UINT64) | |
| 822 | return (UINT64) | |
| 824 | 823 | } |
| 825 | 824 | return 0; |
| 826 | 825 | } |
| 827 | 826 | |
| 828 | ||
| 827 | ||
| 829 | 828 | { |
| 830 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 831 | 829 | if (ACCESSING_BITS_32_63) |
| 832 | 830 | { |
| 833 | 831 | UINT32 d = FLIPENDIAN_INT32((UINT32)(data >> 32)); |
| 834 | | |
| 832 | | |
| 835 | 833 | |
| 836 | state->m_pci_bus = (d >> 16) & 0xff; | |
| 837 | state->m_pci_device = (d >> 11) & 0x1f; | |
| 838 | state->m_pci_function = (d >> 8) & 0x7; | |
| 839 | state->m_pci_reg = (d >> 2) & 0x3f; | |
| 834 | m_pci_bus = (d >> 16) & 0xff; | |
| 835 | m_pci_device = (d >> 11) & 0x1f; | |
| 836 | m_pci_function = (d >> 8) & 0x7; | |
| 837 | m_pci_reg = (d >> 2) & 0x3f; | |
| 840 | 838 | } |
| 841 | 839 | } |
| 842 | 840 | |
| 843 | ||
| 841 | ||
| 844 | 842 | { |
| 845 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 846 | if(state->m_pci_device == 0) { | |
| 847 | return ((UINT64)(FLIPENDIAN_INT32(state->m_mpc105_regs[(state->m_pci_reg/2)+1])) << 32) | | |
| 848 | ((UINT64)(FLIPENDIAN_INT32(state->m_mpc105_regs[(state->m_pci_reg/2)+0]))); | |
| 843 | if(m_pci_device == 0) { | |
| 844 | return ((UINT64)(FLIPENDIAN_INT32(m_mpc105_regs[(m_pci_reg/2)+1])) << 32) | | |
| 845 | ((UINT64)(FLIPENDIAN_INT32(m_mpc105_regs[(m_pci_reg/2)+0]))); | |
| 849 | 846 | } |
| 850 | return FLIPENDIAN_INT32(pci_device_get_reg( | |
| 847 | return FLIPENDIAN_INT32(pci_device_get_reg( | |
| 851 | 848 | } |
| 852 | 849 | |
| 853 | ||
| 850 | ||
| 854 | 851 | { |
| 855 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 856 | if(state->m_pci_device == 0) { | |
| 857 | state->m_mpc105_regs[(state->m_pci_reg/2)+1] = FLIPENDIAN_INT32((UINT32)(data >> 32)); | |
| 858 | state->m_mpc105_regs[(state->m_pci_reg/2)+0] = FLIPENDIAN_INT32((UINT32)(data)); | |
| 852 | if(m_pci_device == 0) { | |
| 853 | m_mpc105_regs[(m_pci_reg/2)+1] = FLIPENDIAN_INT32((UINT32)(data >> 32)); | |
| 854 | m_mpc105_regs[(m_pci_reg/2)+0] = FLIPENDIAN_INT32((UINT32)(data)); | |
| 859 | 855 | return; |
| 860 | 856 | } |
| 861 | 857 | if (ACCESSING_BITS_0_31) |
| 862 | 858 | { |
| 863 | pci_device_set_reg( | |
| 859 | pci_device_set_reg( | |
| 864 | 860 | } |
| 865 | 861 | } |
| 866 | 862 | |
| 867 | ||
| 863 | ||
| 868 | 864 | { |
| 869 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 870 | return ((UINT64)(state->m_mpc105_regs[(offset*2)+0]) << 32) | | |
| 871 | (UINT64)(state->m_mpc105_regs[(offset*2)+1]); | |
| 865 | return ((UINT64)(m_mpc105_regs[(offset*2)+0]) << 32) | | |
| 866 | (UINT64)(m_mpc105_regs[(offset*2)+1]); | |
| 872 | 867 | } |
| 873 | 868 | |
| 874 | ||
| 869 | ||
| 875 | 870 | { |
| 876 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 877 | state->m_mpc105_regs[(offset*2)+0] = (UINT32)(data >> 32); | |
| 878 | state->m_mpc105_regs[(offset*2)+1] = (UINT32)data; | |
| 871 | m_mpc105_regs[(offset*2)+0] = (UINT32)(data >> 32); | |
| 872 | m_mpc105_regs[(offset*2)+1] = (UINT32)data; | |
| 879 | 873 | } |
| 880 | 874 | |
| 881 | 875 | static void mpc105_init(running_machine &machine) |
| r14896 | r14897 | |
| 898 | 892 | /* Motorola MPC106 PCI Bridge/Memory Controller */ |
| 899 | 893 | |
| 900 | 894 | |
| 901 | ||
| 895 | ||
| 902 | 896 | { |
| 903 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 904 | 897 | if (ACCESSING_BITS_32_63) |
| 905 | 898 | { |
| 906 | return (UINT64) | |
| 899 | return (UINT64) | |
| 907 | 900 | } |
| 908 | 901 | return 0; |
| 909 | 902 | } |
| 910 | 903 | |
| 911 | ||
| 904 | ||
| 912 | 905 | { |
| 913 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 914 | 906 | if (ACCESSING_BITS_32_63) |
| 915 | 907 | { |
| 916 | 908 | UINT32 d = FLIPENDIAN_INT32((UINT32)(data >> 32)); |
| 917 | 909 | |
| 918 | 910 | if (((d >> 8) & 0xffffff) == 0x800000) |
| 919 | 911 | { |
| 920 | | |
| 912 | | |
| 921 | 913 | } |
| 922 | 914 | else |
| 923 | 915 | { |
| 924 | | |
| 916 | | |
| 925 | 917 | |
| 926 | state->m_pci_bus = (d >> 16) & 0xff; | |
| 927 | state->m_pci_device = (d >> 11) & 0x1f; | |
| 928 | state->m_pci_function = (d >> 8) & 0x7; | |
| 929 | state->m_pci_reg = (d >> 2) & 0x3f; | |
| 918 | m_pci_bus = (d >> 16) & 0xff; | |
| 919 | m_pci_device = (d >> 11) & 0x1f; | |
| 920 | m_pci_function = (d >> 8) & 0x7; | |
| 921 | m_pci_reg = (d >> 2) & 0x3f; | |
| 930 | 922 | } |
| 931 | 923 | } |
| 932 | 924 | } |
| 933 | 925 | |
| 934 | ||
| 926 | ||
| 935 | 927 | { |
| 936 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 937 | if(state->m_pci_device == 0) { | |
| 938 | return ((UINT64)(FLIPENDIAN_INT32(state->m_mpc106_regs[(state->m_pci_reg/2)+1])) << 32) | | |
| 939 | ((UINT64)(FLIPENDIAN_INT32(state->m_mpc106_regs[(state->m_pci_reg/2)+0]))); | |
| 928 | if(m_pci_device == 0) { | |
| 929 | return ((UINT64)(FLIPENDIAN_INT32(m_mpc106_regs[(m_pci_reg/2)+1])) << 32) | | |
| 930 | ((UINT64)(FLIPENDIAN_INT32(m_mpc106_regs[(m_pci_reg/2)+0]))); | |
| 940 | 931 | } |
| 941 | 932 | if (ACCESSING_BITS_32_63) |
| 942 | 933 | { |
| 943 | return (UINT64)(FLIPENDIAN_INT32(pci_device_get_reg( | |
| 934 | return (UINT64)(FLIPENDIAN_INT32(pci_device_get_reg( | |
| 944 | 935 | } |
| 945 | 936 | else |
| 946 | 937 | { |
| 947 | return (UINT64)(FLIPENDIAN_INT32(pci_device_get_reg( | |
| 938 | return (UINT64)(FLIPENDIAN_INT32(pci_device_get_reg( | |
| 948 | 939 | } |
| 949 | 940 | } |
| 950 | 941 | |
| 951 | ||
| 942 | ||
| 952 | 943 | { |
| 953 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 954 | if(state->m_pci_device == 0) { | |
| 955 | state->m_mpc106_regs[(state->m_pci_reg/2)+1] = FLIPENDIAN_INT32((UINT32)(data >> 32)); | |
| 956 | state->m_mpc106_regs[(state->m_pci_reg/2)+0] = FLIPENDIAN_INT32((UINT32)(data)); | |
| 944 | if(m_pci_device == 0) { | |
| 945 | m_mpc106_regs[(m_pci_reg/2)+1] = FLIPENDIAN_INT32((UINT32)(data >> 32)); | |
| 946 | m_mpc106_regs[(m_pci_reg/2)+0] = FLIPENDIAN_INT32((UINT32)(data)); | |
| 957 | 947 | return; |
| 958 | 948 | } |
| 959 | 949 | if (ACCESSING_BITS_0_31) |
| 960 | 950 | { |
| 961 | pci_device_set_reg( | |
| 951 | pci_device_set_reg( | |
| 962 | 952 | } |
| 963 | 953 | } |
| 964 | 954 | |
| 965 | ||
| 955 | ||
| 966 | 956 | { |
| 967 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 968 | return ((UINT64)(state->m_mpc106_regs[(offset*2)+0]) << 32) | | |
| 969 | (UINT64)(state->m_mpc106_regs[(offset*2)+1]); | |
| 957 | return ((UINT64)(m_mpc106_regs[(offset*2)+0]) << 32) | | |
| 958 | (UINT64)(m_mpc106_regs[(offset*2)+1]); | |
| 970 | 959 | } |
| 971 | 960 | |
| 972 | ||
| 961 | ||
| 973 | 962 | { |
| 974 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 975 | state->m_mpc106_regs[(offset*2)+0] = (UINT32)(data >> 32); | |
| 976 | state->m_mpc106_regs[(offset*2)+1] = (UINT32)data; | |
| 963 | m_mpc106_regs[(offset*2)+0] = (UINT32)(data >> 32); | |
| 964 | m_mpc106_regs[(offset*2)+1] = (UINT32)data; | |
| 977 | 965 | } |
| 978 | 966 | |
| 979 | 967 | static void mpc106_init(running_machine &machine) |
| r14896 | r14897 | |
| 999 | 987 | |
| 1000 | 988 | /*****************************************************************************/ |
| 1001 | 989 | |
| 1002 | ||
| 990 | ||
| 1003 | 991 | { |
| 1004 | 992 | int reg = offset*8; |
| 1005 | 993 | UINT64 r = 0; |
| 1006 | 994 | if (ACCESSING_BITS_56_63) { |
| 1007 | r |= (UINT64)lsi53c810_reg_r(space, reg+0) << 56; | |
| 995 | r |= (UINT64)lsi53c810_reg_r(&space, reg+0) << 56; | |
| 1008 | 996 | } |
| 1009 | 997 | if (ACCESSING_BITS_48_55) { |
| 1010 | r |= (UINT64)lsi53c810_reg_r(space, reg+1) << 48; | |
| 998 | r |= (UINT64)lsi53c810_reg_r(&space, reg+1) << 48; | |
| 1011 | 999 | } |
| 1012 | 1000 | if (ACCESSING_BITS_40_47) { |
| 1013 | r |= (UINT64)lsi53c810_reg_r(space, reg+2) << 40; | |
| 1001 | r |= (UINT64)lsi53c810_reg_r(&space, reg+2) << 40; | |
| 1014 | 1002 | } |
| 1015 | 1003 | if (ACCESSING_BITS_32_39) { |
| 1016 | r |= (UINT64)lsi53c810_reg_r(space, reg+3) << 32; | |
| 1004 | r |= (UINT64)lsi53c810_reg_r(&space, reg+3) << 32; | |
| 1017 | 1005 | } |
| 1018 | 1006 | if (ACCESSING_BITS_24_31) { |
| 1019 | r |= (UINT64)lsi53c810_reg_r(space, reg+4) << 24; | |
| 1007 | r |= (UINT64)lsi53c810_reg_r(&space, reg+4) << 24; | |
| 1020 | 1008 | } |
| 1021 | 1009 | if (ACCESSING_BITS_16_23) { |
| 1022 | r |= (UINT64)lsi53c810_reg_r(space, reg+5) << 16; | |
| 1010 | r |= (UINT64)lsi53c810_reg_r(&space, reg+5) << 16; | |
| 1023 | 1011 | } |
| 1024 | 1012 | if (ACCESSING_BITS_8_15) { |
| 1025 | r |= (UINT64)lsi53c810_reg_r(space, reg+6) << 8; | |
| 1013 | r |= (UINT64)lsi53c810_reg_r(&space, reg+6) << 8; | |
| 1026 | 1014 | } |
| 1027 | 1015 | if (ACCESSING_BITS_0_7) { |
| 1028 | r |= (UINT64)lsi53c810_reg_r(space, reg+7) << 0; | |
| 1016 | r |= (UINT64)lsi53c810_reg_r(&space, reg+7) << 0; | |
| 1029 | 1017 | } |
| 1030 | 1018 | |
| 1031 | 1019 | return r; |
| 1032 | 1020 | } |
| 1033 | 1021 | |
| 1034 | ||
| 1022 | ||
| 1035 | 1023 | { |
| 1036 | 1024 | int reg = offset*8; |
| 1037 | 1025 | if (ACCESSING_BITS_56_63) { |
| 1038 | lsi53c810_reg_w(space, reg+0, data >> 56); | |
| 1026 | lsi53c810_reg_w(&space, reg+0, data >> 56); | |
| 1039 | 1027 | } |
| 1040 | 1028 | if (ACCESSING_BITS_48_55) { |
| 1041 | lsi53c810_reg_w(space, reg+1, data >> 48); | |
| 1029 | lsi53c810_reg_w(&space, reg+1, data >> 48); | |
| 1042 | 1030 | } |
| 1043 | 1031 | if (ACCESSING_BITS_40_47) { |
| 1044 | lsi53c810_reg_w(space, reg+2, data >> 40); | |
| 1032 | lsi53c810_reg_w(&space, reg+2, data >> 40); | |
| 1045 | 1033 | } |
| 1046 | 1034 | if (ACCESSING_BITS_32_39) { |
| 1047 | lsi53c810_reg_w(space, reg+3, data >> 32); | |
| 1035 | lsi53c810_reg_w(&space, reg+3, data >> 32); | |
| 1048 | 1036 | } |
| 1049 | 1037 | if (ACCESSING_BITS_24_31) { |
| 1050 | lsi53c810_reg_w(space, reg+4, data >> 24); | |
| 1038 | lsi53c810_reg_w(&space, reg+4, data >> 24); | |
| 1051 | 1039 | } |
| 1052 | 1040 | if (ACCESSING_BITS_16_23) { |
| 1053 | lsi53c810_reg_w(space, reg+5, data >> 16); | |
| 1041 | lsi53c810_reg_w(&space, reg+5, data >> 16); | |
| 1054 | 1042 | } |
| 1055 | 1043 | if (ACCESSING_BITS_8_15) { |
| 1056 | lsi53c810_reg_w(space, reg+6, data >> 8); | |
| 1044 | lsi53c810_reg_w(&space, reg+6, data >> 8); | |
| 1057 | 1045 | } |
| 1058 | 1046 | if (ACCESSING_BITS_0_7) { |
| 1059 | lsi53c810_reg_w(space, reg+7, data >> 0); | |
| 1047 | lsi53c810_reg_w(&space, reg+7, data >> 0); | |
| 1060 | 1048 | } |
| 1061 | 1049 | } |
| 1062 | 1050 | |
| r14896 | r14897 | |
| 1079 | 1067 | /* Real3D DMA */ |
| 1080 | 1068 | |
| 1081 | 1069 | |
| 1082 | ||
| 1070 | ||
| 1083 | 1071 | { |
| 1084 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1085 | 1072 | switch(offset) |
| 1086 | 1073 | { |
| 1087 | 1074 | case 1: |
| 1088 | return ( | |
| 1075 | return ( | |
| 1089 | 1076 | case 2: |
| 1090 | 1077 | if(ACCESSING_BITS_0_31) { |
| 1091 | return | |
| 1078 | return | |
| 1092 | 1079 | } |
| 1093 | 1080 | break; |
| 1094 | 1081 | } |
| r14896 | r14897 | |
| 1096 | 1083 | return 0; |
| 1097 | 1084 | } |
| 1098 | 1085 | |
| 1099 | ||
| 1086 | ||
| 1100 | 1087 | { |
| 1101 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1102 | 1088 | switch(offset) |
| 1103 | 1089 | { |
| 1104 | 1090 | case 0: |
| 1105 | 1091 | if(ACCESSING_BITS_32_63) { /* DMA source address */ |
| 1106 | | |
| 1092 | | |
| 1107 | 1093 | return; |
| 1108 | 1094 | } |
| 1109 | 1095 | if(ACCESSING_BITS_0_31) { /* DMA destination address */ |
| 1110 | | |
| 1096 | | |
| 1111 | 1097 | return; |
| 1112 | 1098 | } |
| 1113 | 1099 | break; |
| r14896 | r14897 | |
| 1115 | 1101 | if(ACCESSING_BITS_32_63) /* DMA length */ |
| 1116 | 1102 | { |
| 1117 | 1103 | int length = FLIPENDIAN_INT32((UINT32)(data >> 32)) * 4; |
| 1118 | if ( | |
| 1104 | if ( | |
| 1119 | 1105 | { |
| 1120 | real3d_dma_callback( | |
| 1106 | real3d_dma_callback( | |
| 1121 | 1107 | } |
| 1122 | 1108 | else |
| 1123 | 1109 | { |
| 1124 | real3d_dma_callback( | |
| 1110 | real3d_dma_callback( | |
| 1125 | 1111 | } |
| 1126 | state->m_dma_irq |= 0x01; | |
| 1127 | scsi_irq_callback(space->machine(), 1); | |
| 1112 | m_dma_irq |= 0x01; | |
| 1113 | scsi_irq_callback(machine(), 1); | |
| 1128 | 1114 | return; |
| 1129 | 1115 | } |
| 1130 | 1116 | else if(ACCESSING_BITS_16_23) |
| 1131 | 1117 | { |
| 1132 | 1118 | if(data & 0x10000) { |
| 1133 | state->m_dma_irq &= ~0x1; | |
| 1134 | scsi_irq_callback(space->machine(), 0); | |
| 1119 | m_dma_irq &= ~0x1; | |
| 1120 | scsi_irq_callback(machine(), 0); | |
| 1135 | 1121 | } |
| 1136 | 1122 | return; |
| 1137 | 1123 | } |
| 1138 | 1124 | else if(ACCESSING_BITS_8_15) |
| 1139 | 1125 | { |
| 1140 | | |
| 1126 | | |
| 1141 | 1127 | return; |
| 1142 | 1128 | } |
| 1143 | 1129 | break; |
| r14896 | r14897 | |
| 1145 | 1131 | if(ACCESSING_BITS_32_63) { /* DMA command */ |
| 1146 | 1132 | UINT32 cmd = FLIPENDIAN_INT32((UINT32)(data >> 32)); |
| 1147 | 1133 | if(cmd & 0x20000000) { |
| 1148 | | |
| 1134 | | |
| 1149 | 1135 | } |
| 1150 | 1136 | else if(cmd & 0x80000000) { |
| 1151 | state->m_dma_status ^= 0xffffffff; | |
| 1152 | state->m_dma_data = state->m_dma_status; | |
| 1137 | m_dma_status ^= 0xffffffff; | |
| 1138 | m_dma_data = m_dma_status; | |
| 1153 | 1139 | } |
| 1154 | 1140 | return; |
| 1155 | 1141 | } |
| 1156 | 1142 | if(ACCESSING_BITS_0_31) { /* ??? */ |
| 1157 | | |
| 1143 | | |
| 1158 | 1144 | return; |
| 1159 | 1145 | } |
| 1160 | 1146 | return; |
| r14896 | r14897 | |
| 1338 | 1324 | static MACHINE_RESET(model3_21) { model3_init(machine, 0x21); } |
| 1339 | 1325 | |
| 1340 | 1326 | |
| 1341 | ||
| 1327 | ||
| 1342 | 1328 | { |
| 1343 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1344 | 1329 | switch( offset ) |
| 1345 | 1330 | { |
| 1346 | 1331 | case 0: |
| 1347 | 1332 | if (ACCESSING_BITS_56_63) |
| 1348 | 1333 | { |
| 1349 | return (UINT64) | |
| 1334 | return (UINT64) | |
| 1350 | 1335 | } |
| 1351 | 1336 | else if (ACCESSING_BITS_24_31) |
| 1352 | 1337 | { |
| 1353 | if( | |
| 1338 | if( | |
| 1354 | 1339 | { |
| 1355 | return (input_port_read( | |
| 1340 | return (input_port_read( | |
| 1356 | 1341 | } |
| 1357 | 1342 | else |
| 1358 | 1343 | { |
| 1359 | return (input_port_read( | |
| 1344 | return (input_port_read( | |
| 1360 | 1345 | } |
| 1361 | 1346 | } |
| 1362 | 1347 | break; |
| r14896 | r14897 | |
| 1364 | 1349 | case 1: |
| 1365 | 1350 | if (ACCESSING_BITS_56_63) |
| 1366 | 1351 | { |
| 1367 | return (UINT64)input_port_read( | |
| 1352 | return (UINT64)input_port_read( | |
| 1368 | 1353 | } |
| 1369 | 1354 | else if (ACCESSING_BITS_24_31) |
| 1370 | 1355 | { |
| 1371 | return input_port_read( | |
| 1356 | return input_port_read( | |
| 1372 | 1357 | } |
| 1373 | 1358 | break; |
| 1374 | 1359 | |
| r14896 | r14897 | |
| 1384 | 1369 | case 5: |
| 1385 | 1370 | if (ACCESSING_BITS_24_31) /* Serial comm RX FIFO 1 */ |
| 1386 | 1371 | { |
| 1387 | return (UINT64) | |
| 1372 | return (UINT64) | |
| 1388 | 1373 | } |
| 1389 | 1374 | break; |
| 1390 | 1375 | |
| 1391 | 1376 | case 6: |
| 1392 | 1377 | if (ACCESSING_BITS_56_63) /* Serial comm RX FIFO 2 */ |
| 1393 | 1378 | { |
| 1394 | return (UINT64) | |
| 1379 | return (UINT64) | |
| 1395 | 1380 | } |
| 1396 | 1381 | else if (ACCESSING_BITS_24_31) /* Serial comm full/empty flags */ |
| 1397 | 1382 | { |
| r14896 | r14897 | |
| 1403 | 1388 | if (ACCESSING_BITS_24_31) /* ADC Data read */ |
| 1404 | 1389 | { |
| 1405 | 1390 | static const char *const adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" }; |
| 1406 | UINT8 adc_data = input_port_read_safe(space->machine(), adcnames[state->m_adc_channel], 0); | |
| 1407 | state->m_adc_channel++; | |
| 1408 | state->m_adc_channel &= 0x7; | |
| 1391 | UINT8 adc_data = input_port_read_safe(machine(), adcnames[m_adc_channel], 0); | |
| 1392 | m_adc_channel++; | |
| 1393 | m_adc_channel &= 0x7; | |
| 1409 | 1394 | return (UINT64)adc_data << 24; |
| 1410 | 1395 | } |
| 1411 | 1396 | break; |
| r14896 | r14897 | |
| 1415 | 1400 | return 0; |
| 1416 | 1401 | } |
| 1417 | 1402 | |
| 1418 | ||
| 1403 | ||
| 1419 | 1404 | { |
| 1420 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1421 | 1405 | switch(offset) |
| 1422 | 1406 | { |
| 1423 | 1407 | case 0: |
| 1424 | 1408 | if (ACCESSING_BITS_56_63) |
| 1425 | 1409 | { |
| 1426 | eeprom_device *eeprom = | |
| 1410 | eeprom_device *eeprom = | |
| 1427 | 1411 | int reg = (data >> 56) & 0xff; |
| 1428 | 1412 | eeprom->write_bit((reg & 0x20) ? 1 : 0); |
| 1429 | 1413 | eeprom->set_clock_line((reg & 0x80) ? ASSERT_LINE : CLEAR_LINE); |
| 1430 | 1414 | eeprom->set_cs_line((reg & 0x40) ? CLEAR_LINE : ASSERT_LINE); |
| 1431 | | |
| 1415 | | |
| 1432 | 1416 | } |
| 1433 | 1417 | return; |
| 1434 | 1418 | |
| 1435 | 1419 | case 2: |
| 1436 | COMBINE_DATA(& | |
| 1420 | COMBINE_DATA(& | |
| 1437 | 1421 | return; |
| 1438 | 1422 | |
| 1439 | 1423 | case 3: |
| 1440 | COMBINE_DATA(& | |
| 1424 | COMBINE_DATA(& | |
| 1441 | 1425 | return; |
| 1442 | 1426 | |
| 1443 | 1427 | case 4: |
| r14896 | r14897 | |
| 1450 | 1434 | switch(data >> 24) |
| 1451 | 1435 | { |
| 1452 | 1436 | case 0x00: |
| 1453 | | |
| 1437 | | |
| 1454 | 1438 | break; |
| 1455 | 1439 | case 0x87: |
| 1456 | state->m_serial_fifo1 = 0; | |
| 1457 | switch(state->m_lightgun_reg_sel) /* read lightrun register */ | |
| 1440 | m_serial_fifo1 = 0; | |
| 1441 | switch(m_lightgun_reg_sel) /* read lightrun register */ | |
| 1458 | 1442 | { |
| 1459 | 1443 | case 0: /* player 1 gun X-position, lower 8-bits */ |
| 1460 | | |
| 1444 | | |
| 1461 | 1445 | break; |
| 1462 | 1446 | case 1: /* player 1 gun X-position, upper 2-bits */ |
| 1463 | | |
| 1447 | | |
| 1464 | 1448 | break; |
| 1465 | 1449 | case 2: /* player 1 gun Y-position, lower 8-bits */ |
| 1466 | | |
| 1450 | | |
| 1467 | 1451 | break; |
| 1468 | 1452 | case 3: /* player 1 gun Y-position, upper 2-bits */ |
| 1469 | | |
| 1453 | | |
| 1470 | 1454 | break; |
| 1471 | 1455 | case 4: /* player 2 gun X-position, lower 8-bits */ |
| 1472 | | |
| 1456 | | |
| 1473 | 1457 | break; |
| 1474 | 1458 | case 5: /* player 2 gun X-position, upper 2-bits */ |
| 1475 | | |
| 1459 | | |
| 1476 | 1460 | break; |
| 1477 | 1461 | case 6: /* player 2 gun Y-position, lower 8-bits */ |
| 1478 | | |
| 1462 | | |
| 1479 | 1463 | break; |
| 1480 | 1464 | case 7: /* player 2 gun Y-position, upper 2-bits */ |
| 1481 | | |
| 1465 | | |
| 1482 | 1466 | break; |
| 1483 | 1467 | case 8: /* gun offscreen (bit set = gun offscreen, bit clear = gun on screen) */ |
| 1484 | state->m_serial_fifo2 = 0; /* bit 0 = player 1, bit 1 = player 2 */ | |
| 1485 | if(input_port_read(space->machine(), "OFFSCREEN") & 0x1) { | |
| 1486 | state->m_serial_fifo2 |= 0x01; | |
| 1468 | m_serial_fifo2 = 0; /* bit 0 = player 1, bit 1 = player 2 */ | |
| 1469 | if(input_port_read(machine(), "OFFSCREEN") & 0x1) { | |
| 1470 | m_serial_fifo2 |= 0x01; | |
| 1487 | 1471 | } |
| 1488 | 1472 | break; |
| 1489 | 1473 | } |
| 1490 | 1474 | break; |
| 1491 | 1475 | default: |
| 1492 | //mame_printf_debug("Lightgun: Unknown command %02X at %08X\n", (UINT32)(data >> 24), cpu_get_pc(&space | |
| 1476 | //mame_printf_debug("Lightgun: Unknown command %02X at %08X\n", (UINT32)(data >> 24), cpu_get_pc(&space. | |
| 1493 | 1477 | break; |
| 1494 | 1478 | } |
| 1495 | 1479 | } |
| r14896 | r14897 | |
| 1498 | 1482 | case 5: |
| 1499 | 1483 | if (ACCESSING_BITS_56_63) /* Serial comm TX FIFO 2 */ |
| 1500 | 1484 | { |
| 1501 | | |
| 1485 | | |
| 1502 | 1486 | return; |
| 1503 | 1487 | } |
| 1504 | 1488 | break; |
| r14896 | r14897 | |
| 1506 | 1490 | case 7: |
| 1507 | 1491 | if (ACCESSING_BITS_24_31) /* ADC Channel selection */ |
| 1508 | 1492 | { |
| 1509 | | |
| 1493 | | |
| 1510 | 1494 | } |
| 1511 | 1495 | return; |
| 1512 | 1496 | } |
| r14896 | r14897 | |
| 1514 | 1498 | logerror("ctrl_w: %02X, %08X%08X, %08X%08X", offset, (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); |
| 1515 | 1499 | } |
| 1516 | 1500 | |
| 1517 | ||
| 1501 | ||
| 1518 | 1502 | { |
| 1519 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1520 | // printf("model3_sys_r: mask %llx @ %x (PC %x)\n", mem_mask, offset, cpu_get_pc(&space->device())); | |
| 1503 | // printf("model3_sys_r: mask %llx @ %x (PC %x)\n", mem_mask, offset, cpu_get_pc(&space.device())); | |
| 1521 | 1504 | |
| 1522 | 1505 | switch (offset) |
| 1523 | 1506 | { |
| 1524 | 1507 | case 0x08/8: |
| 1525 | 1508 | if (ACCESSING_BITS_56_63) |
| 1526 | 1509 | { |
| 1527 | return ((UINT64) | |
| 1510 | return ((UINT64) | |
| 1528 | 1511 | } |
| 1529 | 1512 | break; |
| 1530 | 1513 | |
| 1531 | 1514 | case 0x10/8: |
| 1532 | 1515 | if (ACCESSING_BITS_56_63) |
| 1533 | 1516 | { |
| 1534 | UINT64 res = model3_tap_read( | |
| 1517 | UINT64 res = model3_tap_read( | |
| 1535 | 1518 | |
| 1536 | 1519 | return res<<61; |
| 1537 | 1520 | } |
| 1538 | 1521 | else if (ACCESSING_BITS_24_31) |
| 1539 | 1522 | { |
| 1540 | return ( | |
| 1523 | return ( | |
| 1541 | 1524 | } |
| 1542 | 1525 | else logerror("m3_sys: Unk sys_r @ 0x10: mask = %x\n", (UINT32)mem_mask); |
| 1543 | 1526 | break; |
| 1544 | 1527 | case 0x18/8: |
| 1545 | // printf("read irq_state %x (PC %x)\n", state->m_irq_state, cpu_get_pc(&space->device())); | |
| 1546 | return (UINT64)state->m_irq_state<<56 | 0xff000000; | |
| 1528 | // printf("read irq_state %x (PC %x)\n", m_irq_state, cpu_get_pc(&space.device())); | |
| 1529 | return (UINT64)m_irq_state<<56 | 0xff000000; | |
| 1547 | 1530 | break; |
| 1548 | 1531 | } |
| 1549 | 1532 | |
| r14896 | r14897 | |
| 1551 | 1534 | return 0; |
| 1552 | 1535 | } |
| 1553 | 1536 | |
| 1554 | ||
| 1537 | ||
| 1555 | 1538 | { |
| 1556 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1557 | 1539 | // printf("model3_sys_w: %llx to %x mask %llx\n", data, offset, mem_mask); |
| 1558 | 1540 | |
| 1559 | 1541 | switch (offset) |
| r14896 | r14897 | |
| 1561 | 1543 | case 0x10/8: |
| 1562 | 1544 | if (ACCESSING_BITS_24_31) |
| 1563 | 1545 | { |
| 1564 | | |
| 1546 | | |
| 1565 | 1547 | } |
| 1566 | 1548 | else logerror("m3_sys: unknown mask on IRQen write\n"); |
| 1567 | 1549 | break; |
| 1568 | 1550 | case 0x18/8: |
| 1569 | 1551 | if ((mem_mask & 0xff000000) == 0xff000000) // int ACK with bits in REVERSE ORDER from the other registers (Seeeee-gaaaa!) |
| 1570 | 1552 | { // may also be a secondary enable based on behavior of e.g. magtruck VBL handler |
| 1571 | // UINT32 old_irq = | |
| 1553 | // UINT32 old_irq = | |
| 1572 | 1554 | UINT8 ack = (data>>24)&0xff, realack; |
| 1573 | 1555 | int i; |
| 1574 | 1556 | |
| r14896 | r14897 | |
| 1590 | 1572 | |
| 1591 | 1573 | // printf("%x to ack (realack %x)\n", ack, realack); |
| 1592 | 1574 | |
| 1593 | | |
| 1575 | | |
| 1594 | 1576 | break; |
| 1595 | 1577 | } |
| 1596 | 1578 | } |
| r14896 | r14897 | |
| 1602 | 1584 | case 0x08/8: |
| 1603 | 1585 | if (ACCESSING_BITS_56_63) |
| 1604 | 1586 | { |
| 1605 | | |
| 1587 | | |
| 1606 | 1588 | |
| 1607 | 1589 | data >>= 56; |
| 1608 | 1590 | data = (~data) & 0x7; |
| 1609 | 1591 | |
| 1610 | memory_set_bankptr( | |
| 1592 | memory_set_bankptr( | |
| 1611 | 1593 | } |
| 1612 | 1594 | if (ACCESSING_BITS_24_31) |
| 1613 | 1595 | { |
| 1614 | 1596 | data >>= 24; |
| 1615 | model3_tap_write( | |
| 1597 | model3_tap_write( | |
| 1616 | 1598 | (data >> 6) & 1,// TCK |
| 1617 | 1599 | (data >> 2) & 1,// TMS |
| 1618 | 1600 | (data >> 5) & 1,// TDI |
| r14896 | r14897 | |
| 1623 | 1605 | } |
| 1624 | 1606 | } |
| 1625 | 1607 | |
| 1626 | ||
| 1608 | ||
| 1627 | 1609 | { |
| 1628 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1629 | 1610 | UINT64 r = 0; |
| 1630 | 1611 | if(ACCESSING_BITS_56_63) { |
| 1631 | r |= (UINT64) | |
| 1612 | r |= (UINT64) | |
| 1632 | 1613 | } |
| 1633 | 1614 | if(ACCESSING_BITS_24_31) { |
| 1634 | r |= (UINT64) | |
| 1615 | r |= (UINT64) | |
| 1635 | 1616 | } |
| 1636 | 1617 | return r; |
| 1637 | 1618 | } |
| 1638 | 1619 | |
| 1639 | ||
| 1620 | ||
| 1640 | 1621 | { |
| 1641 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1642 | 1622 | if(ACCESSING_BITS_56_63) { |
| 1643 | | |
| 1623 | | |
| 1644 | 1624 | } |
| 1645 | 1625 | if(ACCESSING_BITS_24_31) { |
| 1646 | | |
| 1626 | | |
| 1647 | 1627 | } |
| 1648 | 1628 | } |
| 1649 | 1629 | |
| 1650 | ||
| 1630 | ||
| 1651 | 1631 | { |
| 1652 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1653 | state->m_real3d_status ^= U64(0xffffffffffffffff); | |
| 1632 | m_real3d_status ^= U64(0xffffffffffffffff); | |
| 1654 | 1633 | if (offset == 0) |
| 1655 | 1634 | { |
| 1656 | 1635 | /* pretty sure this is VBLANK */ |
| 1657 | state->m_real3d_status &= ~U64(0x0000000200000000); | |
| 1658 | if (space->machine().primary_screen->vblank()) | |
| 1659 | state->m_real3d_status |= U64(0x0000000200000000); | |
| 1660 | return state->m_real3d_status; | |
| 1636 | m_real3d_status &= ~U64(0x0000000200000000); | |
| 1637 | if (machine().primary_screen->vblank()) | |
| 1638 | m_real3d_status |= U64(0x0000000200000000); | |
| 1639 | return m_real3d_status; | |
| 1661 | 1640 | } |
| 1662 | return | |
| 1641 | return | |
| 1663 | 1642 | } |
| 1664 | 1643 | |
| 1665 | 1644 | /* SCSP interface */ |
| 1666 | ||
| 1645 | ||
| 1667 | 1646 | { |
| 1668 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1669 | 1647 | |
| 1670 | 1648 | switch (offset) |
| 1671 | 1649 | { |
| 1672 | 1650 | case 0: |
| 1673 | 1651 | // clear the interrupt |
| 1674 | model3_set_irq_line( | |
| 1652 | model3_set_irq_line( | |
| 1675 | 1653 | |
| 1676 | 1654 | // send to the sound board |
| 1677 | scsp_midi_in( | |
| 1655 | scsp_midi_in( | |
| 1678 | 1656 | |
| 1679 | if ( | |
| 1657 | if ( | |
| 1680 | 1658 | { |
| 1681 | | |
| 1659 | | |
| 1682 | 1660 | } |
| 1683 | 1661 | break; |
| 1684 | 1662 | |
| 1685 | 1663 | case 4: |
| 1686 | 1664 | if (data == 0x27) |
| 1687 | 1665 | { |
| 1688 | state->m_sound_irq_enable = 1; | |
| 1689 | state->m_sound_timer->adjust(attotime::from_msec(1)); | |
| 1666 | m_sound_irq_enable = 1; | |
| 1667 | m_sound_timer->adjust(attotime::from_msec(1)); | |
| 1690 | 1668 | } |
| 1691 | 1669 | else if (data == 0x06) |
| 1692 | 1670 | { |
| 1693 | | |
| 1671 | | |
| 1694 | 1672 | } |
| 1695 | 1673 | break; |
| 1696 | 1674 | } |
| r14896 | r14897 | |
| 1698 | 1676 | |
| 1699 | 1677 | |
| 1700 | 1678 | |
| 1701 | ||
| 1679 | ||
| 1702 | 1680 | { |
| 1703 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1704 | mame_printf_debug("network_r: %02X at %08X\n", offset, cpu_get_pc(&space->device())); | |
| 1705 | return state->m_network_ram[offset]; | |
| 1681 | mame_printf_debug("network_r: %02X at %08X\n", offset, cpu_get_pc(&space.device())); | |
| 1682 | return m_network_ram[offset]; | |
| 1706 | 1683 | } |
| 1707 | 1684 | |
| 1708 | ||
| 1685 | ||
| 1709 | 1686 | { |
| 1710 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1711 | COMBINE_DATA(state->m_network_ram + offset); | |
| 1712 | mame_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), cpu_get_pc(&space->device())); | |
| 1687 | COMBINE_DATA(m_network_ram + offset); | |
| 1688 | mame_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), cpu_get_pc(&space.device())); | |
| 1713 | 1689 | } |
| 1714 | 1690 | |
| 1715 | 1691 | |
| r14896 | r14897 | |
| 1794 | 1770 | discarded). |
| 1795 | 1771 | */ |
| 1796 | 1772 | |
| 1797 | ||
| 1773 | ||
| 1798 | 1774 | { |
| 1799 | model3_state *state = space->machine().driver_data<model3_state>(); | |
| 1800 | 1775 | switch(offset) |
| 1801 | 1776 | { |
| 1802 | 1777 | case 0x00/8: return 0; /* status */ |
| 1803 | 1778 | case 0x1c/8: /* security board data read */ |
| 1804 | 1779 | { |
| 1805 | if (mame_stricmp(space->machine().system().name, "vs299") == 0 || | |
| 1806 | mame_stricmp(space->machine().system().name, "vs2v991") == 0) | |
| 1780 | if (mame_stricmp(machine().system().name, "vs299") == 0 || | |
| 1781 | mame_stricmp(machine().system().name, "vs2v991") == 0) | |
| 1807 | 1782 | { |
| 1808 | return (UINT64)vs299_prot_data[ | |
| 1783 | return (UINT64)vs299_prot_data[ | |
| 1809 | 1784 | } |
| 1810 | else if (mame_stricmp(space->machine().system().name, "swtrilgy") == 0 || | |
| 1811 | mame_stricmp(space->machine().system().name, "swtrilgya") == 0) | |
| 1785 | else if (mame_stricmp(machine().system().name, "swtrilgy") == 0 || | |
| 1786 | mame_stricmp(machine().system().name, "swtrilgya") == 0) | |
| 1812 | 1787 | { |
| 1813 | UINT64 data = (UINT64)swt_prot_data[state->m_prot_data_ptr++] << 16; | |
| 1814 | if (state->m_prot_data_ptr > 0x38) | |
| 1788 | UINT64 data = (UINT64)swt_prot_data[m_prot_data_ptr++] << 16; | |
| 1789 | if (m_prot_data_ptr > 0x38) | |
| 1815 | 1790 | { |
| 1816 | | |
| 1791 | | |
| 1817 | 1792 | } |
| 1818 | 1793 | return data; |
| 1819 | 1794 | } |
| 1820 | else if (mame_stricmp( | |
| 1795 | else if (mame_stricmp( | |
| 1821 | 1796 | { |
| 1822 | UINT64 data = (UINT64)fvipers2_prot_data[state->m_prot_data_ptr++] << 16; | |
| 1823 | if (state->m_prot_data_ptr >= 0x41) | |
| 1797 | UINT64 data = (UINT64)fvipers2_prot_data[m_prot_data_ptr++] << 16; | |
| 1798 | if (m_prot_data_ptr >= 0x41) | |
| 1824 | 1799 | { |
| 1825 | | |
| 1800 | | |
| 1826 | 1801 | } |
| 1827 | 1802 | return data; |
| 1828 | 1803 | } |
| 1829 | else if (mame_stricmp(space->machine().system().name, "spikeout") == 0 || | |
| 1830 | mame_stricmp(space->machine().system().name, "spikeofe") == 0) | |
| 1804 | else if (mame_stricmp(machine().system().name, "spikeout") == 0 || | |
| 1805 | mame_stricmp(machine().system().name, "spikeofe") == 0) | |
| 1831 | 1806 | { |
| 1832 | UINT64 data = (UINT64)spikeout_prot_data[state->m_prot_data_ptr++] << 16; | |
| 1833 | if (state->m_prot_data_ptr >= 0x55) | |
| 1807 | UINT64 data = (UINT64)spikeout_prot_data[m_prot_data_ptr++] << 16; | |
| 1808 | if (m_prot_data_ptr >= 0x55) | |
| 1834 | 1809 | { |
| 1835 | | |
| 1810 | | |
| 1836 | 1811 | } |
| 1837 | 1812 | return data; |
| 1838 | 1813 | } |
| 1839 | else if (mame_stricmp(space->machine().system().name, "eca") == 0 || | |
| 1840 | mame_stricmp(space->machine().system().name, "ecax") == 0) | |
| 1814 | else if (mame_stricmp(machine().system().name, "eca") == 0 || | |
| 1815 | mame_stricmp(machine().system().name, "ecax") == 0) | |
| 1841 | 1816 | { |
| 1842 | UINT64 data = (UINT64)eca_prot_data[state->m_prot_data_ptr++] << 16; | |
| 1843 | if (state->m_prot_data_ptr >= 0x31) | |
| 1817 | UINT64 data = (UINT64)eca_prot_data[m_prot_data_ptr++] << 16; | |
| 1818 | if (m_prot_data_ptr >= 0x31) | |
| 1844 | 1819 | { |
| 1845 | | |
| 1820 | | |
| 1846 | 1821 | } |
| 1847 | 1822 | return data; |
| 1848 | 1823 | } |
| 1849 | else if (mame_stricmp( | |
| 1824 | else if (mame_stricmp( | |
| 1850 | 1825 | { |
| 1851 | UINT64 data = (UINT64)oceanhun_prot_data[state->m_prot_data_ptr++] << 16; | |
| 1852 | if (state->m_prot_data_ptr >= 58) | |
| 1826 | UINT64 data = (UINT64)oceanhun_prot_data[m_prot_data_ptr++] << 16; | |
| 1827 | if (m_prot_data_ptr >= 58) | |
| 1853 | 1828 | { |
| 1854 | | |
| 1829 | | |
| 1855 | 1830 | } |
| 1856 | 1831 | return data; |
| 1857 | 1832 | } |
| r14896 | r14897 | |
| 1864 | 1839 | return U64(0xffffffffffffffff); |
| 1865 | 1840 | } |
| 1866 | 1841 | |
| 1867 | ||
| 1842 | ||
| 1868 | 1843 | { |
| 1869 | 1844 | if (ACCESSING_BITS_56_63) |
| 1870 | 1845 | { |
| 1871 | 1846 | data >>= 56; |
| 1872 | 1847 | data = (~data) & 0xf; |
| 1873 | memory_set_bankptr(space->machine(), "bank1", space->machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */ | |
| 1874 | memory_set_bankptr(space->machine(), "bank2", space->machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */ | |
| 1848 | memory_set_bankptr(machine(), "bank1", machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */ | |
| 1849 | memory_set_bankptr(machine(), "bank2", machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */ | |
| 1875 | 1850 | } |
| 1876 | 1851 | } |
| 1877 | 1852 | |
| 1878 | 1853 | static ADDRESS_MAP_START( model3_mem, AS_PROGRAM, 64, model3_state ) |
| 1879 | 1854 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(m_work_ram) /* work RAM */ |
| 1880 | 1855 | |
| 1881 | AM_RANGE(0x84000000, 0x8400003f) AM_READ | |
| 1856 | AM_RANGE(0x84000000, 0x8400003f) AM_READ | |
| 1882 | 1857 | AM_RANGE(0x88000000, 0x88000007) AM_WRITE(real3d_cmd_w ) |
| 1883 | 1858 | AM_RANGE(0x8e000000, 0x8e0fffff) AM_WRITE(real3d_display_list_w ) |
| 1884 | 1859 | AM_RANGE(0x98000000, 0x980fffff) AM_WRITE(real3d_polygon_ram_w ) |
| 1885 | 1860 | |
| 1886 | AM_RANGE(0xf0040000, 0xf004003f) AM_MIRROR(0x0e000000) AM_READWRITE_LEGACY(model3_ctrl_r, model3_ctrl_w ) | |
| 1887 | AM_RANGE(0xf0080000, 0xf008ffff) AM_MIRROR(0x0e000000) AM_WRITE8_LEGACY(model3_sound_w, U64(0xffffffffffffffff) ) | |
| 1861 | AM_RANGE(0xf0040000, 0xf004003f) AM_MIRROR(0x0e000000) AM_READWRITE(model3_ctrl_r, model3_ctrl_w ) | |
| 1862 | AM_RANGE(0xf0080000, 0xf008ffff) AM_MIRROR(0x0e000000) AM_WRITE8(model3_sound_w, U64(0xffffffffffffffff) ) | |
| 1888 | 1863 | AM_RANGE(0xf00c0000, 0xf00dffff) AM_MIRROR(0x0e000000) AM_RAM AM_SHARE("backup") /* backup SRAM */ |
| 1889 | AM_RANGE(0xf0100000, 0xf010003f) AM_MIRROR(0x0e000000) AM_READWRITE_LEGACY(model3_sys_r, model3_sys_w ) | |
| 1890 | AM_RANGE(0xf0140000, 0xf014003f) AM_MIRROR(0x0e000000) AM_READWRITE_LEGACY(model3_rtc_r, model3_rtc_w ) | |
| 1864 | AM_RANGE(0xf0100000, 0xf010003f) AM_MIRROR(0x0e000000) AM_READWRITE(model3_sys_r, model3_sys_w ) | |
| 1865 | AM_RANGE(0xf0140000, 0xf014003f) AM_MIRROR(0x0e000000) AM_READWRITE(model3_rtc_r, model3_rtc_w ) | |
| 1891 | 1866 | AM_RANGE(0xf0180000, 0xf019ffff) AM_MIRROR(0x0e000000) AM_RAM /* Security Board RAM */ |
| 1892 | AM_RANGE(0xf01a0000, 0xf01a003f) AM_MIRROR(0x0e000000) AM_READ | |
| 1867 | AM_RANGE(0xf01a0000, 0xf01a003f) AM_MIRROR(0x0e000000) AM_READ | |
| 1893 | 1868 | |
| 1894 | 1869 | AM_RANGE(0xf1000000, 0xf10f7fff) AM_READWRITE(model3_char_r, model3_char_w ) /* character RAM */ |
| 1895 | 1870 | AM_RANGE(0xf10f8000, 0xf10fffff) AM_READWRITE(model3_tile_r, model3_tile_w ) /* tilemaps */ |
| r14896 | r14897 | |
| 5066 | 5041 | |
| 5067 | 5042 | /* Model 3 sound board emulation */ |
| 5068 | 5043 | |
| 5069 | ||
| 5044 | ||
| 5070 | 5045 | { |
| 5071 | 5046 | // handle sample banking |
| 5072 | if ( | |
| 5047 | if ( | |
| 5073 | 5048 | { |
| 5074 | UINT8 *snd = | |
| 5049 | UINT8 *snd = | |
| 5075 | 5050 | if (data & 0x20) |
| 5076 | 5051 | { |
| 5077 | memory_set_bankptr(space->machine(), "bank4", snd + 0x200000); | |
| 5078 | memory_set_bankptr(space->machine(), "bank5", snd + 0x600000); | |
| 5052 | memory_set_bankptr(machine(), "bank4", snd + 0x200000); | |
| 5053 | memory_set_bankptr(machine(), "bank5", snd + 0x600000); | |
| 5079 | 5054 | } |
| 5080 | 5055 | else |
| 5081 | 5056 | { |
| 5082 | memory_set_bankptr(space->machine(), "bank4", snd + 0x800000); | |
| 5083 | memory_set_bankptr(space->machine(), "bank5", snd + 0xa00000); | |
| 5057 | memory_set_bankptr(machine(), "bank4", snd + 0x800000); | |
| 5058 | memory_set_bankptr(machine(), "bank5", snd + 0xa00000); | |
| 5084 | 5059 | } |
| 5085 | 5060 | } |
| 5086 | 5061 | } |
| r14896 | r14897 | |
| 5090 | 5065 | AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("scsp1", scsp_r, scsp_w) |
| 5091 | 5066 | AM_RANGE(0x200000, 0x27ffff) AM_RAM AM_REGION("scsp2", 0) |
| 5092 | 5067 | AM_RANGE(0x300000, 0x300fff) AM_DEVREADWRITE_LEGACY("scsp2", scsp_r, scsp_w) |
| 5093 | AM_RANGE(0x400000, 0x400001) AM_WRITE | |
| 5068 | AM_RANGE(0x400000, 0x400001) AM_WRITE | |
| 5094 | 5069 | AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION("audiocpu", 0x80000) |
| 5095 | 5070 | AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION("samples", 0) |
| 5096 | 5071 | AM_RANGE(0xa00000, 0xdfffff) AM_ROMBANK("bank4") |
| r14896 | r14897 | |
| 5355 | 5330 | |
| 5356 | 5331 | static DRIVER_INIT( model3_10 ) |
| 5357 | 5332 | { |
| 5333 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5358 | 5334 | interleave_vroms(machine); |
| 5359 | 5335 | |
| 5360 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5336 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5361 | 5337 | |
| 5362 | 5338 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" ); |
| 5363 | 5339 | |
| 5364 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) ); | |
| 5365 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) ); | |
| 5366 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) ); | |
| 5340 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),state), write64_delegate(FUNC(model3_state::mpc105_addr_w),state)); | |
| 5341 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),state), write64_delegate(FUNC(model3_state::mpc105_data_w),state)); | |
| 5342 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),state), write64_delegate(FUNC(model3_state::mpc105_reg_w),state)); | |
| 5367 | 5343 | } |
| 5368 | 5344 | |
| 5369 | 5345 | static DRIVER_INIT( model3_15 ) |
| 5370 | 5346 | { |
| 5347 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5371 | 5348 | interleave_vroms(machine); |
| 5372 | 5349 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" ); |
| 5373 | 5350 | |
| 5374 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) ); | |
| 5375 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) ); | |
| 5376 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) ); | |
| 5351 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),state), write64_delegate(FUNC(model3_state::mpc105_addr_w),state)); | |
| 5352 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),state), write64_delegate(FUNC(model3_state::mpc105_data_w),state)); | |
| 5353 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),state), write64_delegate(FUNC(model3_state::mpc105_reg_w),state)); | |
| 5377 | 5354 | } |
| 5378 | 5355 | |
| 5379 | 5356 | static DRIVER_INIT( model3_20 ) |
| 5380 | 5357 | { |
| 5358 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5381 | 5359 | interleave_vroms(machine); |
| 5382 | 5360 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" ); |
| 5383 | 5361 | |
| 5384 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5362 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5385 | 5363 | |
| 5386 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) ); | |
| 5387 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) ); | |
| 5388 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) ); | |
| 5364 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),state), write64_delegate(FUNC(model3_state::mpc106_addr_w),state)); | |
| 5365 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),state), write64_delegate(FUNC(model3_state::mpc106_data_w),state)); | |
| 5366 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),state), write64_delegate(FUNC(model3_state::mpc106_reg_w),state)); | |
| 5389 | 5367 | } |
| 5390 | 5368 | |
| 5391 | 5369 | static DRIVER_INIT( lostwsga ) |
| 5392 | 5370 | { |
| 5371 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5393 | 5372 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5394 | 5373 | |
| 5395 | 5374 | DRIVER_INIT_CALL(model3_15); |
| 5396 | 5375 | /* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */ |
| 5397 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5376 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5398 | 5377 | |
| 5399 | 5378 | rom[0x7374f0/4] = 0x38840004; /* This seems to be an actual bug in the original code */ |
| 5400 | 5379 | } |
| 5401 | 5380 | |
| 5402 | 5381 | static DRIVER_INIT( scud ) |
| 5403 | 5382 | { |
| 5383 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5404 | 5384 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5405 | 5385 | |
| 5406 | 5386 | DRIVER_INIT_CALL(model3_15); |
| 5407 | 5387 | /* TODO: network device at 0xC0000000 - FF */ |
| 5408 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5388 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5409 | 5389 | |
| 5410 | 5390 | rom[(0x71275c^4)/4] = 0x60000000; |
| 5411 | 5391 | rom[(0x71277c^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5413 | 5393 | |
| 5414 | 5394 | static DRIVER_INIT( scudp ) |
| 5415 | 5395 | { |
| 5396 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5416 | 5397 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5417 | 5398 | |
| 5418 | 5399 | DRIVER_INIT_CALL(model3_15); |
| 5419 | 5400 | /* TODO: network device at 0xC0000000 - FF */ |
| 5420 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5401 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5421 | 5402 | |
| 5422 | 5403 | rom[(0x713724^4)/4] = 0x60000000; |
| 5423 | 5404 | rom[(0x713744^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5430 | 5411 | |
| 5431 | 5412 | static DRIVER_INIT( lemans24 ) |
| 5432 | 5413 | { |
| 5414 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5433 | 5415 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5434 | 5416 | DRIVER_INIT_CALL(model3_15); |
| 5435 | 5417 | |
| 5436 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5418 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5437 | 5419 | |
| 5438 | 5420 | rom[(0x73fe38^4)/4] = 0x38840004; /* This seems to be an actual bug in the original code */ |
| 5439 | 5421 | |
| r14896 | r14897 | |
| 5457 | 5439 | |
| 5458 | 5440 | static DRIVER_INIT( vs215 ) |
| 5459 | 5441 | { |
| 5442 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5460 | 5443 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5461 | 5444 | |
| 5462 | 5445 | rom[(0x70dde0^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5466 | 5449 | interleave_vroms(machine); |
| 5467 | 5450 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" ); |
| 5468 | 5451 | |
| 5469 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5452 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5470 | 5453 | |
| 5471 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) ); | |
| 5472 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) ); | |
| 5473 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) ); | |
| 5474 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) ); | |
| 5475 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) ); | |
| 5454 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),state), write64_delegate(FUNC(model3_state::mpc106_addr_w),state)); | |
| 5455 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),state), write64_delegate(FUNC(model3_state::mpc106_addr_w),state)); | |
| 5456 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),state), write64_delegate(FUNC(model3_state::mpc106_data_w),state)); | |
| 5457 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),state), write64_delegate(FUNC(model3_state::mpc106_data_w),state)); | |
| 5458 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),state), write64_delegate(FUNC(model3_state::mpc106_reg_w),state)); | |
| 5476 | 5459 | } |
| 5477 | 5460 | |
| 5478 | 5461 | static DRIVER_INIT( vs29815 ) |
| 5479 | 5462 | { |
| 5463 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5480 | 5464 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5481 | 5465 | |
| 5482 | 5466 | rom[(0x6028ec^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5485 | 5469 | interleave_vroms(machine); |
| 5486 | 5470 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" ); |
| 5487 | 5471 | |
| 5488 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5472 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5489 | 5473 | |
| 5490 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) ); | |
| 5491 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) ); | |
| 5492 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) ); | |
| 5493 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) ); | |
| 5494 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) ); | |
| 5474 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),state), write64_delegate(FUNC(model3_state::mpc106_addr_w),state)); | |
| 5475 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),state), write64_delegate(FUNC(model3_state::mpc106_addr_w),state)); | |
| 5476 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),state), write64_delegate(FUNC(model3_state::mpc106_data_w),state)); | |
| 5477 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),state), write64_delegate(FUNC(model3_state::mpc106_data_w),state)); | |
| 5478 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),state), write64_delegate(FUNC(model3_state::mpc106_reg_w),state)); | |
| 5495 | 5479 | } |
| 5496 | 5480 | |
| 5497 | 5481 | static DRIVER_INIT( bass ) |
| 5498 | 5482 | { |
| 5483 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5499 | 5484 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5500 | 5485 | |
| 5501 | 5486 | rom[(0x7999a8^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5504 | 5489 | interleave_vroms(machine); |
| 5505 | 5490 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" ); |
| 5506 | 5491 | |
| 5507 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5492 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5508 | 5493 | |
| 5509 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) ); | |
| 5510 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) ); | |
| 5511 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) ); | |
| 5512 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) ); | |
| 5513 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) ); | |
| 5494 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc106_addr_r),state), write64_delegate(FUNC(model3_state::mpc106_addr_w),state)); | |
| 5495 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfec00000, 0xfedfffff, read64_delegate(FUNC(model3_state::mpc106_addr_r),state), write64_delegate(FUNC(model3_state::mpc106_addr_w),state)); | |
| 5496 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc106_data_r),state), write64_delegate(FUNC(model3_state::mpc106_data_w),state)); | |
| 5497 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xfee00000, 0xfeffffff, read64_delegate(FUNC(model3_state::mpc106_data_r),state), write64_delegate(FUNC(model3_state::mpc106_data_w),state)); | |
| 5498 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc106_reg_r),state), write64_delegate(FUNC(model3_state::mpc106_reg_w),state)); | |
| 5514 | 5499 | } |
| 5515 | 5500 | |
| 5516 | 5501 | static DRIVER_INIT( getbass ) |
| 5517 | 5502 | { |
| 5503 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5518 | 5504 | interleave_vroms(machine); |
| 5519 | 5505 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" ); |
| 5520 | 5506 | |
| 5521 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5507 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5522 | 5508 | |
| 5523 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) ); | |
| 5524 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) ); | |
| 5525 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) ); | |
| 5509 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0800cf8, 0xf0800cff, read64_delegate(FUNC(model3_state::mpc105_addr_r),state), write64_delegate(FUNC(model3_state::mpc105_addr_w),state)); | |
| 5510 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf0c00cf8, 0xf0c00cff, read64_delegate(FUNC(model3_state::mpc105_data_r),state), write64_delegate(FUNC(model3_state::mpc105_data_w),state)); | |
| 5511 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0xf8fff000, 0xf8fff0ff, read64_delegate(FUNC(model3_state::mpc105_reg_r),state), write64_delegate(FUNC(model3_state::mpc105_reg_w),state)); | |
| 5526 | 5512 | } |
| 5527 | 5513 | |
| 5528 | 5514 | static DRIVER_INIT( vs2 ) |
| r14896 | r14897 | |
| 5593 | 5579 | DRIVER_INIT_CALL(model3_20); |
| 5594 | 5580 | |
| 5595 | 5581 | state->m_network_ram = auto_alloc_array_clear(machine, UINT64, 0x10000); |
| 5596 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5582 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5597 | 5583 | |
| 5598 | 5584 | rom[(0x50e8d4^4)/4] = 0x60000000; |
| 5599 | 5585 | rom[(0x50e8f4^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5609 | 5595 | DRIVER_INIT_CALL(model3_20); |
| 5610 | 5596 | |
| 5611 | 5597 | state->m_network_ram = auto_alloc_array_clear(machine, UINT64, 0x10000); |
| 5612 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5598 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5613 | 5599 | |
| 5614 | 5600 | //rom[(0x50e8d4^4)/4] = 0x60000000; |
| 5615 | 5601 | //rom[(0x50e8f4^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5675 | 5661 | |
| 5676 | 5662 | static DRIVER_INIT( daytona2 ) |
| 5677 | 5663 | { |
| 5664 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5678 | 5665 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5679 | 5666 | DRIVER_INIT_CALL(model3_20); |
| 5680 | 5667 | |
| 5681 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5668 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5682 | 5669 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); |
| 5683 | 5670 | |
| 5684 | 5671 | //rom[(0x68468c^4)/4] = 0x60000000; |
| r14896 | r14897 | |
| 5689 | 5676 | |
| 5690 | 5677 | static DRIVER_INIT( dayto2pe ) |
| 5691 | 5678 | { |
| 5679 | model3_state *state = machine.driver_data<model3_state>(); | |
| 5692 | 5680 | UINT32 *rom = (UINT32*)machine.region("user1")->base(); |
| 5693 | 5681 | DRIVER_INIT_CALL(model3_20); |
| 5694 | 5682 | |
| 5695 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5683 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 5696 | 5684 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); |
| 5697 | 5685 | |
| 5698 | 5686 | rom[(0x606784^4)/4] = 0x60000000; |
| r14896 | r14897 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | static ADDRESS_MAP_START( main_portmap, AS_IO, 8, iqblock_state ) |
| 134 | AM_RANGE(0x2000, 0x23ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) | |
| 135 | AM_RANGE(0x2800, 0x2bff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) | |
| 134 | AM_RANGE(0x2000, 0x23ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w) | |
| 135 | AM_RANGE(0x2800, 0x2bff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w) | |
| 136 | 136 | AM_RANGE(0x6000, 0x603f) AM_WRITE(iqblock_fgscroll_w) |
| 137 | 137 | AM_RANGE(0x6800, 0x69ff) AM_WRITE(iqblock_fgvideoram_w) /* initialized up to 6fff... bug or larger tilemap? */ |
| 138 | 138 | AM_RANGE(0x7000, 0x7fff) AM_WRITE(iqblock_bgvideoram_w) |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | { |
| 51 | 51 | public: |
| 52 | 52 | cb2001_state(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | : driver_device(mconfig, type, tag) { } | |
| 53 | : driver_device(mconfig, type, tag) , | |
| 54 | m_vram_fg(*this, "vrafg"), | |
| 55 | m_vram_bg(*this, "vrabg"){ } | |
| 54 | 56 | |
| 55 | UINT16 *m_vram_fg; | |
| 56 | UINT16* m_vram_bg; | |
| 57 | required_shared_ptr<UINT16> m_vram_fg; | |
| 58 | required_shared_ptr<UINT16> m_vram_bg; | |
| 57 | 59 | int m_videobank; |
| 58 | 60 | int m_videomode; |
| 59 | 61 | tilemap_t *m_reel1_tilemap; |
| r14896 | r14897 | |
| 61 | 63 | tilemap_t *m_reel3_tilemap; |
| 62 | 64 | int m_other1; |
| 63 | 65 | int m_other2; |
| 66 | DECLARE_WRITE16_MEMBER(cb2001_vidctrl_w); | |
| 67 | DECLARE_WRITE16_MEMBER(cb2001_vidctrl2_w); | |
| 68 | DECLARE_WRITE16_MEMBER(cb2001_bg_w); | |
| 64 | 69 | }; |
| 65 | 70 | |
| 66 | 71 | |
| r14896 | r14897 | |
| 341 | 346 | int tile; |
| 342 | 347 | int colour; |
| 343 | 348 | |
| 344 | tile = (state->m_vram_bg[count] & 0x0fff); | |
| 345 | colour = (state->m_vram_bg[count] & 0xf000)>>12; | |
| 349 | tile = (state->m_vram_bg.target()[count] & 0x0fff); | |
| 350 | colour = (state->m_vram_bg.target()[count] & 0xf000)>>12; | |
| 346 | 351 | tile += state->m_videobank*0x2000; |
| 347 | 352 | |
| 348 | 353 | |
| r14896 | r14897 | |
| 360 | 365 | { |
| 361 | 366 | UINT16 scroll; |
| 362 | 367 | |
| 363 | scroll = state->m_vram_bg[0xa00/2 + i/2]; | |
| 368 | scroll = state->m_vram_bg.target()[0xa00/2 + i/2]; | |
| 364 | 369 | if (i&1) |
| 365 | 370 | scroll >>=8; |
| 366 | 371 | scroll &=0xff; |
| 367 | 372 | |
| 368 | 373 | state->m_reel2_tilemap->set_scrolly(i, scroll); |
| 369 | 374 | |
| 370 | scroll = state->m_vram_bg[0x800/2 + i/2]; | |
| 375 | scroll = state->m_vram_bg.target()[0x800/2 + i/2]; | |
| 371 | 376 | if (i&1) |
| 372 | 377 | scroll >>=8; |
| 373 | 378 | scroll &=0xff; |
| 374 | 379 | |
| 375 | 380 | state->m_reel1_tilemap->set_scrolly(i, scroll); |
| 376 | 381 | |
| 377 | scroll = state->m_vram_bg[0xc00/2 + i/2]; | |
| 382 | scroll = state->m_vram_bg.target()[0xc00/2 + i/2]; | |
| 378 | 383 | if (i&1) |
| 379 | 384 | scroll >>=8; |
| 380 | 385 | scroll &=0xff; |
| r14896 | r14897 | |
| 403 | 408 | int tile; |
| 404 | 409 | int colour; |
| 405 | 410 | |
| 406 | tile = (state->m_vram_fg[count] & 0x0fff); | |
| 407 | colour = (state->m_vram_fg[count] & 0xf000)>>12; | |
| 411 | tile = (state->m_vram_fg.target()[count] & 0x0fff); | |
| 412 | colour = (state->m_vram_fg.target()[count] & 0xf000)>>12; | |
| 408 | 413 | tile += state->m_videobank*0x2000; |
| 409 | 414 | |
| 410 | 415 | if (state->m_other2 & 0x4) |
| r14896 | r14897 | |
| 426 | 431 | /* these ports sometimes get written with similar values |
| 427 | 432 | - they could be hooked up wrong, or subject to change it the code |
| 428 | 433 | is being executed incorrectly */ |
| 429 | WRITE16_ | |
| 434 | WRITE16_M | |
| 430 | 435 | { |
| 431 | cb2001_state *state = space->machine().driver_data<cb2001_state>(); | |
| 432 | 436 | if (mem_mask&0xff00) // video control? |
| 433 | 437 | { |
| 434 | 438 | printf("cb2001_vidctrl_w %04x %04x\n", data, mem_mask); |
| 435 | | |
| 439 | | |
| 436 | 440 | } |
| 437 | 441 | else // something else |
| 438 | | |
| 442 | | |
| 439 | 443 | } |
| 440 | 444 | |
| 441 | WRITE16_ | |
| 445 | WRITE16_M | |
| 442 | 446 | { |
| 443 | cb2001_state *state = space->machine().driver_data<cb2001_state>(); | |
| 444 | 447 | if (mem_mask&0xff00) // video control? |
| 445 | 448 | { |
| 446 | 449 | printf("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // i think this switches to 'reels' mode |
| 447 | | |
| 450 | | |
| 448 | 451 | } |
| 449 | 452 | else // something else |
| 450 | | |
| 453 | | |
| 451 | 454 | |
| 452 | 455 | // printf("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // bank could be here instead |
| 453 | 456 | } |
| r14896 | r14897 | |
| 456 | 459 | static TILE_GET_INFO( get_cb2001_reel1_tile_info ) |
| 457 | 460 | { |
| 458 | 461 | cb2001_state *state = machine.driver_data<cb2001_state>(); |
| 459 | int code = state->m_vram_bg[(0x0000/2) + tile_index/2]; | |
| 462 | int code = state->m_vram_bg.target()[(0x0000/2) + tile_index/2]; | |
| 460 | 463 | |
| 461 | 464 | if (tile_index&1) |
| 462 | 465 | code >>=8; |
| r14896 | r14897 | |
| 475 | 478 | static TILE_GET_INFO( get_cb2001_reel2_tile_info ) |
| 476 | 479 | { |
| 477 | 480 | cb2001_state *state = machine.driver_data<cb2001_state>(); |
| 478 | int code = state->m_vram_bg[(0x0200/2) + tile_index/2]; | |
| 481 | int code = state->m_vram_bg.target()[(0x0200/2) + tile_index/2]; | |
| 479 | 482 | |
| 480 | 483 | if (tile_index&1) |
| 481 | 484 | code >>=8; |
| r14896 | r14897 | |
| 495 | 498 | static TILE_GET_INFO( get_cb2001_reel3_tile_info ) |
| 496 | 499 | { |
| 497 | 500 | cb2001_state *state = machine.driver_data<cb2001_state>(); |
| 498 | int code = state->m_vram_bg[(0x0400/2) + tile_index/2]; | |
| 501 | int code = state->m_vram_bg.target()[(0x0400/2) + tile_index/2]; | |
| 499 | 502 | int colour = 0;//(cb2001_out_c&0x7) + 8; |
| 500 | 503 | |
| 501 | 504 | if (tile_index&1) |
| r14896 | r14897 | |
| 523 | 526 | state->m_reel3_tilemap->set_scroll_cols(64); |
| 524 | 527 | } |
| 525 | 528 | |
| 526 | WRITE16_ | |
| 529 | WRITE16_M | |
| 527 | 530 | { |
| 528 | cb2001_state *state = space->machine().driver_data<cb2001_state>(); | |
| 529 | COMBINE_DATA(&state->m_vram_bg[offset]); | |
| 531 | COMBINE_DATA(&m_vram_bg.target()[offset]); | |
| 530 | 532 | |
| 531 | 533 | // also used for the reel tilemaps in a different mode |
| 532 | 534 | /* |
| 533 | 535 | if (offset<0x200/2) |
| 534 | 536 | { |
| 535 | | |
| 537 | | |
| 536 | 538 | } |
| 537 | 539 | else if (offset<0x400/2) |
| 538 | 540 | { |
| 539 | | |
| 541 | | |
| 540 | 542 | } |
| 541 | 543 | else if (offset<0x600/2) |
| 542 | 544 | { |
| 543 | | |
| 545 | | |
| 544 | 546 | } |
| 545 | 547 | else if (offset<0x800/2) |
| 546 | 548 | { |
| 547 | 549 | // reel4_tilemap->mark_tile_dirty((offset&0xff)/2); |
| 548 | 550 | } |
| 549 | 551 | */ |
| 550 | state->m_reel1_tilemap->mark_all_dirty(); | |
| 551 | state->m_reel2_tilemap->mark_all_dirty(); | |
| 552 | state->m_reel3_tilemap->mark_all_dirty(); | |
| 552 | m_reel1_tilemap->mark_all_dirty(); | |
| 553 | m_reel2_tilemap->mark_all_dirty(); | |
| 554 | m_reel3_tilemap->mark_all_dirty(); | |
| 553 | 555 | |
| 554 | 556 | |
| 555 | 557 | } |
| 556 | 558 | |
| 557 | 559 | static ADDRESS_MAP_START( cb2001_map, AS_PROGRAM, 16, cb2001_state ) |
| 558 | 560 | AM_RANGE(0x00000, 0x1ffff) AM_RAM |
| 559 | AM_RANGE(0x20000, 0x20fff) AM_RAM AM_BASE(m_vram_fg) | |
| 560 | AM_RANGE(0x21000, 0x21fff) AM_RAM_WRITE_LEGACY(&cb2001_bg_w) AM_BASE(m_vram_bg) | |
| 561 | AM_RANGE(0x20000, 0x20fff) AM_RAM AM_SHARE("vrafg") | |
| 562 | AM_RANGE(0x21000, 0x21fff) AM_RAM_WRITE(cb2001_bg_w) AM_SHARE("vrabg") | |
| 561 | 563 | AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0) |
| 562 | 564 | ADDRESS_MAP_END |
| 563 | 565 | |
| r14896 | r14897 | |
| 567 | 569 | AM_RANGE(0x20, 0x21) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0xff00) |
| 568 | 570 | AM_RANGE(0x22, 0x23) AM_DEVWRITE8_LEGACY("aysnd", ay8910_data_address_w, 0xffff) |
| 569 | 571 | |
| 570 | AM_RANGE(0x30, 0x31) AM_WRITE_LEGACY(cb2001_vidctrl_w) | |
| 571 | AM_RANGE(0x32, 0x33) AM_WRITE_LEGACY(cb2001_vidctrl2_w) | |
| 572 | AM_RANGE(0x30, 0x31) AM_WRITE(cb2001_vidctrl_w) | |
| 573 | AM_RANGE(0x32, 0x33) AM_WRITE(cb2001_vidctrl2_w) | |
| 572 | 574 | ADDRESS_MAP_END |
| 573 | 575 | |
| 574 | 576 | static INPUT_PORTS_START( cb2001 ) |
| r14896 | r14897 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | static ADDRESS_MAP_START( funkyjet_map, AS_PROGRAM, 16, funkyjet_state ) |
| 104 | 104 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 105 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(paletteram | |
| 105 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(paletteram | |
| 106 | 106 | AM_RANGE(0x140000, 0x143fff) AM_RAM |
| 107 | 107 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 108 | 108 | AM_RANGE(0x180000, 0x1807ff) AM_READWRITE_LEGACY(deco16_146_funkyjet_prot_r, deco16_146_funkyjet_prot_w) AM_BASE_LEGACY(&deco16_prot_ram) |
| r14896 | r14897 | |
| 124 | 124 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 125 | 125 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 126 | 126 | AM_RANGE(0x130000, 0x130001) AM_NOP /* This board only has 1 oki chip */ |
| 127 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 127 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 128 | 128 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 129 | 129 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 130 | 130 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 211 | 211 | { |
| 212 | 212 | // anyone knows why 0x1a keeps lurking the sound queue in the world version??? |
| 213 | 213 | if (m_strip_0x1a) |
| 214 | if (soundlatch2_r(space, 0) == 1 && data == 0x1a) | |
| 214 | if (soundlatch2_byte_r(space, 0) == 1 && data == 0x1a) | |
| 215 | 215 | return; |
| 216 | 216 | |
| 217 | soundlatch_w(space, 0, data & 0xff); | |
| 217 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | WRITE16_MEMBER(xexex_state::sound_cmd2_w) |
| 222 | 222 | { |
| 223 | 223 | if (ACCESSING_BITS_0_7) |
| 224 | soundlatch2_w(space, 0, data & 0xff); | |
| 224 | soundlatch2_byte_w(space, 0, data & 0xff); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | WRITE16_MEMBER(xexex_state::sound_irq_w) |
| r14896 | r14897 | |
| 231 | 231 | |
| 232 | 232 | READ16_MEMBER(xexex_state::sound_status_r) |
| 233 | 233 | { |
| 234 | return soundlatch3_r(space, 0); | |
| 234 | return soundlatch3_byte_r(space, 0); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | static void reset_sound_region(running_machine &machine) |
| r14896 | r14897 | |
| 346 | 346 | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) |
| 347 | 347 | AM_RANGE(0x190000, 0x191fff) AM_DEVREAD_LEGACY("k056832", k056832_rom_word_r) // Passthrough to tile roms |
| 348 | 348 | AM_RANGE(0x1a0000, 0x1a1fff) AM_DEVREAD("k053250", k053250_t, rom_r) |
| 349 | AM_RANGE(0x1b0000, 0x1b1fff) AM_RAM_WRITE(paletteram | |
| 349 | AM_RANGE(0x1b0000, 0x1b1fff) AM_RAM_WRITE(paletteram | |
| 350 | 350 | |
| 351 | 351 | #if XE_DEBUG |
| 352 | 352 | AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD_LEGACY("k056832", k056832_word_r) |
| r14896 | r14897 | |
| 365 | 365 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 366 | 366 | AM_RANGE(0xe000, 0xe22f) AM_DEVREADWRITE("k054539", k054539_device, read, write) |
| 367 | 367 | AM_RANGE(0xec00, 0xec01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 368 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_w) | |
| 369 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 370 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 368 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_byte_w) | |
| 369 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r) | |
| 370 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_byte_r) | |
| 371 | 371 | AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w) |
| 372 | 372 | ADDRESS_MAP_END |
| 373 | 373 |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | public: |
| 59 | 59 | wallc_state(const machine_config &mconfig, device_type type, const char *tag) |
| 60 | : driver_device(mconfig, type, tag) { } | |
| 60 | : driver_device(mconfig, type, tag) , | |
| 61 | m_videoram(*this, "videoram"){ } | |
| 61 | 62 | |
| 62 | UINT8 | |
| 63 | required_shared_ptr<UINT8> | |
| 63 | 64 | tilemap_t *m_bg_tilemap; |
| 64 | 65 | DECLARE_WRITE8_MEMBER(wallc_videoram_w); |
| 65 | 66 | DECLARE_WRITE8_MEMBER(wallc_coin_counter_w); |
| r14896 | r14897 | |
| 130 | 131 | |
| 131 | 132 | WRITE8_MEMBER(wallc_state::wallc_videoram_w) |
| 132 | 133 | { |
| 133 | UINT8 *videoram = m_videoram; | |
| 134 | UINT8 *videoram = m_videoram.target(); | |
| 134 | 135 | videoram[offset] = data; |
| 135 | 136 | m_bg_tilemap->mark_tile_dirty(offset); |
| 136 | 137 | } |
| r14896 | r14897 | |
| 138 | 139 | static TILE_GET_INFO( get_bg_tile_info ) |
| 139 | 140 | { |
| 140 | 141 | wallc_state *state = machine.driver_data<wallc_state>(); |
| 141 | UINT8 *videoram = state->m_videoram; | |
| 142 | UINT8 *videoram = state->m_videoram.target(); | |
| 142 | 143 | SET_TILE_INFO(0, videoram[tile_index] + 0x100, 1, 0); |
| 143 | 144 | } |
| 144 | 145 | |
| r14896 | r14897 | |
| 162 | 163 | |
| 163 | 164 | static ADDRESS_MAP_START( wallc_map, AS_PROGRAM, 8, wallc_state ) |
| 164 | 165 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 165 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(wallc_videoram_w) AM_MIRROR(0xc00) AM_ | |
| 166 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(wallc_videoram_w) AM_MIRROR(0xc00) AM_ | |
| 166 | 167 | AM_RANGE(0xa000, 0xa3ff) AM_RAM /* 2114, 2114 */ |
| 167 | 168 | |
| 168 | 169 | AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
|---|---|---|
| 64 | 64 | AM_RANGE(0x0020, 0x003f) AM_RAM AM_BASE(m_scroll) |
| 65 | 65 | AM_RANGE(0x0040, 0x005f) AM_RAM |
| 66 | 66 | AM_RANGE(0x0060, 0x00df) AM_RAM |
| 67 | AM_RANGE(0x0800, 0x0800) AM_WRITE(soundlatch_w) | |
| 67 | AM_RANGE(0x0800, 0x0800) AM_WRITE(soundlatch_byte_w) | |
| 68 | 68 | AM_RANGE(0x0900, 0x0900) AM_READ_PORT("DSW3") AM_WRITE(ironhors_sh_irqtrigger_w) |
| 69 | 69 | AM_RANGE(0x0a00, 0x0a00) AM_READ_PORT("DSW2") AM_WRITE(ironhors_palettebank_w) |
| 70 | 70 | AM_RANGE(0x0b00, 0x0b00) AM_READ_PORT("DSW1") AM_WRITE(ironhors_flipscreen_w) |
| r14896 | r14897 | |
| 87 | 87 | static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 8, ironhors_state ) |
| 88 | 88 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 89 | 89 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 90 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) | |
| 90 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) | |
| 91 | 91 | ADDRESS_MAP_END |
| 92 | 92 | |
| 93 | 93 | static ADDRESS_MAP_START( slave_io_map, AS_IO, 8, ironhors_state ) |
| r14896 | r14897 | |
| 103 | 103 | AM_RANGE(0x31db, 0x31fa) AM_RAM AM_BASE(m_scroll) |
| 104 | 104 | AM_RANGE(0x0040, 0x005f) AM_RAM |
| 105 | 105 | AM_RANGE(0x0060, 0x00ff) AM_RAM |
| 106 | AM_RANGE(0x0800, 0x0800) AM_WRITE(soundlatch_w) | |
| 106 | AM_RANGE(0x0800, 0x0800) AM_WRITE(soundlatch_byte_w) | |
| 107 | 107 | AM_RANGE(0x0900, 0x0900) /*AM_READ_PORT("DSW3") */AM_WRITE(ironhors_sh_irqtrigger_w) |
| 108 | 108 | AM_RANGE(0x0a00, 0x0a00) AM_READ_PORT("DSW2") //AM_WRITE(ironhors_palettebank_w) |
| 109 | 109 | AM_RANGE(0x0b00, 0x0b00) AM_READ_PORT("DSW1") AM_WRITE(ironhors_flipscreen_w) |
| r14896 | r14897 | |
| 442 | 442 | { |
| 443 | 443 | ironhors_state *state = device->machine().driver_data<ironhors_state>(); |
| 444 | 444 | |
| 445 | return state->soundlatch_r(*state->m_soundcpu->memory().space(AS_PROGRAM), 0); | |
| 445 | return state->soundlatch_byte_r(*state->m_soundcpu->memory().space(AS_PROGRAM), 0); | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | static const ym2203_interface farwest_ym2203_config = |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | { |
| 102 | 102 | public: |
| 103 | 103 | marinedt_state(const machine_config &mconfig, device_type type, const char *tag) |
| 104 | : driver_device(mconfig, type, tag) { } | |
| 104 | : driver_device(mconfig, type, tag) , | |
| 105 | m_tx_tileram(*this, "tx_tileram"){ } | |
| 105 | 106 | |
| 106 | 107 | /* memory pointers */ |
| 107 | UINT8 | |
| 108 | required_shared_ptr<UINT8> | |
| 108 | 109 | |
| 109 | 110 | /* video-related */ |
| 110 | 111 | bitmap_ind16 *m_tile; |
| r14896 | r14897 | |
| 152 | 153 | WRITE8_MEMBER(marinedt_state::tx_tileram_w) |
| 153 | 154 | { |
| 154 | 155 | |
| 155 | m_tx_tileram[offset] = data; | |
| 156 | m_tx_tileram.target()[offset] = data; | |
| 156 | 157 | m_tx_tilemap->mark_tile_dirty(offset); |
| 157 | 158 | } |
| 158 | 159 | |
| r14896 | r14897 | |
| 311 | 312 | AM_RANGE(0x0000, 0x37ff) AM_ROM |
| 312 | 313 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 313 | 314 | AM_RANGE(0x4400, 0x47ff) AM_RAM //unused, vram mirror? |
| 314 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(tx_tileram_w) AM_ | |
| 315 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(tx_tileram_w) AM_ | |
| 315 | 316 | AM_RANGE(0x4c00, 0x4c00) AM_WRITENOP //?? maybe off by one error |
| 316 | 317 | ADDRESS_MAP_END |
| 317 | 318 | |
| r14896 | r14897 | |
| 478 | 479 | static TILE_GET_INFO( get_tile_info ) |
| 479 | 480 | { |
| 480 | 481 | marinedt_state *state = machine.driver_data<marinedt_state>(); |
| 481 | int code = state->m_tx_tileram[tile_index]; | |
| 482 | int code = state->m_tx_tileram.target()[tile_index]; | |
| 482 | 483 | int color = 0; |
| 483 | 484 | int flags = TILE_FLIPX; |
| 484 | 485 |
| r14896 | r14897 | |
|---|---|---|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | ||
| 68 | ||
| 69 | 69 | { |
| 70 | atarigen_halt_until_hblank_0(* | |
| 70 | atarigen_halt_until_hblank_0(* | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| r14896 | r14897 | |
| 95 | 95 | * |
| 96 | 96 | *************************************/ |
| 97 | 97 | |
| 98 | ||
| 98 | ||
| 99 | 99 | { |
| 100 | skullxbo_state *state = space->machine().driver_data<skullxbo_state>(); | |
| 101 | int temp = input_port_read(space->machine(), "FF5802"); | |
| 102 | if (state->m_cpu_to_sound_ready) temp ^= 0x0040; | |
| 103 | if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0010; | |
| 100 | int temp = input_port_read(machine(), "FF5802"); | |
| 101 | if (m_cpu_to_sound_ready) temp ^= 0x0040; | |
| 102 | if (atarigen_get_hblank(*machine().primary_screen)) temp ^= 0x0010; | |
| 104 | 103 | return temp; |
| 105 | 104 | } |
| 106 | 105 | |
| r14896 | r14897 | |
| 112 | 111 | * |
| 113 | 112 | *************************************/ |
| 114 | 113 | |
| 115 | ||
| 114 | ||
| 116 | 115 | { |
| 117 | 116 | logerror("MOBWR[%02X] = %04X\n", offset, data); |
| 118 | 117 | } |
| r14896 | r14897 | |
| 128 | 127 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, skullxbo_state ) |
| 129 | 128 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 130 | 129 | AM_RANGE(0xff0000, 0xff07ff) AM_WRITE_LEGACY(skullxbo_mobmsb_w) |
| 131 | AM_RANGE(0xff0800, 0xff0bff) AM_WRITE | |
| 130 | AM_RANGE(0xff0800, 0xff0bff) AM_WRITE | |
| 132 | 131 | AM_RANGE(0xff0c00, 0xff0fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 133 | 132 | AM_RANGE(0xff1000, 0xff13ff) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 134 | 133 | AM_RANGE(0xff1400, 0xff17ff) AM_WRITE_LEGACY(atarigen_sound_w) |
| r14896 | r14897 | |
| 143 | 142 | AM_RANGE(0xff1f80, 0xff1fff) AM_WRITE(watchdog_reset16_w) |
| 144 | 143 | AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 145 | 144 | AM_RANGE(0xff4000, 0xff47ff) AM_WRITE_LEGACY(skullxbo_yscroll_w) AM_BASE(m_yscroll) |
| 146 | AM_RANGE(0xff4800, 0xff4fff) AM_WRITE | |
| 145 | AM_RANGE(0xff4800, 0xff4fff) AM_WRITE | |
| 147 | 146 | AM_RANGE(0xff6000, 0xff6fff) AM_WRITE_LEGACY(atarigen_eeprom_w) AM_SHARE("eeprom") |
| 148 | 147 | AM_RANGE(0xff5000, 0xff5001) AM_READ_LEGACY(atarigen_sound_r) |
| 149 | 148 | AM_RANGE(0xff5800, 0xff5801) AM_READ_PORT("FF5800") |
| 150 | AM_RANGE(0xff5802, 0xff5803) AM_READ | |
| 149 | AM_RANGE(0xff5802, 0xff5803) AM_READ | |
| 151 | 150 | AM_RANGE(0xff6000, 0xff6fff) AM_READ_LEGACY(atarigen_eeprom_r) |
| 152 | 151 | AM_RANGE(0xff8000, 0xff9fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_latched_lsb_w) AM_BASE(m_playfield) |
| 153 | 152 | AM_RANGE(0xffa000, 0xffbfff) AM_RAM_WRITE_LEGACY(atarigen_playfield_upper_w) AM_BASE(m_playfield_upper) |
| r14896 | r14897 | |
|---|---|---|
| 81 | 81 | public: |
| 82 | 82 | sliver_state(const machine_config &mconfig, device_type type, const char *tag) |
| 83 | 83 | : driver_device(mconfig, type, tag), |
| 84 | m_maincpu(*this, "maincpu") | |
| 85 | { } | |
| 84 | m_maincpu(*this, "maincpu"), | |
| 85 | m_colorram(*this, "colorram"){ } | |
| 86 | 86 | |
| 87 | 87 | UINT16 m_io_offset; |
| 88 | 88 | UINT16 m_io_reg[IO_SIZE]; |
| r14896 | r14897 | |
| 96 | 96 | int m_tmp_counter; |
| 97 | 97 | int m_clr_offset; |
| 98 | 98 | |
| 99 | UINT8 *m_colorram; | |
| 99 | required_device<cpu_device> m_maincpu; | |
| 100 | required_shared_ptr<UINT8> m_colorram; | |
| 100 | 101 | bitmap_rgb32 m_bitmap_fg; |
| 101 | 102 | bitmap_rgb32 m_bitmap_bg; |
| 102 | 103 | |
| 103 | 104 | UINT16 m_tempbuf[8]; |
| 104 | 105 | |
| 105 | required_device<cpu_device> m_maincpu; | |
| 106 | 106 | DECLARE_WRITE16_MEMBER(fifo_data_w); |
| 107 | 107 | DECLARE_WRITE16_MEMBER(fifo_clear_w); |
| 108 | 108 | DECLARE_WRITE16_MEMBER(fifo_flush_w); |
| r14896 | r14897 | |
| 132 | 132 | if (y < 0 || x < 0 || x > 383 || y > 255) |
| 133 | 133 | return; |
| 134 | 134 | |
| 135 | b=(state->m_colorram[addr] << 2) | (state->m_colorram[addr] & 0x3); | |
| 136 | g=(state->m_colorram[addr+0x100] << 2) | (state->m_colorram[addr+0x100] & 3); | |
| 137 | r=(state->m_colorram[addr+0x200] << 2) | (state->m_colorram[addr+0x200] & 3); | |
| 135 | b=(state->m_colorram.target()[addr] << 2) | (state->m_colorram.target()[addr] & 0x3); | |
| 136 | g=(state->m_colorram.target()[addr+0x100] << 2) | (state->m_colorram.target()[addr+0x100] & 3); | |
| 137 | r=(state->m_colorram.target()[addr+0x200] << 2) | (state->m_colorram.target()[addr+0x200] & 3); | |
| 138 | 138 | |
| 139 | 139 | state->m_bitmap_fg.pix32(y, x) = r | (g<<8) | (b<<16); |
| 140 | 140 | } |
| r14896 | r14897 | |
| 313 | 313 | |
| 314 | 314 | WRITE16_MEMBER(sliver_state::sound_w) |
| 315 | 315 | { |
| 316 | soundlatch_w(space, 0, data & 0xff); | |
| 316 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 317 | 317 | cputag_set_input_line(machine(), "audiocpu", MCS51_INT0_LINE, HOLD_LINE); |
| 318 | 318 | } |
| 319 | 319 | |
| r14896 | r14897 | |
| 360 | 360 | |
| 361 | 361 | static ADDRESS_MAP_START( soundmem_io, AS_IO, 8, sliver_state ) |
| 362 | 362 | AM_RANGE(0x0100, 0x0100) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 363 | AM_RANGE(0x0101, 0x0101) AM_READ(soundlatch_r) | |
| 363 | AM_RANGE(0x0101, 0x0101) AM_READ(soundlatch_byte_r) | |
| 364 | 364 | /* ports */ |
| 365 | 365 | AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_WRITE(oki_setbank ) |
| 366 | 366 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 453 | 453 | INPUT_PORTS_END |
| 454 | 454 | |
| 455 | 455 | static ADDRESS_MAP_START( ramdac_map, AS_0, 8, sliver_state ) |
| 456 | AM_RANGE(0x000, 0x3ff) AM_RAM AM_ | |
| 456 | AM_RANGE(0x000, 0x3ff) AM_RAM AM_ | |
| 457 | 457 | ADDRESS_MAP_END |
| 458 | 458 | |
| 459 | 459 | static RAMDAC_INTERFACE( ramdac_intf ) |
| r14896 | r14897 | |
|---|---|---|
| 162 | 162 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 163 | 163 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 164 | 164 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(mrflea_videoram_w) AM_BASE(m_videoram) |
| 165 | AM_RANGE(0xe800, 0xe83f) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_SHARE("paletteram") | |
| 165 | AM_RANGE(0xe800, 0xe83f) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 166 | 166 | AM_RANGE(0xec00, 0xecff) AM_RAM_WRITE(mrflea_spriteram_w) AM_BASE(m_spriteram) |
| 167 | 167 | ADDRESS_MAP_END |
| 168 | 168 |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | AM_RANGE(0x102000, 0x102fff) AM_RAM /* Extra Video RAM */ |
| 84 | 84 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_BASE(m_vregs) /* Video Registers */ |
| 85 | 85 | AM_RANGE(0x108008, 0x108009) AM_WRITE(clr_int_w) /* CLR INT Video */ |
| 86 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 86 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 87 | 87 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 88 | 88 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2") |
| 89 | 89 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
|---|---|---|
| 232 | 232 | { |
| 233 | 233 | public: |
| 234 | 234 | subsino_state(const machine_config &mconfig, device_type type, const char *tag) |
| 235 | : driver_device(mconfig, type, tag) { } | |
| 235 | : driver_device(mconfig, type, tag) , | |
| 236 | m_colorram(*this, "colorram"), | |
| 237 | m_videoram(*this, "videoram"), | |
| 238 | m_reel3_scroll(*this, "reel3_scroll"), | |
| 239 | m_reel2_scroll(*this, "reel2_scroll"), | |
| 240 | m_reel1_scroll(*this, "reel1_scroll"), | |
| 241 | m_reel1_ram(*this, "reel1_ram"), | |
| 242 | m_reel2_ram(*this, "reel2_ram"), | |
| 243 | m_reel3_ram(*this, "reel3_ram"){ } | |
| 236 | 244 | |
| 237 | UINT8 *m_videoram; | |
| 238 | UINT8 *m_colorram; | |
| 245 | required_shared_ptr<UINT8> m_colorram; | |
| 246 | required_shared_ptr<UINT8> m_videoram; | |
| 247 | required_shared_ptr<UINT8> m_reel3_scroll; | |
| 248 | required_shared_ptr<UINT8> m_reel2_scroll; | |
| 249 | required_shared_ptr<UINT8> m_reel1_scroll; | |
| 250 | required_shared_ptr<UINT8> m_reel1_ram; | |
| 251 | required_shared_ptr<UINT8> m_reel2_ram; | |
| 252 | required_shared_ptr<UINT8> m_reel3_ram; | |
| 253 | ||
| 239 | 254 | tilemap_t *m_tmap; |
| 240 | 255 | tilemap_t *m_reel1_tilemap; |
| 241 | 256 | tilemap_t *m_reel2_tilemap; |
| 242 | 257 | tilemap_t *m_reel3_tilemap; |
| 243 | 258 | int m_tiles_offset; |
| 244 | UINT8* m_reel1_ram; | |
| 245 | UINT8* m_reel2_ram; | |
| 246 | UINT8* m_reel3_ram; | |
| 247 | UINT8* m_reel1_scroll; | |
| 248 | UINT8* m_reel2_scroll; | |
| 249 | UINT8* m_reel3_scroll; | |
| 250 | 259 | UINT8 m_out_c; |
| 251 | 260 | UINT8* m_reel1_attr; |
| 252 | 261 | UINT8* m_reel2_attr; |
| r14896 | r14897 | |
| 291 | 300 | |
| 292 | 301 | WRITE8_MEMBER(subsino_state::subsino_videoram_w) |
| 293 | 302 | { |
| 294 | m_videoram[offset] = data; | |
| 303 | m_videoram.target()[offset] = data; | |
| 295 | 304 | m_tmap->mark_tile_dirty(offset); |
| 296 | 305 | } |
| 297 | 306 | |
| 298 | 307 | WRITE8_MEMBER(subsino_state::subsino_colorram_w) |
| 299 | 308 | { |
| 300 | m_colorram[offset] = data; | |
| 309 | m_colorram.target()[offset] = data; | |
| 301 | 310 | m_tmap->mark_tile_dirty(offset); |
| 302 | 311 | } |
| 303 | 312 | |
| 304 | 313 | static TILE_GET_INFO( get_tile_info ) |
| 305 | 314 | { |
| 306 | 315 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 307 | UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8); | |
| 316 | UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8); | |
| 308 | 317 | UINT16 color = (code >> 8) & 0x0f; |
| 309 | 318 | code = ((code & 0xf000) >> 4) + ((code & 0xff) >> 0); |
| 310 | 319 | code += state->m_tiles_offset; |
| r14896 | r14897 | |
| 314 | 323 | static TILE_GET_INFO( get_stisub_tile_info ) |
| 315 | 324 | { |
| 316 | 325 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 317 | UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8); | |
| 326 | UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8); | |
| 318 | 327 | code&= 0x3fff; |
| 319 | 328 | SET_TILE_INFO(0, code, 0, 0); |
| 320 | 329 | } |
| r14896 | r14897 | |
| 332 | 341 | |
| 333 | 342 | WRITE8_MEMBER(subsino_state::subsino_reel1_ram_w) |
| 334 | 343 | { |
| 335 | m_reel1_ram[offset] = data; | |
| 344 | m_reel1_ram.target()[offset] = data; | |
| 336 | 345 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 337 | 346 | } |
| 338 | 347 | |
| 339 | 348 | static TILE_GET_INFO( get_subsino_reel1_tile_info ) |
| 340 | 349 | { |
| 341 | 350 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 342 | int code = state->m_reel1_ram[tile_index]; | |
| 351 | int code = state->m_reel1_ram.target()[tile_index]; | |
| 343 | 352 | int colour = (state->m_out_c&0x7) + 8; |
| 344 | 353 | |
| 345 | 354 | SET_TILE_INFO( |
| r14896 | r14897 | |
| 352 | 361 | static TILE_GET_INFO( get_stisub_reel1_tile_info ) |
| 353 | 362 | { |
| 354 | 363 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 355 | int code = state->m_reel1_ram[tile_index]; | |
| 364 | int code = state->m_reel1_ram.target()[tile_index]; | |
| 356 | 365 | int attr = state->m_reel1_attr[tile_index]; |
| 357 | 366 | |
| 358 | 367 | SET_TILE_INFO( |
| r14896 | r14897 | |
| 365 | 374 | |
| 366 | 375 | WRITE8_MEMBER(subsino_state::subsino_reel2_ram_w) |
| 367 | 376 | { |
| 368 | m_reel2_ram[offset] = data; | |
| 377 | m_reel2_ram.target()[offset] = data; | |
| 369 | 378 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 370 | 379 | } |
| 371 | 380 | |
| 372 | 381 | static TILE_GET_INFO( get_subsino_reel2_tile_info ) |
| 373 | 382 | { |
| 374 | 383 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 375 | int code = state->m_reel2_ram[tile_index]; | |
| 384 | int code = state->m_reel2_ram.target()[tile_index]; | |
| 376 | 385 | int colour = (state->m_out_c&0x7) + 8; |
| 377 | 386 | |
| 378 | 387 | SET_TILE_INFO( |
| r14896 | r14897 | |
| 385 | 394 | static TILE_GET_INFO( get_stisub_reel2_tile_info ) |
| 386 | 395 | { |
| 387 | 396 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 388 | int code = state->m_reel2_ram[tile_index]; | |
| 397 | int code = state->m_reel2_ram.target()[tile_index]; | |
| 389 | 398 | int attr = state->m_reel2_attr[tile_index]; |
| 390 | 399 | |
| 391 | 400 | SET_TILE_INFO( |
| r14896 | r14897 | |
| 397 | 406 | |
| 398 | 407 | WRITE8_MEMBER(subsino_state::subsino_reel3_ram_w) |
| 399 | 408 | { |
| 400 | m_reel3_ram[offset] = data; | |
| 409 | m_reel3_ram.target()[offset] = data; | |
| 401 | 410 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 402 | 411 | } |
| 403 | 412 | |
| 404 | 413 | static TILE_GET_INFO( get_subsino_reel3_tile_info ) |
| 405 | 414 | { |
| 406 | 415 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 407 | int code = state->m_reel3_ram[tile_index]; | |
| 416 | int code = state->m_reel3_ram.target()[tile_index]; | |
| 408 | 417 | int colour = (state->m_out_c&0x7) + 8; |
| 409 | 418 | |
| 410 | 419 | SET_TILE_INFO( |
| r14896 | r14897 | |
| 417 | 426 | static TILE_GET_INFO( get_stisub_reel3_tile_info ) |
| 418 | 427 | { |
| 419 | 428 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 420 | int code = state->m_reel3_ram[tile_index]; | |
| 429 | int code = state->m_reel3_ram.target()[tile_index]; | |
| 421 | 430 | int attr = state->m_reel3_attr[tile_index]; |
| 422 | 431 | |
| 423 | 432 | SET_TILE_INFO( |
| r14896 | r14897 | |
| 477 | 486 | |
| 478 | 487 | for (i= 0;i < 64;i++) |
| 479 | 488 | { |
| 480 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]); | |
| 481 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]); | |
| 482 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]); | |
| 489 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]); | |
| 490 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]); | |
| 491 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]); | |
| 483 | 492 | } |
| 484 | 493 | |
| 485 | 494 | if (state->m_out_c&0x08) |
| r14896 | r14897 | |
| 514 | 523 | |
| 515 | 524 | for (i= 0;i < 64;i++) |
| 516 | 525 | { |
| 517 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]); | |
| 518 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]); | |
| 519 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]); | |
| 526 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]); | |
| 527 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]); | |
| 528 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]); | |
| 520 | 529 | } |
| 521 | 530 | |
| 522 | 531 | if (state->m_out_c&0x08) |
| r14896 | r14897 | |
| 1021 | 1030 | AM_RANGE( 0x10000, 0x13fff ) AM_ROM |
| 1022 | 1031 | AM_RANGE( 0x14000, 0x14fff ) AM_ROM // reads the card face data here (see rom copy in rom loading) |
| 1023 | 1032 | |
| 1024 | AM_RANGE( 0x150c0, 0x150ff ) AM_RAM AM_BASE(m_reel3_scroll) | |
| 1025 | AM_RANGE( 0x15140, 0x1517f ) AM_RAM AM_BASE(m_reel2_scroll) | |
| 1026 | AM_RANGE( 0x15180, 0x151bf ) AM_RAM AM_BASE(m_reel1_scroll) | |
| 1033 | AM_RANGE( 0x150c0, 0x150ff ) AM_RAM AM_SHARE("reel3_scroll") | |
| 1034 | AM_RANGE( 0x15140, 0x1517f ) AM_RAM AM_SHARE("reel2_scroll") | |
| 1035 | AM_RANGE( 0x15180, 0x151bf ) AM_RAM AM_SHARE("reel1_scroll") | |
| 1027 | 1036 | |
| 1028 | AM_RANGE( 0x15800, 0x159ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE(m_reel1_ram) | |
| 1029 | AM_RANGE( 0x15a00, 0x15bff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE(m_reel2_ram) | |
| 1030 | AM_RANGE( 0x15c00, 0x15dff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(m_reel3_ram) | |
| 1037 | AM_RANGE( 0x15800, 0x159ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_SHARE("reel1_ram") | |
| 1038 | AM_RANGE( 0x15a00, 0x15bff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_SHARE("reel2_ram") | |
| 1039 | AM_RANGE( 0x15c00, 0x15dff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_SHARE("reel3_ram") | |
| 1031 | 1040 | ADDRESS_MAP_END |
| 1032 | 1041 | |
| 1033 | 1042 | |
| r14896 | r14897 | |
| 1098 | 1107 | } |
| 1099 | 1108 | else if (offset<0x80) |
| 1100 | 1109 | { |
| 1101 | m_reel2_scroll[offset&0x3f] = data; | |
| 1110 | m_reel2_scroll.target()[offset&0x3f] = data; | |
| 1102 | 1111 | } |
| 1103 | 1112 | else if (offset<0xc0) |
| 1104 | 1113 | { |
| 1105 | m_reel1_scroll[offset&0x3f] = data; | |
| 1114 | m_reel1_scroll.target()[offset&0x3f] = data; | |
| 1106 | 1115 | } |
| 1107 | 1116 | else |
| 1108 | 1117 | { |
| 1109 | m_reel3_scroll[offset&0x3f] = data; | |
| 1118 | m_reel3_scroll.target()[offset&0x3f] = data; | |
| 1110 | 1119 | } |
| 1111 | 1120 | } |
| 1112 | 1121 | } |
| r14896 | r14897 | |
| 1147 | 1156 | |
| 1148 | 1157 | AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(reel_scrollattr_r, reel_scrollattr_w) |
| 1149 | 1158 | |
| 1150 | AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE(m_reel1_ram) | |
| 1151 | AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE(m_reel2_ram) | |
| 1152 | AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(m_reel3_ram) | |
| 1159 | AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_SHARE("reel1_ram") | |
| 1160 | AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_SHARE("reel2_ram") | |
| 1161 | AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_SHARE("reel3_ram") | |
| 1153 | 1162 | ADDRESS_MAP_END |
| 1154 | 1163 | |
| 1155 | 1164 | |
| r14896 | r14897 | |
| 1188 | 1197 | |
| 1189 | 1198 | AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(reel_scrollattr_r, reel_scrollattr_w) |
| 1190 | 1199 | |
| 1191 | AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE(m_reel1_ram) | |
| 1192 | AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE(m_reel2_ram) | |
| 1193 | AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(m_reel3_ram) | |
| 1200 | AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_SHARE("reel1_ram") | |
| 1201 | AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_SHARE("reel2_ram") | |
| 1202 | AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_SHARE("reel3_ram") | |
| 1194 | 1203 | ADDRESS_MAP_END |
| 1195 | 1204 | |
| 1196 | 1205 | |
| r14896 | r14897 | |
| 3544 | 3553 | rom[0x957] = 0x18; //patch "losing protection" check |
| 3545 | 3554 | state->m_stisub_colorram = auto_alloc_array(machine, UINT8, 256*3); |
| 3546 | 3555 | |
| 3547 | state->m_reel1_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3548 | state->m_reel2_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3549 | state->m_reel3_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3556 | //state->m_reel1_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3557 | //state->m_reel2_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3558 | //state->m_reel3_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3550 | 3559 | |
| 3551 | 3560 | state->m_reel1_attr = auto_alloc_array(machine, UINT8, 0x200); |
| 3552 | 3561 | state->m_reel2_attr = auto_alloc_array(machine, UINT8, 0x200); |
| r14896 | r14897 | |
| 3558 | 3567 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 3559 | 3568 | state->m_stisub_colorram = auto_alloc_array(machine, UINT8, 256*3); |
| 3560 | 3569 | |
| 3561 | state->m_reel1_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3562 | state->m_reel2_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3563 | state->m_reel3_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3570 | //state->m_reel1_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3571 | //state->m_reel2_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3572 | //state->m_reel3_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3564 | 3573 | |
| 3565 | 3574 | state->m_reel1_attr = auto_alloc_array(machine, UINT8, 0x200); |
| 3566 | 3575 | state->m_reel2_attr = auto_alloc_array(machine, UINT8, 0x200); |
| r14896 | r14897 | |
|---|---|---|
| 522 | 522 | AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(jchan_suprnova_sprite32_1_w) AM_BASE(m_spriteram_1) |
| 523 | 523 | AM_RANGE(0x600000, 0x60003f) AM_RAM_WRITE(jchan_suprnova_sprite32regs_1_w) AM_BASE(m_sprregs_1) |
| 524 | 524 | |
| 525 | AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(paletteram | |
| 525 | AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(paletteram | |
| 526 | 526 | |
| 527 | 527 | AM_RANGE(0xf00000, 0xf00007) AM_READWRITE(jchan_ctrl_r, jchan_ctrl_w) AM_BASE(m_ctrl) |
| 528 | 528 |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | public: |
| 33 | 33 | mlanding_state(const machine_config &mconfig, device_type type, const char *tag) |
| 34 | : driver_device(mconfig, type, tag) { } | |
| 34 | : driver_device(mconfig, type, tag) , | |
| 35 | m_g_ram(*this, "g_ram"), | |
| 36 | m_ml_tileram(*this, "ml_tileram"), | |
| 37 | m_dma_ram(*this, "dma_ram"), | |
| 38 | m_ml_dotram(*this, "ml_dotram"), | |
| 39 | m_mecha_ram(*this, "mecha_ram"){ } | |
| 35 | 40 | |
| 36 | UINT16 * m_ml_tileram; | |
| 37 | UINT16 *m_g_ram; | |
| 38 | UINT16 * m_ml_dotram; | |
| 39 | UINT16 *m_dma_ram; | |
| 41 | required_shared_ptr<UINT16> m_g_ram; | |
| 42 | required_shared_ptr<UINT16> m_ml_tileram; | |
| 43 | required_shared_ptr<UINT16> m_dma_ram; | |
| 44 | required_shared_ptr<UINT16> m_ml_dotram; | |
| 45 | required_shared_ptr<UINT8> m_mecha_ram; | |
| 40 | 46 | UINT32 m_adpcm_pos; |
| 41 | 47 | UINT32 m_adpcm_end; |
| 42 | 48 | int m_adpcm_data; |
| r14896 | r14897 | |
| 44 | 50 | UINT8 m_pal_fg_bank; |
| 45 | 51 | int m_dma_active; |
| 46 | 52 | UINT16 m_dsp_HOLD_signal; |
| 47 | UINT8 *m_mecha_ram; | |
| 48 | 53 | UINT8 m_trigger; |
| 49 | 54 | DECLARE_WRITE16_MEMBER(ml_tileram_w); |
| 50 | 55 | DECLARE_READ16_MEMBER(ml_tileram_r); |
| r14896 | r14897 | |
| 86 | 91 | |
| 87 | 92 | for (y = cliprect.min_y; y <= cliprect.max_y; ++y) |
| 88 | 93 | { |
| 89 | UINT16 *src = &state->m_g_ram[y * 512/2 + cliprect.min_x]; | |
| 94 | UINT16 *src = &state->m_g_ram.target()[y * 512/2 + cliprect.min_x]; | |
| 90 | 95 | UINT16 *dst = &bitmap.pix16(y, cliprect.min_x); |
| 91 | 96 | |
| 92 | 97 | for (x = cliprect.min_x; x <= cliprect.max_x; x += 2) |
| r14896 | r14897 | |
| 119 | 124 | |
| 120 | 125 | int j, k; |
| 121 | 126 | |
| 122 | UINT16 attr = state->m_dma_ram[offs]; | |
| 127 | UINT16 attr = state->m_dma_ram.target()[offs]; | |
| 123 | 128 | |
| 124 | 129 | if (attr == 0) |
| 125 | 130 | continue; |
| 126 | 131 | |
| 127 | x = state->m_dma_ram[offs + 1]; | |
| 128 | y = state->m_dma_ram[offs + 2]; | |
| 129 | colour = state->m_dma_ram[offs + 3]; | |
| 132 | x = state->m_dma_ram.target()[offs + 1]; | |
| 133 | y = state->m_dma_ram.target()[offs + 2]; | |
| 134 | colour = state->m_dma_ram.target()[offs + 3]; | |
| 130 | 135 | |
| 131 | 136 | dx = x >> 11; |
| 132 | 137 | dy = y >> 11; |
| r14896 | r14897 | |
| 161 | 166 | // Draw the 8x8 chunk |
| 162 | 167 | for (y1 = 0; y1 < 8; ++y1) |
| 163 | 168 | { |
| 164 | UINT16 *src = &state->m_ml_tileram[(code * 2 * 8) + y1*2]; | |
| 165 | UINT16 *dst = &state->m_g_ram[(y + k*8+y1)*512/2 + (j*8+x)/2]; | |
| 169 | UINT16 *src = &state->m_ml_tileram.target()[(code * 2 * 8) + y1*2]; | |
| 170 | UINT16 *dst = &state->m_g_ram.target()[(y + k*8+y1)*512/2 + (j*8+x)/2]; | |
| 166 | 171 | |
| 167 | 172 | UINT8 p2 = *src & 0xff; |
| 168 | 173 | UINT8 p1 = *src++ >> 8; |
| r14896 | r14897 | |
| 209 | 214 | for(y1 = 0; y1 < dy*8; y1++) |
| 210 | 215 | { |
| 211 | 216 | int x1; |
| 212 | UINT16 *dst = &state->m_g_ram[((y + y1) * 512/2) + x/2]; | |
| 217 | UINT16 *dst = &state->m_g_ram.target()[((y + y1) * 512/2) + x/2]; | |
| 213 | 218 | |
| 214 | 219 | for(x1 = 0; x1 < dx*8; x1+=2) |
| 215 | 220 | { |
| r14896 | r14897 | |
| 223 | 228 | |
| 224 | 229 | WRITE16_MEMBER(mlanding_state::ml_tileram_w) |
| 225 | 230 | { |
| 226 | COMBINE_DATA(&m_ml_tileram[offset]); | |
| 231 | COMBINE_DATA(&m_ml_tileram.target()[offset]); | |
| 227 | 232 | } |
| 228 | 233 | |
| 229 | 234 | READ16_MEMBER(mlanding_state::ml_tileram_r) |
| 230 | 235 | { |
| 231 | return m_ml_tileram[offset]; | |
| 236 | return m_ml_tileram.target()[offset]; | |
| 232 | 237 | } |
| 233 | 238 | |
| 234 | 239 | |
| r14896 | r14897 | |
| 454 | 459 | |
| 455 | 460 | READ16_MEMBER(mlanding_state::ml_mecha_ram_r) |
| 456 | 461 | { |
| 457 | return (m_mecha_ram[offset*2]<<8)|m_mecha_ram[offset*2+1]; | |
| 462 | return (m_mecha_ram.target()[offset*2]<<8)|m_mecha_ram.target()[offset*2+1]; | |
| 458 | 463 | } |
| 459 | 464 | |
| 460 | 465 | WRITE16_MEMBER(mlanding_state::ml_mecha_ram_w) |
| r14896 | r14897 | |
| 469 | 474 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 470 | 475 | AM_RANGE(0x080000, 0x08ffff) AM_RAM |
| 471 | 476 | |
| 472 | AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_BASE(m_g_ram)// 512kB G RAM - enough here for double buffered 512x400x8 frame | |
| 473 | AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(ml_tileram_r, ml_tileram_w) AM_BASE(m_ml_tileram) | |
| 474 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") AM_BASE(m_dma_ram) | |
| 477 | AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_SHARE("g_ram")// 512kB G RAM - enough here for double buffered 512x400x8 frame | |
| 478 | AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(ml_tileram_r, ml_tileram_w) AM_SHARE("ml_tileram") | |
| 479 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") AM_SHARE("dma_ram") | |
| 475 | 480 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1") |
| 476 | 481 | |
| 477 | 482 | AM_RANGE(0x1d0000, 0x1d0001) AM_WRITE(ml_sub_reset_w) |
| r14896 | r14897 | |
| 481 | 486 | AM_RANGE(0x2d0000, 0x2d0001) AM_READNOP |
| 482 | 487 | AM_RANGE(0x2d0002, 0x2d0003) AM_DEVREAD8_LEGACY("tc0140syt", tc0140syt_comm_r, 0x00ff) |
| 483 | 488 | |
| 484 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(paletteram | |
| 489 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(paletteram | |
| 485 | 490 | AM_RANGE(0x280000, 0x2807ff) AM_READWRITE(ml_mecha_ram_r,ml_mecha_ram_w) |
| 486 | 491 | |
| 487 | 492 | AM_RANGE(0x290000, 0x290001) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 509 | 514 | AM_RANGE(0x050000, 0x0503ff) AM_RAM AM_SHARE("share3") |
| 510 | 515 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") |
| 511 | 516 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1") |
| 512 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_ | |
| 517 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_ | |
| 513 | 518 | ADDRESS_MAP_END |
| 514 | 519 | |
| 515 | 520 | static WRITE8_DEVICE_HANDLER( ml_msm_start_lsb_w ) |
| r14896 | r14897 | |
| 544 | 549 | |
| 545 | 550 | READ16_MEMBER(mlanding_state::ml_dotram_r) |
| 546 | 551 | { |
| 547 | return m_ml_dotram[offset]; | |
| 552 | return m_ml_dotram.target()[offset]; | |
| 548 | 553 | } |
| 549 | 554 | |
| 550 | 555 | WRITE16_MEMBER(mlanding_state::ml_dotram_w) |
| 551 | 556 | { |
| 552 | m_ml_dotram[offset] = data; | |
| 557 | m_ml_dotram.target()[offset] = data; | |
| 553 | 558 | } |
| 554 | 559 | |
| 555 | 560 | READ16_MEMBER(mlanding_state::dsp_HOLD_signal_r) |
| r14896 | r14897 | |
| 566 | 571 | //mecha driver ? |
| 567 | 572 | static ADDRESS_MAP_START( mlanding_z80_sub_mem, AS_PROGRAM, 8, mlanding_state ) |
| 568 | 573 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 569 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_ | |
| 574 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_ | |
| 570 | 575 | AM_RANGE(0x8800, 0x8fff) AM_RAM |
| 571 | 576 | |
| 572 | 577 | AM_RANGE(0x9000, 0x9001) AM_READ(test_r) |
| r14896 | r14897 | |
|---|---|---|
| 80 | 80 | m_irq_mask = data & 1; |
| 81 | 81 | break; |
| 82 | 82 | |
| 83 | case 1: /* 0xe001 (value 0 then 1) written right after the soundlatch_w */ | |
| 83 | case 1: /* 0xe001 (value 0 then 1) written right after the soundlatch_byte_w */ | |
| 84 | 84 | machine().scheduler().synchronize(FUNC(soundirqline_callback), data); |
| 85 | 85 | break; |
| 86 | 86 |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | { |
| 31 | 31 | public: |
| 32 | 32 | neoprint_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | : driver_device(mconfig, type, tag) { } | |
| 33 | : driver_device(mconfig, type, tag) , | |
| 34 | m_npvidram(*this, "npvidram"), | |
| 35 | m_npvidregs(*this, "npvidregs"){ } | |
| 34 | 36 | |
| 35 | UINT16* m_npvidram; | |
| 36 | UINT16* m_npvidregs; | |
| 37 | required_shared_ptr<UINT16> m_npvidram; | |
| 38 | required_shared_ptr<UINT16> m_npvidregs; | |
| 37 | 39 | UINT8 m_audio_result; |
| 38 | 40 | UINT8 m_bank_val; |
| 39 | 41 | UINT8 m_vblank; |
| r14896 | r14897 | |
| 71 | 73 | const gfx_element *gfx = machine.gfx[0]; |
| 72 | 74 | INT16 scrollx, scrolly; |
| 73 | 75 | |
| 74 | i = (state->m_npvidregs[((layer*8)+0x06)/2] & 7) * 0x1000/4; | |
| 75 | scrollx = ((state->m_npvidregs[((layer*8)+0x00)/2] - (0xd8 + layer*4)) & 0x03ff); | |
| 76 | scrolly = ((state->m_npvidregs[((layer*8)+0x02)/2] - 0xffeb) & 0x03ff); | |
| 76 | i = (state->m_npvidregs.target()[((layer*8)+0x06)/2] & 7) * 0x1000/4; | |
| 77 | scrollx = ((state->m_npvidregs.target()[((layer*8)+0x00)/2] - (0xd8 + layer*4)) & 0x03ff); | |
| 78 | scrolly = ((state->m_npvidregs.target()[((layer*8)+0x02)/2] - 0xffeb) & 0x03ff); | |
| 77 | 79 | |
| 78 | 80 | scrollx/=2; |
| 79 | 81 | scrolly/=2; |
| r14896 | r14897 | |
| 82 | 84 | { |
| 83 | 85 | for (x=0;x<32;x++) |
| 84 | 86 | { |
| 85 | UINT16 dat = state->m_npvidram[i*2] >> data_shift; // a video register? | |
| 87 | UINT16 dat = state->m_npvidram.target()[i*2] >> data_shift; // a video register? | |
| 86 | 88 | UINT16 color; |
| 87 | if(state->m_npvidram[i*2+1] & 0x0020) // TODO: 8bpp switch? | |
| 88 | color = ((state->m_npvidram[i*2+1] & 0x8000) << 1) | 0x200 | ((state->m_npvidram[i*2+1] & 0xff00) >> 7); | |
| 89 | if(state->m_npvidram.target()[i*2+1] & 0x0020) // TODO: 8bpp switch? | |
| 90 | color = ((state->m_npvidram.target()[i*2+1] & 0x8000) << 1) | 0x200 | ((state->m_npvidram.target()[i*2+1] & 0xff00) >> 7); | |
| 89 | 91 | else |
| 90 | color = ((state->m_npvidram[i*2+1] & 0xff00) >> 8) | ((state->m_npvidram[i*2+1] & 0x0010) << 4); | |
| 91 | UINT8 fx = (state->m_npvidram[i*2+1] & 0x0040); | |
| 92 | UINT8 fy = (state->m_npvidram[i*2+1] & 0x0080); | |
| 92 | color = ((state->m_npvidram.target()[i*2+1] & 0xff00) >> 8) | ((state->m_npvidram.target()[i*2+1] & 0x0010) << 4); | |
| 93 | UINT8 fx = (state->m_npvidram.target()[i*2+1] & 0x0040); | |
| 94 | UINT8 fy = (state->m_npvidram.target()[i*2+1] & 0x0080); | |
| 93 | 95 | |
| 94 | 96 | drawgfx_transpen(bitmap,cliprect,gfx,dat,color,fx,fy,x*16+scrollx,y*16-scrolly,0); |
| 95 | 97 | drawgfx_transpen(bitmap,cliprect,gfx,dat,color,fx,fy,x*16+scrollx-512,y*16-scrolly,0); |
| r14896 | r14897 | |
| 173 | 175 | /* accessing the LSB only is not mapped */ |
| 174 | 176 | if (mem_mask != 0x00ff) |
| 175 | 177 | { |
| 176 | soundlatch_w(space, 0, data >> 8); | |
| 178 | soundlatch_byte_w(space, 0, data >> 8); | |
| 177 | 179 | |
| 178 | 180 | audio_cpu_assert_nmi(machine()); |
| 179 | 181 | |
| r14896 | r14897 | |
| 187 | 189 | |
| 188 | 190 | READ8_MEMBER(neoprint_state::audio_command_r) |
| 189 | 191 | { |
| 190 | UINT8 ret = soundlatch_r(space, 0); | |
| 192 | UINT8 ret = soundlatch_byte_r(space, 0); | |
| 191 | 193 | |
| 192 | 194 | //if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", cpu_get_pc(&space.device()), ret); |
| 193 | 195 | |
| r14896 | r14897 | |
| 213 | 215 | /* AM_RANGE(0x100000, 0x17ffff) multi-cart or banking, some writes points here if anything lies there too */ |
| 214 | 216 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 215 | 217 | AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("nvram") |
| 216 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_BASE(m_npvidram) | |
| 217 | AM_RANGE(0x500000, 0x51ffff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 218 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_SHARE("npvidram") | |
| 219 | AM_RANGE(0x500000, 0x51ffff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 218 | 220 | AM_RANGE(0x600000, 0x600001) AM_READWRITE(neoprint_audio_result_r,audio_command_w) |
| 219 | 221 | AM_RANGE(0x600002, 0x600003) AM_READWRITE(neoprint_calendar_r,neoprint_calendar_w) |
| 220 | 222 | AM_RANGE(0x600004, 0x600005) AM_READ_PORT("SYSTEM") AM_WRITENOP |
| r14896 | r14897 | |
| 224 | 226 | AM_RANGE(0x60000c, 0x60000d) AM_READ_PORT("DSW2") |
| 225 | 227 | AM_RANGE(0x60000e, 0x60000f) AM_WRITENOP |
| 226 | 228 | |
| 227 | AM_RANGE(0x700000, 0x70001b) AM_RAM AM_ | |
| 229 | AM_RANGE(0x700000, 0x70001b) AM_RAM AM_ | |
| 228 | 230 | |
| 229 | 231 | AM_RANGE(0x70001e, 0x70001f) AM_WRITENOP //watchdog |
| 230 | 232 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 288 | 290 | AM_RANGE(0x20000c, 0x20000d) AM_READ_PORT("DSW2") |
| 289 | 291 | AM_RANGE(0x20000e, 0x20000f) AM_WRITENOP |
| 290 | 292 | |
| 291 | AM_RANGE(0x240000, 0x24001b) AM_RAM AM_ | |
| 293 | AM_RANGE(0x240000, 0x24001b) AM_RAM AM_ | |
| 292 | 294 | AM_RANGE(0x24001e, 0x24001f) AM_WRITENOP //watchdog |
| 293 | 295 | |
| 294 | 296 | AM_RANGE(0x300000, 0x33ffff) AM_RAM AM_SHARE("nvram") |
| 295 | 297 | AM_RANGE(0x380000, 0x38ffff) AM_RAM |
| 296 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_ | |
| 298 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_ | |
| 297 | 299 | AM_RANGE(0x500000, 0x57ffff) AM_RAM_WRITE(nprsp_palette_w) AM_SHARE("paletteram") |
| 298 | 300 | ADDRESS_MAP_END |
| 299 | 301 |
| r14896 | r14897 | |
|---|---|---|
| 426 | 426 | public: |
| 427 | 427 | seattle_state(const machine_config &mconfig, device_type type, const char *tag) |
| 428 | 428 | : driver_device(mconfig, type, tag), |
| 429 | m_nvram(*this, "nvram") { } | |
| 429 | m_nvram(*this, "nvram") , | |
| 430 | m_rambase(*this, "rambase"), | |
| 431 | m_interrupt_enable(*this, "interrupt_enable"), | |
| 432 | m_interrupt_config(*this, "interrupt_config"), | |
| 433 | m_asic_reset(*this, "asic_reset"), | |
| 434 | m_rombase(*this, "rombase"){ } | |
| 430 | 435 | |
| 431 | 436 | required_shared_ptr<UINT32> m_nvram; |
| 432 | UINT32 *m_rambase; | |
| 433 | UINT32 *m_rombase; | |
| 437 | required_shared_ptr<UINT32> m_rambase; | |
| 438 | required_shared_ptr<UINT32> m_interrupt_enable; | |
| 439 | required_shared_ptr<UINT32> m_interrupt_config; | |
| 440 | required_shared_ptr<UINT32> m_asic_reset; | |
| 441 | required_shared_ptr<UINT32> m_rombase; | |
| 434 | 442 | galileo_data m_galileo; |
| 435 | 443 | widget_data m_widget; |
| 436 | 444 | device_t *m_voodoo; |
| r14896 | r14897 | |
| 445 | 453 | UINT8 m_vblank_irq_num; |
| 446 | 454 | UINT8 m_vblank_latch; |
| 447 | 455 | UINT8 m_vblank_state; |
| 448 | UINT32 *m_interrupt_config; | |
| 449 | UINT32 *m_interrupt_enable; | |
| 450 | UINT32 *m_asic_reset; | |
| 451 | 456 | UINT8 m_pending_analog_read; |
| 452 | 457 | UINT8 m_status_leds; |
| 453 | 458 | UINT32 m_cmos_write_enabled; |
| 459 | DECLARE_READ32_MEMBER(interrupt_state_r); | |
| 460 | DECLARE_READ32_MEMBER(interrupt_state2_r); | |
| 461 | DECLARE_WRITE32_MEMBER(interrupt_config_w); | |
| 462 | DECLARE_WRITE32_MEMBER(seattle_interrupt_enable_w); | |
| 463 | DECLARE_WRITE32_MEMBER(vblank_clear_w); | |
| 464 | DECLARE_READ32_MEMBER(galileo_r); | |
| 465 | DECLARE_WRITE32_MEMBER(galileo_w); | |
| 466 | DECLARE_WRITE32_MEMBER(seattle_voodoo_w); | |
| 467 | DECLARE_READ32_MEMBER(analog_port_r); | |
| 468 | DECLARE_WRITE32_MEMBER(analog_port_w); | |
| 469 | DECLARE_READ32_MEMBER(carnevil_gun_r); | |
| 470 | DECLARE_WRITE32_MEMBER(carnevil_gun_w); | |
| 471 | DECLARE_WRITE32_MEMBER(cmos_w); | |
| 472 | DECLARE_READ32_MEMBER(cmos_r); | |
| 473 | DECLARE_WRITE32_MEMBER(cmos_protect_w); | |
| 474 | DECLARE_READ32_MEMBER(cmos_protect_r); | |
| 475 | DECLARE_WRITE32_MEMBER(seattle_watchdog_w); | |
| 476 | DECLARE_WRITE32_MEMBER(asic_reset_w); | |
| 477 | DECLARE_WRITE32_MEMBER(asic_fifo_w); | |
| 478 | DECLARE_READ32_MEMBER(status_leds_r); | |
| 479 | DECLARE_WRITE32_MEMBER(status_leds_w); | |
| 454 | 480 | }; |
| 455 | 481 | |
| 456 | 482 | |
| r14896 | r14897 | |
| 508 | 534 | mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); |
| 509 | 535 | |
| 510 | 536 | /* configure fast RAM regions for DRC */ |
| 511 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_rambase); | |
| 512 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase); | |
| 537 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_rambase.target()); | |
| 538 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase.target()); | |
| 513 | 539 | |
| 514 | 540 | /* register for save states */ |
| 515 | 541 | state_save_register_global_array(machine, state->m_galileo.reg); |
| r14896 | r14897 | |
| 631 | 657 | * |
| 632 | 658 | *************************************/ |
| 633 | 659 | |
| 634 | ||
| 660 | ||
| 635 | 661 | { |
| 636 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 637 | 662 | UINT32 result = 0; |
| 638 | result |= state->m_ethernet_irq_state << ETHERNET_IRQ_SHIFT; | |
| 639 | result |= state->m_vblank_latch << VBLANK_IRQ_SHIFT; | |
| 663 | result |= m_ethernet_irq_state << ETHERNET_IRQ_SHIFT; | |
| 664 | result |= m_vblank_latch << VBLANK_IRQ_SHIFT; | |
| 640 | 665 | return result; |
| 641 | 666 | } |
| 642 | 667 | |
| 643 | 668 | |
| 644 | ||
| 669 | ||
| 645 | 670 | { |
| 646 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 647 | 671 | UINT32 result = interrupt_state_r(space, offset, mem_mask); |
| 648 | result |= | |
| 672 | result |= | |
| 649 | 673 | return result; |
| 650 | 674 | } |
| 651 | 675 | |
| 652 | 676 | |
| 653 | ||
| 677 | ||
| 654 | 678 | { |
| 655 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 656 | 679 | int irq; |
| 657 | COMBINE_DATA( | |
| 680 | COMBINE_DATA( | |
| 658 | 681 | |
| 659 | 682 | /* VBLANK: clear anything pending on the old IRQ */ |
| 660 | if (state->m_vblank_irq_num != 0) | |
| 661 | cputag_set_input_line(space->machine(), "maincpu", state->m_vblank_irq_num, CLEAR_LINE); | |
| 683 | if (m_vblank_irq_num != 0) | |
| 684 | cputag_set_input_line(machine(), "maincpu", m_vblank_irq_num, CLEAR_LINE); | |
| 662 | 685 | |
| 663 | 686 | /* VBLANK: compute the new IRQ vector */ |
| 664 | irq = (*state->m_interrupt_config >> (2*VBLANK_IRQ_SHIFT)) & 3; | |
| 665 | state->m_vblank_irq_num = (irq != 0) ? (2 + irq) : 0; | |
| 687 | irq = (*m_interrupt_config >> (2*VBLANK_IRQ_SHIFT)) & 3; | |
| 688 | m_vblank_irq_num = (irq != 0) ? (2 + irq) : 0; | |
| 666 | 689 | |
| 667 | 690 | /* Widget board case */ |
| 668 | if ( | |
| 691 | if ( | |
| 669 | 692 | { |
| 670 | 693 | /* Widget: clear anything pending on the old IRQ */ |
| 671 | if (state->m_widget.irq_num != 0) | |
| 672 | cputag_set_input_line(space->machine(), "maincpu", state->m_widget.irq_num, CLEAR_LINE); | |
| 694 | if (m_widget.irq_num != 0) | |
| 695 | cputag_set_input_line(machine(), "maincpu", m_widget.irq_num, CLEAR_LINE); | |
| 673 | 696 | |
| 674 | 697 | /* Widget: compute the new IRQ vector */ |
| 675 | irq = (*state->m_interrupt_config >> (2*WIDGET_IRQ_SHIFT)) & 3; | |
| 676 | state->m_widget.irq_num = (irq != 0) ? (2 + irq) : 0; | |
| 698 | irq = (*m_interrupt_config >> (2*WIDGET_IRQ_SHIFT)) & 3; | |
| 699 | m_widget.irq_num = (irq != 0) ? (2 + irq) : 0; | |
| 677 | 700 | } |
| 678 | 701 | |
| 679 | 702 | /* Flagstaff board case */ |
| 680 | if ( | |
| 703 | if ( | |
| 681 | 704 | { |
| 682 | 705 | /* Ethernet: clear anything pending on the old IRQ */ |
| 683 | if (state->m_ethernet_irq_num != 0) | |
| 684 | cputag_set_input_line(space->machine(), "maincpu", state->m_ethernet_irq_num, CLEAR_LINE); | |
| 706 | if (m_ethernet_irq_num != 0) | |
| 707 | cputag_set_input_line(machine(), "maincpu", m_ethernet_irq_num, CLEAR_LINE); | |
| 685 | 708 | |
| 686 | 709 | /* Ethernet: compute the new IRQ vector */ |
| 687 | irq = (*state->m_interrupt_config >> (2*ETHERNET_IRQ_SHIFT)) & 3; | |
| 688 | state->m_ethernet_irq_num = (irq != 0) ? (2 + irq) : 0; | |
| 710 | irq = (*m_interrupt_config >> (2*ETHERNET_IRQ_SHIFT)) & 3; | |
| 711 | m_ethernet_irq_num = (irq != 0) ? (2 + irq) : 0; | |
| 689 | 712 | } |
| 690 | 713 | |
| 691 | 714 | /* update the states */ |
| 692 | update_vblank_irq(space->machine()); | |
| 693 | ethernet_interrupt_machine(space->machine(), state->m_ethernet_irq_state); | |
| 715 | update_vblank_irq(machine()); | |
| 716 | ethernet_interrupt_machine(machine(), m_ethernet_irq_state); | |
| 694 | 717 | } |
| 695 | 718 | |
| 696 | 719 | |
| 697 | ||
| 720 | ||
| 698 | 721 | { |
| 699 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 700 | UINT32 old = *state->m_interrupt_enable; | |
| 701 | COMBINE_DATA(state->m_interrupt_enable); | |
| 702 | if (old != *state->m_interrupt_enable) | |
| 722 | UINT32 old = *m_interrupt_enable.target(); | |
| 723 | COMBINE_DATA(m_interrupt_enable.target()); | |
| 724 | if (old != *m_interrupt_enable.target()) | |
| 703 | 725 | { |
| 704 | if (state->m_vblank_latch) | |
| 705 | update_vblank_irq(space->machine()); | |
| 706 | if (state->m_ethernet_irq_state) | |
| 707 | ethernet_interrupt_machine(space->machine(), state->m_ethernet_irq_state); | |
| 726 | if (m_vblank_latch) | |
| 727 | update_vblank_irq(machine()); | |
| 728 | if (m_ethernet_irq_state) | |
| 729 | ethernet_interrupt_machine(machine(), m_ethernet_irq_state); | |
| 708 | 730 | } |
| 709 | 731 | } |
| 710 | 732 | |
| r14896 | r14897 | |
| 732 | 754 | } |
| 733 | 755 | |
| 734 | 756 | |
| 735 | ||
| 757 | ||
| 736 | 758 | { |
| 737 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 738 | 759 | /* clear the latch and update the IRQ */ |
| 739 | state->m_vblank_latch = 0; | |
| 740 | update_vblank_irq(space->machine()); | |
| 760 | m_vblank_latch = 0; | |
| 761 | update_vblank_irq(machine()); | |
| 741 | 762 | } |
| 742 | 763 | |
| 743 | 764 | |
| r14896 | r14897 | |
| 1088 | 1109 | } |
| 1089 | 1110 | |
| 1090 | 1111 | |
| 1091 | ||
| 1112 | ||
| 1092 | 1113 | { |
| 1093 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1094 | galileo_data &galileo = state->m_galileo; | |
| 1114 | galileo_data &galileo = m_galileo; | |
| 1095 | 1115 | UINT32 result = galileo.reg[offset]; |
| 1096 | 1116 | |
| 1097 | 1117 | /* switch off the offset for special cases */ |
| r14896 | r14897 | |
| 1113 | 1133 | } |
| 1114 | 1134 | |
| 1115 | 1135 | /* eat some time for those which poll this register */ |
| 1116 | device_eat_cycles(&space | |
| 1136 | device_eat_cycles(&space. | |
| 1117 | 1137 | |
| 1118 | 1138 | if (LOG_TIMERS) |
| 1119 | logerror("%08X:hires_timer_r = %08X\n", cpu_get_pc(&space | |
| 1139 | logerror("%08X:hires_timer_r = %08X\n", cpu_get_pc(&space. | |
| 1120 | 1140 | break; |
| 1121 | 1141 | } |
| 1122 | 1142 | |
| r14896 | r14897 | |
| 1135 | 1155 | |
| 1136 | 1156 | /* unit 0 is the PCI bridge */ |
| 1137 | 1157 | if (unit == 0 && func == 0) |
| 1138 | result = pci_bridge_r(space, reg, type); | |
| 1158 | result = pci_bridge_r(&space, reg, type); | |
| 1139 | 1159 | |
| 1140 | 1160 | /* unit 8 is the 3dfx card */ |
| 1141 | 1161 | else if (unit == 8 && func == 0) |
| 1142 | result = pci_3dfx_r(space, reg, type); | |
| 1162 | result = pci_3dfx_r(&space, reg, type); | |
| 1143 | 1163 | |
| 1144 | 1164 | /* unit 9 is the IDE controller */ |
| 1145 | 1165 | else if (unit == 9 && func == 0) |
| 1146 | result = pci_ide_r(space, reg, type); | |
| 1166 | result = pci_ide_r(&space, reg, type); | |
| 1147 | 1167 | |
| 1148 | 1168 | /* anything else, just log */ |
| 1149 | 1169 | else |
| 1150 | 1170 | { |
| 1151 | 1171 | result = ~0; |
| 1152 | logerror("%08X:PCIBus read: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(&space | |
| 1172 | logerror("%08X:PCIBus read: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(&space. | |
| 1153 | 1173 | } |
| 1154 | 1174 | break; |
| 1155 | 1175 | } |
| r14896 | r14897 | |
| 1159 | 1179 | case GREG_INT_MASK: |
| 1160 | 1180 | case GREG_TIMER_CONTROL: |
| 1161 | 1181 | // if (LOG_GALILEO) |
| 1162 | // logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(&space | |
| 1182 | // logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(&space. | |
| 1163 | 1183 | break; |
| 1164 | 1184 | |
| 1165 | 1185 | default: |
| 1166 | logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(&space | |
| 1186 | logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(&space. | |
| 1167 | 1187 | break; |
| 1168 | 1188 | } |
| 1169 | 1189 | |
| r14896 | r14897 | |
| 1171 | 1191 | } |
| 1172 | 1192 | |
| 1173 | 1193 | |
| 1174 | ||
| 1194 | ||
| 1175 | 1195 | { |
| 1176 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1177 | galileo_data &galileo = state->m_galileo; | |
| 1196 | galileo_data &galileo = m_galileo; | |
| 1178 | 1197 | UINT32 oldata = galileo.reg[offset]; |
| 1179 | 1198 | COMBINE_DATA(&galileo.reg[offset]); |
| 1180 | 1199 | |
| r14896 | r14897 | |
| 1189 | 1208 | int which = offset % 4; |
| 1190 | 1209 | |
| 1191 | 1210 | if (LOG_DMA) |
| 1192 | logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space | |
| 1211 | logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space. | |
| 1193 | 1212 | |
| 1194 | 1213 | /* keep the read only activity bit */ |
| 1195 | 1214 | galileo.reg[offset] &= ~0x4000; |
| r14896 | r14897 | |
| 1197 | 1216 | |
| 1198 | 1217 | /* fetch next record */ |
| 1199 | 1218 | if (data & 0x2000) |
| 1200 | galileo_dma_fetch_next(space, which); | |
| 1219 | galileo_dma_fetch_next(&space, which); | |
| 1201 | 1220 | galileo.reg[offset] &= ~0x2000; |
| 1202 | 1221 | |
| 1203 | 1222 | /* if enabling, start the DMA */ |
| 1204 | 1223 | if (!(oldata & 0x1000) && (data & 0x1000)) |
| 1205 | galileo_perform_dma(space, which); | |
| 1224 | galileo_perform_dma(&space, which); | |
| 1206 | 1225 | break; |
| 1207 | 1226 | } |
| 1208 | 1227 | |
| r14896 | r14897 | |
| 1219 | 1238 | if (!timer->active) |
| 1220 | 1239 | timer->count = data; |
| 1221 | 1240 | if (LOG_TIMERS) |
| 1222 | logerror("%08X:timer/counter %d count = %08X [start=%08X]\n", cpu_get_pc(&space | |
| 1241 | logerror("%08X:timer/counter %d count = %08X [start=%08X]\n", cpu_get_pc(&space. | |
| 1223 | 1242 | break; |
| 1224 | 1243 | } |
| 1225 | 1244 | |
| r14896 | r14897 | |
| 1228 | 1247 | int which, mask; |
| 1229 | 1248 | |
| 1230 | 1249 | if (LOG_TIMERS) |
| 1231 | logerror("%08X:timer/counter control = %08X\n", cpu_get_pc(&space | |
| 1250 | logerror("%08X:timer/counter control = %08X\n", cpu_get_pc(&space. | |
| 1232 | 1251 | for (which = 0, mask = 0x01; which < 4; which++, mask <<= 2) |
| 1233 | 1252 | { |
| 1234 | 1253 | galileo_timer *timer = &galileo.timer[which]; |
| r14896 | r14897 | |
| 1262 | 1281 | if (LOG_GALILEO) |
| 1263 | 1282 | logerror("%08X:Galileo write to IRQ clear = %08X & %08X\n", offset*4, data, mem_mask); |
| 1264 | 1283 | galileo.reg[offset] = oldata & data; |
| 1265 | update_galileo_irqs( | |
| 1284 | update_galileo_irqs( | |
| 1266 | 1285 | break; |
| 1267 | 1286 | |
| 1268 | 1287 | case GREG_CONFIG_DATA: |
| r14896 | r14897 | |
| 1275 | 1294 | |
| 1276 | 1295 | /* unit 0 is the PCI bridge */ |
| 1277 | 1296 | if (unit == 0 && func == 0) |
| 1278 | pci_bridge_w(space, reg, type, data); | |
| 1297 | pci_bridge_w(&space, reg, type, data); | |
| 1279 | 1298 | |
| 1280 | 1299 | /* unit 8 is the 3dfx card */ |
| 1281 | 1300 | else if (unit == 8 && func == 0) |
| 1282 | pci_3dfx_w(space, reg, type, data); | |
| 1301 | pci_3dfx_w(&space, reg, type, data); | |
| 1283 | 1302 | |
| 1284 | 1303 | /* unit 9 is the IDE controller */ |
| 1285 | 1304 | else if (unit == 9 && func == 0) |
| 1286 | pci_ide_w(space, reg, type, data); | |
| 1305 | pci_ide_w(&space, reg, type, data); | |
| 1287 | 1306 | |
| 1288 | 1307 | /* anything else, just log */ |
| 1289 | 1308 | else |
| 1290 | logerror("%08X:PCIBus write: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(&space | |
| 1309 | logerror("%08X:PCIBus write: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(&space. | |
| 1291 | 1310 | break; |
| 1292 | 1311 | } |
| 1293 | 1312 | |
| r14896 | r14897 | |
| 1298 | 1317 | case GREG_CONFIG_ADDRESS: |
| 1299 | 1318 | case GREG_INT_MASK: |
| 1300 | 1319 | if (LOG_GALILEO) |
| 1301 | logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space | |
| 1320 | logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space. | |
| 1302 | 1321 | break; |
| 1303 | 1322 | |
| 1304 | 1323 | default: |
| 1305 | logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space | |
| 1324 | logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space. | |
| 1306 | 1325 | break; |
| 1307 | 1326 | } |
| 1308 | 1327 | } |
| r14896 | r14897 | |
| 1315 | 1334 | * |
| 1316 | 1335 | *************************************/ |
| 1317 | 1336 | |
| 1318 | ||
| 1337 | ||
| 1319 | 1338 | { |
| 1320 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1321 | 1339 | /* if we're not stalled, just write and get out */ |
| 1322 | if (! | |
| 1340 | if (! | |
| 1323 | 1341 | { |
| 1324 | voodoo_w( | |
| 1342 | voodoo_w( | |
| 1325 | 1343 | return; |
| 1326 | 1344 | } |
| 1327 | 1345 | |
| 1328 | 1346 | /* shouldn't get here if the CPU is already stalled */ |
| 1329 | if ( | |
| 1347 | if ( | |
| 1330 | 1348 | fatalerror("seattle_voodoo_w while CPU is stalled"); |
| 1331 | 1349 | |
| 1332 | 1350 | /* remember all the info about this access for later */ |
| 1333 | state->m_cpu_stalled_on_voodoo = TRUE; | |
| 1334 | state->m_cpu_stalled_offset = offset; | |
| 1335 | state->m_cpu_stalled_data = data; | |
| 1336 | state->m_cpu_stalled_mem_mask = mem_mask; | |
| 1351 | m_cpu_stalled_on_voodoo = TRUE; | |
| 1352 | m_cpu_stalled_offset = offset; | |
| 1353 | m_cpu_stalled_data = data; | |
| 1354 | m_cpu_stalled_mem_mask = mem_mask; | |
| 1337 | 1355 | |
| 1338 | 1356 | /* spin until we send the magic trigger */ |
| 1339 | device_spin_until_trigger(&space->device(), 45678); | |
| 1340 | if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo (already stalled)\n", cpu_get_pc(&space->device())); | |
| 1357 | device_spin_until_trigger(&space.device(), 45678); | |
| 1358 | if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo (already stalled)\n", cpu_get_pc(&space.device())); | |
| 1341 | 1359 | } |
| 1342 | 1360 | |
| 1343 | 1361 | |
| r14896 | r14897 | |
| 1405 | 1423 | * |
| 1406 | 1424 | *************************************/ |
| 1407 | 1425 | |
| 1408 | ||
| 1426 | ||
| 1409 | 1427 | { |
| 1410 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1411 | return state->m_pending_analog_read; | |
| 1428 | return m_pending_analog_read; | |
| 1412 | 1429 | } |
| 1413 | 1430 | |
| 1414 | 1431 | |
| 1415 | ||
| 1432 | ||
| 1416 | 1433 | { |
| 1417 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1418 | 1434 | static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" }; |
| 1419 | 1435 | |
| 1420 | 1436 | if (data < 8 || data > 15) |
| 1421 | logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(&space->device()), data); | |
| 1422 | state->m_pending_analog_read = input_port_read(space->machine(), portnames[data & 7]); | |
| 1437 | logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(&space.device()), data); | |
| 1438 | m_pending_analog_read = input_port_read(machine(), portnames[data & 7]); | |
| 1423 | 1439 | } |
| 1424 | 1440 | |
| 1425 | 1441 | |
| r14896 | r14897 | |
| 1430 | 1446 | * |
| 1431 | 1447 | *************************************/ |
| 1432 | 1448 | |
| 1433 | ||
| 1449 | ||
| 1434 | 1450 | { |
| 1435 | 1451 | UINT32 result = 0; |
| 1436 | 1452 | |
| 1437 | 1453 | switch (offset) |
| 1438 | 1454 | { |
| 1439 | 1455 | case 0: /* low 8 bits of X */ |
| 1440 | result = (input_port_read( | |
| 1456 | result = (input_port_read( | |
| 1441 | 1457 | break; |
| 1442 | 1458 | |
| 1443 | 1459 | case 1: /* upper 4 bits of X */ |
| 1444 | result = (input_port_read(space->machine(), "LIGHT0_X") >> 4) & 0x0f; | |
| 1445 | result |= (input_port_read(space->machine(), "FAKE") & 0x03) << 4; | |
| 1460 | result = (input_port_read(machine(), "LIGHT0_X") >> 4) & 0x0f; | |
| 1461 | result |= (input_port_read(machine(), "FAKE") & 0x03) << 4; | |
| 1446 | 1462 | result |= 0x40; |
| 1447 | 1463 | break; |
| 1448 | 1464 | |
| 1449 | 1465 | case 2: /* low 8 bits of Y */ |
| 1450 | result = (input_port_read( | |
| 1466 | result = (input_port_read( | |
| 1451 | 1467 | break; |
| 1452 | 1468 | |
| 1453 | 1469 | case 3: /* upper 4 bits of Y */ |
| 1454 | result = (input_port_read( | |
| 1470 | result = (input_port_read( | |
| 1455 | 1471 | break; |
| 1456 | 1472 | |
| 1457 | 1473 | case 4: /* low 8 bits of X */ |
| 1458 | result = (input_port_read( | |
| 1474 | result = (input_port_read( | |
| 1459 | 1475 | break; |
| 1460 | 1476 | |
| 1461 | 1477 | case 5: /* upper 4 bits of X */ |
| 1462 | result = (input_port_read(space->machine(), "LIGHT1_X") >> 4) & 0x0f; | |
| 1463 | result |= (input_port_read(space->machine(), "FAKE") & 0x30); | |
| 1478 | result = (input_port_read(machine(), "LIGHT1_X") >> 4) & 0x0f; | |
| 1479 | result |= (input_port_read(machine(), "FAKE") & 0x30); | |
| 1464 | 1480 | result |= 0x40; |
| 1465 | 1481 | break; |
| 1466 | 1482 | |
| 1467 | 1483 | case 6: /* low 8 bits of Y */ |
| 1468 | result = (input_port_read( | |
| 1484 | result = (input_port_read( | |
| 1469 | 1485 | break; |
| 1470 | 1486 | |
| 1471 | 1487 | case 7: /* upper 4 bits of Y */ |
| 1472 | result = (input_port_read( | |
| 1488 | result = (input_port_read( | |
| 1473 | 1489 | break; |
| 1474 | 1490 | } |
| 1475 | 1491 | return result; |
| 1476 | 1492 | } |
| 1477 | 1493 | |
| 1478 | 1494 | |
| 1479 | ||
| 1495 | ||
| 1480 | 1496 | { |
| 1481 | 1497 | logerror("carnevil_gun_w(%d) = %02X\n", offset, data); |
| 1482 | 1498 | } |
| r14896 | r14897 | |
| 1553 | 1569 | break; |
| 1554 | 1570 | |
| 1555 | 1571 | case WREG_ANALOG: |
| 1556 | result = analog_port_r(device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, mem_mask); | |
| 1572 | result = state->analog_port_r(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, mem_mask); | |
| 1557 | 1573 | break; |
| 1558 | 1574 | |
| 1559 | 1575 | case WREG_ETHER_DATA: |
| r14896 | r14897 | |
| 1585 | 1601 | break; |
| 1586 | 1602 | |
| 1587 | 1603 | case WREG_ANALOG: |
| 1588 | analog_port_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, data, mem_mask); | |
| 1604 | state->analog_port_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, data, mem_mask); | |
| 1589 | 1605 | break; |
| 1590 | 1606 | |
| 1591 | 1607 | case WREG_ETHER_DATA: |
| r14896 | r14897 | |
| 1602 | 1618 | * |
| 1603 | 1619 | *************************************/ |
| 1604 | 1620 | |
| 1605 | ||
| 1621 | ||
| 1606 | 1622 | { |
| 1607 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1608 | if (state->m_cmos_write_enabled) | |
| 1609 | COMBINE_DATA(state->m_nvram + offset); | |
| 1610 | state->m_cmos_write_enabled = FALSE; | |
| 1623 | if (m_cmos_write_enabled) | |
| 1624 | COMBINE_DATA(m_nvram + offset); | |
| 1625 | m_cmos_write_enabled = FALSE; | |
| 1611 | 1626 | } |
| 1612 | 1627 | |
| 1613 | 1628 | |
| 1614 | ||
| 1629 | ||
| 1615 | 1630 | { |
| 1616 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1617 | return state->m_nvram[offset]; | |
| 1631 | return m_nvram.target()[offset]; | |
| 1618 | 1632 | } |
| 1619 | 1633 | |
| 1620 | 1634 | |
| 1621 | ||
| 1635 | ||
| 1622 | 1636 | { |
| 1623 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1624 | state->m_cmos_write_enabled = TRUE; | |
| 1637 | m_cmos_write_enabled = TRUE; | |
| 1625 | 1638 | } |
| 1626 | 1639 | |
| 1627 | 1640 | |
| 1628 | ||
| 1641 | ||
| 1629 | 1642 | { |
| 1630 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1631 | return state->m_cmos_write_enabled; | |
| 1643 | return m_cmos_write_enabled; | |
| 1632 | 1644 | } |
| 1633 | 1645 | |
| 1634 | 1646 | |
| r14896 | r14897 | |
| 1639 | 1651 | * |
| 1640 | 1652 | *************************************/ |
| 1641 | 1653 | |
| 1642 | ||
| 1654 | ||
| 1643 | 1655 | { |
| 1644 | device_eat_cycles(&space | |
| 1656 | device_eat_cycles(&space. | |
| 1645 | 1657 | } |
| 1646 | 1658 | |
| 1647 | 1659 | |
| 1648 | ||
| 1660 | ||
| 1649 | 1661 | { |
| 1650 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1651 | COMBINE_DATA(state->m_asic_reset); | |
| 1652 | if (!(*state->m_asic_reset & 0x0002)) | |
| 1653 | midway_ioasic_reset(space->machine()); | |
| 1662 | COMBINE_DATA(m_asic_reset.target()); | |
| 1663 | if (!(*m_asic_reset & 0x0002)) | |
| 1664 | midway_ioasic_reset(machine()); | |
| 1654 | 1665 | } |
| 1655 | 1666 | |
| 1656 | 1667 | |
| 1657 | ||
| 1668 | ||
| 1658 | 1669 | { |
| 1659 | midway_ioasic_fifo_w( | |
| 1670 | midway_ioasic_fifo_w( | |
| 1660 | 1671 | } |
| 1661 | 1672 | |
| 1662 | 1673 | |
| 1663 | ||
| 1674 | ||
| 1664 | 1675 | { |
| 1665 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1666 | return state->m_status_leds | 0xffffff00; | |
| 1676 | return m_status_leds | 0xffffff00; | |
| 1667 | 1677 | } |
| 1668 | 1678 | |
| 1669 | 1679 | |
| 1670 | ||
| 1680 | ||
| 1671 | 1681 | { |
| 1672 | seattle_state *state = space->machine().driver_data<seattle_state>(); | |
| 1673 | 1682 | if (ACCESSING_BITS_0_7) |
| 1674 | | |
| 1683 | | |
| 1675 | 1684 | } |
| 1676 | 1685 | |
| 1677 | 1686 | |
| r14896 | r14897 | |
| 1763 | 1772 | |
| 1764 | 1773 | static ADDRESS_MAP_START( seattle_map, AS_PROGRAM, 32, seattle_state ) |
| 1765 | 1774 | ADDRESS_MAP_UNMAP_HIGH |
| 1766 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(m_rambase) // wg3dh only has 4MB; sfrush, blitz99 8MB | |
| 1767 | AM_RANGE(0x08000000, 0x08ffffff) AM_DEVREAD_LEGACY("voodoo", voodoo_r) AM_WRITE_LEGACY(seattle_voodoo_w) | |
| 1775 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_SHARE("rambase") // wg3dh only has 4MB; sfrush, blitz99 8MB | |
| 1776 | AM_RANGE(0x08000000, 0x08ffffff) AM_DEVREAD_LEGACY("voodoo", voodoo_r) AM_WRITE(seattle_voodoo_w) | |
| 1768 | 1777 | AM_RANGE(0x0a000000, 0x0a0003ff) AM_DEVREADWRITE_LEGACY("ide", seattle_ide_r, ide_controller32_w) |
| 1769 | 1778 | AM_RANGE(0x0a00040c, 0x0a00040f) AM_NOP // IDE-related, but annoying |
| 1770 | 1779 | AM_RANGE(0x0a000f00, 0x0a000f07) AM_DEVREADWRITE_LEGACY("ide", ide_bus_master32_r, ide_bus_master32_w) |
| 1771 | AM_RANGE(0x0c000000, 0x0c000fff) AM_READWRITE_LEGACY(galileo_r, galileo_w) | |
| 1772 | AM_RANGE(0x13000000, 0x13000003) AM_WRITE_LEGACY(asic_fifo_w) | |
| 1780 | AM_RANGE(0x0c000000, 0x0c000fff) AM_READWRITE(galileo_r, galileo_w) | |
| 1781 | AM_RANGE(0x13000000, 0x13000003) AM_WRITE(asic_fifo_w) | |
| 1773 | 1782 | AM_RANGE(0x16000000, 0x1600003f) AM_READWRITE_LEGACY(midway_ioasic_r, midway_ioasic_w) |
| 1774 | AM_RANGE(0x16100000, 0x1611ffff) AM_READWRITE_LEGACY(cmos_r, cmos_w) AM_SHARE("nvram") | |
| 1775 | AM_RANGE(0x17000000, 0x17000003) AM_READWRITE_LEGACY(cmos_protect_r, cmos_protect_w) | |
| 1776 | AM_RANGE(0x17100000, 0x17100003) AM_WRITE_LEGACY(seattle_watchdog_w) | |
| 1777 | AM_RANGE(0x17300000, 0x17300003) AM_RAM_WRITE_LEGACY(seattle_interrupt_enable_w) AM_BASE(m_interrupt_enable) | |
| 1778 | AM_RANGE(0x17400000, 0x17400003) AM_RAM_WRITE_LEGACY(interrupt_config_w) AM_BASE(m_interrupt_config) | |
| 1779 | AM_RANGE(0x17500000, 0x17500003) AM_READ_LEGACY(interrupt_state_r) | |
| 1780 | AM_RANGE(0x17600000, 0x17600003) AM_READ_LEGACY(interrupt_state2_r) | |
| 1781 | AM_RANGE(0x17700000, 0x17700003) AM_WRITE_LEGACY(vblank_clear_w) | |
| 1783 | AM_RANGE(0x16100000, 0x1611ffff) AM_READWRITE(cmos_r, cmos_w) AM_SHARE("nvram") | |
| 1784 | AM_RANGE(0x17000000, 0x17000003) AM_READWRITE(cmos_protect_r, cmos_protect_w) | |
| 1785 | AM_RANGE(0x17100000, 0x17100003) AM_WRITE(seattle_watchdog_w) | |
| 1786 | AM_RANGE(0x17300000, 0x17300003) AM_RAM_WRITE(seattle_interrupt_enable_w) AM_SHARE("interrupt_enable") | |
| 1787 | AM_RANGE(0x17400000, 0x17400003) AM_RAM_WRITE(interrupt_config_w) AM_SHARE("interrupt_config") | |
| 1788 | AM_RANGE(0x17500000, 0x17500003) AM_READ(interrupt_state_r) | |
| 1789 | AM_RANGE(0x17600000, 0x17600003) AM_READ(interrupt_state2_r) | |
| 1790 | AM_RANGE(0x17700000, 0x17700003) AM_WRITE(vblank_clear_w) | |
| 1782 | 1791 | AM_RANGE(0x17800000, 0x17800003) AM_NOP |
| 1783 | AM_RANGE(0x17900000, 0x17900003) AM_READWRITE_LEGACY(status_leds_r, status_leds_w) | |
| 1784 | AM_RANGE(0x17f00000, 0x17f00003) AM_RAM_WRITE_LEGACY(asic_reset_w) AM_BASE(m_asic_reset) | |
| 1785 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_BASE(m_rombase) | |
| 1792 | AM_RANGE(0x17900000, 0x17900003) AM_READWRITE(status_leds_r, status_leds_w) | |
| 1793 | AM_RANGE(0x17f00000, 0x17f00003) AM_RAM_WRITE(asic_reset_w) AM_SHARE("asic_reset") | |
| 1794 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rombase") | |
| 1786 | 1795 | ADDRESS_MAP_END |
| 1787 | 1796 | |
| 1788 | 1797 | |
| r14896 | r14897 | |
| 2831 | 2840 | |
| 2832 | 2841 | case FLAGSTAFF_CONFIG: |
| 2833 | 2842 | /* set up the analog inputs */ |
| 2834 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2843 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2835 | 2844 | |
| 2836 | 2845 | /* set up the ethernet controller */ |
| 2837 | 2846 | device = machine.device("ethernet"); |
| r14896 | r14897 | |
| 2928 | 2937 | init_common(machine, MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG); |
| 2929 | 2938 | |
| 2930 | 2939 | /* for some reason, the code in the ROM appears buggy; this is a small patch to fix it */ |
| 2931 | state->m_rombase[0x934/4] += 4; | |
| 2940 | state->m_rombase.target()[0x934/4] += 4; | |
| 2932 | 2941 | |
| 2933 | 2942 | /* main CPU speedups */ |
| 2934 | 2943 | mips3drc_add_hotspot(machine.device("maincpu"), 0x80135510, 0x3C028024, 250); /* confirmed */ |
| r14896 | r14897 | |
| 2964 | 2973 | init_common(machine, MIDWAY_IOASIC_CARNEVIL, 469/* 469 or 486 or 528 */, 80, SEATTLE_CONFIG); |
| 2965 | 2974 | |
| 2966 | 2975 | /* set up the gun */ |
| 2967 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16800000, 0x1680001f, FUNC(carnevil_gun_r), FUNC(carnevil_gun_w)); | |
| 2976 | seattle_state *state = machine.driver_data<seattle_state>(); | |
| 2977 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x16800000, 0x1680001f, read32_delegate(FUNC(seattle_state::carnevil_gun_r),state), write32_delegate(FUNC(seattle_state::carnevil_gun_w),state)); | |
| 2968 | 2978 | |
| 2969 | 2979 | /* speedups */ |
| 2970 | 2980 | mips3drc_add_hotspot(machine.device("maincpu"), 0x8015176C, 0x3C03801A, 250); /* confirmed */ |
| r14896 | r14897 | |
|---|---|---|
| 296 | 296 | WRITE16_MEMBER(alpha68k_state::kyros_sound_w) |
| 297 | 297 | { |
| 298 | 298 | if(ACCESSING_BITS_8_15) |
| 299 | soundlatch_w(space, 0, (data >> 8) & 0xff); | |
| 299 | soundlatch_byte_w(space, 0, (data >> 8) & 0xff); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | WRITE16_MEMBER(alpha68k_state::alpha68k_II_sound_w) |
| 303 | 303 | { |
| 304 | 304 | if(ACCESSING_BITS_0_7) |
| 305 | soundlatch_w(space, 0, data & 0xff); | |
| 305 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | WRITE16_MEMBER(alpha68k_state::alpha68k_V_sound_w) |
| 309 | 309 | { |
| 310 | 310 | /* Sound & fix bank select are in the same word */ |
| 311 | 311 | if(ACCESSING_BITS_0_7) |
| 312 | soundlatch_w(space, 0, data & 0xff); | |
| 312 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 313 | 313 | if(ACCESSING_BITS_8_15) |
| 314 | 314 | alpha68k_V_video_bank_w(machine(), (data >> 8) & 0xff); |
| 315 | 315 | } |
| r14896 | r14897 | |
| 319 | 319 | |
| 320 | 320 | if (ACCESSING_BITS_0_7) |
| 321 | 321 | { |
| 322 | soundlatch_w(space, 0, data); | |
| 322 | soundlatch_byte_w(space, 0, data); | |
| 323 | 323 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 324 | 324 | } |
| 325 | 325 | } |
| r14896 | r14897 | |
| 329 | 329 | |
| 330 | 330 | if (ACCESSING_BITS_0_7) |
| 331 | 331 | { |
| 332 | soundlatch_w(space, 0, data); | |
| 332 | soundlatch_byte_w(space, 0, data); | |
| 333 | 333 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 334 | 334 | } |
| 335 | 335 | } |
| r14896 | r14897 | |
| 750 | 750 | static ADDRESS_MAP_START( kyros_sound_map, AS_PROGRAM, 8, alpha68k_state ) |
| 751 | 751 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 752 | 752 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 753 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 754 | AM_RANGE(0xe002, 0xe002) AM_WRITE(soundlatch_clear_w) | |
| 753 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 754 | AM_RANGE(0xe002, 0xe002) AM_WRITE(soundlatch_clear_byte_w) | |
| 755 | 755 | AM_RANGE(0xe004, 0xe004) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 756 | 756 | AM_RANGE(0xe006, 0xe00e) AM_WRITENOP // soundboard I/O's, ignored |
| 757 | 757 | /* reference only |
| r14896 | r14897 | |
| 766 | 766 | static ADDRESS_MAP_START( sstingry_sound_map, AS_PROGRAM, 8, alpha68k_state ) |
| 767 | 767 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 768 | 768 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 769 | AM_RANGE(0xc100, 0xc100) AM_READ(soundlatch_r) | |
| 770 | AM_RANGE(0xc102, 0xc102) AM_WRITE(soundlatch_clear_w) | |
| 769 | AM_RANGE(0xc100, 0xc100) AM_READ(soundlatch_byte_r) | |
| 770 | AM_RANGE(0xc102, 0xc102) AM_WRITE(soundlatch_clear_byte_w) | |
| 771 | 771 | AM_RANGE(0xc104, 0xc104) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 772 | 772 | AM_RANGE(0xc106, 0xc10e) AM_WRITENOP // soundboard I/O's, ignored |
| 773 | 773 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 779 | 779 | |
| 780 | 780 | static ADDRESS_MAP_START( alpha68k_I_s_map, AS_PROGRAM, 8, alpha68k_state ) |
| 781 | 781 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 782 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(soundlatch_r, soundlatch_clear_w) | |
| 782 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(soundlatch_byte_r, soundlatch_clear_byte_w) | |
| 783 | 783 | AM_RANGE(0xe800, 0xe800) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_status_port_r, ym3812_control_port_w) |
| 784 | 784 | AM_RANGE(0xec00, 0xec00) AM_DEVWRITE_LEGACY("ymsnd", ym3812_write_port_w) |
| 785 | 785 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| r14896 | r14897 | |
| 790 | 790 | static ADDRESS_MAP_START( tnextspc_sound_map, AS_PROGRAM, 8, alpha68k_state ) |
| 791 | 791 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 792 | 792 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 793 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(soundlatch_r, soundlatch_clear_w) | |
| 793 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(soundlatch_byte_r, soundlatch_clear_byte_w) | |
| 794 | 794 | ADDRESS_MAP_END |
| 795 | 795 | |
| 796 | 796 | static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, alpha68k_state ) |
| 797 | 797 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 798 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_r, soundlatch_clear_w) | |
| 798 | AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_byte_r, soundlatch_clear_byte_w) | |
| 799 | 799 | AM_RANGE(0x08, 0x08) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 800 | 800 | AM_RANGE(0x0a, 0x0b) AM_DEVWRITE_LEGACY("ym2", ym2413_w) |
| 801 | 801 | AM_RANGE(0x0c, 0x0d) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| r14896 | r14897 | |
| 815 | 815 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 816 | 816 | AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 817 | 817 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_data_w) |
| 818 | AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_clear_w) | |
| 818 | AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_clear_byte_w) | |
| 819 | 819 | AM_RANGE(0x06, 0x06) AM_WRITENOP |
| 820 | 820 | ADDRESS_MAP_END |
| 821 | 821 | |
| r14896 | r14897 | |
| 1823 | 1823 | { |
| 1824 | 1824 | AY8910_LEGACY_OUTPUT, |
| 1825 | 1825 | AY8910_DEFAULT_LOADS, |
| 1826 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r) | |
| 1826 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r) | |
| 1827 | 1827 | }; |
| 1828 | 1828 | |
| 1829 | 1829 | WRITE8_MEMBER(alpha68k_state::porta_w) |
| r14896 | r14897 | |
| 1847 | 1847 | { |
| 1848 | 1848 | AY8910_LEGACY_OUTPUT, |
| 1849 | 1849 | AY8910_DEFAULT_LOADS, |
| 1850 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 1850 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 1851 | 1851 | DEVCB_NULL, |
| 1852 | 1852 | DEVCB_DRIVER_MEMBER(alpha68k_state, porta_w), |
| 1853 | 1853 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 123 | 123 | : driver_device(mconfig, type, tag), |
| 124 | 124 | m_maincpu(*this,"maincpu"), |
| 125 | 125 | m_microtouch(*this,"microtouch") |
| 126 | { } | |
| 126 | , | |
| 127 | m_regs(*this, "regs"), | |
| 128 | m_galgames_ram(*this, "galgames_ram"){ } | |
| 127 | 129 | |
| 128 | DECLARE_WRITE8_MEMBER(microtouch_tx); | |
| 130 | required_device<cpu_device> m_maincpu; | |
| 131 | optional_device<microtouch_device> m_microtouch; | |
| 132 | required_shared_ptr<UINT16> m_regs; | |
| 133 | required_shared_ptr<UINT16> m_galgames_ram; | |
| 129 | 134 | |
| 130 | 135 | int m_okibank; |
| 131 | 136 | UINT8 m_rtc_ram[8]; |
| 132 | 137 | bitmap_ind16 m_bitmap[2][2]; |
| 133 | UINT16 *m_regs; | |
| 134 | 138 | UINT16 m_color; |
| 135 | 139 | UINT16 m_addr; |
| 136 | 140 | UINT32 m_gfx_offs; |
| 137 | 141 | UINT32 m_gfx_size; |
| 138 | 142 | int (*m_compute_addr) (UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high); |
| 139 | UINT16 *m_galgames_ram; | |
| 140 | 143 | UINT16 m_galgames_cart; |
| 141 | 144 | UINT32 m_palette_offset; |
| 142 | 145 | UINT8 m_palette_index; |
| 143 | 146 | UINT8 m_palette_data[3]; |
| 144 | 147 | device_t *m_duart68681; |
| 145 | 148 | |
| 146 | required_device<cpu_device> m_maincpu; | |
| 147 | optional_device<microtouch_device> m_microtouch; | |
| 149 | DECLARE_WRITE8_MEMBER(microtouch_tx); | |
| 148 | 150 | DECLARE_READ16_MEMBER(rtc_r); |
| 149 | 151 | DECLARE_WRITE16_MEMBER(rtc_w); |
| 150 | 152 | DECLARE_WRITE16_MEMBER(tmaster_color_w); |
| r14896 | r14897 | |
| 358 | 360 | |
| 359 | 361 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 360 | 362 | |
| 361 | if (layers_ctrl & 1) copybitmap_trans(bitmap, state->m_bitmap[0][(state->m_regs[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff); | |
| 362 | if (layers_ctrl & 2) copybitmap_trans(bitmap, state->m_bitmap[1][(state->m_regs[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff); | |
| 363 | if (layers_ctrl & 1) copybitmap_trans(bitmap, state->m_bitmap[0][(state->m_regs.target()[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff); | |
| 364 | if (layers_ctrl & 2) copybitmap_trans(bitmap, state->m_bitmap[1][(state->m_regs.target()[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff); | |
| 363 | 365 | |
| 364 | 366 | return 0; |
| 365 | 367 | } |
| r14896 | r14897 | |
| 383 | 385 | |
| 384 | 386 | UINT16 pen; |
| 385 | 387 | |
| 386 | buffer = (state->m_regs[0x02/2] >> 8) & 3; // 1 bit per layer, selects the currently displayed buffer | |
| 387 | sw = state->m_regs[0x04/2]; | |
| 388 | sx = state->m_regs[0x06/2]; | |
| 389 | sh = state->m_regs[0x08/2] + 1; | |
| 390 | sy = state->m_regs[0x0a/2]; | |
| 388 | buffer = (state->m_regs.target()[0x02/2] >> 8) & 3; // 1 bit per layer, selects the currently displayed buffer | |
| 389 | sw = state->m_regs.target()[0x04/2]; | |
| 390 | sx = state->m_regs.target()[0x06/2]; | |
| 391 | sh = state->m_regs.target()[0x08/2] + 1; | |
| 392 | sy = state->m_regs.target()[0x0a/2]; | |
| 391 | 393 | addr = (*state->m_compute_addr)( |
| 392 | state->m_regs[0x0c/2], | |
| 393 | state->m_regs[0x0e/2], state->m_addr); | |
| 394 | mode = state->m_regs[0x10/2]; | |
| 394 | state->m_regs.target()[0x0c/2], | |
| 395 | state->m_regs.target()[0x0e/2], state->m_addr); | |
| 396 | mode = state->m_regs.target()[0x10/2]; | |
| 395 | 397 | |
| 396 | 398 | layer = (mode >> 7) & 1; // layer to draw to |
| 397 | 399 | buffer = ((mode >> 6) & 1) ^ ((buffer >> layer) & 1); // bit 6 selects whether to use the opposite buffer to that displayed |
| r14896 | r14897 | |
| 538 | 540 | |
| 539 | 541 | AM_RANGE( 0x580000, 0x580001 ) AM_WRITENOP // often |
| 540 | 542 | |
| 541 | AM_RANGE( 0x600000, 0x601fff ) AM_RAM_WRITE(paletteram | |
| 543 | AM_RANGE( 0x600000, 0x601fff ) AM_RAM_WRITE(paletteram | |
| 542 | 544 | |
| 543 | 545 | AM_RANGE( 0x800000, 0x800001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff ) |
| 544 | 546 |
| r14896 | r14897 | |
|---|---|---|
| 1360 | 1360 | cputag_set_input_line(machine, "mcu",INPUT_LINE_RESET,ASSERT_LINE); /* MCU */ |
| 1361 | 1361 | } /* InitDSP */ |
| 1362 | 1362 | |
| 1363 | ||
| 1363 | ||
| 1364 | 1364 | { |
| 1365 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1366 | return state->m_mMasterBIOZ; | |
| 1365 | return m_mMasterBIOZ; | |
| 1367 | 1366 | } /* pdp_status_r */ |
| 1368 | 1367 | |
| 1369 | static void | |
| 1370 | WriteToPointRAM( namcos22_state *state, offs_t offs, UINT32 data ) | |
| 1368 | void namcos22_state::WriteToPointRAM(offs_t offs, UINT32 data ) | |
| 1371 | 1369 | { |
| 1372 | 1370 | offs &= 0xffffff; /* 24 bit addressing */ |
| 1373 | if( | |
| 1371 | if( | |
| 1374 | 1372 | { |
| 1375 | 1373 | if( offs>=0xf80000 && offs<=0xf9ffff ) |
| 1376 | | |
| 1374 | | |
| 1377 | 1375 | } |
| 1378 | 1376 | else |
| 1379 | 1377 | { |
| 1380 | 1378 | if( offs>=0xf00000 && offs<=0xf1ffff ) |
| 1381 | | |
| 1379 | | |
| 1382 | 1380 | } |
| 1383 | 1381 | } /* WriteToPointRAM */ |
| 1384 | 1382 | |
| 1385 | static UINT32 | |
| 1386 | ReadFromCommRAM( namcos22_state *state, offs_t offs ) | |
| 1383 | UINT32 namcos22_state::ReadFromCommRAM(offs_t offs ) | |
| 1387 | 1384 | { |
| 1388 | return | |
| 1385 | return | |
| 1389 | 1386 | } /* ReadFromCommRAM */ |
| 1390 | 1387 | |
| 1391 | static void | |
| 1392 | WriteToCommRAM( namcos22_state *state, offs_t offs, UINT32 data ) | |
| 1388 | void namcos22_state::WriteToCommRAM(offs_t offs, UINT32 data ) | |
| 1393 | 1389 | { |
| 1394 | if (data & 0x00800000) state->m_polygonram[offs&0x7fff] = data | 0xff000000; | |
| 1395 | else state->m_polygonram[offs&0x7fff] = data & 0x00ffffff; | |
| 1390 | if (data & 0x00800000) m_polygonram[offs&0x7fff] = data | 0xff000000; | |
| 1391 | else m_polygonram[offs&0x7fff] = data & 0x00ffffff; | |
| 1396 | 1392 | } /* WriteToCommRAM */ |
| 1397 | 1393 | |
| 1398 | ||
| 1394 | ||
| 1399 | 1395 | { |
| 1400 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1401 | 1396 | /* this feature appears to be only used on Super System22 hardware */ |
| 1402 | if( | |
| 1397 | if( | |
| 1403 | 1398 | { |
| 1404 | UINT16 offs = state->m_polygonram[0x20000/4-1]; | |
| 1405 | state->m_mMasterBIOZ = 1; | |
| 1399 | UINT16 offs = m_polygonram[0x20000/4-1]; | |
| 1400 | m_mMasterBIOZ = 1; | |
| 1406 | 1401 | for(;;) |
| 1407 | 1402 | { |
| 1408 | 1403 | UINT16 start = offs; |
| 1409 | UINT16 cmd = ReadFromCommRAM( | |
| 1404 | UINT16 cmd = ReadFromCommRAM( | |
| 1410 | 1405 | UINT32 srcAddr; |
| 1411 | 1406 | UINT32 dstAddr; |
| 1412 | 1407 | UINT32 numWords; |
| r14896 | r14897 | |
| 1418 | 1413 | break; |
| 1419 | 1414 | |
| 1420 | 1415 | case 0xfff5: /* write to point ram */ |
| 1421 | dstAddr = ReadFromCommRAM(state, offs++); /* 32 bit PointRAM address */ | |
| 1422 | data = ReadFromCommRAM(state, offs++); /* 24 bit data */ | |
| 1423 | WriteToPointRAM( state, dstAddr, data ); | |
| 1416 | dstAddr = ReadFromCommRAM(offs++); /* 32 bit PointRAM address */ | |
| 1417 | data = ReadFromCommRAM(offs++); /* 24 bit data */ | |
| 1418 | WriteToPointRAM(dstAddr, data ); | |
| 1424 | 1419 | break; |
| 1425 | 1420 | |
| 1426 | 1421 | case 0xfff6: /* read word from point ram */ |
| 1427 | srcAddr = ReadFromCommRAM(state, offs++); /* 32 bit PointRAM address */ | |
| 1428 | dstAddr = ReadFromCommRAM(state, offs++); /* CommRAM address; receives 24 bit PointRAM data */ | |
| 1429 | data = namcos22_point_rom_r( space->machine(), srcAddr ); | |
| 1430 | WriteToCommRAM( state, dstAddr, data ); | |
| 1422 | srcAddr = ReadFromCommRAM(offs++); /* 32 bit PointRAM address */ | |
| 1423 | dstAddr = ReadFromCommRAM(offs++); /* CommRAM address; receives 24 bit PointRAM data */ | |
| 1424 | data = namcos22_point_rom_r( machine(), srcAddr ); | |
| 1425 | WriteToCommRAM(dstAddr, data ); | |
| 1431 | 1426 | break; |
| 1432 | 1427 | |
| 1433 | 1428 | case 0xfff7: /* block move (CommRAM to CommRAM) */ |
| 1434 | srcAddr = ReadFromCommRAM(state, offs++); | |
| 1435 | dstAddr = ReadFromCommRAM(state, offs++); | |
| 1436 | numWords = ReadFromCommRAM(state, offs++); | |
| 1429 | srcAddr = ReadFromCommRAM(offs++); | |
| 1430 | dstAddr = ReadFromCommRAM(offs++); | |
| 1431 | numWords = ReadFromCommRAM(offs++); | |
| 1437 | 1432 | while( numWords-- ) |
| 1438 | 1433 | { |
| 1439 | data = ReadFromCommRAM(state, srcAddr++); | |
| 1440 | WriteToCommRAM( state, dstAddr++, data ); | |
| 1434 | data = ReadFromCommRAM(srcAddr++); | |
| 1435 | WriteToCommRAM(dstAddr++, data ); | |
| 1441 | 1436 | } |
| 1442 | 1437 | break; |
| 1443 | 1438 | |
| 1444 | 1439 | case 0xfffa: /* read block from point ram */ |
| 1445 | srcAddr = ReadFromCommRAM(state, offs++); /* 32 bit PointRAM address */ | |
| 1446 | dstAddr = ReadFromCommRAM(state, offs++); /* CommRAM address; receives data */ | |
| 1447 | numWords = ReadFromCommRAM(state, offs++); /* block size */ | |
| 1440 | srcAddr = ReadFromCommRAM(offs++); /* 32 bit PointRAM address */ | |
| 1441 | dstAddr = ReadFromCommRAM(offs++); /* CommRAM address; receives data */ | |
| 1442 | numWords = ReadFromCommRAM(offs++); /* block size */ | |
| 1448 | 1443 | while( numWords-- ) |
| 1449 | 1444 | { |
| 1450 | data = namcos22_point_rom_r( space->machine(), srcAddr++ ); | |
| 1451 | WriteToCommRAM( state, dstAddr++, data ); | |
| 1445 | data = namcos22_point_rom_r( machine(), srcAddr++ ); | |
| 1446 | WriteToCommRAM(dstAddr++, data ); | |
| 1452 | 1447 | } |
| 1453 | 1448 | break; |
| 1454 | 1449 | |
| 1455 | 1450 | case 0xfffb: /* write block to point ram */ |
| 1456 | dstAddr = ReadFromCommRAM(state, offs++); /* 32 bit PointRAM address */ | |
| 1457 | numWords = ReadFromCommRAM(state, offs++); /* block size */ | |
| 1451 | dstAddr = ReadFromCommRAM(offs++); /* 32 bit PointRAM address */ | |
| 1452 | numWords = ReadFromCommRAM(offs++); /* block size */ | |
| 1458 | 1453 | while( numWords-- ) |
| 1459 | 1454 | { |
| 1460 | data = ReadFromCommRAM( state, offs++ ); /* 24 bit source data */ | |
| 1461 | WriteToPointRAM( state, dstAddr++, data ); | |
| 1455 | data = ReadFromCommRAM(offs++ ); /* 24 bit source data */ | |
| 1456 | WriteToPointRAM(dstAddr++, data ); | |
| 1462 | 1457 | } |
| 1463 | 1458 | break; |
| 1464 | 1459 | |
| 1465 | 1460 | case 0xfffc: /* point ram to point ram */ |
| 1466 | srcAddr = ReadFromCommRAM(state, offs++); | |
| 1467 | dstAddr = ReadFromCommRAM(state, offs++); | |
| 1468 | numWords = ReadFromCommRAM(state, offs++); | |
| 1461 | srcAddr = ReadFromCommRAM(offs++); | |
| 1462 | dstAddr = ReadFromCommRAM(offs++); | |
| 1463 | numWords = ReadFromCommRAM(offs++); | |
| 1469 | 1464 | while( numWords-- ) |
| 1470 | 1465 | { |
| 1471 | data = namcos22_point_rom_r( space->machine(), srcAddr++ ); | |
| 1472 | WriteToPointRAM( state, dstAddr++, data ); | |
| 1466 | data = namcos22_point_rom_r( machine(), srcAddr++ ); | |
| 1467 | WriteToPointRAM(dstAddr++, data ); | |
| 1473 | 1468 | } |
| 1474 | 1469 | break; |
| 1475 | 1470 | |
| 1476 | 1471 | case 0xfffd: /* direct command to render device */ |
| 1477 | 1472 | // len -> command (eg. BB0003) -> data |
| 1478 | numWords = ReadFromCommRAM( | |
| 1473 | numWords = ReadFromCommRAM( | |
| 1479 | 1474 | while( numWords-- ) |
| 1480 | 1475 | { |
| 1481 | data = ReadFromCommRAM( | |
| 1476 | data = ReadFromCommRAM( | |
| 1482 | 1477 | //namcos22_WriteDataToRenderDevice( data ); |
| 1483 | 1478 | } |
| 1484 | 1479 | break; |
| 1485 | 1480 | |
| 1486 | 1481 | case 0xfffe: /* unknown */ |
| 1487 | data = ReadFromCommRAM( | |
| 1482 | data = ReadFromCommRAM( | |
| 1488 | 1483 | break; |
| 1489 | 1484 | |
| 1490 | 1485 | case 0xffff: /* "goto" command */ |
| 1491 | offs = ReadFromCommRAM( | |
| 1486 | offs = ReadFromCommRAM( | |
| 1492 | 1487 | if( offs == start ) |
| 1493 | 1488 | { /* most commands end with a "goto self" */ |
| 1494 | 1489 | return 0; |
| r14896 | r14897 | |
| 1500 | 1495 | return 0; |
| 1501 | 1496 | } |
| 1502 | 1497 | } /* for(;;) */ |
| 1503 | } /* | |
| 1498 | } /* | |
| 1504 | 1499 | return 0; |
| 1505 | 1500 | } /* pdp_begin_r */ |
| 1506 | 1501 | |
| 1507 | ||
| 1502 | ||
| 1508 | 1503 | { |
| 1509 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1510 | return state->m_mpSlaveExternalRAM[offset]; | |
| 1504 | return m_mpSlaveExternalRAM[offset]; | |
| 1511 | 1505 | } |
| 1512 | 1506 | |
| 1513 | ||
| 1507 | ||
| 1514 | 1508 | { |
| 1515 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1516 | COMBINE_DATA( &state->m_mpSlaveExternalRAM[offset] ); | |
| 1509 | COMBINE_DATA( &m_mpSlaveExternalRAM[offset] ); | |
| 1517 | 1510 | } |
| 1518 | 1511 | |
| 1519 | 1512 | static void HaltSlaveDSP( running_machine &machine ) |
| r14896 | r14897 | |
| 1528 | 1521 | namcos22_enable_slave_simulation(machine, 1); |
| 1529 | 1522 | } |
| 1530 | 1523 | |
| 1531 | ||
| 1524 | ||
| 1532 | 1525 | { /* STUB */ |
| 1533 | 1526 | return 0; |
| 1534 | 1527 | } |
| 1535 | 1528 | |
| 1536 | ||
| 1529 | ||
| 1537 | 1530 | { /* STUB */ |
| 1538 | 1531 | } |
| 1539 | 1532 | |
| 1540 | ||
| 1533 | ||
| 1541 | 1534 | { /* STUB */ |
| 1542 | 1535 | } |
| 1543 | 1536 | |
| 1544 | 1537 | /************************************************************/ |
| 1545 | 1538 | |
| 1546 | ||
| 1539 | ||
| 1547 | 1540 | { |
| 1548 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1549 | state->m_mPointAddr<<=16; | |
| 1550 | state->m_mPointAddr |= data; | |
| 1541 | m_mPointAddr<<=16; | |
| 1542 | m_mPointAddr |= data; | |
| 1551 | 1543 | } |
| 1552 | 1544 | |
| 1553 | ||
| 1545 | ||
| 1554 | 1546 | { |
| 1555 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1556 | state->m_mPointData |= data; | |
| 1557 | WriteToPointRAM( state, state->m_mPointAddr++, state->m_mPointData ); | |
| 1547 | m_mPointData |= data; | |
| 1548 | WriteToPointRAM(m_mPointAddr++, m_mPointData ); | |
| 1558 | 1549 | } |
| 1559 | 1550 | |
| 1560 | ||
| 1551 | ||
| 1561 | 1552 | { |
| 1562 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1563 | state->m_mPointData = (data<<16); | |
| 1553 | m_mPointData = (data<<16); | |
| 1564 | 1554 | } |
| 1565 | 1555 | |
| 1566 | ||
| 1556 | ||
| 1567 | 1557 | { |
| 1568 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1569 | return namcos22_point_rom_r(space->machine(), state->m_mPointAddr)&0xffff; | |
| 1558 | return namcos22_point_rom_r(machine(), m_mPointAddr)&0xffff; | |
| 1570 | 1559 | } |
| 1571 | 1560 | |
| 1572 | ||
| 1561 | ||
| 1573 | 1562 | { |
| 1574 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1575 | return namcos22_point_rom_r(space->machine(), state->m_mPointAddr++)>>16; | |
| 1563 | return namcos22_point_rom_r(machine(), m_mPointAddr++)>>16; | |
| 1576 | 1564 | } |
| 1577 | 1565 | |
| 1578 | ||
| 1566 | ||
| 1579 | 1567 | { |
| 1580 | 1568 | /** |
| 1581 | 1569 | * Used by Ridge Racer (Japan) to specify baseaddr |
| r14896 | r14897 | |
| 1593 | 1581 | eDSP_UPLOAD_DATA |
| 1594 | 1582 | }; |
| 1595 | 1583 | |
| 1596 | ||
| 1584 | ||
| 1597 | 1585 | { |
| 1598 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1599 | state->m_mMasterBIOZ = 0; | |
| 1600 | state->m_mDspUploadState = eDSP_UPLOAD_READY; | |
| 1586 | m_mMasterBIOZ = 0; | |
| 1587 | m_mDspUploadState = eDSP_UPLOAD_READY; | |
| 1601 | 1588 | return 0; |
| 1602 | 1589 | } |
| 1603 | 1590 | |
| 1604 | ||
| 1591 | ||
| 1605 | 1592 | { |
| 1606 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1607 | 1593 | |
| 1608 | switch( | |
| 1594 | switch( | |
| 1609 | 1595 | { |
| 1610 | 1596 | case eDSP_UPLOAD_READY: |
| 1611 | 1597 | logerror( "UPLOAD_READY; cmd = 0x%x\n", data ); |
| 1612 | 1598 | switch (data) |
| 1613 | 1599 | { |
| 1614 | 1600 | case 0: |
| 1615 | HaltSlaveDSP( | |
| 1601 | HaltSlaveDSP( | |
| 1616 | 1602 | break; |
| 1617 | 1603 | case 1: |
| 1618 | | |
| 1604 | | |
| 1619 | 1605 | break; |
| 1620 | 1606 | case 2: |
| 1621 | 1607 | /* custom IC poke */ |
| 1622 | 1608 | break; |
| 1623 | 1609 | case 3: |
| 1624 | EnableSlaveDSP( | |
| 1610 | EnableSlaveDSP( | |
| 1625 | 1611 | break; |
| 1626 | 1612 | case 4: |
| 1627 | 1613 | break; |
| 1628 | 1614 | case 0x10: |
| 1629 | 1615 | /* serial i/o related? */ |
| 1630 | EnableSlaveDSP( | |
| 1616 | EnableSlaveDSP( | |
| 1631 | 1617 | break; |
| 1632 | 1618 | |
| 1633 | 1619 | default: |
| 1634 | logerror( "%08x: master port#7: 0x%04x\n", cpu_get_previouspc(&space | |
| 1620 | logerror( "%08x: master port#7: 0x%04x\n", cpu_get_previouspc(&space. | |
| 1635 | 1621 | break; |
| 1636 | 1622 | } |
| 1637 | 1623 | break; |
| 1638 | 1624 | |
| 1639 | 1625 | case eDSP_UPLOAD_DEST: |
| 1640 | state->m_mUploadDestIdx = data; | |
| 1641 | state->m_mDspUploadState = eDSP_UPLOAD_DATA; | |
| 1626 | m_mUploadDestIdx = data; | |
| 1627 | m_mDspUploadState = eDSP_UPLOAD_DATA; | |
| 1642 | 1628 | break; |
| 1643 | 1629 | |
| 1644 | 1630 | case eDSP_UPLOAD_DATA: |
| 1645 | state->m_mpSlaveExternalRAM[state->m_mUploadDestIdx&0x1fff] = data; | |
| 1646 | state->m_mUploadDestIdx++; | |
| 1631 | m_mpSlaveExternalRAM[m_mUploadDestIdx&0x1fff] = data; | |
| 1632 | m_mUploadDestIdx++; | |
| 1647 | 1633 | break; |
| 1648 | 1634 | |
| 1649 | 1635 | default: |
| r14896 | r14897 | |
| 1651 | 1637 | } |
| 1652 | 1638 | } |
| 1653 | 1639 | |
| 1654 | ||
| 1640 | ||
| 1655 | 1641 | { |
| 1656 | 1642 | /* bit 0x0001 is busy signal */ |
| 1657 | 1643 | return 0; |
| 1658 | 1644 | } |
| 1659 | 1645 | |
| 1660 | ||
| 1646 | ||
| 1661 | 1647 | { |
| 1662 | 1648 | /* bit 0x0001 signals completion */ |
| 1663 | 1649 | return 0x0063; |
| 1664 | 1650 | } |
| 1665 | 1651 | |
| 1666 | ||
| 1652 | ||
| 1667 | 1653 | { |
| 1668 | 1654 | /** |
| 1669 | 1655 | * bit 0x0001 is polled to confirm that code/data has been |
| r14896 | r14897 | |
| 1672 | 1658 | return 0x0000; |
| 1673 | 1659 | } |
| 1674 | 1660 | |
| 1675 | ||
| 1661 | ||
| 1676 | 1662 | { |
| 1677 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1678 | return state->m_mpMasterExternalRAM[offset]; | |
| 1663 | return m_mpMasterExternalRAM[offset]; | |
| 1679 | 1664 | } |
| 1680 | 1665 | |
| 1681 | ||
| 1666 | ||
| 1682 | 1667 | { |
| 1683 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1684 | COMBINE_DATA( &state->m_mpMasterExternalRAM[offset] ); | |
| 1668 | COMBINE_DATA( &m_mpMasterExternalRAM[offset] ); | |
| 1685 | 1669 | } |
| 1686 | 1670 | |
| 1687 | ||
| 1671 | ||
| 1688 | 1672 | { |
| 1689 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1690 | state->m_mSerialDataSlaveToMasterNext = data; | |
| 1673 | m_mSerialDataSlaveToMasterNext = data; | |
| 1691 | 1674 | logerror( "slave_serial_io_w(%04x)\n", data ); |
| 1692 | 1675 | } |
| 1693 | 1676 | |
| 1694 | ||
| 1677 | ||
| 1695 | 1678 | { |
| 1696 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1697 | 1679 | logerror( "master_serial_io_r() == %04x\n", |
| 1698 | state->m_mSerialDataSlaveToMasterCurrent ); | |
| 1699 | return state->m_mSerialDataSlaveToMasterCurrent; | |
| 1680 | m_mSerialDataSlaveToMasterCurrent ); | |
| 1681 | return m_mSerialDataSlaveToMasterCurrent; | |
| 1700 | 1682 | } |
| 1701 | 1683 | |
| 1702 | 1684 | static TIMER_DEVICE_CALLBACK( dsp_master_serial_irq ) |
| r14896 | r14897 | |
| 1733 | 1715 | } |
| 1734 | 1716 | } |
| 1735 | 1717 | |
| 1736 | ||
| 1718 | ||
| 1737 | 1719 | { |
| 1738 | 1720 | } |
| 1739 | 1721 | |
| 1740 | ||
| 1722 | ||
| 1741 | 1723 | { |
| 1742 | 1724 | /* I believe this port controls diagnostic LEDs on the DSP PCB. */ |
| 1743 | 1725 | } |
| r14896 | r14897 | |
| 1778 | 1760 | * 0x0075 0xf205 // sx,sy |
| 1779 | 1761 | * 0x602b 0x93e8 // i,zpos |
| 1780 | 1762 | */ |
| 1781 | ||
| 1763 | ||
| 1782 | 1764 | { |
| 1783 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1784 | state->m_mRenderBufSize = 0; | |
| 1765 | m_mRenderBufSize = 0; | |
| 1785 | 1766 | } |
| 1786 | 1767 | |
| 1787 | ||
| 1768 | ||
| 1788 | 1769 | { |
| 1789 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 1790 | if( state->m_mRenderBufSize<MAX_RENDER_CMD_SEQ ) | |
| 1770 | if( m_mRenderBufSize<MAX_RENDER_CMD_SEQ ) | |
| 1791 | 1771 | { |
| 1792 | state->m_mRenderBufData[state->m_mRenderBufSize++] = data; | |
| 1793 | if( state->m_mRenderBufSize == MAX_RENDER_CMD_SEQ ) | |
| 1772 | m_mRenderBufData[m_mRenderBufSize++] = data; | |
| 1773 | if( m_mRenderBufSize == MAX_RENDER_CMD_SEQ ) | |
| 1794 | 1774 | { |
| 1795 | namcos22_draw_direct_poly( | |
| 1775 | namcos22_draw_direct_poly( | |
| 1796 | 1776 | } |
| 1797 | 1777 | } |
| 1798 | 1778 | } |
| r14896 | r14897 | |
| 1804 | 1784 | |
| 1805 | 1785 | static ADDRESS_MAP_START( master_dsp_data, AS_DATA, 16, namcos22_state ) |
| 1806 | 1786 | AM_RANGE(0x1000, 0x3fff) AM_RAM |
| 1807 | AM_RANGE(0x4000, 0x7fff) AM_READ | |
| 1787 | AM_RANGE(0x4000, 0x7fff) AM_READ | |
| 1808 | 1788 | AM_RANGE(0x8000, 0xffff) AM_READ(namcos22_dspram16_r) AM_WRITE(namcos22_dspram16_w) |
| 1809 | 1789 | ADDRESS_MAP_END |
| 1810 | 1790 | |
| 1811 | 1791 | static ADDRESS_MAP_START( master_dsp_io, AS_IO, 16, namcos22_state ) |
| 1812 | AM_RANGE(0x0,0x0) AM_WRITE_LEGACY(point_ram_loword_iw) AM_READ_LEGACY(point_ram_loword_r) | |
| 1813 | AM_RANGE(0x1,0x1) AM_WRITE_LEGACY(point_ram_hiword_w) AM_READ_LEGACY(point_ram_hiword_ir) | |
| 1814 | AM_RANGE(0x2,0x2) AM_WRITE_LEGACY(dsp_unk2_w) AM_READ_LEGACY(pdp_begin_r) | |
| 1815 | AM_RANGE(0x3,0x3) AM_WRITE_LEGACY(point_ram_idx_w) AM_READ_LEGACY(dsp_unk_port3_r) | |
| 1792 | AM_RANGE(0x0,0x0) AM_WRITE(point_ram_loword_iw) AM_READ(point_ram_loword_r) | |
| 1793 | AM_RANGE(0x1,0x1) AM_WRITE(point_ram_hiword_w) AM_READ(point_ram_hiword_ir) | |
| 1794 | AM_RANGE(0x2,0x2) AM_WRITE(dsp_unk2_w) AM_READ(pdp_begin_r) | |
| 1795 | AM_RANGE(0x3,0x3) AM_WRITE(point_ram_idx_w) AM_READ(dsp_unk_port3_r) | |
| 1816 | 1796 | AM_RANGE(0x4,0x4) AM_WRITENOP /* unknown */ |
| 1817 | AM_RANGE(0x7,0x7) AM_WRITE_LEGACY(upload_code_to_slave_dsp_w) | |
| 1818 | AM_RANGE(0x8,0x8) AM_WRITE_LEGACY(dsp_unk8_w) AM_READ_LEGACY(dsp_unk8_r) /* trigger irq? */ | |
| 1819 | AM_RANGE(0x9,0x9) AM_WRITENOP AM_READ_LEGACY(custom_ic_status_r) /* trigger irq? */ | |
| 1820 | AM_RANGE(0xa,0xa) AM_WRITE_LEGACY(dsp_unk_porta_w) | |
| 1797 | AM_RANGE(0x7,0x7) AM_WRITE(upload_code_to_slave_dsp_w) | |
| 1798 | AM_RANGE(0x8,0x8) AM_WRITE(dsp_unk8_w) AM_READ(dsp_unk8_r) /* trigger irq? */ | |
| 1799 | AM_RANGE(0x9,0x9) AM_WRITENOP AM_READ(custom_ic_status_r) /* trigger irq? */ | |
| 1800 | AM_RANGE(0xa,0xa) AM_WRITE(dsp_unk_porta_w) | |
| 1821 | 1801 | AM_RANGE(0xb,0xb) AM_WRITENOP /* RINT-related? */ |
| 1822 | AM_RANGE(0xc,0xc) AM_WRITE | |
| 1802 | AM_RANGE(0xc,0xc) AM_WRITE | |
| 1823 | 1803 | AM_RANGE(0xd,0xd) AM_WRITE(namcos22_dspram16_bank_w) |
| 1824 | AM_RANGE(0xe,0xe) AM_WRITE_LEGACY(dsp_led_w) | |
| 1825 | AM_RANGE(0xf,0xf) AM_WRITENOP AM_READ_LEGACY(dsp_upload_status_r) | |
| 1826 | AM_RANGE(TMS32025_HOLD, TMS32025_HOLD) AM_READ_LEGACY(dsp_HOLD_signal_r) | |
| 1827 | AM_RANGE(TMS32025_HOLDA, TMS32025_HOLDA) AM_WRITE_LEGACY(dsp_HOLD_ACK_w) | |
| 1828 | AM_RANGE(TMS32025_XF, TMS32025_XF) AM_WRITE_LEGACY(dsp_XF_output_w) | |
| 1829 | AM_RANGE(TMS32025_BIO, TMS32025_BIO) AM_READ_LEGACY(pdp_status_r) | |
| 1830 | AM_RANGE(TMS32025_DR, TMS32025_DR) AM_READ_LEGACY(master_serial_io_r) | |
| 1804 | AM_RANGE(0xe,0xe) AM_WRITE(dsp_led_w) | |
| 1805 | AM_RANGE(0xf,0xf) AM_WRITENOP AM_READ(dsp_upload_status_r) | |
| 1806 | AM_RANGE(TMS32025_HOLD, TMS32025_HOLD) AM_READ(dsp_HOLD_signal_r) | |
| 1807 | AM_RANGE(TMS32025_HOLDA, TMS32025_HOLDA) AM_WRITE(dsp_HOLD_ACK_w) | |
| 1808 | AM_RANGE(TMS32025_XF, TMS32025_XF) AM_WRITE(dsp_XF_output_w) | |
| 1809 | AM_RANGE(TMS32025_BIO, TMS32025_BIO) AM_READ(pdp_status_r) | |
| 1810 | AM_RANGE(TMS32025_DR, TMS32025_DR) AM_READ(master_serial_io_r) | |
| 1831 | 1811 | ADDRESS_MAP_END |
| 1832 | 1812 | |
| 1833 | ||
| 1813 | ||
| 1834 | 1814 | { /* STUB */ |
| 1835 | 1815 | return 1; |
| 1836 | 1816 | } |
| 1837 | 1817 | |
| 1838 | ||
| 1818 | ||
| 1839 | 1819 | { |
| 1840 | 1820 | return 0x0010; /* ? */ |
| 1841 | 1821 | } |
| 1842 | 1822 | |
| 1843 | ||
| 1823 | ||
| 1844 | 1824 | { |
| 1845 | 1825 | return 0; |
| 1846 | 1826 | // return ReadDataFromSlaveBuf(); |
| 1847 | 1827 | } |
| 1848 | 1828 | |
| 1849 | ||
| 1829 | ||
| 1850 | 1830 | { |
| 1851 | 1831 | #if 0 |
| 1852 | 1832 | int numWords = SlaveBufSize(); |
| r14896 | r14897 | |
| 1856 | 1836 | return 0; |
| 1857 | 1837 | } |
| 1858 | 1838 | |
| 1859 | ||
| 1839 | ||
| 1860 | 1840 | { |
| 1861 | 1841 | /** |
| 1862 | 1842 | * bit 0x9 indicates whether device at port2 is ready to receive data |
| r14896 | r14897 | |
| 1865 | 1845 | return 0; |
| 1866 | 1846 | } |
| 1867 | 1847 | |
| 1868 | ||
| 1848 | ||
| 1869 | 1849 | { |
| 1870 | 1850 | /* Unknown; used before transmitting a command sequence. */ |
| 1871 | 1851 | } |
| 1872 | 1852 | |
| 1873 | ||
| 1853 | ||
| 1874 | 1854 | { |
| 1875 | 1855 | /* This reports status of the device mapped at port 0xb. |
| 1876 | 1856 | * |
| r14896 | r14897 | |
| 1880 | 1860 | return 0; /* status */ |
| 1881 | 1861 | } |
| 1882 | 1862 | |
| 1883 | ||
| 1863 | ||
| 1884 | 1864 | { |
| 1885 | 1865 | /* The slave DSP reads before transmitting a command sequence. */ |
| 1886 | 1866 | return 0; |
| 1887 | 1867 | } |
| 1888 | 1868 | |
| 1889 | ||
| 1869 | ||
| 1890 | 1870 | { |
| 1891 | 1871 | /* The slave dsp uses this to transmit a command sequence to an external device. */ |
| 1892 | 1872 | } |
| r14896 | r14897 | |
| 1897 | 1877 | ADDRESS_MAP_END |
| 1898 | 1878 | |
| 1899 | 1879 | static ADDRESS_MAP_START( slave_dsp_data, AS_DATA, 16, namcos22_state ) |
| 1900 | AM_RANGE(0x8000, 0x9fff) AM_READ | |
| 1880 | AM_RANGE(0x8000, 0x9fff) AM_READ | |
| 1901 | 1881 | ADDRESS_MAP_END |
| 1902 | 1882 | |
| 1903 | 1883 | static ADDRESS_MAP_START( slave_dsp_io, AS_IO, 16, namcos22_state ) |
| 1904 | 1884 | /* unknown signal */ |
| 1905 | AM_RANGE(0x3,0x3) AM_READ | |
| 1885 | AM_RANGE(0x3,0x3) AM_READ | |
| 1906 | 1886 | |
| 1907 | AM_RANGE(0x4,0x4) AM_READ_LEGACY(dsp_slave_port4_r) | |
| 1908 | AM_RANGE(0x5,0x5) AM_READ_LEGACY(dsp_slave_port5_r) | |
| 1909 | AM_RANGE(0x6,0x6) AM_WRITENOP AM_READ_LEGACY(dsp_slave_port6_r) | |
| 1887 | AM_RANGE(0x4,0x4) AM_READ(dsp_slave_port4_r) | |
| 1888 | AM_RANGE(0x5,0x5) AM_READ(dsp_slave_port5_r) | |
| 1889 | AM_RANGE(0x6,0x6) AM_WRITENOP AM_READ(dsp_slave_port6_r) | |
| 1910 | 1890 | |
| 1911 | 1891 | /* render device state */ |
| 1912 | AM_RANGE(0x8,0x8) AM_WRITENOP AM_READ | |
| 1892 | AM_RANGE(0x8,0x8) AM_WRITENOP AM_READ | |
| 1913 | 1893 | |
| 1914 | 1894 | /* render device */ |
| 1915 | AM_RANGE(0xb,0xb) AM_WRITE | |
| 1895 | AM_RANGE(0xb,0xb) AM_WRITE | |
| 1916 | 1896 | |
| 1917 | AM_RANGE(0xc,0xc) AM_WRITE | |
| 1897 | AM_RANGE(0xc,0xc) AM_WRITE | |
| 1918 | 1898 | |
| 1919 | AM_RANGE(TMS32025_HOLD, TMS32025_HOLD) AM_READ_LEGACY(dsp_HOLD_signal_r) | |
| 1920 | AM_RANGE(TMS32025_HOLDA, TMS32025_HOLDA) AM_WRITE_LEGACY(dsp_HOLD_ACK_w) | |
| 1921 | AM_RANGE(TMS32025_XF, TMS32025_XF) AM_WRITE_LEGACY(dsp_XF_output_w) | |
| 1922 | AM_RANGE(TMS32025_BIO, TMS32025_BIO) AM_READ_LEGACY(dsp_BIOZ_r) | |
| 1923 | AM_RANGE(TMS32025_DX, TMS32025_DX) AM_WRITE_LEGACY(slave_serial_io_w) | |
| 1899 | AM_RANGE(TMS32025_HOLD, TMS32025_HOLD) AM_READ(dsp_HOLD_signal_r) | |
| 1900 | AM_RANGE(TMS32025_HOLDA, TMS32025_HOLDA) AM_WRITE(dsp_HOLD_ACK_w) | |
| 1901 | AM_RANGE(TMS32025_XF, TMS32025_XF) AM_WRITE(dsp_XF_output_w) | |
| 1902 | AM_RANGE(TMS32025_BIO, TMS32025_BIO) AM_READ(dsp_BIOZ_r) | |
| 1903 | AM_RANGE(TMS32025_DX, TMS32025_DX) AM_WRITE(slave_serial_io_w) | |
| 1924 | 1904 | ADDRESS_MAP_END |
| 1925 | 1905 | |
| 1926 | 1906 | static NVRAM_HANDLER( namcos22 ) |
| r14896 | r14897 | |
| 2032 | 2012 | GFXDECODE_END |
| 2033 | 2013 | |
| 2034 | 2014 | /* prelim! */ |
| 2035 | ||
| 2015 | ||
| 2036 | 2016 | { |
| 2037 | 2017 | switch( offset ) |
| 2038 | 2018 | { |
| r14896 | r14897 | |
| 2042 | 2022 | } |
| 2043 | 2023 | |
| 2044 | 2024 | #if 0 |
| 2045 | ||
| 2025 | ||
| 2046 | 2026 | { |
| 2047 | 2027 | COMBINE_DATA( &namcos22_C139_SCI[offset] ); |
| 2048 | 2028 | /* |
| r14896 | r14897 | |
| 2074 | 2054 | } |
| 2075 | 2055 | #endif |
| 2076 | 2056 | |
| 2077 | ||
| 2057 | ||
| 2078 | 2058 | { |
| 2079 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2080 | return state->m_system_controller[offset]; | |
| 2059 | return m_system_controller[offset]; | |
| 2081 | 2060 | } |
| 2082 | 2061 | |
| 2083 | 2062 | /* system controller (super system22) |
| r14896 | r14897 | |
| 2119 | 2098 | |
| 2120 | 2099 | 0x1c: dsp control |
| 2121 | 2100 | */ |
| 2122 | ||
| 2101 | ||
| 2123 | 2102 | { |
| 2124 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2125 | 2103 | int oldreg, newreg; |
| 2126 | 2104 | |
| 2127 | 2105 | // acknowledge irqs |
| 2128 | 2106 | if (offset == 0x04/4 && mem_mask & 0xff000000) |
| 2129 | 2107 | { |
| 2130 | 2108 | // vblank |
| 2131 | state->m_irq_state &= ~1; | |
| 2132 | cputag_set_input_line(space->machine(), "maincpu", nthbyte(state->m_system_controller, 0x00) & 7, CLEAR_LINE); | |
| 2109 | m_irq_state &= ~1; | |
| 2110 | cputag_set_input_line(machine(), "maincpu", nthbyte(m_system_controller, 0x00) & 7, CLEAR_LINE); | |
| 2133 | 2111 | } |
| 2134 | 2112 | |
| 2135 | 2113 | // irq level / enable irqs |
| 2136 | 2114 | if (offset == 0x00/4 && mem_mask & 0xff000000) |
| 2137 | 2115 | { |
| 2138 | 2116 | // vblank |
| 2139 | oldreg = nthbyte( | |
| 2117 | oldreg = nthbyte( | |
| 2140 | 2118 | newreg = data >> 24 & 7; |
| 2141 | if ( | |
| 2119 | if ( | |
| 2142 | 2120 | { |
| 2143 | cputag_set_input_line( | |
| 2121 | cputag_set_input_line( | |
| 2144 | 2122 | if (newreg) |
| 2145 | cputag_set_input_line( | |
| 2123 | cputag_set_input_line( | |
| 2146 | 2124 | else |
| 2147 | | |
| 2125 | | |
| 2148 | 2126 | } |
| 2149 | 2127 | } |
| 2150 | 2128 | |
| r14896 | r14897 | |
| 2152 | 2130 | if (offset == 0x16/4 && mem_mask & 0x0000ff00) |
| 2153 | 2131 | { |
| 2154 | 2132 | if (data & 0x0000ff00) |
| 2155 | cputag_set_input_line( | |
| 2133 | cputag_set_input_line( | |
| 2156 | 2134 | else |
| 2157 | cputag_set_input_line( | |
| 2135 | cputag_set_input_line( | |
| 2158 | 2136 | } |
| 2159 | 2137 | |
| 2160 | 2138 | // dsp control |
| 2161 | 2139 | if (offset == 0x1c/4 && mem_mask & 0xff000000) |
| 2162 | 2140 | { |
| 2163 | oldreg = nthbyte( | |
| 2141 | oldreg = nthbyte( | |
| 2164 | 2142 | newreg = data >> 24 & 0xff; |
| 2165 | 2143 | if (newreg != oldreg) |
| 2166 | 2144 | { |
| 2167 | 2145 | if( newreg == 0 ) |
| 2168 | 2146 | { /* disable DSPs */ |
| 2169 | cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, ASSERT_LINE); /* master DSP */ | |
| 2170 | cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, ASSERT_LINE); /* slave DSP */ | |
| 2171 | namcos22_enable_slave_simulation(space->machine(), 0); | |
| 2172 | state->m_mbEnableDspIrqs = 0; | |
| 2147 | cputag_set_input_line(machine(), "master", INPUT_LINE_RESET, ASSERT_LINE); /* master DSP */ | |
| 2148 | cputag_set_input_line(machine(), "slave", INPUT_LINE_RESET, ASSERT_LINE); /* slave DSP */ | |
| 2149 | namcos22_enable_slave_simulation(machine(), 0); | |
| 2150 | m_mbEnableDspIrqs = 0; | |
| 2173 | 2151 | } |
| 2174 | 2152 | else if( newreg == 1 ) |
| 2175 | 2153 | { /* enable dsp and rendering subsystem */ |
| 2176 | cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2177 | namcos22_enable_slave_simulation(space->machine(), 1); | |
| 2178 | state->m_mbEnableDspIrqs = 1; | |
| 2154 | cputag_set_input_line(machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2155 | namcos22_enable_slave_simulation(machine(), 1); | |
| 2156 | m_mbEnableDspIrqs = 1; | |
| 2179 | 2157 | } |
| 2180 | 2158 | else if( newreg == 0xff ) |
| 2181 | 2159 | { /* used to upload game-specific code to master/slave dsps */ |
| 2182 | cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2183 | state->m_mbEnableDspIrqs = 0; | |
| 2160 | cputag_set_input_line(machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2161 | m_mbEnableDspIrqs = 0; | |
| 2184 | 2162 | } |
| 2185 | 2163 | } |
| 2186 | 2164 | } |
| 2187 | 2165 | |
| 2188 | COMBINE_DATA( & | |
| 2166 | COMBINE_DATA( & | |
| 2189 | 2167 | |
| 2190 | 2168 | } /* namcos22s_system_controller_w */ |
| 2191 | 2169 | |
| r14896 | r14897 | |
| 2250 | 2228 | 0x1a: 0 or 1 or 0xff -> DSP control |
| 2251 | 2229 | 0x1b: ? |
| 2252 | 2230 | */ |
| 2253 | ||
| 2231 | ||
| 2254 | 2232 | { |
| 2255 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2256 | 2233 | int oldreg, newreg; |
| 2257 | 2234 | |
| 2258 | 2235 | // acknowledge irqs |
| 2259 | 2236 | if (offset == 0x09/4 && mem_mask & 0x00ff0000) |
| 2260 | 2237 | { |
| 2261 | 2238 | // vblank |
| 2262 | state->m_irq_state &= ~1; | |
| 2263 | cputag_set_input_line(space->machine(), "maincpu", nthbyte(state->m_system_controller, 0x04) & 7, CLEAR_LINE); | |
| 2239 | m_irq_state &= ~1; | |
| 2240 | cputag_set_input_line(machine(), "maincpu", nthbyte(m_system_controller, 0x04) & 7, CLEAR_LINE); | |
| 2264 | 2241 | } |
| 2265 | 2242 | |
| 2266 | 2243 | // irq level / enable irqs |
| 2267 | 2244 | if (offset == 0x04/4 && mem_mask & 0xff000000) |
| 2268 | 2245 | { |
| 2269 | 2246 | // vblank |
| 2270 | oldreg = nthbyte( | |
| 2247 | oldreg = nthbyte( | |
| 2271 | 2248 | newreg = data >> 24 & 7; |
| 2272 | if ( | |
| 2249 | if ( | |
| 2273 | 2250 | { |
| 2274 | cputag_set_input_line( | |
| 2251 | cputag_set_input_line( | |
| 2275 | 2252 | if (newreg) |
| 2276 | cputag_set_input_line( | |
| 2253 | cputag_set_input_line( | |
| 2277 | 2254 | else |
| 2278 | | |
| 2255 | | |
| 2279 | 2256 | } |
| 2280 | 2257 | } |
| 2281 | 2258 | |
| r14896 | r14897 | |
| 2283 | 2260 | if (offset == 0x1a/4 && mem_mask & 0xff000000) |
| 2284 | 2261 | { |
| 2285 | 2262 | if (data & 0xff000000) |
| 2286 | cputag_set_input_line( | |
| 2263 | cputag_set_input_line( | |
| 2287 | 2264 | else |
| 2288 | cputag_set_input_line( | |
| 2265 | cputag_set_input_line( | |
| 2289 | 2266 | } |
| 2290 | 2267 | |
| 2291 | 2268 | // dsp control |
| 2292 | 2269 | if (offset == 0x1a/4 && mem_mask & 0x0000ff00) |
| 2293 | 2270 | { |
| 2294 | oldreg = nthbyte( | |
| 2271 | oldreg = nthbyte( | |
| 2295 | 2272 | newreg = data >> 8 & 0xff; |
| 2296 | 2273 | if (newreg != oldreg) |
| 2297 | 2274 | { |
| 2298 | 2275 | if( newreg == 0 ) |
| 2299 | 2276 | { /* disable DSPs */ |
| 2300 | cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, ASSERT_LINE); /* master DSP */ | |
| 2301 | cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, ASSERT_LINE); /* slave DSP */ | |
| 2302 | namcos22_enable_slave_simulation(space->machine(), 0); | |
| 2303 | state->m_mbEnableDspIrqs = 0; | |
| 2277 | cputag_set_input_line(machine(), "master", INPUT_LINE_RESET, ASSERT_LINE); /* master DSP */ | |
| 2278 | cputag_set_input_line(machine(), "slave", INPUT_LINE_RESET, ASSERT_LINE); /* slave DSP */ | |
| 2279 | namcos22_enable_slave_simulation(machine(), 0); | |
| 2280 | m_mbEnableDspIrqs = 0; | |
| 2304 | 2281 | } |
| 2305 | 2282 | else if( newreg == 1 ) |
| 2306 | 2283 | { /* enable dsp and rendering subsystem */ |
| 2307 | cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2308 | namcos22_enable_slave_simulation(space->machine(), 1); | |
| 2309 | state->m_mbEnableDspIrqs = 1; | |
| 2284 | cputag_set_input_line(machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2285 | namcos22_enable_slave_simulation(machine(), 1); | |
| 2286 | m_mbEnableDspIrqs = 1; | |
| 2310 | 2287 | } |
| 2311 | 2288 | else if( newreg == 0xff ) |
| 2312 | 2289 | { /* used to upload game-specific code to master/slave dsps */ |
| 2313 | cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2314 | state->m_mbEnableDspIrqs = 0; | |
| 2290 | cputag_set_input_line(machine(), "master", INPUT_LINE_RESET, CLEAR_LINE); | |
| 2291 | m_mbEnableDspIrqs = 0; | |
| 2315 | 2292 | } |
| 2316 | 2293 | } |
| 2317 | 2294 | } |
| 2318 | 2295 | |
| 2319 | COMBINE_DATA( & | |
| 2296 | COMBINE_DATA( & | |
| 2320 | 2297 | |
| 2321 | 2298 | } /* namcos22_system_controller_w */ |
| 2322 | 2299 | |
| r14896 | r14897 | |
| 2394 | 2371 | } |
| 2395 | 2372 | } |
| 2396 | 2373 | |
| 2397 | ||
| 2374 | ||
| 2398 | 2375 | { |
| 2399 | 2376 | // this chip is also used for reading random values in some games |
| 2400 | 2377 | // for example in timecris to determine where certain enemies will emerge |
| 2401 | 2378 | // but it is not yet understood how this works |
| 2402 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2403 | // printf("Hit keycus mask %x PC=%x\n", mem_mask, cpu_get_pc(&space->device())); | |
| 2379 | // printf("Hit keycus mask %x PC=%x\n", mem_mask, cpu_get_pc(&space.device())); | |
| 2404 | 2380 | |
| 2405 | 2381 | if (ACCESSING_BITS_0_15) |
| 2406 | return | |
| 2382 | return | |
| 2407 | 2383 | if (ACCESSING_BITS_16_31) |
| 2408 | return | |
| 2384 | return | |
| 2409 | 2385 | |
| 2410 | 2386 | return 0; |
| 2411 | 2387 | } |
| 2412 | 2388 | |
| 2413 | ||
| 2389 | ||
| 2414 | 2390 | { |
| 2415 | 2391 | // for obfuscating keycus and/or random seed? |
| 2416 | 2392 | } |
| r14896 | r14897 | |
| 2430 | 2406 | * Other values seem to be digital versions of analog ports, for example "the gas pedal is |
| 2431 | 2407 | * pressed" as a boolean flag. IO RAM supplies it as an analog value. |
| 2432 | 2408 | */ |
| 2433 | ||
| 2409 | ||
| 2434 | 2410 | { |
| 2435 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2436 | UINT32 data = state->m_mSys22PortBits; | |
| 2437 | state->m_mSys22PortBits>>=1; | |
| 2411 | UINT32 data = m_mSys22PortBits; | |
| 2412 | m_mSys22PortBits>>=1; | |
| 2438 | 2413 | return data&0x10001; |
| 2439 | 2414 | } |
| 2440 | ||
| 2415 | ||
| 2441 | 2416 | { |
| 2442 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2443 | unsigned dat50000008 = AnalogAsDigital(space->machine()); | |
| 2417 | unsigned dat50000008 = AnalogAsDigital(machine()); | |
| 2444 | 2418 | unsigned dat5000000a = 0xffff; |
| 2445 | | |
| 2419 | | |
| 2446 | 2420 | } |
| 2447 | 2421 | |
| 2448 | ||
| 2422 | ||
| 2449 | 2423 | { |
| 2450 | return input_port_read( | |
| 2424 | return input_port_read( | |
| 2451 | 2425 | } |
| 2452 | 2426 | |
| 2453 | ||
| 2427 | ||
| 2454 | 2428 | { |
| 2455 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2456 | return state->m_shareram[offset]; | |
| 2429 | return m_shareram[offset]; | |
| 2457 | 2430 | } |
| 2458 | 2431 | |
| 2459 | ||
| 2432 | ||
| 2460 | 2433 | { |
| 2461 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2462 | COMBINE_DATA(&state->m_shareram[offset]); | |
| 2434 | COMBINE_DATA(&m_shareram[offset]); | |
| 2463 | 2435 | } |
| 2464 | 2436 | |
| 2465 | ||
| 2437 | ||
| 2466 | 2438 | { |
| 2467 | int xpos = input_port_read_safe(space->machine(), "LIGHTX", 0) * 640 / 0xff; | |
| 2468 | int ypos = input_port_read_safe(space->machine(), "LIGHTY", 0) * 240 / 0xff + 0x10; | |
| 2439 | int xpos = input_port_read_safe(machine(), "LIGHTX", 0) * 640 / 0xff; | |
| 2440 | int ypos = input_port_read_safe(machine(), "LIGHTY", 0) * 240 / 0xff + 0x10; | |
| 2469 | 2441 | switch( offset ) |
| 2470 | 2442 | { |
| 2471 | 2443 | case 0: /* 430000 */ |
| r14896 | r14897 | |
| 2481 | 2453 | } |
| 2482 | 2454 | } /* namcos22_gun_r */ |
| 2483 | 2455 | |
| 2484 | ||
| 2456 | ||
| 2485 | 2457 | { |
| 2486 | 2458 | // 8 leds on cpu board, left to right: |
| 2487 | 2459 | // GYRGYRGY green/yellow/red, 0=on 1=off |
| r14896 | r14897 | |
| 2498 | 2470 | output_set_lamp_value(7, data>>0 & 1); |
| 2499 | 2471 | } |
| 2500 | 2472 | |
| 2501 | ||
| 2473 | ||
| 2502 | 2474 | { |
| 2503 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2504 | return state->m_mAlpineSurferProtData; | |
| 2475 | return m_mAlpineSurferProtData; | |
| 2505 | 2476 | } /* alpinesa_prot_r */ |
| 2506 | 2477 | |
| 2507 | ||
| 2478 | ||
| 2508 | 2479 | { |
| 2509 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2510 | 2480 | switch( data ) |
| 2511 | 2481 | { |
| 2512 | 2482 | case 0: |
| 2513 | | |
| 2483 | | |
| 2514 | 2484 | break; |
| 2515 | 2485 | case 1: |
| 2516 | | |
| 2486 | | |
| 2517 | 2487 | break; |
| 2518 | 2488 | case 3: |
| 2519 | | |
| 2489 | | |
| 2520 | 2490 | break; |
| 2521 | 2491 | default: |
| 2522 | 2492 | break; |
| 2523 | 2493 | } |
| 2524 | 2494 | } /* alpinesa_prot_w */ |
| 2525 | 2495 | |
| 2526 | ||
| 2496 | ||
| 2527 | 2497 | { |
| 2528 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2529 | mem_mask &= 0xff00ff00; // 8KB RAM over 16KB address space | |
| 2530 | COMBINE_DATA(&state->m_nvmem[offset]); | |
| 2498 | mem_mask &= 0xff00ff00; // 8KB RAM over 16KB address &space | |
| 2499 | COMBINE_DATA(&m_nvmem[offset]); | |
| 2531 | 2500 | } |
| 2532 | 2501 | |
| 2533 | ||
| 2502 | ||
| 2534 | 2503 | { |
| 2535 | 2504 | // assume that this register is for chip enable/disable |
| 2536 | 2505 | // it's written many times during boot-up, and most games don't touch it afterwards (last value usually 0038 or 0838) |
| r14896 | r14897 | |
| 2538 | 2507 | // 4000: spot related (set in dirtdash and testmode) |
| 2539 | 2508 | // 0800: fade related? |
| 2540 | 2509 | // other bits: no clue |
| 2541 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2542 | 2510 | if (ACCESSING_BITS_16_23) |
| 2543 | | |
| 2511 | | |
| 2544 | 2512 | else if (ACCESSING_BITS_24_31) |
| 2545 | | |
| 2513 | | |
| 2546 | 2514 | } |
| 2547 | 2515 | |
| 2548 | 2516 | /* Namco Super System 22 */ |
| 2549 | 2517 | static ADDRESS_MAP_START( namcos22s_am, AS_PROGRAM, 32, namcos22_state ) |
| 2550 | 2518 | AM_RANGE(0x000000, 0x3fffff) AM_ROM |
| 2551 | AM_RANGE(0x400000, 0x40001f) AM_READWRITE | |
| 2519 | AM_RANGE(0x400000, 0x40001f) AM_READWRITE | |
| 2552 | 2520 | AM_RANGE(0x410000, 0x413fff) AM_RAM /* C139 SCI buffer */ |
| 2553 | AM_RANGE(0x420000, 0x42000f) AM_READ_LEGACY(namcos22_C139_SCI_r) AM_WRITEONLY /* C139 SCI registers */ | |
| 2554 | AM_RANGE(0x430000, 0x43000f) AM_READ_LEGACY(namcos22_gun_r) | |
| 2555 | AM_RANGE(0x430000, 0x430003) AM_WRITE_LEGACY(namcos22_cpuleds_w) | |
| 2556 | AM_RANGE(0x440000, 0x440003) AM_READ_LEGACY(namcos22_dipswitch_r) | |
| 2557 | AM_RANGE(0x450008, 0x45000b) AM_READWRITE_LEGACY(namcos22_portbit_r, namcos22_portbit_w) | |
| 2558 | AM_RANGE(0x460000, 0x463fff) AM_RAM_WRITE_LEGACY(namcos22s_nvmem_w) AM_BASE_SIZE(m_nvmem, m_nvmem_size) | |
| 2559 | AM_RANGE(0x700000, 0x70001f) AM_READWRITE_LEGACY(namcos22_system_controller_r, namcos22s_system_controller_w) AM_BASE(m_system_controller) | |
| 2560 | AM_RANGE(0x800000, 0x800003) AM_WRITE_LEGACY(namcos22s_chipselect_w) | |
| 2521 | AM_RANGE(0x420000, 0x42000f) AM_READ(namcos22_C139_SCI_r) AM_WRITEONLY /* C139 SCI registers */ | |
| 2522 | AM_RANGE(0x430000, 0x43000f) AM_READ(namcos22_gun_r) | |
| 2523 | AM_RANGE(0x430000, 0x430003) AM_WRITE(namcos22_cpuleds_w) | |
| 2524 | AM_RANGE(0x440000, 0x440003) AM_READ(namcos22_dipswitch_r) | |
| 2525 | AM_RANGE(0x450008, 0x45000b) AM_READWRITE(namcos22_portbit_r, namcos22_portbit_w) | |
| 2526 | AM_RANGE(0x460000, 0x463fff) AM_RAM_WRITE(namcos22s_nvmem_w) AM_BASE_SIZE(m_nvmem, m_nvmem_size) | |
| 2527 | AM_RANGE(0x700000, 0x70001f) AM_READWRITE(namcos22_system_controller_r, namcos22s_system_controller_w) AM_BASE(m_system_controller) | |
| 2528 | AM_RANGE(0x800000, 0x800003) AM_WRITE(namcos22s_chipselect_w) | |
| 2561 | 2529 | AM_RANGE(0x810000, 0x81000f) AM_RAM AM_BASE(m_czattr) |
| 2562 | 2530 | AM_RANGE(0x810200, 0x8103ff) AM_READWRITE(namcos22s_czram_r, namcos22s_czram_w) |
| 2563 | 2531 | AM_RANGE(0x820000, 0x8202ff) AM_WRITENOP /* leftover of old (non-super) video mixer device */ |
| r14896 | r14897 | |
| 2570 | 2538 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(m_vics_data) |
| 2571 | 2539 | AM_RANGE(0x940000, 0x94007f) AM_READWRITE(namcos22s_vics_control_r, namcos22s_vics_control_w) AM_BASE(m_vics_control) |
| 2572 | 2540 | AM_RANGE(0x980000, 0x9affff) AM_RAM AM_BASE(m_spriteram) /* C374 */ |
| 2573 | AM_RANGE(0xa04000, 0xa0bfff) AM_READWRITE | |
| 2541 | AM_RANGE(0xa04000, 0xa0bfff) AM_READWRITE | |
| 2574 | 2542 | AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(namcos22_dspram_r, namcos22_dspram_w) AM_BASE(m_polygonram) |
| 2575 | 2543 | AM_RANGE(0xe00000, 0xe3ffff) AM_RAM /* workram */ |
| 2576 | 2544 | ADDRESS_MAP_END |
| 2577 | 2545 | |
| 2578 | ||
| 2546 | ||
| 2579 | 2547 | { |
| 2580 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2581 | UINT16 *share16 = (UINT16 *)state->m_shareram; | |
| 2548 | UINT16 *share16 = (UINT16 *)m_shareram; | |
| 2582 | 2549 | |
| 2583 | 2550 | return share16[BYTE_XOR_BE(offset)]; |
| 2584 | 2551 | } |
| 2585 | 2552 | |
| 2586 | ||
| 2553 | ||
| 2587 | 2554 | { |
| 2588 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2589 | UINT16 *share16 = (UINT16 *)state->m_shareram; | |
| 2555 | UINT16 *share16 = (UINT16 *)m_shareram; | |
| 2590 | 2556 | |
| 2591 | 2557 | COMBINE_DATA(&share16[BYTE_XOR_BE(offset)]); |
| 2592 | 2558 | } |
| r14896 | r14897 | |
| 2619 | 2585 | // Super System 22 M37710 |
| 2620 | 2586 | static ADDRESS_MAP_START( mcu_program, AS_PROGRAM, 16, namcos22_state ) |
| 2621 | 2587 | AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE("c352", c352_device, read, write) |
| 2622 | AM_RANGE(0x004000, 0x00bfff) AM_READWRITE | |
| 2588 | AM_RANGE(0x004000, 0x00bfff) AM_READWRITE | |
| 2623 | 2589 | AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("user4", 0xc000) |
| 2624 | 2590 | AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("user4", 0) |
| 2625 | 2591 | AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("user4", 0) |
| r14896 | r14897 | |
| 2631 | 2597 | // System 22 37702 |
| 2632 | 2598 | static ADDRESS_MAP_START( mcu_s22_program, AS_PROGRAM, 16, namcos22_state ) |
| 2633 | 2599 | AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE("c352", c352_device, read, write) |
| 2634 | AM_RANGE(0x004000, 0x00bfff) AM_READWRITE | |
| 2600 | AM_RANGE(0x004000, 0x00bfff) AM_READWRITE | |
| 2635 | 2601 | AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("mcu", 0) |
| 2636 | 2602 | AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("user4", 0) |
| 2637 | 2603 | AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("user4", 0) |
| r14896 | r14897 | |
| 2641 | 2607 | ADDRESS_MAP_END |
| 2642 | 2608 | |
| 2643 | 2609 | |
| 2644 | ||
| 2610 | ||
| 2645 | 2611 | { |
| 2646 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2647 | state->m_p4 = data; | |
| 2612 | m_p4 = data; | |
| 2648 | 2613 | } |
| 2649 | 2614 | |
| 2650 | ||
| 2615 | ||
| 2651 | 2616 | { |
| 2652 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2653 | return state->m_p4; | |
| 2617 | return m_p4; | |
| 2654 | 2618 | } |
| 2655 | 2619 | |
| 2656 | ||
| 2620 | ||
| 2657 | 2621 | { |
| 2658 | 2622 | ; |
| 2659 | 2623 | } |
| 2660 | 2624 | |
| 2661 | ||
| 2625 | ||
| 2662 | 2626 | { |
| 2663 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2664 | 2627 | |
| 2665 | if (state->m_p4 & 8) | |
| 2666 | return input_port_read_safe(space->machine(), "MCUP5A", 0xff); | |
| 2628 | if (m_p4 & 8) | |
| 2629 | return input_port_read_safe(machine(), "MCUP5A", 0xff); | |
| 2667 | 2630 | else |
| 2668 | return input_port_read_safe( | |
| 2631 | return input_port_read_safe( | |
| 2669 | 2632 | } |
| 2670 | 2633 | |
| 2671 | ||
| 2634 | ||
| 2672 | 2635 | { |
| 2673 | 2636 | ; |
| 2674 | 2637 | } |
| 2675 | 2638 | |
| 2676 | ||
| 2639 | ||
| 2677 | 2640 | { |
| 2678 | 2641 | return 0; |
| 2679 | 2642 | } |
| 2680 | 2643 | |
| 2681 | ||
| 2644 | ||
| 2682 | 2645 | { |
| 2683 | 2646 | ; |
| 2684 | 2647 | } |
| 2685 | 2648 | |
| 2686 | ||
| 2649 | ||
| 2687 | 2650 | { |
| 2688 | 2651 | return 0; |
| 2689 | 2652 | } |
| 2690 | 2653 | |
| 2691 | ||
| 2654 | ||
| 2692 | 2655 | { |
| 2693 | 2656 | // prop cycle outputs: |
| 2694 | 2657 | // bit 1 = fan |
| 2695 | 2658 | // bit 2 = button light |
| 2696 | 2659 | |
| 2697 | 2660 | output_set_value("fan0", data & 1); |
| 2698 | set_led_status( | |
| 2661 | set_led_status( | |
| 2699 | 2662 | } |
| 2700 | 2663 | |
| 2701 | ||
| 2664 | ||
| 2702 | 2665 | { |
| 2703 | 2666 | // H+L = horizontal, 1 H+L = vertical |
| 2704 | 2667 | UINT16 ddx, ddy; |
| 2705 | 2668 | |
| 2706 | ddx = input_port_read( | |
| 2669 | ddx = input_port_read( | |
| 2707 | 2670 | if (ddx > 0) ddx -= 1; |
| 2708 | ddy = input_port_read( | |
| 2671 | ddy = input_port_read( | |
| 2709 | 2672 | if (ddy > 0) ddy -= 1; |
| 2710 | 2673 | |
| 2711 | 2674 | ddx <<= 2; |
| r14896 | r14897 | |
| 2722 | 2685 | // and timer A3 is configured by the MCU program to cause an interrupt each time |
| 2723 | 2686 | // it's clocked. by counting the number of interrupts in a frame, we can determine |
| 2724 | 2687 | // how fast the user is pedaling. |
| 2725 | if( input_port_read( | |
| 2688 | if( input_port_read( | |
| 2726 | 2689 | { |
| 2727 | 2690 | int i; |
| 2728 | 2691 | for (i = 0; i < 16; i++) |
| 2729 | 2692 | { |
| 2730 | generic_pulse_irq_line( | |
| 2693 | generic_pulse_irq_line( | |
| 2731 | 2694 | } |
| 2732 | 2695 | } |
| 2733 | 2696 | |
| r14896 | r14897 | |
| 2749 | 2712 | state->m_motor_status = param; |
| 2750 | 2713 | } |
| 2751 | 2714 | |
| 2752 | ||
| 2715 | ||
| 2753 | 2716 | { |
| 2754 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2755 | 2717 | |
| 2756 | 2718 | // bits 1+2 are steplock motor outputs |
| 2757 | 2719 | if ((data & 6) == 6) |
| 2758 | 2720 | { |
| 2759 | if ( | |
| 2721 | if ( | |
| 2760 | 2722 | { |
| 2761 | 2723 | // free steps |
| 2762 | state->m_motor_status = 0; | |
| 2763 | state->m_motor_timer->adjust(attotime::from_msec(500), 1); | |
| 2724 | m_motor_status = 0; | |
| 2725 | m_motor_timer->adjust(attotime::from_msec(500), 1); | |
| 2764 | 2726 | } |
| 2765 | 2727 | } |
| 2766 | 2728 | else if (data & 4) |
| 2767 | 2729 | { |
| 2768 | if ( | |
| 2730 | if ( | |
| 2769 | 2731 | { |
| 2770 | 2732 | // lock steps |
| 2771 | state->m_motor_status = 0; | |
| 2772 | state->m_motor_timer->adjust(attotime::from_msec(500), 2); | |
| 2733 | m_motor_status = 0; | |
| 2734 | m_motor_timer->adjust(attotime::from_msec(500), 2); | |
| 2773 | 2735 | } |
| 2774 | 2736 | } |
| 2775 | 2737 | } |
| 2776 | 2738 | |
| 2777 | ||
| 2739 | ||
| 2778 | 2740 | { |
| 2779 | 2741 | // 0 H+L = swing, 1 H+L = edge |
| 2780 | UINT16 swing = input_port_read(space->machine(), "SWING")<<2; | |
| 2781 | UINT16 edge = input_port_read(space->machine(), "EDGE" )<<2; | |
| 2742 | UINT16 swing = input_port_read(machine(), "SWING")<<2; | |
| 2743 | UINT16 edge = input_port_read(machine(), "EDGE" )<<2; | |
| 2782 | 2744 | |
| 2783 | 2745 | switch (offset) |
| 2784 | 2746 | { |
| r14896 | r14897 | |
| 2799 | 2761 | } |
| 2800 | 2762 | } |
| 2801 | 2763 | |
| 2802 | ||
| 2764 | ||
| 2803 | 2765 | { |
| 2804 | 2766 | UINT16 gas,brake,steer; |
| 2805 | ReadAnalogDrivingPorts( | |
| 2767 | ReadAnalogDrivingPorts( | |
| 2806 | 2768 | |
| 2807 | 2769 | gas <<= 2; |
| 2808 | 2770 | brake <<= 2; |
| r14896 | r14897 | |
| 2833 | 2795 | } |
| 2834 | 2796 | } |
| 2835 | 2797 | |
| 2836 | ||
| 2798 | ||
| 2837 | 2799 | { |
| 2838 | 2800 | UINT16 gas,brake,steer; |
| 2839 | ReadAnalogDrivingPorts( | |
| 2801 | ReadAnalogDrivingPorts( | |
| 2840 | 2802 | |
| 2841 | 2803 | gas <<= 2; |
| 2842 | 2804 | brake <<= 2; |
| r14896 | r14897 | |
| 2867 | 2829 | } |
| 2868 | 2830 | } |
| 2869 | 2831 | |
| 2870 | ||
| 2832 | ||
| 2871 | 2833 | { |
| 2872 | 2834 | UINT16 gas, steer, ddy; |
| 2873 | 2835 | |
| 2874 | gas = input_port_read(space->machine(), "GAS") ^ 0x7f; | |
| 2875 | steer = input_port_read(space->machine(), "STEER") ^ 0xff; | |
| 2876 | ddy = input_port_read(space->machine(), "STICKY"); | |
| 2836 | gas = input_port_read(machine(), "GAS") ^ 0x7f; | |
| 2837 | steer = input_port_read(machine(), "STEER") ^ 0xff; | |
| 2838 | ddy = input_port_read(machine(), "STICKY"); | |
| 2877 | 2839 | if (ddy > 0) ddy -= 1; |
| 2878 | 2840 | |
| 2879 | 2841 | gas <<= 2; |
| r14896 | r14897 | |
| 2911 | 2873 | } |
| 2912 | 2874 | } |
| 2913 | 2875 | |
| 2914 | ||
| 2876 | ||
| 2915 | 2877 | { |
| 2916 | 2878 | UINT16 pedal, x, y; |
| 2917 | 2879 | |
| 2918 | pedal = input_port_read(space->machine(), "PEDAL")<<2; | |
| 2919 | x = input_port_read(space->machine(), "STICKX")<<2; | |
| 2920 | y = input_port_read(space->machine(), "STICKY")<<2; | |
| 2880 | pedal = input_port_read(machine(), "PEDAL")<<2; | |
| 2881 | x = input_port_read(machine(), "STICKX")<<2; | |
| 2882 | y = input_port_read(machine(), "STICKY")<<2; | |
| 2921 | 2883 | |
| 2922 | 2884 | |
| 2923 | 2885 | switch (offset) |
| r14896 | r14897 | |
| 2946 | 2908 | } |
| 2947 | 2909 | |
| 2948 | 2910 | static ADDRESS_MAP_START( mcu_io, AS_IO, 8, namcos22_state ) |
| 2949 | AM_RANGE(M37710_PORT4, M37710_PORT4) AM_READ_LEGACY(mcu_port4_r ) AM_WRITE_LEGACY(mcu_port4_w ) | |
| 2950 | AM_RANGE(M37710_PORT5, M37710_PORT5) AM_READ_LEGACY(mcu_port5_r ) AM_WRITE_LEGACY(mcu_port5_w ) | |
| 2951 | AM_RANGE(M37710_PORT6, M37710_PORT6) AM_READ_LEGACY(mcu_port6_r ) AM_WRITE_LEGACY(mcu_port6_w ) | |
| 2952 | AM_RANGE(M37710_PORT7, M37710_PORT7) AM_READ_LEGACY(mcu_port7_r ) AM_WRITE_LEGACY(mcu_port7_w ) | |
| 2911 | AM_RANGE(M37710_PORT4, M37710_PORT4) AM_READ(mcu_port4_r ) AM_WRITE(mcu_port4_w ) | |
| 2912 | AM_RANGE(M37710_PORT5, M37710_PORT5) AM_READ(mcu_port5_r ) AM_WRITE(mcu_port5_w ) | |
| 2913 | AM_RANGE(M37710_PORT6, M37710_PORT6) AM_READ(mcu_port6_r ) AM_WRITE(mcu_port6_w ) | |
| 2914 | AM_RANGE(M37710_PORT7, M37710_PORT7) AM_READ(mcu_port7_r ) AM_WRITE(mcu_port7_w ) | |
| 2953 | 2915 | ADDRESS_MAP_END |
| 2954 | 2916 | |
| 2955 | ||
| 2917 | ||
| 2956 | 2918 | { |
| 2957 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 2958 | return state->m_p4 | 0x10; // for C74, 0x10 selects sound MCU role, 0x00 selects control-reading role | |
| 2919 | return m_p4 | 0x10; // for C74, 0x10 selects sound MCU role, 0x00 selects control-reading role | |
| 2959 | 2920 | } |
| 2960 | 2921 | |
| 2961 | 2922 | static ADDRESS_MAP_START( mcu_s22_io, AS_IO, 8, namcos22_state ) |
| 2962 | AM_RANGE(M37710_PORT4, M37710_PORT4) AM_READ | |
| 2923 | AM_RANGE(M37710_PORT4, M37710_PORT4) AM_READ | |
| 2963 | 2924 | ADDRESS_MAP_END |
| 2964 | 2925 | |
| 2965 | 2926 | static TIMER_DEVICE_CALLBACK( mcu_irq ) |
| r14896 | r14897 | |
| 3055 | 3016 | * C389? (Cyber Cycles) |
| 3056 | 3017 | * C392? (Ace Driver Victory Lap) |
| 3057 | 3018 | */ |
| 3058 | AM_RANGE(0x20000000, 0x2000000f) AM_READWRITE | |
| 3019 | AM_RANGE(0x20000000, 0x2000000f) AM_READWRITE | |
| 3059 | 3020 | |
| 3060 | 3021 | /** |
| 3061 | 3022 | * C139 SCI Buffer |
| r14896 | r14897 | |
| 3098 | 3059 | * 2002000c 2 R/W RX FIFO Pointer (0x0000 - 0x0fff) |
| 3099 | 3060 | * 2002000e 2 W TX FIFO Pointer (0x0000 - 0x1fff) |
| 3100 | 3061 | */ |
| 3101 | AM_RANGE(0x20020000, 0x2002000f) AM_READ | |
| 3062 | AM_RANGE(0x20020000, 0x2002000f) AM_READ | |
| 3102 | 3063 | |
| 3103 | 3064 | /** |
| 3104 | 3065 | * System Controller: Interrupt Control, Peripheral Control |
| 3105 | 3066 | * |
| 3106 | 3067 | */ |
| 3107 | AM_RANGE(0x40000000, 0x4000001f) AM_READWRITE | |
| 3068 | AM_RANGE(0x40000000, 0x4000001f) AM_READWRITE | |
| 3108 | 3069 | |
| 3109 | 3070 | /** |
| 3110 | 3071 | * Unknown Device (optional for diagnostics?) |
| r14896 | r14897 | |
| 3119 | 3080 | * 0x50000000 - DIPSW3 |
| 3120 | 3081 | * 0x50000001 - DIPSW2 |
| 3121 | 3082 | */ |
| 3122 | AM_RANGE(0x50000000, 0x50000003) AM_READ_LEGACY(namcos22_dipswitch_r) AM_WRITENOP | |
| 3123 | AM_RANGE(0x50000008, 0x5000000b) AM_READWRITE_LEGACY(namcos22_portbit_r, namcos22_portbit_w) | |
| 3083 | AM_RANGE(0x50000000, 0x50000003) AM_READ(namcos22_dipswitch_r) AM_WRITENOP | |
| 3084 | AM_RANGE(0x50000008, 0x5000000b) AM_READWRITE(namcos22_portbit_r, namcos22_portbit_w) | |
| 3124 | 3085 | |
| 3125 | 3086 | /** |
| 3126 | 3087 | * EEPROM |
| r14896 | r14897 | |
| 3169 | 3130 | * +0x0300 - 0x03ff? Song Title (put messages here from Sound CPU) |
| 3170 | 3131 | */ |
| 3171 | 3132 | AM_RANGE(0x60000000, 0x60003fff) AM_WRITENOP |
| 3172 | AM_RANGE(0x60004000, 0x6000bfff) AM_READWRITE | |
| 3133 | AM_RANGE(0x60004000, 0x6000bfff) AM_READWRITE | |
| 3173 | 3134 | |
| 3174 | 3135 | /** |
| 3175 | 3136 | * C71 (TI TMS320C25 DSP) Shared RAM (0x70000000 - 0x70020000) |
| r14896 | r14897 | |
| 5446 | 5407 | // MCU speed cheats (every bit helps with these games) |
| 5447 | 5408 | |
| 5448 | 5409 | // for MCU BIOS v1.41 |
| 5449 | ||
| 5410 | ||
| 5450 | 5411 | { |
| 5451 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 5452 | if ((cpu_get_pc(&space->device()) == 0xc12d) && (!(state->m_su_82 & 0xff00))) | |
| 5412 | if ((cpu_get_pc(&space.device()) == 0xc12d) && (!(m_su_82 & 0xff00))) | |
| 5453 | 5413 | { |
| 5454 | device_spin_until_interrupt(&space | |
| 5414 | device_spin_until_interrupt(&space. | |
| 5455 | 5415 | } |
| 5456 | 5416 | |
| 5457 | return | |
| 5417 | return | |
| 5458 | 5418 | } |
| 5459 | 5419 | |
| 5460 | ||
| 5420 | ||
| 5461 | 5421 | { |
| 5462 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 5463 | COMBINE_DATA(&state->m_su_82); | |
| 5422 | COMBINE_DATA(&m_su_82); | |
| 5464 | 5423 | } |
| 5465 | 5424 | |
| 5466 | 5425 | // for MCU BIOS v1.30 |
| 5467 | ||
| 5426 | ||
| 5468 | 5427 | { |
| 5469 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 5470 | if ((cpu_get_pc(&space->device()) == 0xc12a) && (!(state->m_su_82 & 0xff00))) | |
| 5428 | if ((cpu_get_pc(&space.device()) == 0xc12a) && (!(m_su_82 & 0xff00))) | |
| 5471 | 5429 | { |
| 5472 | device_spin_until_interrupt(&space | |
| 5430 | device_spin_until_interrupt(&space. | |
| 5473 | 5431 | } |
| 5474 | 5432 | |
| 5475 | return | |
| 5433 | return | |
| 5476 | 5434 | } |
| 5477 | 5435 | |
| 5478 | 5436 | // for NSTX7702 v1.00 (C74) |
| 5479 | ||
| 5437 | ||
| 5480 | 5438 | { |
| 5481 | namcos22_state *state = space->machine().driver_data<namcos22_state>(); | |
| 5482 | if (((cpu_get_pc(&space->device()) == 0xc0df) || (cpu_get_pc(&space->device()) == 0xc101)) && (!(state->m_su_82 & 0xff00))) | |
| 5439 | if (((cpu_get_pc(&space.device()) == 0xc0df) || (cpu_get_pc(&space.device()) == 0xc101)) && (!(m_su_82 & 0xff00))) | |
| 5483 | 5440 | { |
| 5484 | device_spin_until_interrupt(&space | |
| 5441 | device_spin_until_interrupt(&space. | |
| 5485 | 5442 | } |
| 5486 | 5443 | |
| 5487 | return | |
| 5444 | return | |
| 5488 | 5445 | } |
| 5489 | 5446 | |
| 5490 | 5447 | static void install_c74_speedup(running_machine &machine) |
| 5491 | 5448 | { |
| 5449 | namcos22_state *state = machine.driver_data<namcos22_state>(); | |
| 5492 | 5450 | if (MCU_SPEEDUP) |
| 5493 | machine.device("mcu")->memory().space(AS_PROGRAM)->install_ | |
| 5451 | machine.device("mcu")->memory().space(AS_PROGRAM)->install_ | |
| 5494 | 5452 | } |
| 5495 | 5453 | |
| 5496 | 5454 | static void install_130_speedup(running_machine &machine) |
| 5497 | 5455 | { |
| 5456 | namcos22_state *state = machine.driver_data<namcos22_state>(); | |
| 5498 | 5457 | // install speedup cheat for 1.30 MCU BIOS |
| 5499 | 5458 | if (MCU_SPEEDUP) |
| 5500 | machine.device("mcu")->memory().space(AS_PROGRAM)->install_ | |
| 5459 | machine.device("mcu")->memory().space(AS_PROGRAM)->install_ | |
| 5501 | 5460 | } |
| 5502 | 5461 | |
| 5503 | 5462 | static void install_141_speedup(running_machine &machine) |
| 5504 | 5463 | { |
| 5464 | namcos22_state *state = machine.driver_data<namcos22_state>(); | |
| 5505 | 5465 | // install speedup cheat for 1.41 MCU BIOS |
| 5506 | 5466 | if (MCU_SPEEDUP) |
| 5507 | machine.device("mcu")->memory().space(AS_PROGRAM)->install_ | |
| 5467 | machine.device("mcu")->memory().space(AS_PROGRAM)->install_ | |
| 5508 | 5468 | } |
| 5509 | 5469 | |
| 5510 | 5470 | static void namcos22_init( running_machine &machine, int game_type ) |
| r14896 | r14897 | |
| 5527 | 5487 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 5528 | 5488 | namcos22_init(machine, game_type); |
| 5529 | 5489 | |
| 5530 | machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(alpineracer_mcu_adc_r)); | |
| 5531 | machine.device("mcu")->memory().space(AS_IO)->install_legacy_write_handler(M37710_PORT5, M37710_PORT5, FUNC(alpine_mcu_port5_w)); | |
| 5490 | machine.device("mcu")->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::alpineracer_mcu_adc_r),state)); | |
| 5491 | machine.device("mcu")->memory().space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::alpine_mcu_port5_w),state)); | |
| 5532 | 5492 | |
| 5533 | 5493 | state->m_motor_timer = machine.scheduler().timer_alloc(FUNC(alpine_steplock_callback)); |
| 5534 | 5494 | state->m_motor_timer->reset(); |
| r14896 | r14897 | |
| 5560 | 5520 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 5561 | 5521 | alpine_init_common(machine, NAMCOS22_ALPINE_SURFER); |
| 5562 | 5522 | |
| 5563 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x200000, 0x200003, FUNC(alpinesa_prot_r)); | |
| 5564 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(alpinesa_prot_w)); | |
| 5523 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler (0x200000, 0x200003, read32_delegate(FUNC(namcos22_state::alpinesa_prot_r),state)); | |
| 5524 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(namcos22_state::alpinesa_prot_w),state)); | |
| 5565 | 5525 | install_141_speedup(machine); |
| 5566 | 5526 | |
| 5567 | 5527 | state->m_keycus_id = 0x01a9; |
| r14896 | r14897 | |
| 5569 | 5529 | |
| 5570 | 5530 | static DRIVER_INIT( airco22 ) |
| 5571 | 5531 | { |
| 5532 | namcos22_state *state = machine.driver_data<namcos22_state>(); | |
| 5572 | 5533 | namcos22_init(machine, NAMCOS22_AIR_COMBAT22); |
| 5573 | 5534 | |
| 5574 | 5535 | // S22-BIOS ver1.20 namco all rights reserved 94/12/21 |
| 5575 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5536 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5576 | 5537 | } |
| 5577 | 5538 | |
| 5578 | 5539 | static DRIVER_INIT( propcycl ) |
| r14896 | r14897 | |
| 5595 | 5556 | // pROM[0x22296/4] |= 0x00004e75; |
| 5596 | 5557 | |
| 5597 | 5558 | namcos22_init(machine, NAMCOS22_PROP_CYCLE); |
| 5598 | ||
| 5599 | machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(propcycle_mcu_adc_r)); | |
| 5600 | machine.device("mcu")->memory().space(AS_IO)->install_legacy_write_handler(M37710_PORT5, M37710_PORT5, FUNC(propcycle_mcu_port5_w)); | |
| 5559 | namcos22_state *state = machine.driver_data<namcos22_state>(); | |
| 5560 | machine.device("mcu")->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::propcycle_mcu_adc_r),state)); | |
| 5561 | machine.device("mcu")->memory().space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::propcycle_mcu_port5_w),state)); | |
| 5601 | 5562 | install_141_speedup(machine); |
| 5602 | 5563 | } |
| 5603 | 5564 | |
| r14896 | r14897 | |
| 5663 | 5624 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 5664 | 5625 | namcos22_init(machine, NAMCOS22_CYBER_CYCLES); |
| 5665 | 5626 | |
| 5666 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5627 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5667 | 5628 | install_130_speedup(machine); |
| 5668 | 5629 | |
| 5669 | 5630 | state->m_keycus_id = 0x0387; |
| r14896 | r14897 | |
| 5681 | 5642 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 5682 | 5643 | namcos22_init(machine, NAMCOS22_TOKYO_WARS); |
| 5683 | 5644 | |
| 5684 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5645 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5685 | 5646 | install_141_speedup(machine); |
| 5686 | 5647 | |
| 5687 | 5648 | state->m_keycus_id = 0x01a8; |
| r14896 | r14897 | |
| 5690 | 5651 | static DRIVER_INIT( aquajet ) |
| 5691 | 5652 | { |
| 5692 | 5653 | namcos22_init(machine, NAMCOS22_AQUA_JET); |
| 5693 | ||
| 5694 | machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(aquajet_mcu_adc_r)); | |
| 5654 | namcos22_state *state = machine.driver_data<namcos22_state>(); | |
| 5655 | machine.device("mcu")->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::aquajet_mcu_adc_r),state)); | |
| 5695 | 5656 | install_141_speedup(machine); |
| 5696 | 5657 | } |
| 5697 | 5658 | |
| r14896 | r14897 | |
| 5700 | 5661 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 5701 | 5662 | namcos22_init(machine, NAMCOS22_DIRT_DASH); |
| 5702 | 5663 | |
| 5703 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5664 | machine.device("mcu")->memory().space(AS_IO)->install_ | |
| 5704 | 5665 | install_141_speedup(machine); |
| 5705 | 5666 | |
| 5706 | 5667 | state->m_keycus_id = 0x01a2; |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | public: |
| 24 | 24 | flyball_state(const machine_config &mconfig, device_type type, const char *tag) |
| 25 | : driver_device(mconfig, type, tag) { } | |
| 25 | : driver_device(mconfig, type, tag) , | |
| 26 | m_playfield_ram(*this, "playfield_ram"), | |
| 27 | m_rombase(*this, "rombase"){ } | |
| 26 | 28 | |
| 27 | 29 | /* memory pointers */ |
| 28 | UINT8 * m_rombase; | |
| 29 | UINT8 * m_playfield_ram; | |
| 30 | required_shared_ptr<UINT8> m_playfield_ram; | |
| 31 | required_shared_ptr<UINT8> m_rombase; | |
| 30 | 32 | |
| 31 | 33 | /* video-related */ |
| 32 | 34 | tilemap_t *m_tmap; |
| r14896 | r14897 | |
| 73 | 75 | static TILE_GET_INFO( flyball_get_tile_info ) |
| 74 | 76 | { |
| 75 | 77 | flyball_state *state = machine.driver_data<flyball_state>(); |
| 76 | UINT8 data = state->m_playfield_ram[tile_index]; | |
| 78 | UINT8 data = state->m_playfield_ram.target()[tile_index]; | |
| 77 | 79 | int flags = ((data & 0x40) ? TILE_FLIPX : 0) | ((data & 0x80) ? TILE_FLIPY : 0); |
| 78 | 80 | int code = data & 63; |
| 79 | 81 | |
| r14896 | r14897 | |
| 262 | 264 | AM_RANGE(0x0900, 0x0900) AM_WRITE(flyball_potmask_w) |
| 263 | 265 | AM_RANGE(0x0a00, 0x0a07) AM_WRITE(flyball_misc_w) |
| 264 | 266 | AM_RANGE(0x0b00, 0x0b00) AM_READ(flyball_input_r) |
| 265 | AM_RANGE(0x0d00, 0x0eff) AM_WRITEONLY AM_BASE(m_playfield_ram) | |
| 266 | AM_RANGE(0x1000, 0x1fff) AM_ROM AM_BASE(m_rombase) /* program */ | |
| 267 | AM_RANGE(0x0d00, 0x0eff) AM_WRITEONLY AM_SHARE("playfield_ram") | |
| 268 | AM_RANGE(0x1000, 0x1fff) AM_ROM AM_SHARE("rombase") /* program */ | |
| 267 | 269 | ADDRESS_MAP_END |
| 268 | 270 | |
| 269 | 271 | |
| r14896 | r14897 | |
| 390 | 392 | UINT8* ROM = machine.region("maincpu")->base() + 0x2000; |
| 391 | 393 | |
| 392 | 394 | for (i = 0; i < 0x1000; i++) |
| 393 | state->m_rombase[i] = ROM[i ^ 0x1ff]; | |
| 395 | state->m_rombase.target()[i] = ROM[i ^ 0x1ff]; | |
| 394 | 396 | |
| 395 | 397 | machine.device("maincpu")->reset(); |
| 396 | 398 |
| r14896 | r14897 | |
|---|---|---|
| 413 | 413 | AM_RANGE(0x5000, 0x53ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 414 | 414 | AM_RANGE(0x5400, 0x57ff) AM_READ(galaxold_videoram_r) |
| 415 | 415 | AM_RANGE(0x5800, 0x583f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 416 | AM_RANGE(0x5840, 0x585f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 417 | AM_RANGE(0x5860, 0x587f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 416 | AM_RANGE(0x5840, 0x585f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 417 | AM_RANGE(0x5860, 0x587f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 418 | 418 | AM_RANGE(0x5880, 0x58ff) AM_RAM |
| 419 | 419 | AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0") |
| 420 | 420 | AM_RANGE(0x6000, 0x6001) AM_WRITE(galaxold_leds_w) |
| r14896 | r14897 | |
| 443 | 443 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 444 | 444 | AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r) |
| 445 | 445 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 446 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 447 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 446 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 447 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 448 | 448 | AM_RANGE(0x9880, 0x98ff) AM_RAM |
| 449 | 449 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| 450 | 450 | AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w) |
| r14896 | r14897 | |
| 475 | 475 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 476 | 476 | AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r) |
| 477 | 477 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 478 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 479 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 478 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 479 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 480 | 480 | AM_RANGE(0x9880, 0x98ff) AM_RAM |
| 481 | 481 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| 482 | 482 | AM_RANGE(0xa000, 0xa002) AM_WRITE(galaxold_gfxbank_w)// a002 - sprite bank |
| r14896 | r14897 | |
| 500 | 500 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
| 501 | 501 | AM_RANGE(0x9000, 0x93ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(m_videoram) |
| 502 | 502 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 503 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 504 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 503 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 504 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 505 | 505 | AM_RANGE(0x9880, 0x98ff) AM_RAM |
| 506 | 506 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0") |
| 507 | 507 | AM_RANGE(0xc000, 0xc001) AM_WRITE(galaxold_leds_w) |
| r14896 | r14897 | |
| 527 | 527 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
| 528 | 528 | AM_RANGE(0x9000, 0x93ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(m_videoram) |
| 529 | 529 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 530 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 531 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 530 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 531 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 532 | 532 | AM_RANGE(0x9880, 0x98ff) AM_RAM |
| 533 | 533 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| 534 | 534 | AM_RANGE(0xa001, 0xa002) AM_WRITE(galaxold_leds_w) /* GUESS */ |
| r14896 | r14897 | |
| 554 | 554 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 555 | 555 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 556 | 556 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 557 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 558 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 557 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 558 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 559 | 559 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 560 | 560 | AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0") |
| 561 | 561 | AM_RANGE(0x6000, 0x6001) AM_WRITENOP /* sound triggers */ |
| r14896 | r14897 | |
| 590 | 590 | AM_RANGE(0x4800, 0x4bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 591 | 591 | AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w) // mirror |
| 592 | 592 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 593 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 594 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 593 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 594 | AM_RANGE(0x5060, 0x507f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 595 | 595 | AM_RANGE(0x5080, 0x50ff) AM_RAM |
| 596 | 596 | AM_RANGE(0x5800, 0x5fff) AM_READ(scramb2_protection_r) // must return 0x25 |
| 597 | 597 | AM_RANGE(0x6000, 0x6007) AM_READ(scramb2_port0_r) // reads from 8 addresses, 1 bit per address |
| r14896 | r14897 | |
| 615 | 615 | AM_RANGE(0x5000, 0x53ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 616 | 616 | AM_RANGE(0x5400, 0x57ff) AM_READ(galaxold_videoram_r) |
| 617 | 617 | AM_RANGE(0x5800, 0x583f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 618 | AM_RANGE(0x5840, 0x585f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 619 | AM_RANGE(0x5860, 0x587f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 618 | AM_RANGE(0x5840, 0x585f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 619 | AM_RANGE(0x5860, 0x587f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 620 | 620 | AM_RANGE(0x5880, 0x58ff) AM_RAM |
| 621 | 621 | AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0") |
| 622 | 622 | AM_RANGE(0x6000, 0x6001) AM_WRITE(galaxold_leds_w) |
| r14896 | r14897 | |
| 646 | 646 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 647 | 647 | AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r) |
| 648 | 648 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 649 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 650 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 649 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 650 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 651 | 651 | AM_RANGE(0x9880, 0x98ff) AM_RAM |
| 652 | 652 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| 653 | 653 | AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w) |
| r14896 | r14897 | |
| 667 | 667 | AM_RANGE(0x7000, 0x7fff) AM_ROM |
| 668 | 668 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 669 | 669 | AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 670 | AM_RANGE(0x9840, 0x987f) AM_WRITEONLY AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 671 | AM_RANGE(0x98c0, 0x98ff) AM_WRITEONLY AM_BASE(m_spriteram2) AM_SIZE(m_spriteram2_size) | |
| 670 | AM_RANGE(0x9840, 0x987f) AM_WRITEONLY AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 671 | AM_RANGE(0x98c0, 0x98ff) AM_WRITEONLY AM_BASE_SIZE(m_spriteram2,m_spriteram2_size) | |
| 672 | 672 | AM_RANGE(0xa000, 0xa0ff) AM_READ_PORT("IN0") |
| 673 | 673 | AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w) |
| 674 | 674 | //AM_RANGE(0xa004, 0xa007) AM_WRITE_LEGACY(galaxian_lfo_freq_w) |
| r14896 | r14897 | |
| 692 | 692 | AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW0") /* mirror */ |
| 693 | 693 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 694 | 694 | AM_RANGE(0x8800, 0x883f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 695 | AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 696 | AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 695 | AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 696 | AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 697 | 697 | AM_RANGE(0x8880, 0x8bff) AM_WRITENOP |
| 698 | 698 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 699 | 699 | AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r) |
| r14896 | r14897 | |
| 719 | 719 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(m_videoram) |
| 720 | 720 | AM_RANGE(0x9400, 0x97ff) AM_WRITENOP // not used |
| 721 | 721 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 722 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(m_spriteram) AM_SIZE(m_spriteram_size) | |
| 723 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(m_bulletsram) AM_SIZE(m_bulletsram_size) | |
| 722 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE_SIZE(m_spriteram,m_spriteram_size) | |
| 723 | AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE_SIZE(m_bulletsram,m_bulletsram_size) | |
| 724 | 724 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") |
| 725 | 725 | AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") |
| 726 | 726 | AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW0") |
| r14896 | r14897 | |
| 745 | 745 | AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(m_videoram) |
| 746 | 746 | AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w) |
| 747 | 747 | AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 748 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(m_spriteram | |
| 748 | AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 749 | 749 | AM_RANGE(0x6801, 0x6801) AM_WRITENOP //continuosly 0 and 1 |
| 750 | 750 | AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w) |
| 751 | 751 | AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w) |
| r14896 | r14897 | |
| 781 | 781 | AM_RANGE(0x6103, 0x6103) AM_WRITENOP |
| 782 | 782 | AM_RANGE(0x6200, 0x6203) AM_WRITENOP AM_BASE(m_attributesram) |
| 783 | 783 | AM_RANGE(0x8000, 0x9fff) AM_ROM |
| 784 | AM_RANGE(0xffe6, 0xffff) AM_RAM AM_BASE(m_spriteram | |
| 784 | AM_RANGE(0xffe6, 0xffff) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 785 | 785 | ADDRESS_MAP_END |
| 786 | 786 | |
| 787 | 787 | static ADDRESS_MAP_START( harem_cpu2, AS_PROGRAM, 8, galaxold_state ) |
| r14896 | r14897 | |
| 798 | 798 | AM_RANGE(0x20, 0x20) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 799 | 799 | AM_RANGE(0x40, 0x40) AM_DEVWRITE_LEGACY("ay3", ay8910_address_w) |
| 800 | 800 | AM_RANGE(0x80, 0x80) AM_DEVWRITE_LEGACY("ay3", ay8910_data_w) |
| 801 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) | |
| 801 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) | |
| 802 | 802 | ADDRESS_MAP_END |
| 803 | 803 | |
| 804 | 804 | static ADDRESS_MAP_START( hunchbkg, AS_PROGRAM, 8, galaxold_state ) |
| 805 | 805 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 806 | 806 | AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 807 | AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE(m_spriteram | |
| 807 | AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, | |
| 808 | 808 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ_PORT("IN0") |
| 809 | 809 | AM_RANGE(0x1500, 0x1501) AM_MIRROR(0x6000) AM_WRITE(galaxold_leds_w) /* not connected ... */ |
| 810 | 810 | AM_RANGE(0x1502, 0x1502) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_lockout_w) /* not connected ... */ |
| r14896 | r14897 | |
| 839 | 839 | static ADDRESS_MAP_START( drivfrcg, AS_PROGRAM, 8, galaxold_state ) |
| 840 | 840 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 841 | 841 | AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 842 | AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE(m_spriteram | |
| 842 | AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, | |
| 843 | 843 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ_PORT("IN0") |
| 844 | 844 | AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w) |
| 845 | 845 | AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
| 867 | 867 | static ADDRESS_MAP_START( racknrol, AS_PROGRAM, 8, galaxold_state ) |
| 868 | 868 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 869 | 869 | AM_RANGE(0x1400, 0x143f) AM_MIRROR(0x6000) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(m_attributesram) |
| 870 | AM_RANGE(0x1440, 0x14bf) AM_MIRROR(0x6000) AM_RAM AM_BASE(m_spriteram | |
| 870 | AM_RANGE(0x1440, 0x14bf) AM_MIRROR(0x6000) AM_RAM AM_BASE_SIZE(m_spriteram, | |
| 871 | 871 | AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_RAM |
| 872 | 872 | AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ_PORT("IN0") |
| 873 | 873 | AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
|---|---|---|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | |
| 264 | ||
| 264 | ||
| 265 | 265 | { |
| 266 | atarisy1_state *state = space->machine().driver_data<atarisy1_state>(); | |
| 267 | 266 | int newval = 0xff; |
| 268 | 267 | static const char *const portnames[] = { "IN0", "IN1" }; |
| 269 | 268 | |
| 270 | 269 | /* digital joystick type */ |
| 271 | if (state->m_joystick_type == 1) | |
| 272 | newval = (input_port_read(space->machine(), "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00; | |
| 270 | if (m_joystick_type == 1) | |
| 271 | newval = (input_port_read(machine(), "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00; | |
| 273 | 272 | |
| 274 | 273 | /* Hall-effect analog joystick */ |
| 275 | else if (state->m_joystick_type == 2) | |
| 276 | newval = input_port_read(space->machine(), portnames[offset & 1]); | |
| 274 | else if (m_joystick_type == 2) | |
| 275 | newval = input_port_read(machine(), portnames[offset & 1]); | |
| 277 | 276 | |
| 278 | 277 | /* Road Blasters gas pedal */ |
| 279 | else if (state->m_joystick_type == 3) | |
| 280 | newval = input_port_read(space->machine(), "IN1"); | |
| 278 | else if (m_joystick_type == 3) | |
| 279 | newval = input_port_read(machine(), "IN1"); | |
| 281 | 280 | |
| 282 | 281 | /* the A4 bit enables/disables joystick IRQs */ |
| 283 | | |
| 282 | | |
| 284 | 283 | |
| 285 | 284 | /* clear any existing interrupt and set a timer for a new one */ |
| 286 | state->m_joystick_int = 0; | |
| 287 | state->m_joystick_timer->adjust(attotime::from_usec(50), newval); | |
| 288 | atarigen_update_interrupts(space->machine()); | |
| 285 | m_joystick_int = 0; | |
| 286 | m_joystick_timer->adjust(attotime::from_usec(50), newval); | |
| 287 | atarigen_update_interrupts(machine()); | |
| 289 | 288 | |
| 290 | return | |
| 289 | return | |
| 291 | 290 | } |
| 292 | 291 | |
| 293 | 292 | |
| 294 | ||
| 293 | ||
| 295 | 294 | { |
| 296 | 295 | /* the A4 bit enables/disables joystick IRQs */ |
| 297 | atarisy1_state *state = space->machine().driver_data<atarisy1_state>(); | |
| 298 | state->m_joystick_int_enable = ((offset >> 3) & 1) ^ 1; | |
| 296 | m_joystick_int_enable = ((offset >> 3) & 1) ^ 1; | |
| 299 | 297 | } |
| 300 | 298 | |
| 301 | 299 | |
| r14896 | r14897 | |
| 306 | 304 | * |
| 307 | 305 | *************************************/ |
| 308 | 306 | |
| 309 | ||
| 307 | ||
| 310 | 308 | { |
| 311 | atarisy1_state *state = space->machine().driver_data<atarisy1_state>(); | |
| 312 | 309 | int result = 0xff; |
| 313 | 310 | |
| 314 | 311 | /* Marble Madness trackball type -- rotated 45 degrees! */ |
| 315 | if ( | |
| 312 | if ( | |
| 316 | 313 | { |
| 317 | 314 | int player = (offset >> 1) & 1; |
| 318 | 315 | int which = offset & 1; |
| r14896 | r14897 | |
| 324 | 321 | |
| 325 | 322 | if (player == 0) |
| 326 | 323 | { |
| 327 | posx = (INT8)input_port_read(space->machine(), "IN0"); | |
| 328 | posy = (INT8)input_port_read(space->machine(), "IN1"); | |
| 324 | posx = (INT8)input_port_read(machine(), "IN0"); | |
| 325 | posy = (INT8)input_port_read(machine(), "IN1"); | |
| 329 | 326 | } |
| 330 | 327 | else |
| 331 | 328 | { |
| 332 | posx = (INT8)input_port_read(space->machine(), "IN2"); | |
| 333 | posy = (INT8)input_port_read(space->machine(), "IN3"); | |
| 329 | posx = (INT8)input_port_read(machine(), "IN2"); | |
| 330 | posy = (INT8)input_port_read(machine(), "IN3"); | |
| 334 | 331 | } |
| 335 | 332 | |
| 336 | state->m_cur[player][0] = posx + posy; | |
| 337 | state->m_cur[player][1] = posx - posy; | |
| 333 | m_cur[player][0] = posx + posy; | |
| 334 | m_cur[player][1] = posx - posy; | |
| 338 | 335 | } |
| 339 | 336 | |
| 340 | result = | |
| 337 | result = | |
| 341 | 338 | } |
| 342 | 339 | |
| 343 | 340 | /* Road Blasters steering wheel */ |
| 344 | else if (state->m_trackball_type == 2) | |
| 345 | result = input_port_read(space->machine(), "IN0"); | |
| 341 | else if (m_trackball_type == 2) | |
| 342 | result = input_port_read(machine(), "IN0"); | |
| 346 | 343 | |
| 347 | 344 | return result; |
| 348 | 345 | } |
| r14896 | r14897 | |
| 355 | 352 | * |
| 356 | 353 | *************************************/ |
| 357 | 354 | |
| 358 | ||
| 355 | ||
| 359 | 356 | { |
| 360 | atarisy1_state *state = space->machine().driver_data<atarisy1_state>(); | |
| 361 | int temp = input_port_read(space->machine(), "F60000"); | |
| 362 | if (state->m_cpu_to_sound_ready) temp ^= 0x0080; | |
| 357 | int temp = input_port_read(machine(), "F60000"); | |
| 358 | if (m_cpu_to_sound_ready) temp ^= 0x0080; | |
| 363 | 359 | return temp; |
| 364 | 360 | } |
| 365 | 361 | |
| r14896 | r14897 | |
| 371 | 367 | * |
| 372 | 368 | *************************************/ |
| 373 | 369 | |
| 374 | ||
| 370 | ||
| 375 | 371 | { |
| 376 | atarisy1_state *state = space->machine().driver_data<atarisy1_state>(); | |
| 377 | int temp = input_port_read(space->machine(), "1820"); | |
| 372 | int temp = input_port_read(machine(), "1820"); | |
| 378 | 373 | |
| 379 | if (state->m_cpu_to_sound_ready) temp ^= 0x08; | |
| 380 | if (state->m_sound_to_cpu_ready) temp ^= 0x10; | |
| 381 | if (!(input_port_read(space->machine(), "F60000") & 0x0040)) temp ^= 0x80; | |
| 374 | if (m_cpu_to_sound_ready) temp ^= 0x08; | |
| 375 | if (m_sound_to_cpu_ready) temp ^= 0x10; | |
| 376 | if (!(input_port_read(machine(), "F60000") & 0x0040)) temp ^= 0x80; | |
| 382 | 377 | |
| 383 | 378 | return temp; |
| 384 | 379 | } |
| r14896 | r14897 | |
| 455 | 450 | * |
| 456 | 451 | *************************************/ |
| 457 | 452 | |
| 458 | ||
| 453 | ||
| 459 | 454 | { |
| 460 | set_led_status( | |
| 455 | set_led_status( | |
| 461 | 456 | } |
| 462 | 457 | |
| 463 | 458 | |
| r14896 | r14897 | |
| 484 | 479 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 485 | 480 | AM_RANGE(0xa02000, 0xa02fff) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarisy1_spriteram_w) |
| 486 | 481 | AM_RANGE(0xa03000, 0xa03fff) AM_RAM_WRITE_LEGACY(atarigen_alpha_w) AM_BASE(m_alpha) |
| 487 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 482 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 488 | 483 | AM_RANGE(0xf00000, 0xf00fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 489 | AM_RANGE(0xf20000, 0xf20007) AM_READ_LEGACY(trakball_r) | |
| 490 | AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE_LEGACY(joystick_r, joystick_w) | |
| 491 | AM_RANGE(0xf60000, 0xf60003) AM_READ_LEGACY(port4_r) | |
| 484 | AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r) | |
| 485 | AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w) | |
| 486 | AM_RANGE(0xf60000, 0xf60003) AM_READ(port4_r) | |
| 492 | 487 | AM_RANGE(0xf80000, 0xf80001) AM_WRITE_LEGACY(atarigen_sound_w) /* used by roadbls2 */ |
| 493 | 488 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ_LEGACY(atarigen_sound_r) |
| 494 | 489 | AM_RANGE(0xfe0000, 0xfe0001) AM_WRITE_LEGACY(atarigen_sound_w) |
| r14896 | r14897 | |
| 507 | 502 | AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write) |
| 508 | 503 | AM_RANGE(0x1800, 0x1801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 509 | 504 | AM_RANGE(0x1810, 0x1810) AM_READWRITE_LEGACY(atarigen_6502_sound_r, atarigen_6502_sound_w) |
| 510 | AM_RANGE(0x1820, 0x1820) AM_READ_LEGACY(switch_6502_r) | |
| 511 | AM_RANGE(0x1824, 0x1825) AM_WRITE_LEGACY(led_w) | |
| 505 | AM_RANGE(0x1820, 0x1820) AM_READ(switch_6502_r) | |
| 506 | AM_RANGE(0x1824, 0x1825) AM_WRITE(led_w) | |
| 512 | 507 | AM_RANGE(0x1870, 0x187f) AM_DEVREADWRITE_LEGACY("pokey", pokey_r, pokey_w) |
| 513 | 508 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 514 | 509 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | { |
| 28 | 28 | public: |
| 29 | 29 | horse_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | : driver_device(mconfig, type, tag) { } | |
| 30 | : driver_device(mconfig, type, tag) , | |
| 31 | m_video_ram(*this, "video_ram"), | |
| 32 | m_color_ram(*this, "color_ram"){ } | |
| 31 | 33 | |
| 32 | UINT8 *m_video_ram; | |
| 33 | UINT8 *m_color_ram; | |
| 34 | required_shared_ptr<UINT8> m_video_ram; | |
| 35 | required_shared_ptr<UINT8> m_color_ram; | |
| 34 | 36 | UINT8 m_output; |
| 35 | 37 | }; |
| 36 | 38 | |
| r14896 | r14897 | |
| 56 | 58 | { |
| 57 | 59 | for (int x = 0; x < 32; x++) |
| 58 | 60 | { |
| 59 | UINT8 data = state->m_video_ram[y << 5 | x]; | |
| 60 | UINT8 color = state->m_color_ram[(y << 3 & 0x780) | x] >> 4; | |
| 61 | UINT8 data = state->m_video_ram.target()[y << 5 | x]; | |
| 62 | UINT8 color = state->m_color_ram.target()[(y << 3 & 0x780) | x] >> 4; | |
| 61 | 63 | |
| 62 | 64 | for (int i = 0; i < 8; i++) |
| 63 | 65 | bitmap.pix16(y, x << 3 | i) = (data >> i & 1) ? color : 0; |
| r14896 | r14897 | |
| 77 | 79 | static ADDRESS_MAP_START( horse_map, AS_PROGRAM, 8, horse_state ) |
| 78 | 80 | AM_RANGE(0x0000, 0x37ff) AM_ROM |
| 79 | 81 | AM_RANGE(0x4000, 0x40ff) AM_DEVREADWRITE("i8155", i8155_device, memory_r, memory_w) |
| 80 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE(m_video_ram) | |
| 81 | AM_RANGE(0x8000, 0x879f) AM_RAM AM_BASE(m_color_ram) AM_MIRROR(0x0860) | |
| 82 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_SHARE("video_ram") | |
| 83 | AM_RANGE(0x8000, 0x879f) AM_RAM AM_SHARE("color_ram") AM_MIRROR(0x0860) | |
| 82 | 84 | |
| 83 | 85 | ADDRESS_MAP_END |
| 84 | 86 |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | { |
| 84 | 84 | public: |
| 85 | 85 | pturn_state(const machine_config &mconfig, device_type type, const char *tag) |
| 86 | : driver_device(mconfig, type, tag) { } | |
| 86 | : driver_device(mconfig, type, tag) , | |
| 87 | m_videoram(*this, "videoram"), | |
| 88 | m_spriteram(*this, "spriteram"){ } | |
| 87 | 89 | |
| 88 | UINT8 | |
| 90 | required_shared_ptr<UINT8> | |
| 89 | 91 | tilemap_t *m_fgmap; |
| 90 | 92 | tilemap_t *m_bgmap; |
| 91 | 93 | int m_bgbank; |
| r14896 | r14897 | |
| 95 | 97 | int m_bgcolor; |
| 96 | 98 | int m_nmi_main; |
| 97 | 99 | int m_nmi_sub; |
| 98 | UINT8 *m_spriteram; | |
| 99 | size_t m_spriteram_size; | |
| 100 | required_shared_ptr<UINT8> m_spriteram; | |
| 100 | 101 | DECLARE_WRITE8_MEMBER(pturn_videoram_w); |
| 101 | 102 | DECLARE_WRITE8_MEMBER(nmi_main_enable_w); |
| 102 | 103 | DECLARE_WRITE8_MEMBER(nmi_sub_enable_w); |
| r14896 | r14897 | |
| 127 | 128 | static TILE_GET_INFO( get_pturn_tile_info ) |
| 128 | 129 | { |
| 129 | 130 | pturn_state *state = machine.driver_data<pturn_state>(); |
| 130 | UINT8 *videoram = state->m_videoram; | |
| 131 | UINT8 *videoram = state->m_videoram.target(); | |
| 131 | 132 | int tileno; |
| 132 | 133 | tileno = videoram[tile_index]; |
| 133 | 134 | |
| r14896 | r14897 | |
| 163 | 164 | static SCREEN_UPDATE_IND16(pturn) |
| 164 | 165 | { |
| 165 | 166 | pturn_state *state = screen.machine().driver_data<pturn_state>(); |
| 166 | UINT8 *spriteram = state->m_spriteram; | |
| 167 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 167 | 168 | int offs; |
| 168 | 169 | int sx, sy; |
| 169 | 170 | int flipx, flipy; |
| r14896 | r14897 | |
| 179 | 180 | flipy=spriteram[offs+1]&0x80; |
| 180 | 181 | |
| 181 | 182 | |
| 182 | if (flip_screen_x | |
| 183 | if (state->flip_screen_x | |
| 183 | 184 | { |
| 184 | 185 | sx = 224 - sx; |
| 185 | 186 | flipx ^= 0x40; |
| 186 | 187 | } |
| 187 | 188 | |
| 188 | if (flip_screen_y | |
| 189 | if (state->flip_screen_y | |
| 189 | 190 | { |
| 190 | 191 | flipy ^= 0x80; |
| 191 | 192 | sy = 224 - sy; |
| r14896 | r14897 | |
| 218 | 219 | |
| 219 | 220 | WRITE8_MEMBER(pturn_state::pturn_videoram_w) |
| 220 | 221 | { |
| 221 | UINT8 *videoram = m_videoram; | |
| 222 | UINT8 *videoram = m_videoram.target(); | |
| 222 | 223 | videoram[offset]=data; |
| 223 | 224 | m_fgmap->mark_tile_dirty(offset); |
| 224 | 225 | } |
| r14896 | r14897 | |
| 236 | 237 | |
| 237 | 238 | WRITE8_MEMBER(pturn_state::sound_w) |
| 238 | 239 | { |
| 239 | soundlatch_w(space,0,data); | |
| 240 | soundlatch_byte_w(space,0,data); | |
| 240 | 241 | } |
| 241 | 242 | |
| 242 | 243 | |
| r14896 | r14897 | |
| 277 | 278 | |
| 278 | 279 | WRITE8_MEMBER(pturn_state::flip_w) |
| 279 | 280 | { |
| 280 | flip_screen_set( | |
| 281 | flip_screen_set( | |
| 281 | 282 | } |
| 282 | 283 | |
| 283 | 284 | |
| r14896 | r14897 | |
| 314 | 315 | |
| 315 | 316 | AM_RANGE(0xdfe0, 0xdfe0) AM_NOP |
| 316 | 317 | |
| 317 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(pturn_videoram_w) AM_ | |
| 318 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(pturn_videoram_w) AM_ | |
| 318 | 319 | AM_RANGE(0xe400, 0xe400) AM_WRITE(fgpalette_w) |
| 319 | 320 | AM_RANGE(0xe800, 0xe800) AM_WRITE(sound_w) |
| 320 | 321 | |
| 321 | AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_ | |
| 322 | AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_ | |
| 322 | 323 | |
| 323 | 324 | AM_RANGE(0xf400, 0xf400) AM_WRITE(bg_scrollx_w) |
| 324 | 325 | |
| r14896 | r14897 | |
| 344 | 345 | static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, pturn_state ) |
| 345 | 346 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 346 | 347 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 347 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) AM_WRITE(nmi_sub_enable_w) | |
| 348 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(nmi_sub_enable_w) | |
| 348 | 349 | AM_RANGE(0x4000, 0x4000) AM_RAM |
| 349 | 350 | AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 350 | 351 | AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| r14896 | r14897 | |
| 478 | 479 | { |
| 479 | 480 | pturn_state *state = machine.driver_data<pturn_state>(); |
| 480 | 481 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 481 | state->soundlatch_clear_w(*space,0,0); | |
| 482 | state->soundlatch_clear_byte_w(*space,0,0); | |
| 482 | 483 | } |
| 483 | 484 | |
| 484 | 485 | static MACHINE_CONFIG_START( pturn, pturn_state ) |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | static ADDRESS_MAP_START( gumbo_map, AS_PROGRAM, 16, gumbo_state ) |
| 50 | 50 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 51 | 51 | AM_RANGE(0x080000, 0x083fff) AM_RAM // main ram |
| 52 | AM_RANGE(0x1b0000, 0x1b03ff) AM_RAM_WRITE(paletteram | |
| 52 | AM_RANGE(0x1b0000, 0x1b03ff) AM_RAM_WRITE(paletteram | |
| 53 | 53 | AM_RANGE(0x1c0100, 0x1c0101) AM_READ_PORT("P1_P2") |
| 54 | 54 | AM_RANGE(0x1c0200, 0x1c0201) AM_READ_PORT("DSW") |
| 55 | 55 | AM_RANGE(0x1c0300, 0x1c0301) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| r14896 | r14897 | |
| 63 | 63 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 64 | 64 | AM_RANGE(0x100000, 0x103fff) AM_RAM // main ram |
| 65 | 65 | AM_RANGE(0x190000, 0x197fff) AM_RAM_WRITE(gumbo_fg_videoram_w) AM_BASE(m_fg_videoram) // fg tilemap |
| 66 | AM_RANGE(0x1a0000, 0x1a03ff) AM_RAM_WRITE(paletteram | |
| 66 | AM_RANGE(0x1a0000, 0x1a03ff) AM_RAM_WRITE(paletteram | |
| 67 | 67 | AM_RANGE(0x1b0100, 0x1b0101) AM_READ_PORT("P1_P2") |
| 68 | 68 | AM_RANGE(0x1b0200, 0x1b0201) AM_READ_PORT("DSW") |
| 69 | 69 | AM_RANGE(0x1b0300, 0x1b0301) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| r14896 | r14897 | |
| 73 | 73 | static ADDRESS_MAP_START( dblpoint_map, AS_PROGRAM, 16, gumbo_state ) |
| 74 | 74 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 75 | 75 | AM_RANGE(0x080000, 0x083fff) AM_RAM // main ram |
| 76 | AM_RANGE(0x1b0000, 0x1b03ff) AM_WRITE(paletteram | |
| 76 | AM_RANGE(0x1b0000, 0x1b03ff) AM_WRITE(paletteram | |
| 77 | 77 | AM_RANGE(0x1c0100, 0x1c0101) AM_READ_PORT("P1_P2") |
| 78 | 78 | AM_RANGE(0x1c0200, 0x1c0201) AM_READ_PORT("DSW") |
| 79 | 79 | AM_RANGE(0x1c0300, 0x1c0301) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| r14896 | r14897 | |
|---|---|---|
| 188 | 188 | case 4: /* 6502 sound cpu */ |
| 189 | 189 | if (ACCESSING_BITS_0_7) |
| 190 | 190 | { |
| 191 | soundlatch_w(space, 0, data & 0xff); | |
| 191 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 192 | 192 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 193 | 193 | } |
| 194 | 194 | break; |
| r14896 | r14897 | |
| 227 | 227 | case 0xe: /* 6502 sound cpu */ |
| 228 | 228 | if (ACCESSING_BITS_0_7) |
| 229 | 229 | { |
| 230 | soundlatch_w(space, 0, data & 0xff); | |
| 230 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 231 | 231 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 232 | 232 | } |
| 233 | 233 | break; |
| r14896 | r14897 | |
| 260 | 260 | case 0: |
| 261 | 261 | if (ACCESSING_BITS_0_7) |
| 262 | 262 | { |
| 263 | soundlatch_w(space, 0, data & 0xff); | |
| 263 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 264 | 264 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 265 | 265 | } |
| 266 | 266 | break; |
| r14896 | r14897 | |
| 274 | 274 | { |
| 275 | 275 | if (ACCESSING_BITS_0_7) |
| 276 | 276 | { |
| 277 | soundlatch_w(space, 0, data & 0xff); | |
| 277 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 278 | 278 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 279 | 279 | } |
| 280 | 280 | } |
| r14896 | r14897 | |
| 507 | 507 | |
| 508 | 508 | AM_RANGE(0x304000, 0x307fff) AM_RAM AM_BASE(m_ram) /* Sly spy main ram */ |
| 509 | 509 | AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_BASE(m_spriteram) /* Sprites */ |
| 510 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 510 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 511 | 511 | AM_RANGE(0x314000, 0x314003) AM_WRITE(slyspy_control_w) |
| 512 | 512 | AM_RANGE(0x314008, 0x31400f) AM_READ(slyspy_controls_r) |
| 513 | 513 | AM_RANGE(0x31c000, 0x31c00f) AM_READ(slyspy_protection_r) AM_WRITENOP |
| r14896 | r14897 | |
| 518 | 518 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 519 | 519 | AM_RANGE(0x100000, 0x103fff) AM_RAM AM_BASE(m_ram) |
| 520 | 520 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE(m_spriteram) |
| 521 | AM_RANGE(0x140000, 0x1407ff) AM_WRITE(paletteram | |
| 521 | AM_RANGE(0x140000, 0x1407ff) AM_WRITE(paletteram | |
| 522 | 522 | AM_RANGE(0x160000, 0x160001) AM_WRITE(dec0_priority_w) |
| 523 | 523 | AM_RANGE(0x180000, 0x18000f) AM_READ(midres_controls_r) |
| 524 | 524 | AM_RANGE(0x180008, 0x18000f) AM_WRITENOP /* ?? watchdog ?? */ |
| r14896 | r14897 | |
| 552 | 552 | AM_RANGE(0x0000, 0x05ff) AM_RAM |
| 553 | 553 | AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 554 | 554 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3812_w) |
| 555 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 555 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 556 | 556 | AM_RANGE(0x3800, 0x3800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 557 | 557 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 558 | 558 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 564 | 564 | AM_RANGE(0x0a0000, 0x0a0001) AM_READNOP /* Protection counter */ |
| 565 | 565 | AM_RANGE(0x0b0000, 0x0b0001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 566 | 566 | AM_RANGE(0x0e0000, 0x0e0001) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 567 | AM_RANGE(0x0f0000, 0x0f0001) AM_READ(soundlatch_r) | |
| 567 | AM_RANGE(0x0f0000, 0x0f0001) AM_READ(soundlatch_byte_r) | |
| 568 | 568 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 569 | 569 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| 570 | 570 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 574 | 574 | AM_RANGE(0x108000, 0x108001) AM_DEVWRITE_LEGACY("ym2", ym3812_w) |
| 575 | 575 | AM_RANGE(0x118000, 0x118001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 576 | 576 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 577 | AM_RANGE(0x138000, 0x138001) AM_READ(soundlatch_r) | |
| 577 | AM_RANGE(0x138000, 0x138001) AM_READ(soundlatch_byte_r) | |
| 578 | 578 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 579 | 579 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| 580 | 580 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 606 | 606 | AM_RANGE(0x300c00, 0x300fff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w) |
| 607 | 607 | AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w) |
| 608 | 608 | AM_RANGE(0x301800, 0x307fff) AM_RAM AM_BASE(m_ram) /* Sly spy main ram */ |
| 609 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 609 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 610 | 610 | AM_RANGE(0xb08000, 0xb087ff) AM_RAM AM_BASE(m_spriteram) /* Sprites */ |
| 611 | 611 | ADDRESS_MAP_END |
| 612 | 612 | |
| r14896 | r14897 | |
| 636 | 636 | AM_RANGE(0x300000, 0x30001f) AM_READ(dec0_rotary_r) |
| 637 | 637 | AM_RANGE(0x30c000, 0x30c00b) AM_READ(dec0_controls_r) |
| 638 | 638 | AM_RANGE(0x30c000, 0x30c01f) AM_WRITE(automat_control_w) /* Priority, sound, etc. */ |
| 639 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 639 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram | |
| 640 | 640 | AM_RANGE(0x314000, 0x3147ff) AM_RAM |
| 641 | 641 | AM_RANGE(0x400008, 0x400009) AM_WRITE(dec0_priority_w) // NEW |
| 642 | 642 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_BASE(m_ram) /* Main ram */ |
| r14896 | r14897 | |
| 652 | 652 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 653 | 653 | // AM_RANGE(0xc800, 0xc800) AM_WRITE_LEGACY(ym2203_control_port_0_w) |
| 654 | 654 | // AM_RANGE(0xc801, 0xc801) AM_WRITE_LEGACY(ym2203_write_port_0_w) |
| 655 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r) | |
| 655 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) | |
| 656 | 656 | // AM_RANGE(0xd000, 0xd000) AM_WRITE_LEGACY(ym2203_control_port_1_w) |
| 657 | 657 | // AM_RANGE(0xd001, 0xd001) AM_WRITE_LEGACY(ym2203_write_port_1_w) |
| 658 | 658 | AM_RANGE(0xf000, 0xf000) AM_WRITE(automat_adpcm_w) |
| r14896 | r14897 | |
|---|---|---|
| 70 | 70 | * |
| 71 | 71 | *************************************/ |
| 72 | 72 | |
| 73 | ||
| 73 | ||
| 74 | 74 | { |
| 75 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 76 | int temp = input_port_read(space->machine(), "IN2"); | |
| 77 | if (state->m_cpu_to_sound_ready) temp ^= 0x0020; | |
| 78 | if (state->m_sound_to_cpu_ready) temp ^= 0x0010; | |
| 75 | int temp = input_port_read(machine(), "IN2"); | |
| 76 | if (m_cpu_to_sound_ready) temp ^= 0x0020; | |
| 77 | if (m_sound_to_cpu_ready) temp ^= 0x0010; | |
| 79 | 78 | temp ^= 0x0008; /* A2D.EOC always high for now */ |
| 80 | 79 | return temp; |
| 81 | 80 | } |
| 82 | 81 | |
| 83 | 82 | |
| 84 | ||
| 83 | ||
| 85 | 84 | { |
| 86 | 85 | static const char *const portnames[] = { "A2D0", "A2D1" }; |
| 87 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 88 | 86 | |
| 89 | | |
| 87 | | |
| 90 | 88 | } |
| 91 | 89 | |
| 92 | 90 | |
| 93 | ||
| 91 | ||
| 94 | 92 | { |
| 95 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 96 | return state->m_analog_data << 8; | |
| 93 | return m_analog_data << 8; | |
| 97 | 94 | } |
| 98 | 95 | |
| 99 | 96 | |
| 100 | ||
| 97 | ||
| 101 | 98 | { |
| 102 | 99 | /* upper byte */ |
| 103 | 100 | if (ACCESSING_BITS_8_15) |
| 104 | 101 | { |
| 105 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 106 | 102 | |
| 107 | 103 | /* bit 14 controls the ASIC65 reset line */ |
| 108 | asic65_reset( | |
| 104 | asic65_reset( | |
| 109 | 105 | |
| 110 | 106 | /* bits 13-11 are the MO control bits */ |
| 111 | atarirle_control_w( | |
| 107 | atarirle_control_w( | |
| 112 | 108 | } |
| 113 | 109 | |
| 114 | 110 | /* lower byte */ |
| 115 | 111 | if (ACCESSING_BITS_0_7) |
| 116 | 112 | { |
| 117 | 113 | /* bit 4 resets the sound CPU */ |
| 118 | cputag_set_input_line( | |
| 114 | cputag_set_input_line( | |
| 119 | 115 | if (!(data & 0x10)) atarijsa_reset(); |
| 120 | 116 | |
| 121 | 117 | /* bit 5 is /XRESET, probably related to the ASIC */ |
| r14896 | r14897 | |
| 125 | 121 | } |
| 126 | 122 | |
| 127 | 123 | |
| 128 | ||
| 124 | ||
| 129 | 125 | { |
| 130 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 131 | COMBINE_DATA(state->m_mo_command); | |
| 132 | atarirle_command_w(state->m_rle, (data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); | |
| 126 | COMBINE_DATA(m_mo_command); | |
| 127 | atarirle_command_w(m_rle, (data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); | |
| 133 | 128 | } |
| 134 | 129 | |
| 135 | 130 | |
| r14896 | r14897 | |
| 152 | 147 | } |
| 153 | 148 | |
| 154 | 149 | |
| 155 | ||
| 150 | ||
| 156 | 151 | { |
| 157 | 152 | /* |
| 158 | 153 | sequence 1: |
| r14896 | r14897 | |
| 175 | 170 | { |
| 176 | 171 | /* standard 68000 -> 68eee -> (bank) addressing */ |
| 177 | 172 | case 0x68000/2: |
| 178 | | |
| 173 | | |
| 179 | 174 | break; |
| 180 | 175 | case 0x68eee/2: |
| 181 | if (state->m_sloop_state == 1) | |
| 182 | state->m_sloop_state = 2; | |
| 176 | if (m_sloop_state == 1) | |
| 177 | m_sloop_state = 2; | |
| 183 | 178 | break; |
| 184 | 179 | case 0x00124/2: |
| 185 | if ( | |
| 180 | if ( | |
| 186 | 181 | { |
| 187 | state->m_sloop_next_bank = 0; | |
| 188 | state->m_sloop_state = 3; | |
| 182 | m_sloop_next_bank = 0; | |
| 183 | m_sloop_state = 3; | |
| 189 | 184 | } |
| 190 | 185 | break; |
| 191 | 186 | case 0x00678/2: |
| 192 | if ( | |
| 187 | if ( | |
| 193 | 188 | { |
| 194 | state->m_sloop_next_bank = 1; | |
| 195 | state->m_sloop_state = 3; | |
| 189 | m_sloop_next_bank = 1; | |
| 190 | m_sloop_state = 3; | |
| 196 | 191 | } |
| 197 | 192 | break; |
| 198 | 193 | case 0x00abc/2: |
| 199 | if ( | |
| 194 | if ( | |
| 200 | 195 | { |
| 201 | state->m_sloop_next_bank = 2; | |
| 202 | state->m_sloop_state = 3; | |
| 196 | m_sloop_next_bank = 2; | |
| 197 | m_sloop_state = 3; | |
| 203 | 198 | } |
| 204 | 199 | break; |
| 205 | 200 | case 0x01024/2: |
| 206 | if ( | |
| 201 | if ( | |
| 207 | 202 | { |
| 208 | state->m_sloop_next_bank = 3; | |
| 209 | state->m_sloop_state = 3; | |
| 203 | m_sloop_next_bank = 3; | |
| 204 | m_sloop_state = 3; | |
| 210 | 205 | } |
| 211 | 206 | break; |
| 212 | 207 | |
| r14896 | r14897 | |
| 219 | 214 | /* written if $ff8007 == 2 */ |
| 220 | 215 | case 0x71166/2: |
| 221 | 216 | /* written if $ff8007 == 3 */ |
| 222 | if (state->m_sloop_state == 3) | |
| 223 | state->m_sloop_bank = state->m_sloop_next_bank; | |
| 224 | state->m_sloop_state = 0; | |
| 217 | if (m_sloop_state == 3) | |
| 218 | m_sloop_bank = m_sloop_next_bank; | |
| 219 | m_sloop_state = 0; | |
| 225 | 220 | break; |
| 226 | 221 | |
| 227 | 222 | /* bank offsets */ |
| 228 | 223 | case 0x5edb4/2: |
| 229 | if ( | |
| 224 | if ( | |
| 230 | 225 | { |
| 231 | state->m_sloop_state = 10; | |
| 232 | state->m_sloop_offset = 0; | |
| 226 | m_sloop_state = 10; | |
| 227 | m_sloop_offset = 0; | |
| 233 | 228 | } |
| 234 | | |
| 229 | | |
| 235 | 230 | break; |
| 236 | 231 | case 0x5db0a/2: |
| 237 | if ( | |
| 232 | if ( | |
| 238 | 233 | { |
| 239 | state->m_sloop_state = 10; | |
| 240 | state->m_sloop_offset = 0; | |
| 234 | m_sloop_state = 10; | |
| 235 | m_sloop_offset = 0; | |
| 241 | 236 | } |
| 242 | | |
| 237 | | |
| 243 | 238 | break; |
| 244 | 239 | |
| 245 | 240 | /* apply the offset */ |
| 246 | 241 | case 0x5f042/2: |
| 247 | if ( | |
| 242 | if ( | |
| 248 | 243 | { |
| 249 | state->m_sloop_bank = (state->m_sloop_bank + state->m_sloop_offset) & 3; | |
| 250 | state->m_sloop_offset = 0; | |
| 251 | state->m_sloop_state = 0; | |
| 244 | m_sloop_bank = (m_sloop_bank + m_sloop_offset) & 3; | |
| 245 | m_sloop_offset = 0; | |
| 246 | m_sloop_state = 0; | |
| 252 | 247 | } |
| 253 | 248 | break; |
| 254 | 249 | |
| r14896 | r14897 | |
| 264 | 259 | } |
| 265 | 260 | |
| 266 | 261 | |
| 267 | ||
| 262 | ||
| 268 | 263 | { |
| 269 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 270 | roadriot_sloop_tweak(state, offset); | |
| 264 | roadriot_sloop_tweak(offset); | |
| 271 | 265 | if (offset < 0x78000/2) |
| 272 | return | |
| 266 | return | |
| 273 | 267 | else |
| 274 | return | |
| 268 | return | |
| 275 | 269 | } |
| 276 | 270 | |
| 277 | 271 | |
| 278 | ||
| 272 | ||
| 279 | 273 | { |
| 280 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 281 | roadriot_sloop_tweak(state, offset); | |
| 274 | roadriot_sloop_tweak(offset); | |
| 282 | 275 | } |
| 283 | 276 | |
| 284 | 277 | |
| r14896 | r14897 | |
| 289 | 282 | * |
| 290 | 283 | *************************************/ |
| 291 | 284 | |
| 292 | ||
| 285 | ||
| 293 | 286 | { |
| 294 | UINT32 *last_accesses = | |
| 287 | UINT32 *last_accesses = | |
| 295 | 288 | |
| 296 | 289 | if (offset >= 0x7f7c0/2) |
| 297 | 290 | { |
| r14896 | r14897 | |
| 306 | 299 | |
| 307 | 300 | if (last_accesses[0] == 0x7f7c0/2 && last_accesses[1] == 0x7f7ce/2 && last_accesses[2] == 0x7f7c2/2 && last_accesses[3] == 0x7f7cc/2 && |
| 308 | 301 | last_accesses[4] == 0x7f7c4/2 && last_accesses[5] == 0x7f7ca/2 && last_accesses[6] == 0x7f7c6/2 && last_accesses[7] == 0x7f7c8/2) |
| 309 | | |
| 302 | | |
| 310 | 303 | |
| 311 | 304 | if (last_accesses[0] == 0x7f7d0/2 && last_accesses[1] == 0x7f7de/2 && last_accesses[2] == 0x7f7d2/2 && last_accesses[3] == 0x7f7dc/2 && |
| 312 | 305 | last_accesses[4] == 0x7f7d4/2 && last_accesses[5] == 0x7f7da/2 && last_accesses[6] == 0x7f7d6/2 && last_accesses[7] == 0x7f7d8/2) |
| 313 | | |
| 306 | | |
| 314 | 307 | |
| 315 | 308 | if (last_accesses[0] == 0x7f7e0/2 && last_accesses[1] == 0x7f7ee/2 && last_accesses[2] == 0x7f7e2/2 && last_accesses[3] == 0x7f7ec/2 && |
| 316 | 309 | last_accesses[4] == 0x7f7e4/2 && last_accesses[5] == 0x7f7ea/2 && last_accesses[6] == 0x7f7e6/2 && last_accesses[7] == 0x7f7e8/2) |
| 317 | | |
| 310 | | |
| 318 | 311 | |
| 319 | 312 | if (last_accesses[0] == 0x7f7f0/2 && last_accesses[1] == 0x7f7fe/2 && last_accesses[2] == 0x7f7f2/2 && last_accesses[3] == 0x7f7fc/2 && |
| 320 | 313 | last_accesses[4] == 0x7f7f4/2 && last_accesses[5] == 0x7f7fa/2 && last_accesses[6] == 0x7f7f6/2 && last_accesses[7] == 0x7f7f8/2) |
| 321 | | |
| 314 | | |
| 322 | 315 | } |
| 323 | 316 | } |
| 324 | 317 | |
| 325 | 318 | |
| 326 | ||
| 319 | ||
| 327 | 320 | { |
| 328 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 329 | guardians_sloop_tweak(state, offset); | |
| 321 | guardians_sloop_tweak(offset); | |
| 330 | 322 | if (offset < 0x78000/2) |
| 331 | return | |
| 323 | return | |
| 332 | 324 | else |
| 333 | return | |
| 325 | return | |
| 334 | 326 | } |
| 335 | 327 | |
| 336 | 328 | |
| 337 | ||
| 329 | ||
| 338 | 330 | { |
| 339 | atarig42_state *state = space->machine().driver_data<atarig42_state>(); | |
| 340 | guardians_sloop_tweak(state, offset); | |
| 331 | guardians_sloop_tweak(offset); | |
| 341 | 332 | } |
| 342 | 333 | |
| 343 | 334 | |
| r14896 | r14897 | |
| 352 | 343 | AM_RANGE(0x000000, 0x080001) AM_ROM |
| 353 | 344 | AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("IN0") |
| 354 | 345 | AM_RANGE(0xe00002, 0xe00003) AM_READ_PORT("IN1") |
| 355 | AM_RANGE(0xe00010, 0xe00011) AM_READ | |
| 346 | AM_RANGE(0xe00010, 0xe00011) AM_READ | |
| 356 | 347 | AM_RANGE(0xe00012, 0xe00013) AM_READ_PORT("JSAIII") |
| 357 | AM_RANGE(0xe00020, 0xe00027) AM_READWRITE | |
| 348 | AM_RANGE(0xe00020, 0xe00027) AM_READWRITE | |
| 358 | 349 | AM_RANGE(0xe00030, 0xe00031) AM_READ_LEGACY(atarigen_sound_r) |
| 359 | 350 | AM_RANGE(0xe00040, 0xe00041) AM_WRITE_LEGACY(atarigen_sound_w) |
| 360 | AM_RANGE(0xe00050, 0xe00051) AM_WRITE | |
| 351 | AM_RANGE(0xe00050, 0xe00051) AM_WRITE | |
| 361 | 352 | AM_RANGE(0xe00060, 0xe00061) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 362 | 353 | AM_RANGE(0xe03000, 0xe03001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 363 | 354 | AM_RANGE(0xe03800, 0xe03801) AM_WRITE(watchdog_reset16_w) |
| r14896 | r14897 | |
| 370 | 361 | AM_RANGE(0xff0000, 0xff0fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram_r, atarirle_spriteram_w) |
| 371 | 362 | AM_RANGE(0xff2000, 0xff5fff) AM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 372 | 363 | AM_RANGE(0xff6000, 0xff6fff) AM_WRITE_LEGACY(atarigen_alpha_w) AM_BASE(m_alpha) |
| 373 | AM_RANGE(0xff7000, 0xff7001) AM_WRITE | |
| 364 | AM_RANGE(0xff7000, 0xff7001) AM_WRITE | |
| 374 | 365 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 375 | 366 | ADDRESS_MAP_END |
| 376 | 367 | |
| r14896 | r14897 | |
| 800 | 791 | state->m_playfield_base = 0x400; |
| 801 | 792 | |
| 802 | 793 | address_space *main = machine.device<m68000_device>("maincpu")->space(AS_PROGRAM); |
| 803 | state->m_sloop_base = main->install_ | |
| 794 | state->m_sloop_base = main->install_ | |
| 804 | 795 | main->set_direct_update_handler(direct_update_delegate(FUNC(atarig42_sloop_direct_handler), &machine)); |
| 805 | 796 | |
| 806 | 797 | asic65_config(machine, ASIC65_ROMBASED); |
| r14896 | r14897 | |
| 839 | 830 | *(UINT16 *)&machine.region("maincpu")->base()[0x80000] = 0x4E75; |
| 840 | 831 | |
| 841 | 832 | address_space *main = machine.device<m68000_device>("maincpu")->space(AS_PROGRAM); |
| 842 | state->m_sloop_base = main->install_ | |
| 833 | state->m_sloop_base = main->install_ | |
| 843 | 834 | main->set_direct_update_handler(direct_update_delegate(FUNC(atarig42_sloop_direct_handler), &machine)); |
| 844 | 835 | |
| 845 | 836 | asic65_config(machine, ASIC65_GUARDIANS); |
| r14896 | r14897 | |
|---|---|---|
| 94 | 94 | { |
| 95 | 95 | public: |
| 96 | 96 | jubilee_state(const machine_config &mconfig, device_type type, const char *tag) |
| 97 | : driver_device(mconfig, type, tag) { } | |
| 97 | : driver_device(mconfig, type, tag) , | |
| 98 | m_videoram(*this, "videoram"){ } | |
| 98 | 99 | |
| 99 | UINT8 | |
| 100 | required_shared_ptr<UINT8> | |
| 100 | 101 | tilemap_t *m_bg_tilemap; |
| 101 | 102 | DECLARE_WRITE8_MEMBER(jubileep_videoram_w); |
| 102 | 103 | DECLARE_READ8_MEMBER(unk_r); |
| r14896 | r14897 | |
| 110 | 111 | |
| 111 | 112 | WRITE8_MEMBER(jubilee_state::jubileep_videoram_w) |
| 112 | 113 | { |
| 113 | m_videoram[offset] = data; | |
| 114 | m_videoram.target()[offset] = data; | |
| 114 | 115 | m_bg_tilemap->mark_tile_dirty(offset); |
| 115 | 116 | } |
| 116 | 117 | |
| r14896 | r14897 | |
| 118 | 119 | static TILE_GET_INFO( get_bg_tile_info ) |
| 119 | 120 | { |
| 120 | 121 | jubilee_state *state = machine.driver_data<jubilee_state>(); |
| 121 | int code = state->m_videoram[tile_index]; | |
| 122 | int code = state->m_videoram.target()[tile_index]; | |
| 122 | 123 | |
| 123 | 124 | SET_TILE_INFO( 0, code, 0, 0); |
| 124 | 125 | } |
| r14896 | r14897 | |
| 164 | 165 | static ADDRESS_MAP_START( jubileep_map, AS_PROGRAM, 8, jubilee_state ) |
| 165 | 166 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 166 | 167 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 167 | AM_RANGE(0x3000, 0x30ff) AM_WRITE(jubileep_videoram_w) AM_ | |
| 168 | AM_RANGE(0x3000, 0x30ff) AM_WRITE(jubileep_videoram_w) AM_ | |
| 168 | 169 | AM_RANGE(0x3100, 0x3fff) AM_RAM |
| 169 | 170 | ADDRESS_MAP_END |
| 170 | 171 |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | * |
| 64 | 64 | *************************************/ |
| 65 | 65 | |
| 66 | ||
| 66 | ||
| 67 | 67 | { |
| 68 | vindictr_state *state = space->machine().driver_data<vindictr_state>(); | |
| 69 | int result = input_port_read(space->machine(), "260010"); | |
| 70 | if (state->m_sound_to_cpu_ready) result ^= 0x0004; | |
| 71 | if (state->m_cpu_to_sound_ready) result ^= 0x0008; | |
| 68 | int result = input_port_read(machine(), "260010"); | |
| 69 | if (m_sound_to_cpu_ready) result ^= 0x0004; | |
| 70 | if (m_cpu_to_sound_ready) result ^= 0x0008; | |
| 72 | 71 | result ^= 0x0010; |
| 73 | 72 | return result; |
| 74 | 73 | } |
| r14896 | r14897 | |
| 88 | 87 | AM_RANGE(0x0e0000, 0x0e0fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 89 | 88 | AM_RANGE(0x1f0000, 0x1fffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 90 | 89 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 91 | AM_RANGE(0x260010, 0x26001f) AM_READ | |
| 90 | AM_RANGE(0x260010, 0x26001f) AM_READ | |
| 92 | 91 | AM_RANGE(0x260020, 0x26002f) AM_READ_PORT("260020") |
| 93 | 92 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) |
| 94 | 93 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| r14896 | r14897 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | WRITE8_MEMBER(cop01_state::cop01_sound_command_w) |
| 74 | 74 | { |
| 75 | soundlatch_w(space, offset, data); | |
| 75 | soundlatch_byte_w(space, offset, data); | |
| 76 | 76 | device_set_input_line(m_audiocpu, 0, ASSERT_LINE ); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | READ8_MEMBER(cop01_state::cop01_sound_command_r) |
| 80 | 80 | { |
| 81 | int res = (soundlatch_r(space, offset) & 0x7f) << 1; | |
| 81 | int res = (soundlatch_byte_r(space, offset) & 0x7f) << 1; | |
| 82 | 82 | |
| 83 | 83 | /* bit 0 seems to be a timer */ |
| 84 | 84 | if ((m_audiocpu->total_cycles() / TIMER_RATE) & 1) |
| r14896 | r14897 | |
|---|---|---|
| 241 | 241 | { |
| 242 | 242 | public: |
| 243 | 243 | goldngam_state(const machine_config &mconfig, device_type type, const char *tag) |
| 244 | : driver_device(mconfig, type, tag) { } | |
| 244 | : driver_device(mconfig, type, tag) , | |
| 245 | m_videoram(*this, "videoram"){ } | |
| 245 | 246 | |
| 246 | UINT16 | |
| 247 | required_shared_ptr<UINT16> | |
| 247 | 248 | DECLARE_READ16_MEMBER(unk_r); |
| 248 | 249 | }; |
| 249 | 250 | |
| r14896 | r14897 | |
| 263 | 264 | |
| 264 | 265 | int x, y; |
| 265 | 266 | |
| 266 | UINT8 *tmp = (UINT8 *) state->m_videoram; | |
| 267 | UINT8 *tmp = (UINT8 *) state->m_videoram.target(); | |
| 267 | 268 | int index = 0; |
| 268 | 269 | |
| 269 | 270 | for(y = 0; y < 512; ++y) |
| r14896 | r14897 | |
| 307 | 308 | AM_RANGE(0x402000, 0x402001) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff) |
| 308 | 309 | AM_RANGE(0x402000, 0x402003) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff) //wrong |
| 309 | 310 | |
| 310 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_ | |
| 311 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_ | |
| 311 | 312 | AM_RANGE(0x500200, 0x50020f) AM_RAM //? |
| 312 | 313 | AM_RANGE(0x503000, 0x503001) AM_RAM //int ack ? |
| 313 | 314 | AM_RANGE(0x503002, 0x503003) AM_RAM //int ack ? |
| r14896 | r14897 | |
| 351 | 352 | static ADDRESS_MAP_START( moviecrd_map, AS_PROGRAM, 16, goldngam_state ) |
| 352 | 353 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 353 | 354 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 354 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_ | |
| 355 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_ | |
| 355 | 356 | AM_RANGE(0x503000, 0x5031ff) AM_RAM //int ack ? |
| 356 | 357 | ADDRESS_MAP_END |
| 357 | 358 |
| r14896 | r14897 | |
|---|---|---|
| 153 | 153 | AM_RANGE(0x0003, 0x0004) AM_MIRROR(0x03f8) AM_WRITE(circusc_coin_counter_w) /* COIN1, COIN2 */ |
| 154 | 154 | AM_RANGE(0x0005, 0x0005) AM_MIRROR(0x03f8) AM_WRITEONLY AM_BASE(m_spritebank) /* OBJ CHENG */ |
| 155 | 155 | AM_RANGE(0x0400, 0x0400) AM_MIRROR(0x03ff) AM_WRITE(watchdog_reset_w) /* WDOG */ |
| 156 | AM_RANGE(0x0800, 0x0800) AM_MIRROR(0x03ff) AM_WRITE(soundlatch_w) /* SOUND DATA */ | |
| 156 | AM_RANGE(0x0800, 0x0800) AM_MIRROR(0x03ff) AM_WRITE(soundlatch_byte_w) /* SOUND DATA */ | |
| 157 | 157 | AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x03ff) AM_WRITE(circusc_sh_irqtrigger_w) /* SOUND-ON causes interrupt on audio CPU */ |
| 158 | 158 | AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x03fc) AM_READ_PORT("SYSTEM") |
| 159 | 159 | AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x03fc) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 174 | 174 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, circusc_state ) |
| 175 | 175 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 176 | 176 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x1c00) AM_RAM |
| 177 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_r) /* CS0 */ | |
| 177 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READ(soundlatch_byte_r) /* CS0 */ | |
| 178 | 178 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1fff) AM_READ(circusc_sh_timer_r) /* CS1 */ |
| 179 | 179 | AM_RANGE(0xa000, 0xa07f) AM_MIRROR(0x1f80) AM_WRITE(circusc_sound_w) /* CS2 - CS6 */ |
| 180 | 180 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | { |
| 40 | 40 | public: |
| 41 | 41 | laserbas_state(const machine_config &mconfig, device_type type, const char *tag) |
| 42 | : driver_device(mconfig, type, tag) { } | |
| 42 | : driver_device(mconfig, type, tag) , | |
| 43 | m_protram(*this, "protram"){ } | |
| 43 | 44 | |
| 44 | 45 | /* misc */ |
| 45 | 46 | int m_count; |
| r14896 | r14897 | |
| 48 | 49 | int m_vrambank; |
| 49 | 50 | UINT8 m_vram1[0x8000]; |
| 50 | 51 | UINT8 m_vram2[0x8000]; |
| 51 | UINT8 | |
| 52 | required_shared_ptr<UINT8> | |
| 52 | 53 | DECLARE_READ8_MEMBER(vram_r); |
| 53 | 54 | DECLARE_WRITE8_MEMBER(vram_w); |
| 54 | 55 | DECLARE_READ8_MEMBER(read_unk); |
| r14896 | r14897 | |
| 125 | 126 | READ8_MEMBER(laserbas_state::protram_r) |
| 126 | 127 | { |
| 127 | 128 | |
| 128 | return m_protram[offset]; | |
| 129 | return m_protram.target()[offset]; | |
| 129 | 130 | } |
| 130 | 131 | |
| 131 | 132 | WRITE8_MEMBER(laserbas_state::protram_w) |
| 132 | 133 | { |
| 133 | 134 | |
| 134 | m_protram[offset] = data; | |
| 135 | m_protram.target()[offset] = data; | |
| 135 | 136 | } |
| 136 | 137 | |
| 137 | 138 | static ADDRESS_MAP_START( laserbas_memory, AS_PROGRAM, 8, laserbas_state ) |
| r14896 | r14897 | |
| 139 | 140 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 140 | 141 | AM_RANGE(0x4000, 0xbfff) AM_READWRITE(vram_r, vram_w) |
| 141 | 142 | AM_RANGE(0xc000, 0xf7ff) AM_ROM |
| 142 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(protram_r, protram_w) AM_ | |
| 143 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(protram_r, protram_w) AM_ | |
| 143 | 144 | AM_RANGE(0xfc00, 0xffff) AM_RAM |
| 144 | 145 | ADDRESS_MAP_END |
| 145 | 146 | |
| r14896 | r14897 | |
| 154 | 155 | // AM_RANGE(0x23, 0x23) AM_WRITE_LEGACY(test_w) bit 2 presumably is a mux for 0x20? |
| 155 | 156 | AM_RANGE(0x40, 0x43) AM_DEVREADWRITE_LEGACY("pit0", pit8253_r, pit8253_w) |
| 156 | 157 | AM_RANGE(0x44, 0x47) AM_DEVREADWRITE_LEGACY("pit1", pit8253_r, pit8253_w) |
| 157 | AM_RANGE(0x80, 0x9f) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_SHARE("paletteram") | |
| 158 | AM_RANGE(0x80, 0x9f) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram") | |
| 158 | 159 | ADDRESS_MAP_END |
| 159 | 160 | |
| 160 | 161 | static INPUT_PORTS_START( laserbas ) |
| r14896 | r14897 | |
|---|---|---|
| 102 | 102 | AM_RANGE(0x2100, 0x2100) AM_WRITE(watchdog_reset_w) |
| 103 | 103 | AM_RANGE(0x2200, 0x2200) AM_WRITE(mikie_palettebank_w) |
| 104 | 104 | AM_RANGE(0x2300, 0x2300) AM_WRITENOP // ??? |
| 105 | AM_RANGE(0x2400, 0x2400) AM_READ_PORT("SYSTEM") AM_WRITE(soundlatch_w) | |
| 105 | AM_RANGE(0x2400, 0x2400) AM_READ_PORT("SYSTEM") AM_WRITE(soundlatch_byte_w) | |
| 106 | 106 | AM_RANGE(0x2401, 0x2401) AM_READ_PORT("P1") |
| 107 | 107 | AM_RANGE(0x2402, 0x2402) AM_READ_PORT("P2") |
| 108 | 108 | AM_RANGE(0x2403, 0x2403) AM_READ_PORT("DSW3") |
| r14896 | r14897 | |
| 122 | 122 | AM_RANGE(0x8000, 0x8000) AM_WRITENOP // sound command latch |
| 123 | 123 | AM_RANGE(0x8001, 0x8001) AM_WRITENOP // ??? |
| 124 | 124 | AM_RANGE(0x8002, 0x8002) AM_DEVWRITE_LEGACY("sn1", sn76496_w) // trigger read of latch |
| 125 | AM_RANGE(0x8003, 0x8003) AM_READ(soundlatch_r) | |
| 125 | AM_RANGE(0x8003, 0x8003) AM_READ(soundlatch_byte_r) | |
| 126 | 126 | AM_RANGE(0x8004, 0x8004) AM_DEVWRITE_LEGACY("sn2", sn76496_w) // trigger read of latch |
| 127 | 127 | AM_RANGE(0x8005, 0x8005) AM_READ(mikie_sh_timer_r) |
| 128 | 128 | AM_RANGE(0x8079, 0x8079) AM_WRITENOP // ??? |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | * |
| 88 | 88 | *************************************/ |
| 89 | 89 | |
| 90 | ||
| 90 | ||
| 91 | 91 | { |
| 92 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 93 | UINT16 val = input_port_read(space->machine(), "IN0"); | |
| 94 | UINT16 diff = val ^ state->m_last_port0; | |
| 92 | UINT16 val = input_port_read(machine(), "IN0"); | |
| 93 | UINT16 diff = val ^ m_last_port0; | |
| 95 | 94 | |
| 96 | 95 | /* make sure the shift controls are mutually exclusive */ |
| 97 | 96 | if ((diff & 0x0400) && !(val & 0x0400)) |
| 98 | | |
| 97 | | |
| 99 | 98 | if ((diff & 0x0800) && !(val & 0x0800)) |
| 100 | | |
| 99 | | |
| 101 | 100 | if ((diff & 0x1000) && !(val & 0x1000)) |
| 102 | | |
| 101 | | |
| 103 | 102 | if ((diff & 0x2000) && !(val & 0x2000)) |
| 104 | state->m_shifter_state = (state->m_shifter_state == 8) ? 0 : 8; | |
| 105 | state->m_last_port0 = val; | |
| 103 | m_shifter_state = (m_shifter_state == 8) ? 0 : 8; | |
| 104 | m_last_port0 = val; | |
| 106 | 105 | |
| 107 | val = (val | 0x3c00) ^ ( | |
| 106 | val = (val | 0x3c00) ^ ( | |
| 108 | 107 | |
| 109 | 108 | return (val << 16) | val; |
| 110 | 109 | } |
| r14896 | r14897 | |
| 116 | 115 | * |
| 117 | 116 | *************************************/ |
| 118 | 117 | |
| 119 | ||
| 118 | ||
| 120 | 119 | { |
| 121 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 122 | if (!(state->m_control_data & 0x40)) | |
| 120 | if (!(m_control_data & 0x40)) | |
| 123 | 121 | { |
| 124 | cputag_set_input_line(space->machine(), "maincpu", 3, CLEAR_LINE); | |
| 125 | return state->m_adc_data << state->m_adc_shift; | |
| 122 | cputag_set_input_line(machine(), "maincpu", 3, CLEAR_LINE); | |
| 123 | return m_adc_data << m_adc_shift; | |
| 126 | 124 | } |
| 127 | 125 | else |
| 128 | 126 | logerror("adc_r without enabling reads!\n"); |
| r14896 | r14897 | |
| 136 | 134 | } |
| 137 | 135 | |
| 138 | 136 | |
| 139 | ||
| 137 | ||
| 140 | 138 | { |
| 141 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 142 | 139 | static const char *const adcnames[] = { "WHEEL", "ACCEL", "BRAKE" }; |
| 143 | 140 | |
| 144 | if (!( | |
| 141 | if (!( | |
| 145 | 142 | { |
| 146 | int which = (data >> | |
| 143 | int which = (data >> | |
| 147 | 144 | if (which < 0 || which > 2) |
| 148 | 145 | logerror("adc_w: unexpected which = %02X\n", which + 4); |
| 149 | state->m_adc_data = input_port_read_safe(space->machine(), adcnames[which], 0); | |
| 150 | space->machine().scheduler().timer_set(attotime::from_msec(1), FUNC(adc_ready)); | |
| 146 | m_adc_data = input_port_read_safe(machine(), adcnames[which], 0); | |
| 147 | machine().scheduler().timer_set(attotime::from_msec(1), FUNC(adc_ready)); | |
| 151 | 148 | } |
| 152 | 149 | else |
| 153 | 150 | logerror("adc_w without enabling writes!\n"); |
| r14896 | r14897 | |
| 161 | 158 | * |
| 162 | 159 | *************************************/ |
| 163 | 160 | |
| 164 | ||
| 161 | ||
| 165 | 162 | { |
| 166 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 167 | state->m_cmos_protected = ((data & 0xc00) != 0xc00); | |
| 163 | m_cmos_protected = ((data & 0xc00) != 0xc00); | |
| 168 | 164 | } |
| 169 | 165 | |
| 170 | 166 | |
| 171 | ||
| 167 | ||
| 172 | 168 | { |
| 173 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 174 | if (!state->m_cmos_protected) | |
| 175 | COMBINE_DATA(state->m_nvram + offset); | |
| 169 | if (!m_cmos_protected) | |
| 170 | COMBINE_DATA(m_nvram + offset); | |
| 176 | 171 | } |
| 177 | 172 | |
| 178 | 173 | |
| 179 | ||
| 174 | ||
| 180 | 175 | { |
| 181 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 182 | return state->m_nvram[offset]; | |
| 176 | return m_nvram[offset]; | |
| 183 | 177 | } |
| 184 | 178 | |
| 185 | 179 | |
| r14896 | r14897 | |
| 190 | 184 | * |
| 191 | 185 | *************************************/ |
| 192 | 186 | |
| 193 | ||
| 187 | ||
| 194 | 188 | { |
| 195 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 196 | UINT16 olddata = state->m_control_data; | |
| 197 | COMBINE_DATA(&state->m_control_data); | |
| 189 | UINT16 olddata = m_control_data; | |
| 190 | COMBINE_DATA(&m_control_data); | |
| 198 | 191 | |
| 199 | 192 | /* bit 7 is the LED */ |
| 200 | 193 | |
| 201 | 194 | /* bit 3 is the watchdog */ |
| 202 | if ((olddata ^ state->m_control_data) & 0x0008) | |
| 203 | state->watchdog_reset_w(*space, 0, 0); | |
| 195 | if ((olddata ^ m_control_data) & 0x0008) | |
| 196 | watchdog_reset_w(*&space, 0, 0); | |
| 204 | 197 | |
| 205 | 198 | /* bit 1 is the DCS sound reset */ |
| 206 | dcs_reset_w( | |
| 199 | dcs_reset_w( | |
| 207 | 200 | |
| 208 | 201 | /* log anything unusual */ |
| 209 | if ((olddata ^ state->m_control_data) & ~0x00e8) | |
| 210 | logerror("midvunit_control_w: old=%04X new=%04X diff=%04X\n", olddata, state->m_control_data, olddata ^ state->m_control_data); | |
| 202 | if ((olddata ^ m_control_data) & ~0x00e8) | |
| 203 | logerror("midvunit_control_w: old=%04X new=%04X diff=%04X\n", olddata, m_control_data, olddata ^ m_control_data); | |
| 211 | 204 | } |
| 212 | 205 | |
| 213 | 206 | |
| 214 | ||
| 207 | ||
| 215 | 208 | { |
| 216 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 217 | UINT16 olddata = state->m_control_data; | |
| 218 | COMBINE_DATA(&state->m_control_data); | |
| 209 | UINT16 olddata = m_control_data; | |
| 210 | COMBINE_DATA(&m_control_data); | |
| 219 | 211 | |
| 220 | 212 | /* bit 11 is the DCS sound reset */ |
| 221 | dcs_reset_w( | |
| 213 | dcs_reset_w( | |
| 222 | 214 | |
| 223 | 215 | /* bit 9 is the watchdog */ |
| 224 | if ((olddata ^ state->m_control_data) & 0x0200) | |
| 225 | state->watchdog_reset_w(*space, 0, 0); | |
| 216 | if ((olddata ^ m_control_data) & 0x0200) | |
| 217 | watchdog_reset_w(*&space, 0, 0); | |
| 226 | 218 | |
| 227 | 219 | /* bit 8 is the LED */ |
| 228 | 220 | |
| 229 | 221 | /* log anything unusual */ |
| 230 | if ((olddata ^ state->m_control_data) & ~0xe800) | |
| 231 | logerror("crusnwld_control_w: old=%04X new=%04X diff=%04X\n", olddata, state->m_control_data, olddata ^ state->m_control_data); | |
| 222 | if ((olddata ^ m_control_data) & ~0xe800) | |
| 223 | logerror("crusnwld_control_w: old=%04X new=%04X diff=%04X\n", olddata, m_control_data, olddata ^ m_control_data); | |
| 232 | 224 | } |
| 233 | 225 | |
| 234 | 226 | |
| 235 | ||
| 227 | ||
| 236 | 228 | { |
| 237 | 229 | logerror("Sound W = %02X\n", data); |
| 238 | dcs_data_w( | |
| 230 | dcs_data_w( | |
| 239 | 231 | } |
| 240 | 232 | |
| 241 | 233 | |
| r14896 | r14897 | |
| 246 | 238 | * |
| 247 | 239 | *************************************/ |
| 248 | 240 | |
| 249 | ||
| 241 | ||
| 250 | 242 | { |
| 251 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 252 | 243 | /* watch for accesses to the timers */ |
| 253 | 244 | if (offset == 0x24 || offset == 0x34) |
| 254 | 245 | { |
| 255 | 246 | /* timer is clocked at 100ns */ |
| 256 | 247 | int which = (offset >> 4) & 1; |
| 257 | INT32 result = (state->m_timer[which]->time_elapsed() * state->m_timer_rate).as_double(); | |
| 258 | // logerror("%06X:tms32031_control_r(%02X) = %08X\n", cpu_get_pc(&space->device()), offset, result); | |
| 248 | INT32 result = (m_timer[which]->time_elapsed() * m_timer_rate).as_double(); | |
| 249 | // logerror("%06X:tms32031_control_r(%02X) = %08X\n", cpu_get_pc(&space.device()), offset, result); | |
| 259 | 250 | return result; |
| 260 | 251 | } |
| 261 | 252 | |
| 262 | 253 | /* log anything else except the memory control register */ |
| 263 | 254 | if (offset != 0x64) |
| 264 | logerror("%06X:tms32031_control_r(%02X)\n", cpu_get_pc(&space | |
| 255 | logerror("%06X:tms32031_control_r(%02X)\n", cpu_get_pc(&space. | |
| 265 | 256 | |
| 266 | return | |
| 257 | return | |
| 267 | 258 | } |
| 268 | 259 | |
| 269 | 260 | |
| 270 | ||
| 261 | ||
| 271 | 262 | { |
| 272 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 273 | COMBINE_DATA(&state->m_tms32031_control[offset]); | |
| 263 | COMBINE_DATA(&m_tms32031_control[offset]); | |
| 274 | 264 | |
| 275 | 265 | /* ignore changes to the memory control register */ |
| 276 | 266 | if (offset == 0x64) |
| r14896 | r14897 | |
| 280 | 270 | else if (offset == 0x20 || offset == 0x30) |
| 281 | 271 | { |
| 282 | 272 | int which = (offset >> 4) & 1; |
| 283 | // logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(&space | |
| 273 | // logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(&space. | |
| 284 | 274 | if (data & 0x40) |
| 285 | | |
| 275 | | |
| 286 | 276 | |
| 287 | 277 | /* bit 0x200 selects internal clocking, which is 1/2 the main CPU clock rate */ |
| 288 | 278 | if (data & 0x200) |
| 289 | | |
| 279 | | |
| 290 | 280 | else |
| 291 | | |
| 281 | | |
| 292 | 282 | } |
| 293 | 283 | else |
| 294 | logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(&space | |
| 284 | logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(&space. | |
| 295 | 285 | } |
| 296 | 286 | |
| 297 | 287 | |
| r14896 | r14897 | |
| 303 | 293 | *************************************/ |
| 304 | 294 | |
| 305 | 295 | #if 0 |
| 306 | ||
| 296 | ||
| 307 | 297 | { |
| 308 | 298 | int status = midway_serial_pic_status_r(); |
| 309 | return (input_port_read( | |
| 299 | return (input_port_read( | |
| 310 | 300 | } |
| 311 | 301 | |
| 312 | 302 | |
| 313 | ||
| 303 | ||
| 314 | 304 | { |
| 315 | 305 | return midway_serial_pic_r() << 16; |
| 316 | 306 | } |
| 317 | 307 | |
| 318 | 308 | |
| 319 | ||
| 309 | ||
| 320 | 310 | { |
| 321 | 311 | if ((data & 0xf0000) == 0x10000) |
| 322 | 312 | { |
| r14896 | r14897 | |
| 345 | 335 | }; |
| 346 | 336 | |
| 347 | 337 | |
| 348 | ||
| 338 | ||
| 349 | 339 | { |
| 350 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 351 | int bit = (bit_data[state->m_bit_index / 32] >> (31 - (state->m_bit_index % 32))) & 1; | |
| 352 | state->m_bit_index = (state->m_bit_index + 1) % 512; | |
| 353 | return bit ? state->m_nvram[offset] : ~state->m_nvram[offset]; | |
| 340 | int bit = (bit_data[m_bit_index / 32] >> (31 - (m_bit_index % 32))) & 1; | |
| 341 | m_bit_index = (m_bit_index + 1) % 512; | |
| 342 | return bit ? m_nvram[offset] : ~m_nvram[offset]; | |
| 354 | 343 | } |
| 355 | 344 | |
| 356 | 345 | |
| 357 | ||
| 346 | ||
| 358 | 347 | { |
| 359 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 360 | state->m_bit_index = 0; | |
| 348 | m_bit_index = 0; | |
| 361 | 349 | } |
| 362 | 350 | |
| 363 | 351 | |
| r14896 | r14897 | |
| 368 | 356 | * |
| 369 | 357 | *************************************/ |
| 370 | 358 | |
| 371 | ||
| 359 | ||
| 372 | 360 | { |
| 373 | int status = midway_serial_pic2_status_r(space); | |
| 374 | return (input_port_read(space->machine(), "991030") & 0x7fff7fff) | (status << 31) | (status << 15); | |
| 361 | int status = midway_serial_pic2_status_r(&space); | |
| 362 | return (input_port_read(machine(), "991030") & 0x7fff7fff) | (status << 31) | (status << 15); | |
| 375 | 363 | } |
| 376 | 364 | |
| 377 | 365 | |
| 378 | ||
| 366 | ||
| 379 | 367 | { |
| 380 | return midway_serial_pic2_r(space) << 16; | |
| 368 | return midway_serial_pic2_r(&space) << 16; | |
| 381 | 369 | } |
| 382 | 370 | |
| 383 | 371 | |
| 384 | ||
| 372 | ||
| 385 | 373 | { |
| 386 | midway_serial_pic2_w(space, data >> 16); | |
| 374 | midway_serial_pic2_w(&space, data >> 16); | |
| 387 | 375 | } |
| 388 | 376 | |
| 389 | 377 | |
| r14896 | r14897 | |
| 394 | 382 | * |
| 395 | 383 | *************************************/ |
| 396 | 384 | |
| 397 | ||
| 385 | ||
| 398 | 386 | { |
| 399 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 400 | UINT32 result = state->m_midvplus_misc[offset]; | |
| 387 | UINT32 result = m_midvplus_misc[offset]; | |
| 401 | 388 | |
| 402 | 389 | switch (offset) |
| 403 | 390 | { |
| r14896 | r14897 | |
| 415 | 402 | } |
| 416 | 403 | |
| 417 | 404 | if (offset != 0 && offset != 3) |
| 418 | logerror("%06X:midvplus_misc_r(%d) = %08X\n", cpu_get_pc(&space | |
| 405 | logerror("%06X:midvplus_misc_r(%d) = %08X\n", cpu_get_pc(&space. | |
| 419 | 406 | return result; |
| 420 | 407 | } |
| 421 | 408 | |
| 422 | 409 | |
| 423 | ||
| 410 | ||
| 424 | 411 | { |
| 425 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 426 | UINT32 olddata = state->m_midvplus_misc[offset]; | |
| 412 | UINT32 olddata = m_midvplus_misc[offset]; | |
| 427 | 413 | int logit = 1; |
| 428 | 414 | |
| 429 | COMBINE_DATA(& | |
| 415 | COMBINE_DATA(& | |
| 430 | 416 | |
| 431 | 417 | switch (offset) |
| 432 | 418 | { |
| 433 | 419 | case 0: |
| 434 | 420 | /* bit 0x10 resets watchdog */ |
| 435 | if ((olddata ^ | |
| 421 | if ((olddata ^ | |
| 436 | 422 | { |
| 437 | | |
| 423 | | |
| 438 | 424 | logit = 0; |
| 439 | 425 | } |
| 440 | 426 | break; |
| r14896 | r14897 | |
| 445 | 431 | } |
| 446 | 432 | |
| 447 | 433 | if (logit) |
| 448 | logerror("%06X:midvplus_misc_w(%d) = %08X\n", cpu_get_pc(&space | |
| 434 | logerror("%06X:midvplus_misc_w(%d) = %08X\n", cpu_get_pc(&space. | |
| 449 | 435 | } |
| 450 | 436 | |
| 451 | 437 | |
| r14896 | r14897 | |
| 479 | 465 | AM_RANGE(0x000000, 0x01ffff) AM_RAM AM_BASE(m_ram_base) |
| 480 | 466 | AM_RANGE(0x400000, 0x41ffff) AM_RAM |
| 481 | 467 | AM_RANGE(0x600000, 0x600000) AM_WRITE(midvunit_dma_queue_w) |
| 482 | AM_RANGE(0x808000, 0x80807f) AM_READWRITE | |
| 468 | AM_RANGE(0x808000, 0x80807f) AM_READWRITE | |
| 483 | 469 | AM_RANGE(0x809800, 0x809fff) AM_RAM |
| 484 | 470 | AM_RANGE(0x900000, 0x97ffff) AM_READWRITE(midvunit_videoram_r, midvunit_videoram_w) AM_BASE(m_videoram) |
| 485 | 471 | AM_RANGE(0x980000, 0x980000) AM_READ(midvunit_dma_queue_entries_r) |
| r14896 | r14897 | |
| 491 | 477 | AM_RANGE(0x990000, 0x990000) AM_READNOP // link PAL (low 4 bits must == 4) |
| 492 | 478 | AM_RANGE(0x991030, 0x991030) AM_READ_PORT("991030") |
| 493 | 479 | // AM_RANGE(0x991050, 0x991050) AM_READONLY // seems to be another port |
| 494 | AM_RANGE(0x991060, 0x991060) AM_READ | |
| 480 | AM_RANGE(0x991060, 0x991060) AM_READ | |
| 495 | 481 | AM_RANGE(0x992000, 0x992000) AM_READ_PORT("992000") |
| 496 | AM_RANGE(0x993000, 0x993000) AM_READWRITE_LEGACY(midvunit_adc_r, midvunit_adc_w) | |
| 497 | AM_RANGE(0x994000, 0x994000) AM_WRITE_LEGACY(midvunit_control_w) | |
| 482 | AM_RANGE(0x993000, 0x993000) AM_READWRITE(midvunit_adc_r, midvunit_adc_w) | |
| 483 | AM_RANGE(0x994000, 0x994000) AM_WRITE(midvunit_control_w) | |
| 498 | 484 | AM_RANGE(0x995000, 0x995000) AM_WRITENOP // force feedback? |
| 499 | AM_RANGE(0x995020, 0x995020) AM_WRITE | |
| 485 | AM_RANGE(0x995020, 0x995020) AM_WRITE | |
| 500 | 486 | AM_RANGE(0x997000, 0x997000) AM_NOP // communications |
| 501 | AM_RANGE(0x9a0000, 0x9a0000) AM_WRITE_LEGACY(midvunit_sound_w) | |
| 502 | AM_RANGE(0x9c0000, 0x9c1fff) AM_READWRITE_LEGACY(midvunit_cmos_r, midvunit_cmos_w) AM_SHARE("nvram") | |
| 487 | AM_RANGE(0x9a0000, 0x9a0000) AM_WRITE(midvunit_sound_w) | |
| 488 | AM_RANGE(0x9c0000, 0x9c1fff) AM_READWRITE(midvunit_cmos_r, midvunit_cmos_w) AM_SHARE("nvram") | |
| 503 | 489 | AM_RANGE(0x9e0000, 0x9e7fff) AM_RAM_WRITE(midvunit_paletteram_w) AM_SHARE("paletteram") |
| 504 | 490 | AM_RANGE(0xa00000, 0xbfffff) AM_READWRITE(midvunit_textureram_r, midvunit_textureram_w) AM_BASE(m_textureram) |
| 505 | 491 | AM_RANGE(0xc00000, 0xffffff) AM_ROM AM_REGION("user1", 0) |
| r14896 | r14897 | |
| 512 | 498 | AM_RANGE(0x000000, 0x01ffff) AM_RAM AM_BASE(m_ram_base) |
| 513 | 499 | AM_RANGE(0x400000, 0x41ffff) AM_RAM AM_BASE(m_fastram_base) |
| 514 | 500 | AM_RANGE(0x600000, 0x600000) AM_WRITE(midvunit_dma_queue_w) |
| 515 | AM_RANGE(0x808000, 0x80807f) AM_READWRITE | |
| 501 | AM_RANGE(0x808000, 0x80807f) AM_READWRITE | |
| 516 | 502 | AM_RANGE(0x809800, 0x809fff) AM_RAM |
| 517 | 503 | AM_RANGE(0x900000, 0x97ffff) AM_READWRITE(midvunit_videoram_r, midvunit_videoram_w) AM_BASE(m_videoram) |
| 518 | 504 | AM_RANGE(0x980000, 0x980000) AM_READ(midvunit_dma_queue_entries_r) |
| r14896 | r14897 | |
| 522 | 508 | AM_RANGE(0x980080, 0x980080) AM_NOP |
| 523 | 509 | AM_RANGE(0x980082, 0x980083) AM_READ(midvunit_dma_trigger_r) |
| 524 | 510 | AM_RANGE(0x990000, 0x99000f) AM_READWRITE_LEGACY(midway_ioasic_r, midway_ioasic_w) |
| 525 | AM_RANGE(0x994000, 0x994000) AM_WRITE_LEGACY(midvunit_control_w) | |
| 526 | AM_RANGE(0x995020, 0x995020) AM_WRITE_LEGACY(midvunit_cmos_protect_w) | |
| 511 | AM_RANGE(0x994000, 0x994000) AM_WRITE(midvunit_control_w) | |
| 512 | AM_RANGE(0x995020, 0x995020) AM_WRITE(midvunit_cmos_protect_w) | |
| 527 | 513 | AM_RANGE(0x9a0000, 0x9a0007) AM_DEVREADWRITE_LEGACY("ide", midway_ide_asic_r, midway_ide_asic_w) |
| 528 | 514 | AM_RANGE(0x9c0000, 0x9c7fff) AM_RAM_WRITE(midvunit_paletteram_w) AM_SHARE("paletteram") |
| 529 | AM_RANGE(0x9d0000, 0x9d000f) AM_READWRITE | |
| 515 | AM_RANGE(0x9d0000, 0x9d000f) AM_READWRITE | |
| 530 | 516 | AM_RANGE(0xa00000, 0xbfffff) AM_READWRITE(midvunit_textureram_r, midvunit_textureram_w) AM_BASE(m_textureram) |
| 531 | 517 | AM_RANGE(0xc00000, 0xcfffff) AM_RAM |
| 532 | 518 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1630 | 1616 | * |
| 1631 | 1617 | *************************************/ |
| 1632 | 1618 | |
| 1633 | ||
| 1619 | ||
| 1634 | 1620 | { |
| 1635 | midvunit_state *state = space->machine().driver_data<midvunit_state>(); | |
| 1636 | device_eat_cycles(&space->device(), 100); | |
| 1637 | return state->m_generic_speedup[offset]; | |
| 1621 | device_eat_cycles(&space.device(), 100); | |
| 1622 | return m_generic_speedup[offset]; | |
| 1638 | 1623 | } |
| 1639 | 1624 | |
| 1640 | 1625 | |
| r14896 | r14897 | |
| 1645 | 1630 | state->m_adc_shift = 24; |
| 1646 | 1631 | |
| 1647 | 1632 | /* speedups */ |
| 1648 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1633 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1649 | 1634 | } |
| 1650 | 1635 | static DRIVER_INIT( crusnusa ) { init_crusnusa_common(machine, 0xc93e); } |
| 1651 | 1636 | static DRIVER_INIT( crusnu40 ) { init_crusnusa_common(machine, 0xc957); } |
| r14896 | r14897 | |
| 1659 | 1644 | state->m_adc_shift = 16; |
| 1660 | 1645 | |
| 1661 | 1646 | /* control register is different */ |
| 1662 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1647 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1663 | 1648 | |
| 1664 | 1649 | /* valid values are 450 or 460 */ |
| 1665 | 1650 | midway_serial_pic_init(machine, 450); |
| 1666 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x991030, 0x991030, FUNC(offroadc_serial_status_r)); | |
| 1667 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_r)); | |
| 1668 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_w)); | |
| 1651 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x991030, 0x991030, read32_delegate(FUNC(midvunit_state::offroadc_serial_status_r),state)); | |
| 1652 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x996000, 0x996000, read32_delegate(FUNC(midvunit_state::offroadc_serial_data_r),state)); | |
| 1653 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x996000, 0x996000, write32_delegate(FUNC(midvunit_state::offroadc_serial_data_w),state)); | |
| 1669 | 1654 | |
| 1670 | 1655 | /* install strange protection device */ |
| 1671 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9d0000, 0x9d1fff, FUNC(bit_data_r)); | |
| 1672 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x9d0000, 0x9d0000, FUNC(bit_reset_w)); | |
| 1656 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x9d0000, 0x9d1fff, read32_delegate(FUNC(midvunit_state::bit_data_r),state)); | |
| 1657 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x9d0000, 0x9d0000, write32_delegate(FUNC(midvunit_state::bit_reset_w),state)); | |
| 1673 | 1658 | |
| 1674 | 1659 | /* speedups */ |
| 1675 | 1660 | if (speedup) |
| 1676 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1661 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1677 | 1662 | } |
| 1678 | 1663 | static DRIVER_INIT( crusnwld ) { init_crusnwld_common(machine, 0xd4c0); } |
| 1679 | 1664 | #if 0 |
| r14896 | r14897 | |
| 1688 | 1673 | state->m_adc_shift = 16; |
| 1689 | 1674 | |
| 1690 | 1675 | /* control register is different */ |
| 1691 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1676 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1692 | 1677 | |
| 1693 | 1678 | /* valid values are 230 or 234 */ |
| 1694 | 1679 | midway_serial_pic2_init(machine, 230, 94); |
| 1695 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x991030, 0x991030, FUNC(offroadc_serial_status_r)); | |
| 1696 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_r), FUNC(offroadc_serial_data_w)); | |
| 1680 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x991030, 0x991030, read32_delegate(FUNC(midvunit_state::offroadc_serial_status_r),state)); | |
| 1681 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x996000, 0x996000, read32_delegate(FUNC(midvunit_state::offroadc_serial_data_r),state), write32_delegate(FUNC(midvunit_state::offroadc_serial_data_w),state)); | |
| 1697 | 1682 | |
| 1698 | 1683 | /* speedups */ |
| 1699 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1684 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1700 | 1685 | } |
| 1701 | 1686 | |
| 1702 | 1687 | |
| r14896 | r14897 | |
| 1722 | 1707 | midway_serial_pic2_set_default_nvram(default_nvram); |
| 1723 | 1708 | |
| 1724 | 1709 | /* speedups */ |
| 1725 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1710 | state->m_generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1726 | 1711 | } |
| 1727 | 1712 | |
| 1728 | 1713 |
| r14896 | r14897 | |
|---|---|---|
| 362 | 362 | AM_RANGE(0x0ff802, 0x0ff803) AM_WRITE(opwolf_cchip_status_w) |
| 363 | 363 | AM_RANGE(0x0ffc00, 0x0ffc01) AM_WRITE(opwolf_cchip_bank_w) |
| 364 | 364 | AM_RANGE(0x100000, 0x107fff) AM_RAM |
| 365 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 365 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 366 | 366 | AM_RANGE(0x380000, 0x380003) AM_READ(opwolf_dsw_r) /* dip switches */ |
| 367 | 367 | AM_RANGE(0x380000, 0x380003) AM_WRITE(opwolf_spritectrl_w) // usually 0x4, changes when you fire |
| 368 | 368 | AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r) /* lightgun, read at $11e0/6 */ |
| r14896 | r14897 | |
| 383 | 383 | AM_RANGE(0x0f0008, 0x0f000b) AM_READ(opwolf_in_r) /* coins and buttons */ |
| 384 | 384 | AM_RANGE(0x0ff000, 0x0fffff) AM_READWRITE(cchip_r,cchip_w) |
| 385 | 385 | AM_RANGE(0x100000, 0x107fff) AM_RAM |
| 386 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 386 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 387 | 387 | AM_RANGE(0x380000, 0x380003) AM_READ(opwolf_dsw_r) /* dip switches */ |
| 388 | 388 | AM_RANGE(0x380000, 0x380003) AM_WRITE(opwolf_spritectrl_w) // usually 0x4, changes when you fire |
| 389 | 389 | AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r) /* lightgun, read at $11e0/6 */ |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | if (ACCESSING_BITS_0_7) |
| 44 | 44 | { |
| 45 | soundlatch_w(space, 0, data & 0xff ); | |
| 45 | soundlatch_byte_w(space, 0, data & 0xff ); | |
| 46 | 46 | } |
| 47 | 47 | if (data & ~0xff) logerror("CPU#0 PC %06X - Sound latch unknown bits: %04X\n", cpu_get_pc(&space.device()), data); |
| 48 | 48 | } |
| r14896 | r14897 | |
| 202 | 202 | AM_RANGE(0x0000, 0x7fff) AM_ROM // ROM |
| 203 | 203 | AM_RANGE(0xf000, 0xf7ff) AM_RAM // RAM |
| 204 | 204 | AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // YM2151 |
| 205 | AM_RANGE(0xfc00, 0xfc00) AM_READ(soundlatch_r) // From Main CPU | |
| 206 | AM_RANGE(0xfd00, 0xfd00) AM_WRITE(soundlatch2_w) // To PCM Z80 #1 | |
| 207 | AM_RANGE(0xfe00, 0xfe00) AM_WRITE(soundlatch3_w) // To PCM Z80 #2 | |
| 205 | AM_RANGE(0xfc00, 0xfc00) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 206 | AM_RANGE(0xfd00, 0xfd00) AM_WRITE(soundlatch2_byte_w) // To PCM Z80 #1 | |
| 207 | AM_RANGE(0xfe00, 0xfe00) AM_WRITE(soundlatch3_byte_w) // To PCM Z80 #2 | |
| 208 | 208 | ADDRESS_MAP_END |
| 209 | 209 | |
| 210 | 210 | /*************************************************************************** |
| r14896 | r14897 | |
| 215 | 215 | AM_RANGE(0x0000, 0xefff) AM_ROM // ROM |
| 216 | 216 | AM_RANGE(0xf000, 0xf7ff) AM_RAM // RAM |
| 217 | 217 | AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // YM2151 |
| 218 | AM_RANGE(0xfc00, 0xfc00) AM_READWRITE(soundlatch_r, soundlatch2_w) // To PCM Z80 | |
| 218 | AM_RANGE(0xfc00, 0xfc00) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) // To PCM Z80 | |
| 219 | 219 | ADDRESS_MAP_END |
| 220 | 220 | |
| 221 | 221 | /*************************************************************************** |
| r14896 | r14897 | |
| 226 | 226 | AM_RANGE(0x0000, 0xe82f) AM_ROM // ROM |
| 227 | 227 | AM_RANGE(0xe830, 0xf7ff) AM_RAM // RAM (writes to efxx, could be a program bug tho) |
| 228 | 228 | AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // YM2151 |
| 229 | AM_RANGE(0xfc00, 0xfc00) AM_READWRITE(soundlatch_r, soundlatch2_w) // To PCM Z80 | |
| 229 | AM_RANGE(0xfc00, 0xfc00) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) // To PCM Z80 | |
| 230 | 230 | ADDRESS_MAP_END |
| 231 | 231 | |
| 232 | 232 | /*************************************************************************** |
| r14896 | r14897 | |
| 238 | 238 | AM_RANGE( 0xc000, 0xc001 ) AM_DEVWRITE_LEGACY("ymsnd", ym3526_w ) // |
| 239 | 239 | AM_RANGE( 0xc002, 0xc003 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w ) // AY8910 |
| 240 | 240 | AM_RANGE( 0xe000, 0xe7ff ) AM_RAM // RAM |
| 241 | AM_RANGE( 0xf000, 0xf000 ) AM_WRITE(soundlatch2_w ) // To PCM Z80 | |
| 242 | AM_RANGE( 0xf800, 0xf800 ) AM_READ ( soundlatch_r ) // From Main CPU | |
| 241 | AM_RANGE( 0xf000, 0xf000 ) AM_WRITE(soundlatch2_byte_w ) // To PCM Z80 | |
| 242 | AM_RANGE( 0xf800, 0xf800 ) AM_READ ( soundlatch_byte_r ) // From Main CPU | |
| 243 | 243 | ADDRESS_MAP_END |
| 244 | 244 | |
| 245 | 245 | /*************************************************************************** |
| r14896 | r14897 | |
| 299 | 299 | |
| 300 | 300 | static ADDRESS_MAP_START( bssoccer_pcm_1_io_map, AS_IO, 8, suna16_state ) |
| 301 | 301 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 302 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r) // From The Sound Z80 | |
| 302 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) // From The Sound Z80 | |
| 303 | 303 | AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("dac1", bssoccer_DAC_w) // 2 x DAC |
| 304 | 304 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("dac2", bssoccer_DAC_w) // 2 x DAC |
| 305 | 305 | AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_1_bankswitch_w) // Rom Bank |
| r14896 | r14897 | |
| 307 | 307 | |
| 308 | 308 | static ADDRESS_MAP_START( bssoccer_pcm_2_io_map, AS_IO, 8, suna16_state ) |
| 309 | 309 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 310 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch3_r) // From The Sound Z80 | |
| 310 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch3_byte_r) // From The Sound Z80 | |
| 311 | 311 | AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("dac3", bssoccer_DAC_w) // 2 x DAC |
| 312 | 312 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("dac4", bssoccer_DAC_w) // 2 x DAC |
| 313 | 313 | AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_2_bankswitch_w) // Rom Bank |
| r14896 | r14897 | |
| 337 | 337 | |
| 338 | 338 | static ADDRESS_MAP_START( uballoon_pcm_1_io_map, AS_IO, 8, suna16_state ) |
| 339 | 339 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 340 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r) // From The Sound Z80 | |
| 340 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) // From The Sound Z80 | |
| 341 | 341 | AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("dac1", bssoccer_DAC_w) // 2 x DAC |
| 342 | 342 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("dac2", bssoccer_DAC_w) // 2 x DAC |
| 343 | 343 | AM_RANGE(0x03, 0x03) AM_WRITE(uballoon_pcm_1_bankswitch_w) // Rom Bank |
| r14896 | r14897 | |
| 361 | 361 | |
| 362 | 362 | static ADDRESS_MAP_START( bestbest_pcm_1_iomap, AS_IO, 8, suna16_state ) |
| 363 | 363 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 364 | AM_RANGE(0x00, 0x00) AM_READ (soundlatch2_r ) // From The Sound Z80 | |
| 364 | AM_RANGE(0x00, 0x00) AM_READ (soundlatch2_byte_r ) // From The Sound Z80 | |
| 365 | 365 | AM_RANGE(0x00, 0x00) AM_MIRROR(0x02) AM_DEVWRITE_LEGACY("dac1", bssoccer_DAC_w) // 2 x DAC |
| 366 | 366 | AM_RANGE(0x01, 0x01) AM_MIRROR(0x02) AM_DEVWRITE_LEGACY("dac2", bssoccer_DAC_w) // 2 x DAC |
| 367 | 367 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | WRITE16_MEMBER(shadfrce_state::shadfrce_flip_screen) |
| 153 | 153 | { |
| 154 | flip_screen_set( | |
| 154 | flip_screen_set( | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
| r14896 | r14897 | |
| 262 | 262 | { |
| 263 | 263 | if (ACCESSING_BITS_8_15) |
| 264 | 264 | { |
| 265 | soundlatch_w(space, 1, data >> 8); | |
| 265 | soundlatch_byte_w(space, 1, data >> 8); | |
| 266 | 266 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE ); |
| 267 | 267 | } |
| 268 | 268 | else |
| r14896 | r14897 | |
| 368 | 368 | AM_RANGE(0x102000, 0x1027ff) AM_RAM_WRITE(shadfrce_bg1videoram_w) AM_BASE(m_bg1videoram) /* bg 2 */ |
| 369 | 369 | AM_RANGE(0x102800, 0x103fff) AM_RAM |
| 370 | 370 | AM_RANGE(0x140000, 0x141fff) AM_RAM_WRITE(shadfrce_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 371 | AM_RANGE(0x142000, 0x143fff) AM_RAM AM_BASE(m_spvideoram) AM_SIZE(m_spvideoram_size) /* sprites */ | |
| 372 | AM_RANGE(0x180000, 0x187fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 371 | AM_RANGE(0x142000, 0x143fff) AM_RAM AM_BASE_SIZE(m_spvideoram,m_spvideoram_size) /* sprites */ | |
| 372 | AM_RANGE(0x180000, 0x187fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 373 | 373 | AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(shadfrce_bg0scrollx_w) /* SCROLL X */ |
| 374 | 374 | AM_RANGE(0x1c0002, 0x1c0003) AM_WRITE(shadfrce_bg0scrolly_w) /* SCROLL Y */ |
| 375 | 375 | AM_RANGE(0x1c0004, 0x1c0005) AM_WRITE(shadfrce_bg1scrollx_w) /* SCROLL X */ |
| r14896 | r14897 | |
| 401 | 401 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 402 | 402 | AM_RANGE(0xc800, 0xc801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 403 | 403 | AM_RANGE(0xd800, 0xd800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 404 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 404 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 405 | 405 | AM_RANGE(0xe800, 0xe800) AM_DEVWRITE_LEGACY("oki", oki_bankswitch_w) |
| 406 | 406 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 407 | 407 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 147 | 147 | { |
| 148 | 148 | public: |
| 149 | 149 | firebeat_state(const machine_config &mconfig, device_type type, const char *tag) |
| 150 | : driver_device(mconfig, type, tag) { } | |
| 150 | : driver_device(mconfig, type, tag) , | |
| 151 | m_work_ram(*this, "work_ram"){ } | |
| 151 | 152 | |
| 152 | 153 | UINT8 m_extend_board_irq_enable; |
| 153 | 154 | UINT8 m_extend_board_irq_active; |
| r14896 | r14897 | |
| 170 | 171 | const int * m_cur_cab_data; |
| 171 | 172 | int m_keyboard_state[2]; |
| 172 | 173 | UINT8 m_spu_shared_ram[0x400]; |
| 173 | UINT32 | |
| 174 | required_shared_ptr<UINT32> | |
| 174 | 175 | IBUTTON m_ibutton; |
| 175 | 176 | int m_ibutton_state; |
| 176 | 177 | int m_ibutton_read_subkey_ptr; |
| r14896 | r14897 | |
| 1742 | 1743 | ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); |
| 1743 | 1744 | |
| 1744 | 1745 | /* configure fast RAM regions for DRC */ |
| 1745 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->m_work_ram); | |
| 1746 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->m_work_ram.target()); | |
| 1746 | 1747 | |
| 1747 | 1748 | state->m_flash[0] = machine.device<fujitsu_29f016a_device>("flash0"); |
| 1748 | 1749 | state->m_flash[1] = machine.device<fujitsu_29f016a_device>("flash1"); |
| r14896 | r14897 | |
| 1750 | 1751 | } |
| 1751 | 1752 | |
| 1752 | 1753 | static ADDRESS_MAP_START( firebeat_map, AS_PROGRAM, 32, firebeat_state ) |
| 1753 | AM_RANGE(0x00000000, 0x01ffffff) AM_RAM AM_ | |
| 1754 | AM_RANGE(0x00000000, 0x01ffffff) AM_RAM AM_ | |
| 1754 | 1755 | AM_RANGE(0x70000000, 0x70000fff) AM_READWRITE_LEGACY(midi_uart_r, midi_uart_w) |
| 1755 | 1756 | AM_RANGE(0x70006000, 0x70006003) AM_WRITE_LEGACY(extend_board_irq_w) |
| 1756 | 1757 | AM_RANGE(0x70008000, 0x7000800f) AM_READ_LEGACY(keyboard_wheel_r) |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | public: |
| 23 | 23 | clayshoo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | : driver_device(mconfig, type, tag) { } | |
| 24 | : driver_device(mconfig, type, tag) , | |
| 25 | m_videoram(*this, "videoram"){ } | |
| 25 | 26 | |
| 26 | 27 | /* memory pointers */ |
| 27 | UINT8 * m_videoram; | |
| 28 | size_t m_videoram_size; | |
| 28 | required_shared_ptr<UINT8> m_videoram; | |
| 29 | 29 | |
| 30 | 30 | /* misc */ |
| 31 | 31 | emu_timer *m_analog_timer_1, *m_analog_timer_2; |
| r14896 | r14897 | |
| 188 | 188 | clayshoo_state *state = screen.machine().driver_data<clayshoo_state>(); |
| 189 | 189 | offs_t offs; |
| 190 | 190 | |
| 191 | for (offs = 0; offs < state->m_videoram | |
| 191 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 192 | 192 | { |
| 193 | 193 | int i; |
| 194 | 194 | UINT8 x = offs << 3; |
| 195 | 195 | UINT8 y = ~(offs >> 5); |
| 196 | UINT8 data = state->m_videoram[offs]; | |
| 196 | UINT8 data = state->m_videoram.target()[offs]; | |
| 197 | 197 | |
| 198 | 198 | for (i = 0; i < 8; i++) |
| 199 | 199 | { |
| r14896 | r14897 | |
| 220 | 220 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 221 | 221 | AM_RANGE(0x2000, 0x23ff) AM_RAM |
| 222 | 222 | AM_RANGE(0x4000, 0x47ff) AM_ROM |
| 223 | AM_RANGE(0x8000, 0x97ff) AM_RAM AM_ | |
| 223 | AM_RANGE(0x8000, 0x97ff) AM_RAM AM_ | |
| 224 | 224 | AM_RANGE(0x9800, 0xa800) AM_WRITENOP /* not really mapped, but cleared */ |
| 225 | 225 | AM_RANGE(0xc800, 0xc800) AM_READWRITE(analog_r, analog_reset_w) |
| 226 | 226 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 90 | 90 | return; |
| 91 | 91 | |
| 92 | 92 | m_pending_command = 1; |
| 93 | soundlatch_w(space, 0, data & 0xff); | |
| 93 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 94 | 94 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 95 | 95 | } |
| 96 | 96 | } |
| r14896 | r14897 | |
| 139 | 139 | AM_RANGE(0x200000, 0x200001) AM_WRITE_PORT("EEPROMOUT") |
| 140 | 140 | AM_RANGE(0x280000, 0x280001) AM_WRITE(inufuku_soundcommand_w) // sound command |
| 141 | 141 | |
| 142 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 142 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram | |
| 143 | 143 | AM_RANGE(0x380000, 0x3801ff) AM_WRITEONLY AM_BASE(m_bg_rasterram) // bg raster ram |
| 144 | 144 | AM_RANGE(0x400000, 0x401fff) AM_READWRITE(inufuku_bg_videoram_r, inufuku_bg_videoram_w) AM_BASE(m_bg_videoram) // bg ram |
| 145 | 145 | AM_RANGE(0x402000, 0x403fff) AM_READWRITE(inufuku_tx_videoram_r, inufuku_tx_videoram_w) AM_BASE(m_tx_videoram) // text ram |
| r14896 | r14897 | |
| 170 | 170 | static ADDRESS_MAP_START( inufuku_sound_io_map, AS_IO, 8, inufuku_state ) |
| 171 | 171 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 172 | 172 | AM_RANGE(0x00, 0x00) AM_WRITE(inufuku_soundrombank_w) |
| 173 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) AM_WRITE(pending_command_clear_w) | |
| 173 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w) | |
| 174 | 174 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 175 | 175 | ADDRESS_MAP_END |
| 176 | 176 |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | { |
| 27 | 27 | public: |
| 28 | 28 | tattack_state(const machine_config &mconfig, device_type type, const char *tag) |
| 29 | : driver_device(mconfig, type, tag) { } | |
| 29 | : driver_device(mconfig, type, tag) , | |
| 30 | m_videoram(*this, "videoram"), | |
| 31 | m_colorram(*this, "colorram"){ } | |
| 30 | 32 | |
| 31 | UINT8 *m_videoram; | |
| 32 | UINT8 *m_colorram; | |
| 33 | required_shared_ptr<UINT8> m_videoram; | |
| 34 | required_shared_ptr<UINT8> m_colorram; | |
| 33 | 35 | tilemap_t *m_tmap; |
| 34 | 36 | }; |
| 35 | 37 | |
| r14896 | r14897 | |
| 38 | 40 | static TILE_GET_INFO( get_tile_info ) |
| 39 | 41 | { |
| 40 | 42 | tattack_state *state = machine.driver_data<tattack_state>(); |
| 41 | int code = state->m_videoram[tile_index]; | |
| 42 | int color = state->m_colorram[tile_index]; | |
| 43 | int code = state->m_videoram.target()[tile_index]; | |
| 44 | int color = state->m_colorram.target()[tile_index]; | |
| 43 | 45 | |
| 44 | 46 | if((color&1 ) || (color>15) ) |
| 45 | 47 | logerror("COLOR %i\n",color); |
| r14896 | r14897 | |
| 70 | 72 | static ADDRESS_MAP_START( mem, AS_PROGRAM, 8, tattack_state ) |
| 71 | 73 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 72 | 74 | // AM_RANGE(0x4000, 0x4000) AM_READNOP $315 |
| 73 | AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE(m_videoram) | |
| 74 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(m_colorram) // color map ? something else .. only bits 1-3 are used | |
| 75 | AM_RANGE(0x5000, 0x53ff) AM_RAM AM_SHARE("videoram") | |
| 76 | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("colorram") // color map ? something else .. only bits 1-3 are used | |
| 75 | 77 | AM_RANGE(0x6000, 0x6000) AM_READ_PORT("DSW2") |
| 76 | 78 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW1") // dsw ? something else ? |
| 77 | 79 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("INPUTS") AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | return; |
| 40 | 40 | |
| 41 | 41 | case 2: /* Sound CPU write */ |
| 42 | soundlatch_w(space, 0, data & 0xff); | |
| 42 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 43 | 43 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 44 | 44 | return; |
| 45 | 45 | |
| r14896 | r14897 | |
| 133 | 133 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ym2", ym2151_r, ym2151_w) |
| 134 | 134 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 135 | 135 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 136 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 136 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 137 | 137 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 138 | 138 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 139 | 139 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | public: |
| 80 | 80 | ghosteo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 81 | : driver_device(mconfig, type, tag) { } | |
| 81 | : driver_device(mconfig, type, tag) , | |
| 82 | m_system_memory(*this, "systememory"){ } | |
| 82 | 83 | |
| 83 | UINT32 | |
| 84 | required_shared_ptr<UINT32> | |
| 84 | 85 | int m_security_count; |
| 85 | 86 | UINT32 m_bballoon_port[20]; |
| 86 | 87 | struct nand_t m_nand; |
| r14896 | r14897 | |
| 352 | 353 | AM_RANGE(0x10100000, 0x10100003) AM_READ_PORT("10100000") |
| 353 | 354 | AM_RANGE(0x10200000, 0x10200003) AM_READ_PORT("10200000") |
| 354 | 355 | AM_RANGE(0x10300000, 0x10300003) AM_WRITE(sound_w) |
| 355 | AM_RANGE(0x30000000, 0x31ffffff) AM_RAM AM_ | |
| 356 | AM_RANGE(0x30000000, 0x31ffffff) AM_RAM AM_ | |
| 356 | 357 | ADDRESS_MAP_END |
| 357 | 358 | |
| 358 | 359 | /* |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | AM_RANGE(0x02, 0x02) AM_WRITE(n8080_shift_bits_w) |
| 57 | 57 | AM_RANGE(0x03, 0x03) AM_WRITE(n8080_shift_data_w) |
| 58 | AM_RANGE(0x04, 0x04) AM_WRITE_LEGACY(n8080_sound_1_w) | |
| 59 | AM_RANGE(0x05, 0x05) AM_WRITE_LEGACY(n8080_sound_2_w) | |
| 58 | AM_RANGE(0x04, 0x04) AM_WRITE(n8080_sound_1_w) | |
| 59 | AM_RANGE(0x05, 0x05) AM_WRITE(n8080_sound_2_w) | |
| 60 | 60 | AM_RANGE(0x06, 0x06) AM_WRITE(n8080_video_control_w) |
| 61 | 61 | ADDRESS_MAP_END |
| 62 | 62 |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | { |
| 38 | 38 | |
| 39 | 39 | if ((data & 0x80) == 0) |
| 40 | soundlatch_w(space, 0, data & 0x7f); | |
| 40 | soundlatch_byte_w(space, 0, data & 0x7f); | |
| 41 | 41 | else |
| 42 | 42 | device_set_input_line(m_soundcpu, 0, ASSERT_LINE); |
| 43 | 43 | } |
| r14896 | r14897 | |
| 235 | 235 | { |
| 236 | 236 | AY8910_LEGACY_OUTPUT, |
| 237 | 237 | AY8910_DEFAULT_LOADS, |
| 238 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 238 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 239 | 239 | DEVCB_NULL, |
| 240 | 240 | DEVCB_NULL, |
| 241 | 241 | DEVCB_HANDLER(unused_w) |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | WRITE8_MEMBER(spdodgeb_state::sound_command_w) |
| 33 | 33 | { |
| 34 | soundlatch_w(space, offset, data); | |
| 34 | soundlatch_byte_w(space, offset, data); | |
| 35 | 35 | cputag_set_input_line(machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE); |
| 36 | 36 | } |
| 37 | 37 | |
| r14896 | r14897 | |
| 263 | 263 | |
| 264 | 264 | static ADDRESS_MAP_START( spdodgeb_sound_map, AS_PROGRAM, 8, spdodgeb_state ) |
| 265 | 265 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 266 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_r) | |
| 266 | AM_RANGE(0x1000, 0x1000) AM_READ(soundlatch_byte_r) | |
| 267 | 267 | AM_RANGE(0x2800, 0x2801) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w) |
| 268 | 268 | AM_RANGE(0x3800, 0x3807) AM_WRITE(spd_adpcm_w) |
| 269 | 269 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 112 | 112 | public: |
| 113 | 113 | deco_ld_state(const machine_config &mconfig, device_type type, const char *tag) |
| 114 | 114 | : driver_device(mconfig, type, tag), |
| 115 | m_laserdisc(*this, "laserdisc") { } | |
| 115 | m_laserdisc(*this, "laserdisc") , | |
| 116 | m_videoram(*this, "videoram"){ } | |
| 116 | 117 | |
| 117 | UINT8 *m_videoram; | |
| 118 | required_device<pioneer_ldv1000_device> m_laserdisc; | |
| 119 | required_shared_ptr<UINT8> m_videoram; | |
| 118 | 120 | UINT8 m_vram_bank; |
| 119 | required_device<pioneer_ldv1000_device> m_laserdisc; | |
| 120 | 121 | UINT8 m_laserdisc_data; |
| 121 | 122 | int m_nmimask; |
| 122 | 123 | DECLARE_WRITE8_MEMBER(rblaster_sound_w); |
| r14896 | r14897 | |
| 132 | 133 | static SCREEN_UPDATE_IND16( rblaster ) |
| 133 | 134 | { |
| 134 | 135 | deco_ld_state *state = screen.machine().driver_data<deco_ld_state>(); |
| 135 | UINT8 *videoram = state->m_videoram; | |
| 136 | UINT8 *videoram = state->m_videoram.target(); | |
| 136 | 137 | const gfx_element *gfx = screen.machine().gfx[0]; |
| 137 | 138 | int count = 0x0000; |
| 138 | 139 | |
| r14896 | r14897 | |
| 156 | 157 | #if 0 |
| 157 | 158 | WRITE8_MEMBER(deco_ld_state::rblaster_sound_w) |
| 158 | 159 | { |
| 159 | soundlatch_w(space,0,data); | |
| 160 | soundlatch_byte_w(space,0,data); | |
| 160 | 161 | device_set_input_line(machine().cpu[1], 0, HOLD_LINE); |
| 161 | 162 | } |
| 162 | 163 | #endif |
| r14896 | r14897 | |
| 196 | 197 | AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001 |
| 197 | 198 | AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command |
| 198 | 199 | AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data |
| 199 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_SHARE("paletteram") | |
| 200 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram") | |
| 200 | 201 | AM_RANGE(0x2000, 0x27ff) AM_RAM |
| 201 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_ | |
| 202 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_ | |
| 202 | 203 | AM_RANGE(0x3000, 0x3fff) AM_RAM |
| 203 | 204 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 204 | 205 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 214 | 215 | AM_RANGE(0x1004, 0x1004) AM_WRITE(rblaster_vram_bank_w) //might be 1001 |
| 215 | 216 | AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command |
| 216 | 217 | AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data |
| 217 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_SHARE("paletteram") | |
| 218 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram") | |
| 218 | 219 | AM_RANGE(0x2000, 0x2fff) AM_RAM |
| 219 | 220 | AM_RANGE(0x3000, 0x37ff) AM_RAM //vram attr? |
| 220 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_ | |
| 221 | AM_RANGE(0x3800, 0x3fff) AM_RAM AM_ | |
| 221 | 222 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 222 | 223 | ADDRESS_MAP_END |
| 223 | 224 | |
| r14896 | r14897 | |
| 230 | 231 | AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001 |
| 231 | 232 | AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command |
| 232 | 233 | AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data |
| 233 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_SHARE("paletteram") | |
| 234 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE(m_videoram) | |
| 234 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram") | |
| 235 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("videoram") | |
| 235 | 236 | AM_RANGE(0x3000, 0x3fff) AM_RAM |
| 236 | 237 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 237 | 238 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 258 | 259 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 259 | 260 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 260 | 261 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| 261 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 262 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 262 | 263 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 263 | 264 | ADDRESS_MAP_END |
| 264 | 265 |
| r14896 | r14897 | |
|---|---|---|
| 391 | 391 | |
| 392 | 392 | /* FIXME: this was by observation on board ??? |
| 393 | 393 | * -bit 7 is TMS status (active LO) */ |
| 394 | return ((tms5110_ctl_r(m_tms, 0) ^ 1) << 7) | (soundlatch_r(space, 0) & 0x7f); | |
| 394 | return ((tms5110_ctl_r(m_tms, 0) ^ 1) << 7) | (soundlatch_byte_r(space, 0) & 0x7f); | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
| r14896 | r14897 | |
| 459 | 459 | |
| 460 | 460 | LOG(("data %02x\n", data)); |
| 461 | 461 | /* cause interrupt on audio CPU if bit 7 set */ |
| 462 | soundlatch_w(space, 0, data); | |
| 462 | soundlatch_byte_w(space, 0, data); | |
| 463 | 463 | cvs_slave_cpu_interrupt(m_audiocpu, data & 0x80 ? 1 : 0); |
| 464 | 464 | } |
| 465 | 465 | |
| r14896 | r14897 | |
| 506 | 506 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 507 | 507 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 508 | 508 | AM_RANGE(0x1000, 0x107f) AM_RAM |
| 509 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_r) | |
| 509 | AM_RANGE(0x1800, 0x1800) AM_READ(soundlatch_byte_r) | |
| 510 | 510 | AM_RANGE(0x1840, 0x1840) AM_DEVWRITE_LEGACY("dac1", dac_w) |
| 511 | 511 | AM_RANGE(0x1880, 0x1883) AM_DEVWRITE_LEGACY("dac2", cvs_4_bit_dac_data_w) AM_BASE(m_cvs_4_bit_dac_data) |
| 512 | 512 | AM_RANGE(0x1884, 0x1887) AM_DEVWRITE_LEGACY("dac3", cvs_unknown_w) AM_BASE(m_dac3_state) /* ???? not connected to anything */ |
| r14896 | r14897 | |
|---|---|---|
| 761 | 761 | /* arknoid2, extrmatn, plumppop and drtoppel have PROMs instead of RAM */ |
| 762 | 762 | /* drtoppel writes here anyway! (maybe leftover from tests during development) */ |
| 763 | 763 | /* so the handler is patched out in init_drtopple() */ |
| 764 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 764 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 765 | 765 | ADDRESS_MAP_END |
| 766 | 766 | |
| 767 | 767 | static ADDRESS_MAP_START( cpu0_type2, AS_PROGRAM, 8, tnzs_state ) |
| r14896 | r14897 | |
| 807 | 807 | |
| 808 | 808 | WRITE8_MEMBER(tnzs_state::tnzsb_sound_command_w) |
| 809 | 809 | { |
| 810 | soundlatch_w(space, offset, data); | |
| 810 | soundlatch_byte_w(space, offset, data); | |
| 811 | 811 | device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); |
| 812 | 812 | } |
| 813 | 813 | |
| r14896 | r14897 | |
| 824 | 824 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 825 | 825 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("share1") |
| 826 | 826 | AM_RANGE(0xf000, 0xf003) AM_READONLY |
| 827 | AM_RANGE(0xf000, 0xf3ff) AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 827 | AM_RANGE(0xf000, 0xf3ff) AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 828 | 828 | ADDRESS_MAP_END |
| 829 | 829 | |
| 830 | 830 | static ADDRESS_MAP_START( kabukiz_cpu1_map, AS_PROGRAM, 8, tnzs_state ) |
| r14896 | r14897 | |
| 839 | 839 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("IN2") |
| 840 | 840 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 841 | 841 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("share1") |
| 842 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 842 | AM_RANGE(0xf800, 0xfbff) AM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 843 | 843 | ADDRESS_MAP_END |
| 844 | 844 | |
| 845 | 845 | static ADDRESS_MAP_START( tnzsb_cpu2_map, AS_PROGRAM, 8, tnzs_state ) |
| r14896 | r14897 | |
| 856 | 856 | static ADDRESS_MAP_START( tnzsb_io_map, AS_IO, 8, tnzs_state ) |
| 857 | 857 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 858 | 858 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 859 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r) | |
| 859 | AM_RANGE(0x02, 0x02) AM_READ(soundlatch_byte_r) | |
| 860 | 860 | ADDRESS_MAP_END |
| 861 | 861 | |
| 862 | 862 | static ADDRESS_MAP_START( i8742_io_map, AS_IO, 8, tnzs_state ) |
| r14896 | r14897 | |
|---|---|---|
| 266 | 266 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) |
| 267 | 267 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 268 | 268 | AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 269 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 269 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 270 | 270 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 271 | 271 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 272 | 272 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 161 | 161 | /* sound CPU communications */ |
| 162 | 162 | READ32_MEMBER(polygonet_state::sound_r) |
| 163 | 163 | { |
| 164 | int latch = soundlatch3_r(space, 0); | |
| 164 | int latch = soundlatch3_byte_r(space, 0); | |
| 165 | 165 | |
| 166 | 166 | if ((latch == 0xd) || (latch == 0xe)) latch = 0xf; /* hack: until 54539 NMI disable found */ |
| 167 | 167 | |
| r14896 | r14897 | |
| 172 | 172 | { |
| 173 | 173 | if (ACCESSING_BITS_8_15) |
| 174 | 174 | { |
| 175 | soundlatch_w(space, 0, (data>>8)&0xff); | |
| 175 | soundlatch_byte_w(space, 0, (data>>8)&0xff); | |
| 176 | 176 | } |
| 177 | 177 | else |
| 178 | 178 | { |
| 179 | soundlatch2_w(space, 0, data&0xff); | |
| 179 | soundlatch2_byte_w(space, 0, data&0xff); | |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| r14896 | r14897 | |
| 570 | 570 | AM_RANGE(0xe230, 0xe3ff) AM_RAM |
| 571 | 571 | AM_RANGE(0xe400, 0xe62f) AM_DEVREADWRITE("konami2", k054539_device, read, write) |
| 572 | 572 | AM_RANGE(0xe630, 0xe7ff) AM_RAM |
| 573 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_w) | |
| 574 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 575 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 573 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_byte_w) | |
| 574 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r) | |
| 575 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_byte_r) | |
| 576 | 576 | AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w) |
| 577 | 577 | AM_RANGE(0xfff1, 0xfff3) AM_WRITENOP |
| 578 | 578 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | * |
| 69 | 69 | *************************************/ |
| 70 | 70 | |
| 71 | ||
| 71 | ||
| 72 | 72 | { |
| 73 | return atarivc_r(* | |
| 73 | return atarivc_r(* | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| 77 | ||
| 77 | ||
| 78 | 78 | { |
| 79 | atarivc_w(* | |
| 79 | atarivc_w(* | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| r14896 | r14897 | |
| 87 | 87 | * |
| 88 | 88 | *************************************/ |
| 89 | 89 | |
| 90 | ||
| 90 | ||
| 91 | 91 | { |
| 92 | batman_state *state = space->machine().driver_data<batman_state>(); | |
| 93 | int result = input_port_read(space->machine(), "260010"); | |
| 94 | if (state->m_sound_to_cpu_ready) result ^= 0x0010; | |
| 95 | if (state->m_cpu_to_sound_ready) result ^= 0x0020; | |
| 92 | int result = input_port_read(machine(), "260010"); | |
| 93 | if (m_sound_to_cpu_ready) result ^= 0x0010; | |
| 94 | if (m_cpu_to_sound_ready) result ^= 0x0020; | |
| 96 | 95 | return result; |
| 97 | 96 | } |
| 98 | 97 | |
| 99 | 98 | |
| 100 | ||
| 99 | ||
| 101 | 100 | { |
| 102 | batman_state *state = space->machine().driver_data<batman_state>(); | |
| 103 | int oldword = state->m_latch_data; | |
| 104 | COMBINE_DATA(&state->m_latch_data); | |
| 101 | int oldword = m_latch_data; | |
| 102 | COMBINE_DATA(&m_latch_data); | |
| 105 | 103 | |
| 106 | 104 | /* bit 4 is connected to the /RESET pin on the 6502 */ |
| 107 | if (state->m_latch_data & 0x0010) | |
| 108 | cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, CLEAR_LINE); | |
| 105 | if (m_latch_data & 0x0010) | |
| 106 | cputag_set_input_line(machine(), "jsa", INPUT_LINE_RESET, CLEAR_LINE); | |
| 109 | 107 | else |
| 110 | cputag_set_input_line( | |
| 108 | cputag_set_input_line( | |
| 111 | 109 | |
| 112 | 110 | /* alpha bank is selected by the upper 4 bits */ |
| 113 | if ((oldword ^ | |
| 111 | if ((oldword ^ | |
| 114 | 112 | { |
| 115 | space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos()); | |
| 116 | state->m_alpha_tilemap->mark_all_dirty(); | |
| 117 | state->m_alpha_tile_bank = (state->m_latch_data >> 12) & 7; | |
| 113 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
| 114 | m_alpha_tilemap->mark_all_dirty(); | |
| 115 | m_alpha_tile_bank = (m_latch_data >> 12) & 7; | |
| 118 | 116 | } |
| 119 | 117 | } |
| 120 | 118 | |
| r14896 | r14897 | |
| 137 | 135 | AM_RANGE(0x120000, 0x120fff) AM_MIRROR(0x01f000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 138 | 136 | AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x11ff8c) AM_READ_PORT("260000") |
| 139 | 137 | AM_RANGE(0x260002, 0x260003) AM_MIRROR(0x11ff8c) AM_READ_PORT("260002") |
| 140 | AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ | |
| 138 | AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ | |
| 141 | 139 | AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_READ_LEGACY(atarigen_sound_r) |
| 142 | 140 | AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_WRITE_LEGACY(atarigen_sound_w) |
| 143 | AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE | |
| 141 | AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE | |
| 144 | 142 | AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 145 | 143 | AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_WRITE(watchdog_reset16_w) |
| 146 | 144 | AM_RANGE(0x3e0000, 0x3e0fff) AM_MIRROR(0x100000) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 147 | AM_RANGE(0x3effc0, 0x3effff) AM_MIRROR(0x100000) AM_READWRITE | |
| 145 | AM_RANGE(0x3effc0, 0x3effff) AM_MIRROR(0x100000) AM_READWRITE | |
| 148 | 146 | AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x100000) AM_WRITE_LEGACY(atarigen_playfield2_latched_msb_w) AM_BASE(m_playfield2) |
| 149 | 147 | AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x100000) AM_WRITE_LEGACY(atarigen_playfield_latched_lsb_w) AM_BASE(m_playfield) |
| 150 | 148 | AM_RANGE(0x3f4000, 0x3f5fff) AM_MIRROR(0x100000) AM_WRITE_LEGACY(atarigen_playfield_dual_upper_w) AM_BASE(m_playfield_upper) |
| r14896 | r14897 | |
|---|---|---|
| 241 | 241 | WRITE16_MEMBER(nemesis_state::nemesis_soundlatch_word_w) |
| 242 | 242 | { |
| 243 | 243 | if (ACCESSING_BITS_0_7) |
| 244 | soundlatch_w(space, offset, data & 0xff); | |
| 244 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | static WRITE8_DEVICE_HANDLER( gx400_speech_start_w ) |
| r14896 | r14897 | |
| 426 | 426 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 427 | 427 | AM_RANGE(0xa000, 0xafff) AM_DEVWRITE_LEGACY("k007232", k005289_pitch_A_w) |
| 428 | 428 | AM_RANGE(0xc000, 0xcfff) AM_DEVWRITE_LEGACY("k007232", k005289_pitch_B_w) |
| 429 | AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_r) | |
| 429 | AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_byte_r) | |
| 430 | 430 | AM_RANGE(0xe003, 0xe003) AM_DEVWRITE_LEGACY("k007232", k005289_keylatch_A_w) |
| 431 | 431 | AM_RANGE(0xe004, 0xe004) AM_DEVWRITE_LEGACY("k007232", k005289_keylatch_B_w) |
| 432 | 432 | AM_RANGE(0xe005, 0xe005) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| r14896 | r14897 | |
| 443 | 443 | AM_RANGE(0xa000, 0xafff) AM_DEVWRITE_LEGACY("k007232", k005289_pitch_A_w) |
| 444 | 444 | AM_RANGE(0xc000, 0xcfff) AM_DEVWRITE_LEGACY("k007232", k005289_pitch_B_w) |
| 445 | 445 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) |
| 446 | AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_r) | |
| 446 | AM_RANGE(0xe001, 0xe001) AM_READ(soundlatch_byte_r) | |
| 447 | 447 | AM_RANGE(0xe003, 0xe003) AM_DEVWRITE_LEGACY("k007232", k005289_keylatch_A_w) |
| 448 | 448 | AM_RANGE(0xe004, 0xe004) AM_DEVWRITE_LEGACY("k007232", k005289_keylatch_B_w) |
| 449 | 449 | AM_RANGE(0xe005, 0xe005) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| r14896 | r14897 | |
| 569 | 569 | static ADDRESS_MAP_START( sal_sound_map, AS_PROGRAM, 8, nemesis_state ) |
| 570 | 570 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 571 | 571 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 572 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 572 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 573 | 573 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) |
| 574 | 574 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 575 | 575 | AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) |
| r14896 | r14897 | |
| 580 | 580 | static ADDRESS_MAP_START( blkpnthr_sound_map, AS_PROGRAM, 8, nemesis_state ) |
| 581 | 581 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 582 | 582 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 583 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 583 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 584 | 584 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) |
| 585 | 585 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 586 | 586 | AM_RANGE(0xe000, 0xe000) AM_READ(wd_r) /* watchdog?? */ |
| r14896 | r14897 | |
| 597 | 597 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) |
| 598 | 598 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) |
| 599 | 599 | AM_RANGE(0xc000, 0xc000) AM_DEVWRITE_LEGACY("k007232", city_sound_bank_w) /* 7232 bankswitch */ |
| 600 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) | |
| 600 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) | |
| 601 | 601 | ADDRESS_MAP_END |
| 602 | 602 | |
| 603 | 603 | /******************************************************************************/ |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | public: |
| 62 | 62 | progolf_state(const machine_config &mconfig, device_type type, const char *tag) |
| 63 | : driver_device(mconfig, type, tag) { } | |
| 63 | : driver_device(mconfig, type, tag) , | |
| 64 | m_fbram(*this, "fbram"){ } | |
| 64 | 65 | |
| 65 | 66 | UINT8 *m_videoram; |
| 66 | 67 | UINT8 m_char_pen; |
| 67 | 68 | UINT8 m_char_pen_vreg; |
| 68 | 69 | UINT8 *m_fg_fb; |
| 69 | UINT8 | |
| 70 | required_shared_ptr<UINT8> | |
| 70 | 71 | UINT8 m_scrollx_hi; |
| 71 | 72 | UINT8 m_scrollx_lo; |
| 72 | 73 | UINT8 m_gfx_switch; |
| r14896 | r14897 | |
| 152 | 153 | WRITE8_MEMBER(progolf_state::progolf_charram_w) |
| 153 | 154 | { |
| 154 | 155 | int i; |
| 155 | m_fbram[offset] = data; | |
| 156 | m_fbram.target()[offset] = data; | |
| 156 | 157 | |
| 157 | 158 | if(m_char_pen == 7) |
| 158 | 159 | { |
| r14896 | r14897 | |
| 190 | 191 | |
| 191 | 192 | WRITE8_MEMBER(progolf_state::progolf_flip_screen_w) |
| 192 | 193 | { |
| 193 | flip_screen_set( | |
| 194 | flip_screen_set( | |
| 194 | 195 | if(data & 0xfe) |
| 195 | 196 | printf("$9600 with data = %02x used\n",data); |
| 196 | 197 | } |
| r14896 | r14897 | |
| 243 | 244 | |
| 244 | 245 | static ADDRESS_MAP_START( main_cpu, AS_PROGRAM, 8, progolf_state ) |
| 245 | 246 | AM_RANGE(0x0000, 0x5fff) AM_RAM |
| 246 | AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(progolf_charram_w) AM_ | |
| 247 | AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(progolf_charram_w) AM_ | |
| 247 | 248 | AM_RANGE(0x8000, 0x8fff) AM_READWRITE(progolf_videoram_r,progolf_videoram_w) |
| 248 | 249 | AM_RANGE(0x9000, 0x9000) AM_READ_PORT("IN2") AM_WRITE(progolf_char_vregs_w) |
| 249 | 250 | AM_RANGE(0x9200, 0x9200) AM_READ_PORT("P1") AM_WRITE(progolf_scrollx_hi_w) //p1 inputs |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | public: |
| 54 | 54 | jackie_state(const machine_config &mconfig, device_type type, const char *tag) |
| 55 | 55 | : driver_device(mconfig, type, tag), |
| 56 | m_maincpu(*this,"maincpu") | |
| 57 | { } | |
| 56 | m_maincpu(*this,"maincpu"), | |
| 57 | m_bg_scroll2(*this, "bg_scroll2"), | |
| 58 | m_bg_scroll(*this, "bg_scroll"), | |
| 59 | m_reel1_ram(*this, "reel1_ram"), | |
| 60 | m_reel2_ram(*this, "reel2_ram"), | |
| 61 | m_reel3_ram(*this, "reel3_ram"), | |
| 62 | m_fg_tile_ram(*this, "fg_tile_ram"), | |
| 63 | m_fg_color_ram(*this, "fg_color_ram"){ } | |
| 58 | 64 | |
| 65 | required_device<cpu_device> m_maincpu; | |
| 66 | required_shared_ptr<UINT8> m_bg_scroll2; | |
| 67 | required_shared_ptr<UINT8> m_bg_scroll; | |
| 68 | required_shared_ptr<UINT8> m_reel1_ram; | |
| 69 | required_shared_ptr<UINT8> m_reel2_ram; | |
| 70 | required_shared_ptr<UINT8> m_reel3_ram; | |
| 71 | required_shared_ptr<UINT8> m_fg_tile_ram; | |
| 72 | required_shared_ptr<UINT8> m_fg_color_ram; | |
| 59 | 73 | int m_exp_bank; |
| 60 | UINT8 *m_fg_tile_ram; | |
| 61 | UINT8 *m_fg_color_ram; | |
| 62 | 74 | tilemap_t *m_fg_tilemap; |
| 63 | UINT8 *m_bg_scroll; | |
| 64 | UINT8 *m_bg_scroll2; | |
| 65 | 75 | tilemap_t *m_reel1_tilemap; |
| 66 | UINT8 *m_reel1_ram; | |
| 67 | 76 | tilemap_t *m_reel2_tilemap; |
| 68 | UINT8 *m_reel2_ram; | |
| 69 | 77 | tilemap_t *m_reel3_tilemap; |
| 70 | UINT8 *m_reel3_ram; | |
| 71 | 78 | int m_irq_enable; |
| 72 | 79 | int m_nmi_enable; |
| 73 | 80 | int m_bg_enable; |
| r14896 | r14897 | |
| 75 | 82 | UINT8 m_out[3]; |
| 76 | 83 | UINT16 m_unk_reg[3][5]; |
| 77 | 84 | |
| 78 | required_device<cpu_device> m_maincpu; | |
| 79 | 85 | DECLARE_WRITE8_MEMBER(fg_tile_w); |
| 80 | 86 | DECLARE_WRITE8_MEMBER(fg_color_w); |
| 81 | 87 | DECLARE_WRITE8_MEMBER(bg_scroll_w); |
| r14896 | r14897 | |
| 105 | 111 | static TILE_GET_INFO( get_fg_tile_info ) |
| 106 | 112 | { |
| 107 | 113 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 108 | int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8); | |
| 114 | int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8); | |
| 109 | 115 | int tile = code & 0x1fff; |
| 110 | 116 | SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0); |
| 111 | 117 | } |
| 112 | 118 | |
| 113 | 119 | WRITE8_MEMBER(jackie_state::fg_tile_w) |
| 114 | 120 | { |
| 115 | m_fg_tile_ram[offset] = data; | |
| 121 | m_fg_tile_ram.target()[offset] = data; | |
| 116 | 122 | m_fg_tilemap->mark_tile_dirty(offset); |
| 117 | 123 | } |
| 118 | 124 | |
| 119 | 125 | WRITE8_MEMBER(jackie_state::fg_color_w) |
| 120 | 126 | { |
| 121 | m_fg_color_ram[offset] = data; | |
| 127 | m_fg_color_ram.target()[offset] = data; | |
| 122 | 128 | m_fg_tilemap->mark_tile_dirty(offset); |
| 123 | 129 | } |
| 124 | 130 | |
| r14896 | r14897 | |
| 127 | 133 | |
| 128 | 134 | WRITE8_MEMBER(jackie_state::bg_scroll_w) |
| 129 | 135 | { |
| 130 | m_bg_scroll[offset] = data; | |
| 136 | m_bg_scroll.target()[offset] = data; | |
| 131 | 137 | } |
| 132 | 138 | |
| 133 | 139 | |
| 134 | 140 | WRITE8_MEMBER(jackie_state::jackie_reel1_ram_w) |
| 135 | 141 | { |
| 136 | m_reel1_ram[offset] = data; | |
| 142 | m_reel1_ram.target()[offset] = data; | |
| 137 | 143 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 138 | 144 | } |
| 139 | 145 | |
| 140 | 146 | static TILE_GET_INFO( get_jackie_reel1_tile_info ) |
| 141 | 147 | { |
| 142 | 148 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 143 | int code = state->m_reel1_ram[tile_index]; | |
| 149 | int code = state->m_reel1_ram.target()[tile_index]; | |
| 144 | 150 | SET_TILE_INFO(1, code, 0, 0); |
| 145 | 151 | } |
| 146 | 152 | |
| r14896 | r14897 | |
| 148 | 154 | |
| 149 | 155 | WRITE8_MEMBER(jackie_state::jackie_reel2_ram_w) |
| 150 | 156 | { |
| 151 | m_reel2_ram[offset] = data; | |
| 157 | m_reel2_ram.target()[offset] = data; | |
| 152 | 158 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 153 | 159 | } |
| 154 | 160 | |
| 155 | 161 | static TILE_GET_INFO( get_jackie_reel2_tile_info ) |
| 156 | 162 | { |
| 157 | 163 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 158 | int code = state->m_reel2_ram[tile_index]; | |
| 164 | int code = state->m_reel2_ram.target()[tile_index]; | |
| 159 | 165 | SET_TILE_INFO(1, code, 0, 0); |
| 160 | 166 | } |
| 161 | 167 | |
| 162 | 168 | |
| 163 | 169 | WRITE8_MEMBER(jackie_state::jackie_reel3_ram_w) |
| 164 | 170 | { |
| 165 | m_reel3_ram[offset] = data; | |
| 171 | m_reel3_ram.target()[offset] = data; | |
| 166 | 172 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 167 | 173 | } |
| 168 | 174 | |
| 169 | 175 | static TILE_GET_INFO( get_jackie_reel3_tile_info ) |
| 170 | 176 | { |
| 171 | 177 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 172 | int code = state->m_reel3_ram[tile_index]; | |
| 178 | int code = state->m_reel3_ram.target()[tile_index]; | |
| 173 | 179 | SET_TILE_INFO(1, code, 0, 0); |
| 174 | 180 | } |
| 175 | 181 | |
| r14896 | r14897 | |
| 200 | 206 | |
| 201 | 207 | for (i=0;i < 0x40;i++) |
| 202 | 208 | { |
| 203 | state->m_reel1_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x000]); | |
| 204 | state->m_reel2_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x040]); | |
| 205 | state->m_reel3_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x080]); | |
| 209 | state->m_reel1_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x000]); | |
| 210 | state->m_reel2_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x040]); | |
| 211 | state->m_reel3_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x080]); | |
| 206 | 212 | } |
| 207 | 213 | |
| 208 | 214 | for (j=0; j < 0x100-1; j++) |
| 209 | 215 | { |
| 210 | 216 | rectangle clip; |
| 211 | int rowenable = state->m_bg_scroll2[j]; | |
| 217 | int rowenable = state->m_bg_scroll2.target()[j]; | |
| 212 | 218 | |
| 213 | 219 | /* draw top of screen */ |
| 214 | 220 | clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+1); |
| r14896 | r14897 | |
| 361 | 367 | AM_RANGE(0x05a0, 0x05a4) AM_WRITE(jackie_unk_reg3_lo_w) |
| 362 | 368 | AM_RANGE(0x0da0, 0x0da4) AM_WRITE(jackie_unk_reg3_hi_w) |
| 363 | 369 | AM_RANGE(0x1000, 0x1107) AM_RAM AM_BASE(m_bg_scroll2 ) |
| 364 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 365 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 370 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 371 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 366 | 372 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") /* DSW1 */ |
| 367 | 373 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") /* DSW2 */ |
| 368 | 374 | AM_RANGE(0x4002, 0x4002) AM_READ_PORT("DSW3") /* DSW3 */ |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | if (ACCESSING_BITS_8_15) |
| 21 | 21 | { |
| 22 | soundlatch_w(space, 0, (data >> 8) & 0xff); | |
| 22 | soundlatch_byte_w(space, 0, (data >> 8) & 0xff); | |
| 23 | 23 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 24 | 24 | } |
| 25 | 25 | } |
| r14896 | r14897 | |
| 53 | 53 | AM_RANGE(0x101000, 0x1017ff) AM_RAM_WRITE(goal92_foreground_w) AM_BASE(m_fg_data) |
| 54 | 54 | AM_RANGE(0x101800, 0x101fff) AM_RAM // it has tiles for clouds, but they aren't used |
| 55 | 55 | AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(goal92_text_w) AM_BASE(m_tx_data) |
| 56 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 56 | AM_RANGE(0x103000, 0x103fff) AM_RAM_WRITE(paletteram | |
| 57 | 57 | AM_RANGE(0x104000, 0x13ffff) AM_RAM |
| 58 | 58 | AM_RANGE(0x140000, 0x1407ff) AM_RAM AM_BASE(m_spriteram) |
| 59 | 59 | AM_RANGE(0x140800, 0x140801) AM_WRITENOP |
| r14896 | r14897 | |
| 87 | 87 | AM_RANGE(0xe800, 0xe801) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 88 | 88 | AM_RANGE(0xec00, 0xec01) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r, ym2203_w) |
| 89 | 89 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 90 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) | |
| 90 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) | |
| 91 | 91 | ADDRESS_MAP_END |
| 92 | 92 | |
| 93 | 93 | static INPUT_PORTS_START( goal92 ) |
| r14896 | r14897 | |
|---|---|---|
| 142 | 142 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(bombjack_colorram_w) AM_BASE(m_colorram) |
| 143 | 143 | AM_RANGE(0x9820, 0x987f) AM_WRITEONLY AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 144 | 144 | AM_RANGE(0x9a00, 0x9a00) AM_WRITENOP |
| 145 | AM_RANGE(0x9c00, 0x9cff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 145 | AM_RANGE(0x9c00, 0x9cff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 146 | 146 | AM_RANGE(0x9e00, 0x9e00) AM_WRITE(bombjack_background_w) |
| 147 | 147 | AM_RANGE(0xb000, 0xb000) AM_READ_PORT("P1") |
| 148 | 148 | AM_RANGE(0xb000, 0xb000) AM_WRITE(irq_mask_w) |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | |
| 53 | 53 | if (m_palette_selected) |
| 54 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 54 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 55 | 55 | else |
| 56 | 56 | m_ram[offset] = data; |
| 57 | 57 | } |
| r14896 | r14897 | |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, blockhl_state ) |
| 95 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_w) | |
| 95 | AM_RANGE(0x1f84, 0x1f84) AM_WRITE(soundlatch_byte_w) | |
| 96 | 96 | AM_RANGE(0x1f88, 0x1f88) AM_WRITE(blockhl_sh_irqtrigger_w) |
| 97 | 97 | AM_RANGE(0x1f8c, 0x1f8c) AM_WRITE(watchdog_reset_w) |
| 98 | 98 | AM_RANGE(0x1f94, 0x1f94) AM_READ_PORT("DSW3") |
| r14896 | r14897 | |
| 110 | 110 | static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, blockhl_state ) |
| 111 | 111 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 112 | 112 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 113 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 113 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 114 | 114 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 115 | 115 | AM_RANGE(0xe00c, 0xe00d) AM_WRITENOP /* leftover from missing 007232? */ |
| 116 | 116 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 233 | 233 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 234 | 234 | AM_RANGE(0xc00000, 0xc03fff) AM_READWRITE(gcpinbal_tilemaps_word_r, gcpinbal_tilemaps_word_w) AM_BASE(m_tilemapram) |
| 235 | 235 | AM_RANGE(0xc80000, 0xc80fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* sprite ram */ |
| 236 | AM_RANGE(0xd00000, 0xd00fff) AM_RAM_WRITE(paletteram | |
| 236 | AM_RANGE(0xd00000, 0xd00fff) AM_RAM_WRITE(paletteram | |
| 237 | 237 | AM_RANGE(0xd80000, 0xd800ff) AM_READWRITE(ioc_r, ioc_w) AM_BASE(m_ioc_ram) |
| 238 | 238 | AM_RANGE(0xff0000, 0xffffff) AM_RAM /* RAM */ |
| 239 | 239 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | public: |
| 59 | 59 | blackt96_state(const machine_config &mconfig, device_type type, const char *tag) |
| 60 | : driver_device(mconfig, type, tag) { } | |
| 60 | : driver_device(mconfig, type, tag) , | |
| 61 | m_tilemapram(*this, "tilemapram"), | |
| 62 | m_tilemapram2(*this, "tilemapram2"){ } | |
| 61 | 63 | |
| 62 | UINT16* m_tilemapram; | |
| 63 | UINT16* m_tilemapram2; | |
| 64 | required_shared_ptr<UINT16> m_tilemapram; | |
| 65 | required_shared_ptr<UINT16> m_tilemapram2; | |
| 64 | 66 | DECLARE_WRITE16_MEMBER(blackt96_c0000_w); |
| 65 | 67 | DECLARE_WRITE16_MEMBER(blackt96_80000_w); |
| 66 | 68 | DECLARE_READ8_MEMBER(PIC16C5X_T0_clk_r); |
| r14896 | r14897 | |
| 88 | 90 | |
| 89 | 91 | for (y=0;y<32;y++) |
| 90 | 92 | { |
| 91 | UINT16 tile = (state->m_tilemapram2[count*2 + (base/2)+1]&0x3fff); | |
| 92 | UINT16 flipx = (state->m_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 93 | UINT16 colour = (state->m_tilemapram2[count*2 + (base/2)]&0x00ff); | |
| 93 | UINT16 tile = (state->m_tilemapram2.target()[count*2 + (base/2)+1]&0x3fff); | |
| 94 | UINT16 flipx = (state->m_tilemapram2.target()[count*2 + (base/2)+1]&0x4000); | |
| 95 | UINT16 colour = (state->m_tilemapram2.target()[count*2 + (base/2)]&0x00ff); | |
| 94 | 96 | |
| 95 | 97 | if (tile&0x2000) |
| 96 | 98 | { |
| r14896 | r14897 | |
| 119 | 121 | int yy; |
| 120 | 122 | int s = 0; |
| 121 | 123 | |
| 122 | xx= ((state->m_tilemapram2[x+0]&0x001f)<<4) | (state->m_tilemapram2[x+1]&0xf000)>>12; | |
| 123 | yy = ((state->m_tilemapram2[x+1]&0x1ff)); | |
| 124 | xx= ((state->m_tilemapram2.target()[x+0]&0x001f)<<4) | (state->m_tilemapram2.target()[x+1]&0xf000)>>12; | |
| 125 | yy = ((state->m_tilemapram2.target()[x+1]&0x1ff)); | |
| 124 | 126 | |
| 125 | 127 | if (xx&0x100) xx-=0x200; |
| 126 | 128 | yy = 0x1ff-yy; |
| r14896 | r14897 | |
| 154 | 156 | { |
| 155 | 157 | for (y=0;y<32;y++) |
| 156 | 158 | { |
| 157 | UINT16 tile = (state->m_tilemapram[count*2]&0x7ff)+0x800; // +0xc00 for korean text | |
| 159 | UINT16 tile = (state->m_tilemapram.target()[count*2]&0x7ff)+0x800; // +0xc00 for korean text | |
| 158 | 160 | drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,-16+y*8,0); |
| 159 | 161 | count++; |
| 160 | 162 | } |
| r14896 | r14897 | |
| 185 | 187 | AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1") |
| 186 | 188 | AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW2") |
| 187 | 189 | |
| 188 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE(m_tilemapram) // text tilemap | |
| 189 | AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(m_tilemapram2)// sprite list + sprite tilemaps | |
| 190 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_SHARE("paletteram") | |
| 190 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_SHARE("tilemapram") // text tilemap | |
| 191 | AM_RANGE(0x200000, 0x207fff) AM_RAM AM_SHARE("tilemapram2")// sprite list + sprite tilemaps | |
| 192 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_word_w) AM_SHARE("paletteram") | |
| 191 | 193 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM // main ram |
| 192 | 194 | |
| 193 | 195 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 377 | 377 | AM_RANGE(0x0000, 0x07ff) AM_ROM /* CPU board ROM */ |
| 378 | 378 | AM_RANGE(0x0800, 0xbfff) AM_ROM /* PROM board ROM area */ |
| 379 | 379 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(mainram_w) AM_BASE(m_mainram) |
| 380 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(vectorram_w) AM_BASE(m_vectorram | |
| 380 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(vectorram_w) AM_BASE_SIZE(m_vectorram, | |
| 381 | 381 | ADDRESS_MAP_END |
| 382 | 382 | |
| 383 | 383 | |
| r14896 | r14897 | |
| 1298 | 1298 | |
| 1299 | 1299 | /* configure sound */ |
| 1300 | 1300 | state->m_usb = NULL; |
| 1301 | iospace->install_legacy_write_handler(0x3e, 0x3e, FUNC(elim1_sh_w)); | |
| 1302 | iospace->install_legacy_write_handler(0x3f, 0x3f, FUNC(elim2_sh_w)); | |
| 1301 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::elim1_sh_w),state)); | |
| 1302 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::elim2_sh_w),state)); | |
| 1303 | 1303 | } |
| 1304 | 1304 | |
| 1305 | 1305 | |
| r14896 | r14897 | |
| 1313 | 1313 | |
| 1314 | 1314 | /* configure sound */ |
| 1315 | 1315 | state->m_usb = NULL; |
| 1316 | iospace->install_legacy_write_handler(0x3e, 0x3e, FUNC(elim1_sh_w)); | |
| 1317 | iospace->install_legacy_write_handler(0x3f, 0x3f, FUNC(elim2_sh_w)); | |
| 1316 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::elim1_sh_w),state)); | |
| 1317 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::elim2_sh_w),state)); | |
| 1318 | 1318 | |
| 1319 | 1319 | /* configure inputs */ |
| 1320 | 1320 | iospace->install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),state)); |
| r14896 | r14897 | |
| 1334 | 1334 | state->m_usb = NULL; |
| 1335 | 1335 | iospace->install_legacy_write_handler(*machine.device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); |
| 1336 | 1336 | iospace->install_legacy_write_handler(*machine.device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); |
| 1337 | iospace->install_legacy_write_handler(0x3e, 0x3e, FUNC(spacfury1_sh_w)); | |
| 1338 | iospace->install_legacy_write_handler(0x3f, 0x3f, FUNC(spacfury2_sh_w)); | |
| 1337 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::spacfury1_sh_w),state)); | |
| 1338 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::spacfury2_sh_w),state)); | |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | 1341 | |
| r14896 | r14897 | |
| 1353 | 1353 | iospace->install_legacy_write_handler(*machine.device("segaspeech"), 0x38, 0x38, FUNC(sega_speech_data_w)); |
| 1354 | 1354 | iospace->install_legacy_write_handler(*machine.device("segaspeech"), 0x3b, 0x3b, FUNC(sega_speech_control_w)); |
| 1355 | 1355 | iospace->install_legacy_write_handler(*ay, 0x3c, 0x3d, FUNC(ay8910_address_data_w)); |
| 1356 | iospace->install_legacy_write_handler(0x3e, 0x3e, FUNC(zektor1_sh_w)); | |
| 1357 | iospace->install_legacy_write_handler(0x3f, 0x3f, FUNC(zektor2_sh_w)); | |
| 1356 | iospace->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(segag80v_state::zektor1_sh_w),state)); | |
| 1357 | iospace->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(segag80v_state::zektor2_sh_w),state)); | |
| 1358 | 1358 | |
| 1359 | 1359 | /* configure inputs */ |
| 1360 | 1360 | iospace->install_write_handler(0xf8, 0xf8, write8_delegate(FUNC(segag80v_state::spinner_select_w),state)); |
| r14896 | r14897 | |
|---|---|---|
| 47 | 47 | { |
| 48 | 48 | public: |
| 49 | 49 | aceal_state(const machine_config &mconfig, device_type type, const char *tag) |
| 50 | : driver_device(mconfig, type, tag) { } | |
| 50 | : driver_device(mconfig, type, tag) , | |
| 51 | m_scoreram(*this, "scoreram"), | |
| 52 | m_ram2(*this, "ram2"), | |
| 53 | m_characterram(*this, "characterram"){ } | |
| 51 | 54 | |
| 52 | 55 | /* video-related */ |
| 53 | UINT8 * m_ram2; | |
| 54 | UINT8 * m_scoreram; | |
| 55 | UINT8 * m_characterram; | |
| 56 | required_shared_ptr<UINT8> m_scoreram; | |
| 57 | required_shared_ptr<UINT8> m_ram2; | |
| 58 | required_shared_ptr<UINT8> m_characterram; | |
| 56 | 59 | |
| 57 | 60 | /* input-related */ |
| 58 | 61 | int m_objpos[8]; |
| r14896 | r14897 | |
| 79 | 82 | static VIDEO_START( ace ) |
| 80 | 83 | { |
| 81 | 84 | aceal_state *state = machine.driver_data<aceal_state>(); |
| 82 | gfx_element_set_source(machine.gfx[1], state->m_characterram); | |
| 83 | gfx_element_set_source(machine.gfx[2], state->m_characterram); | |
| 84 | gfx_element_set_source(machine.gfx[3], state->m_characterram); | |
| 85 | gfx_element_set_source(machine.gfx[4], state->m_scoreram); | |
| 85 | gfx_element_set_source(machine.gfx[1], state->m_characterram.target()); | |
| 86 | gfx_element_set_source(machine.gfx[2], state->m_characterram.target()); | |
| 87 | gfx_element_set_source(machine.gfx[3], state->m_characterram.target()); | |
| 88 | gfx_element_set_source(machine.gfx[4], state->m_scoreram.target()); | |
| 86 | 89 | } |
| 87 | 90 | |
| 88 | 91 | static SCREEN_UPDATE_IND16( ace ) |
| r14896 | r14897 | |
| 133 | 136 | |
| 134 | 137 | WRITE8_MEMBER(aceal_state::ace_characterram_w) |
| 135 | 138 | { |
| 136 | if (m_characterram[offset] != data) | |
| 139 | if (m_characterram.target()[offset] != data) | |
| 137 | 140 | { |
| 138 | 141 | if (data & ~0x07) |
| 139 | 142 | { |
| 140 | 143 | logerror("write to %04x data = %02x\n", 0x8000 + offset, data); |
| 141 | 144 | popmessage("write to %04x data = %02x\n", 0x8000 + offset, data); |
| 142 | 145 | } |
| 143 | m_characterram[offset] = data; | |
| 146 | m_characterram.target()[offset] = data; | |
| 144 | 147 | gfx_element_mark_dirty(machine().gfx[1], 0); |
| 145 | 148 | gfx_element_mark_dirty(machine().gfx[2], 0); |
| 146 | 149 | gfx_element_mark_dirty(machine().gfx[3], 0); |
| r14896 | r14897 | |
| 149 | 152 | |
| 150 | 153 | WRITE8_MEMBER(aceal_state::ace_scoreram_w) |
| 151 | 154 | { |
| 152 | m_scoreram[offset] = data; | |
| 155 | m_scoreram.target()[offset] = data; | |
| 153 | 156 | gfx_element_mark_dirty(machine().gfx[4], offset / 32); |
| 154 | 157 | } |
| 155 | 158 | |
| r14896 | r14897 | |
| 167 | 170 | |
| 168 | 171 | AM_RANGE(0x0000, 0x09ff) AM_ROM |
| 169 | 172 | |
| 170 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(ace_scoreram_w) AM_BASE(m_scoreram) /* 2x2101 */ | |
| 171 | AM_RANGE(0x8300, 0x83ff) AM_RAM AM_BASE(m_ram2) /* 2x2101 */ | |
| 172 | AM_RANGE(0x8000, 0x80ff) AM_RAM_WRITE(ace_characterram_w) AM_BASE(m_characterram) /* 3x3101 (3bits: 0, 1, 2) */ | |
| 173 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(ace_scoreram_w) AM_SHARE("scoreram") /* 2x2101 */ | |
| 174 | AM_RANGE(0x8300, 0x83ff) AM_RAM AM_SHARE("ram2") /* 2x2101 */ | |
| 175 | AM_RANGE(0x8000, 0x80ff) AM_RAM_WRITE(ace_characterram_w) AM_SHARE("characterram") /* 3x3101 (3bits: 0, 1, 2) */ | |
| 173 | 176 | |
| 174 | 177 | AM_RANGE(0xc000, 0xc005) AM_WRITE(ace_objpos_w) |
| 175 | 178 |
| r14896 | r14897 | |
|---|---|---|
| 93 | 93 | if (m_k052109_selected) |
| 94 | 94 | k052109_051960_w(space, offset + 0x2000, data); |
| 95 | 95 | else |
| 96 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 96 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | WRITE8_MEMBER(bottom9_state::bankswitch_w) |
| r14896 | r14897 | |
| 169 | 169 | AM_RANGE(0x1f80, 0x1f80) AM_WRITE(bankswitch_w) |
| 170 | 170 | AM_RANGE(0x1f90, 0x1f90) AM_WRITE(bottom9_1f90_w) |
| 171 | 171 | AM_RANGE(0x1fa0, 0x1fa0) AM_WRITE(watchdog_reset_w) |
| 172 | AM_RANGE(0x1fb0, 0x1fb0) AM_WRITE(soundlatch_w) | |
| 172 | AM_RANGE(0x1fb0, 0x1fb0) AM_WRITE(soundlatch_byte_w) | |
| 173 | 173 | AM_RANGE(0x1fc0, 0x1fc0) AM_WRITE(bottom9_sh_irqtrigger_w) |
| 174 | 174 | AM_RANGE(0x1fd0, 0x1fd0) AM_READ_PORT("SYSTEM") |
| 175 | 175 | AM_RANGE(0x1fd1, 0x1fd1) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 190 | 190 | AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w) |
| 191 | 191 | AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE_LEGACY("k007232_1", k007232_r, k007232_w) |
| 192 | 192 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("k007232_2", k007232_r, k007232_w) |
| 193 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) | |
| 193 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) | |
| 194 | 194 | AM_RANGE(0xf000, 0xf000) AM_WRITE(nmi_enable_w) |
| 195 | 195 | ADDRESS_MAP_END |
| 196 | 196 |
| r14896 | r14897 | |
|---|---|---|
| 125 | 125 | { |
| 126 | 126 | public: |
| 127 | 127 | dreamwld_state(const machine_config &mconfig, device_type type, const char *tag) |
| 128 | : driver_device(mconfig, type, tag) { } | |
| 128 | : driver_device(mconfig, type, tag) , | |
| 129 | m_spriteram(*this, "spriteram"), | |
| 130 | m_paletteram(*this, "paletteram"), | |
| 131 | m_bg_videoram(*this, "bg_videoram"), | |
| 132 | m_bg2_videoram(*this, "bg2_videoram"), | |
| 133 | m_vregs(*this, "vregs"), | |
| 134 | m_workram(*this, "workram"){ } | |
| 129 | 135 | |
| 130 | 136 | /* memory pointers */ |
| 131 | UINT32 * m_bg_videoram; | |
| 132 | UINT32 * m_bg2_videoram; | |
| 133 | UINT32 * m_vregs; | |
| 134 | UINT32 * m_paletteram; | |
| 135 | UINT32 * m_spriteram; | |
| 136 | UINT32 * m_workram; | |
| 137 | required_shared_ptr<UINT32> m_spriteram; | |
| 138 | required_shared_ptr<UINT32> m_paletteram; | |
| 139 | required_shared_ptr<UINT32> m_bg_videoram; | |
| 140 | required_shared_ptr<UINT32> m_bg2_videoram; | |
| 141 | required_shared_ptr<UINT32> m_vregs; | |
| 142 | required_shared_ptr<UINT32> m_workram; | |
| 137 | 143 | |
| 138 | 144 | /* video-related */ |
| 139 | 145 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 223 | 229 | |
| 224 | 230 | WRITE32_MEMBER(dreamwld_state::dreamwld_bg_videoram_w) |
| 225 | 231 | { |
| 226 | COMBINE_DATA(&m_bg_videoram[offset]); | |
| 232 | COMBINE_DATA(&m_bg_videoram.target()[offset]); | |
| 227 | 233 | m_bg_tilemap->mark_tile_dirty(offset * 2); |
| 228 | 234 | m_bg_tilemap->mark_tile_dirty(offset * 2 + 1); |
| 229 | 235 | } |
| r14896 | r14897 | |
| 232 | 238 | { |
| 233 | 239 | dreamwld_state *state = machine.driver_data<dreamwld_state>(); |
| 234 | 240 | int tileno, colour; |
| 235 | tileno = (tile_index & 1) ? (state->m_bg_videoram[tile_index >> 1] & 0xffff) : ((state->m_bg_videoram[tile_index >> 1] >> 16) & 0xffff); | |
| 241 | tileno = (tile_index & 1) ? (state->m_bg_videoram.target()[tile_index >> 1] & 0xffff) : ((state->m_bg_videoram.target()[tile_index >> 1] >> 16) & 0xffff); | |
| 236 | 242 | colour = tileno >> 13; |
| 237 | 243 | tileno &= 0x1fff; |
| 238 | 244 | SET_TILE_INFO(1, tileno + state->m_tilebank[0] * 0x2000, 0x80 + colour, 0); |
| r14896 | r14897 | |
| 241 | 247 | |
| 242 | 248 | WRITE32_MEMBER(dreamwld_state::dreamwld_bg2_videoram_w) |
| 243 | 249 | { |
| 244 | COMBINE_DATA(&m_bg2_videoram[offset]); | |
| 250 | COMBINE_DATA(&m_bg2_videoram.target()[offset]); | |
| 245 | 251 | m_bg2_tilemap->mark_tile_dirty(offset * 2); |
| 246 | 252 | m_bg2_tilemap->mark_tile_dirty(offset * 2 + 1); |
| 247 | 253 | } |
| r14896 | r14897 | |
| 250 | 256 | { |
| 251 | 257 | dreamwld_state *state = machine.driver_data<dreamwld_state>(); |
| 252 | 258 | UINT16 tileno, colour; |
| 253 | tileno = (tile_index & 1) ? (state->m_bg2_videoram[tile_index >> 1] & 0xffff) : ((state->m_bg2_videoram[tile_index >> 1] >> 16) & 0xffff); | |
| 259 | tileno = (tile_index & 1) ? (state->m_bg2_videoram.target()[tile_index >> 1] & 0xffff) : ((state->m_bg2_videoram.target()[tile_index >> 1] >> 16) & 0xffff); | |
| 254 | 260 | colour = tileno >> 13; |
| 255 | 261 | tileno &= 0x1fff; |
| 256 | 262 | SET_TILE_INFO(1, tileno + state->m_tilebank[1] * 0x2000, 0xc0 + colour, 0); |
| r14896 | r14897 | |
| 298 | 304 | tmptilemap0 = state->m_bg_tilemap; |
| 299 | 305 | tmptilemap1 = state->m_bg2_tilemap; |
| 300 | 306 | |
| 301 | int layer0_scrolly = state->m_vregs[(0x400 / 4)] + 32; | |
| 302 | int layer1_scrolly = state->m_vregs[(0x400 / 4) + 2] + 32; | |
| 307 | int layer0_scrolly = state->m_vregs.target()[(0x400 / 4)] + 32; | |
| 308 | int layer1_scrolly = state->m_vregs.target()[(0x400 / 4) + 2] + 32; | |
| 303 | 309 | |
| 304 | int layer0_scrollx = state->m_vregs[(0x400 / 4) + 1] + 3; | |
| 305 | int layer1_scrollx = state->m_vregs[(0x400 / 4) + 3] + 5; | |
| 306 | UINT32 layer0_ctrl = state->m_vregs[0x412 / 4]; | |
| 307 | UINT32 layer1_ctrl = state->m_vregs[0x416 / 4]; | |
| 310 | int layer0_scrollx = state->m_vregs.target()[(0x400 / 4) + 1] + 3; | |
| 311 | int layer1_scrollx = state->m_vregs.target()[(0x400 / 4) + 3] + 5; | |
| 312 | UINT32 layer0_ctrl = state->m_vregs.target()[0x412 / 4]; | |
| 313 | UINT32 layer1_ctrl = state->m_vregs.target()[0x416 / 4]; | |
| 308 | 314 | |
| 309 | 315 | tmptilemap0->set_scrolly(0, layer0_scrolly); |
| 310 | 316 | tmptilemap1->set_scrolly(0, layer1_scrolly); |
| r14896 | r14897 | |
| 338 | 344 | { |
| 339 | 345 | if (layer0_ctrl & 0x0200) |
| 340 | 346 | /* per-tile rowscroll */ |
| 341 | x0 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x000/2 + i/16)]; | |
| 347 | x0 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x000/2 + i/16)]; | |
| 342 | 348 | else |
| 343 | 349 | /* per-line rowscroll */ |
| 344 | x0 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) | |
| 350 | x0 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) | |
| 345 | 351 | } |
| 346 | 352 | |
| 347 | 353 | |
| r14896 | r14897 | |
| 355 | 361 | { |
| 356 | 362 | if (layer1_ctrl & 0x0200) |
| 357 | 363 | /* per-tile rowscroll */ |
| 358 | x1 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x200/2 + i/16)]; | |
| 364 | x1 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x200/2 + i/16)]; | |
| 359 | 365 | else |
| 360 | 366 | /* per-line rowscroll */ |
| 361 | x1 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) | |
| 367 | x1 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) | |
| 362 | 368 | } |
| 363 | 369 | |
| 364 | 370 | |
| r14896 | r14897 | |
| 368 | 374 | } |
| 369 | 375 | |
| 370 | 376 | |
| 371 | state->m_tilebank[0] = (state->m_vregs[(0x400 / 4) + 4] >> 6) & 1; | |
| 372 | state->m_tilebank[1] = (state->m_vregs[(0x400 / 4) + 5] >> 6) & 1; | |
| 377 | state->m_tilebank[0] = (state->m_vregs.target()[(0x400 / 4) + 4] >> 6) & 1; | |
| 378 | state->m_tilebank[1] = (state->m_vregs.target()[(0x400 / 4) + 5] >> 6) & 1; | |
| 373 | 379 | |
| 374 | 380 | if (state->m_tilebank[0] != state->m_tilebankold[0]) |
| 375 | 381 | { |
| r14896 | r14897 | |
| 432 | 438 | logerror("OKI1: unk bank write %x mem_mask %8x\n", data, mem_mask); |
| 433 | 439 | } |
| 434 | 440 | |
| 435 | // why doesn't using paletteram | |
| 441 | // why doesn't using paletteram | |
| 436 | 442 | // severely corrupt on dream world's semicom screen + many sprites, seems palette values get duplicated. |
| 437 | 443 | WRITE32_MEMBER(dreamwld_state::dreamwld_palette_w) |
| 438 | 444 | { |
| 439 | 445 | UINT16 dat; |
| 440 | 446 | int color; |
| 441 | 447 | |
| 442 | COMBINE_DATA(&m_paletteram[offset]); | |
| 448 | COMBINE_DATA(&m_paletteram.target()[offset]); | |
| 443 | 449 | color = offset * 2; |
| 444 | 450 | |
| 445 | dat = m_paletteram[offset] & 0x7fff; | |
| 451 | dat = m_paletteram.target()[offset] & 0x7fff; | |
| 446 | 452 | palette_set_color_rgb(machine(), color+1, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0)); |
| 447 | 453 | |
| 448 | dat = (m_paletteram[offset] >> 16) & 0x7fff; | |
| 454 | dat = (m_paletteram.target()[offset] >> 16) & 0x7fff; | |
| 449 | 455 | palette_set_color_rgb(machine(), color, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0)); |
| 450 | 456 | } |
| 451 | 457 | |
| r14896 | r14897 | |
| 454 | 460 | static ADDRESS_MAP_START( baryon_map, AS_PROGRAM, 32, dreamwld_state ) |
| 455 | 461 | AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_WRITENOP |
| 456 | 462 | |
| 457 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_BASE(m_spriteram) | |
| 458 | AM_RANGE(0x600000, 0x601fff) AM_RAM AM_WRITE(dreamwld_palette_w) AM_BASE(m_paletteram) | |
| 459 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(dreamwld_bg_videoram_w ) AM_BASE(m_bg_videoram) | |
| 460 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(dreamwld_bg2_videoram_w ) AM_BASE(m_bg2_videoram) | |
| 461 | AM_RANGE(0x804000, 0x805fff) AM_RAM AM_BASE(m_vregs) // scroll regs etc. | |
| 463 | AM_RANGE(0x400000, 0x401fff) AM_RAM AM_SHARE("spriteram") | |
| 464 | AM_RANGE(0x600000, 0x601fff) AM_RAM AM_WRITE(dreamwld_palette_w) AM_SHARE("paletteram") | |
| 465 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(dreamwld_bg_videoram_w ) AM_SHARE("bg_videoram") | |
| 466 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(dreamwld_bg2_videoram_w ) AM_SHARE("bg2_videoram") | |
| 467 | AM_RANGE(0x804000, 0x805fff) AM_RAM AM_SHARE("vregs") // scroll regs etc. | |
| 462 | 468 | |
| 463 | 469 | AM_RANGE(0xc00000, 0xc00003) AM_READ_PORT("INPUTS") |
| 464 | 470 | AM_RANGE(0xc00004, 0xc00007) AM_READ_PORT("c00004") |
| r14896 | r14897 | |
| 468 | 474 | |
| 469 | 475 | AM_RANGE(0xc00030, 0xc00033) AM_READ(dreamwld_protdata_r) // it reads protection data (irq code) from here and puts it at ffd000 |
| 470 | 476 | |
| 471 | AM_RANGE(0xfe0000, 0xffffff) AM_RAM AM_ | |
| 477 | AM_RANGE(0xfe0000, 0xffffff) AM_RAM AM_ | |
| 472 | 478 | ADDRESS_MAP_END |
| 473 | 479 | |
| 474 | 480 | static ADDRESS_MAP_START( dreamwld_map, AS_PROGRAM, 32, dreamwld_state ) |
| r14896 | r14897 | |
|---|---|---|
| 522 | 522 | |
| 523 | 523 | WRITE8_MEMBER(astrocde_state::tenpindx_sound_w) |
| 524 | 524 | { |
| 525 | soundlatch_w(space, offset, data); | |
| 525 | soundlatch_byte_w(space, offset, data); | |
| 526 | 526 | cputag_set_input_line(machine(), "sub", INPUT_LINE_NMI, PULSE_LINE); |
| 527 | 527 | } |
| 528 | 528 | |
| r14896 | r14897 | |
| 708 | 708 | static ADDRESS_MAP_START( tenpin_sub_io_map, AS_IO, 8, astrocde_state ) |
| 709 | 709 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 710 | 710 | AM_RANGE(0x90, 0x93) AM_DEVREADWRITE_LEGACY("ctc", z80ctc_r, z80ctc_w) |
| 711 | AM_RANGE(0x97, 0x97) AM_READ(soundlatch_r) | |
| 711 | AM_RANGE(0x97, 0x97) AM_READ(soundlatch_byte_r) | |
| 712 | 712 | AM_RANGE(0x98, 0x98) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 713 | 713 | AM_RANGE(0x98, 0x98) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 714 | 714 | AM_RANGE(0x9a, 0x9a) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| r14896 | r14897 | |
|---|---|---|
| 100 | 100 | static ADDRESS_MAP_START( megazone_sound_map, AS_PROGRAM, 8, megazone_state ) |
| 101 | 101 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 102 | 102 | AM_RANGE(0x2000, 0x2000) AM_WRITE(megazone_i8039_irq_w) /* START line. Interrupts 8039 */ |
| 103 | AM_RANGE(0x4000, 0x4000) AM_WRITE(soundlatch_w) /* CODE line. Command Interrupts 8039 */ | |
| 103 | AM_RANGE(0x4000, 0x4000) AM_WRITE(soundlatch_byte_w) /* CODE line. Command Interrupts 8039 */ | |
| 104 | 104 | AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0") /* IO Coin */ |
| 105 | 105 | AM_RANGE(0x6001, 0x6001) AM_READ_PORT("IN1") /* P1 IO */ |
| 106 | 106 | AM_RANGE(0x6002, 0x6002) AM_READ_PORT("IN2") /* P2 IO */ |
| r14896 | r14897 | |
| 124 | 124 | ADDRESS_MAP_END |
| 125 | 125 | |
| 126 | 126 | static ADDRESS_MAP_START( megazone_i8039_io_map, AS_IO, 8, megazone_state ) |
| 127 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch_r) | |
| 127 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch_byte_r) | |
| 128 | 128 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 129 | 129 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w) |
| 130 | 130 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 113 | 113 | AM_RANGE(0x080000, 0x083fff) AM_RAM |
| 114 | 114 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(pass_bg_videoram_w) AM_BASE(m_bg_videoram) // Background |
| 115 | 115 | AM_RANGE(0x210000, 0x213fff) AM_RAM_WRITE(pass_fg_videoram_w) AM_BASE(m_fg_videoram) // Foreground |
| 116 | AM_RANGE(0x220000, 0x2203ff) AM_RAM_WRITE(paletteram | |
| 116 | AM_RANGE(0x220000, 0x2203ff) AM_RAM_WRITE(paletteram | |
| 117 | 117 | AM_RANGE(0x230000, 0x230001) AM_WRITE(soundlatch_word_w) |
| 118 | 118 | AM_RANGE(0x230100, 0x230101) AM_READ_PORT("DSW") |
| 119 | 119 | AM_RANGE(0x230200, 0x230201) AM_READ_PORT("INPUTS") |
| r14896 | r14897 | |
| 127 | 127 | |
| 128 | 128 | static ADDRESS_MAP_START( pass_sound_io_map, AS_IO, 8, pass_state ) |
| 129 | 129 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 130 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) | |
| 130 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) | |
| 131 | 131 | AM_RANGE(0x70, 0x71) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 132 | 132 | AM_RANGE(0x80, 0x80) AM_DEVWRITE("oki", okim6295_device, write) |
| 133 | AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_clear_w) | |
| 133 | AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_clear_byte_w) | |
| 134 | 134 | ADDRESS_MAP_END |
| 135 | 135 | |
| 136 | 136 | /* todo : work out function of unknown but used dsw */ |
| r14896 | r14897 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | WRITE8_MEMBER(fortyl_state::sound_command_w) |
| 238 | 238 | { |
| 239 | soundlatch_w(space, 0, data); | |
| 239 | soundlatch_byte_w(space, 0, data); | |
| 240 | 240 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 241 | 241 | } |
| 242 | 242 | |
| r14896 | r14897 | |
| 750 | 750 | AM_RANGE(0xca00, 0xca0d) AM_DEVWRITE_LEGACY("msm", msm5232_w) |
| 751 | 751 | AM_RANGE(0xcc00, 0xcc00) AM_DEVWRITE_LEGACY("msm", sound_control_0_w) |
| 752 | 752 | AM_RANGE(0xce00, 0xce00) AM_DEVWRITE_LEGACY("msm", sound_control_1_w) |
| 753 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r) AM_WRITE(to_main_w) | |
| 753 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w) | |
| 754 | 754 | AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read */ |
| 755 | 755 | AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w) |
| 756 | 756 | AM_RANGE(0xde00, 0xde00) AM_READNOP AM_DEVWRITE_LEGACY("dac", dac_signed_w) /* signed 8-bit DAC - unknown read */ |
| r14896 | r14897 | |
|---|---|---|
| 725 | 725 | |
| 726 | 726 | WRITE8_MEMBER(galaga_state::galaga_flip_screen_w) |
| 727 | 727 | { |
| 728 | flip_screen_set( | |
| 728 | flip_screen_set( | |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | WRITE8_MEMBER(bosco_state::bosco_flip_screen_w) |
| 732 | 732 | { |
| 733 | flip_screen_set( | |
| 733 | flip_screen_set( | |
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | |
| r14896 | r14897 | |
| 777 | 777 | } |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | CUSTOM_INPUT_MEMBER(g | |
| 780 | CUSTOM_INPUT_MEMBER(digdu | |
| 781 | 781 | |
| 782 | 782 | static WRITE8_DEVICE_HANDLER( out_0 ) |
| 783 | 783 | { |
| r14896 | r14897 | |
| 1416 | 1416 | PORT_DIPSETTING( 0xc0, "5" ) |
| 1417 | 1417 | |
| 1418 | 1418 | PORT_START("DSWA_HI") |
| 1419 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, | |
| 1419 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, digdug_state,shifted_port_r, "DSWA") | |
| 1420 | 1420 | |
| 1421 | 1421 | PORT_START("DSWB") // reverse order against SWA |
| 1422 | 1422 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWB:1,2") |
| r14896 | r14897 | |
| 1443 | 1443 | PORT_DIPSETTING( 0x03, DEF_STR( Hardest ) ) |
| 1444 | 1444 | |
| 1445 | 1445 | PORT_START("DSWB_HI") |
| 1446 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, | |
| 1446 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, digdug_state,shifted_port_r, "DSWB") | |
| 1447 | 1447 | INPUT_PORTS_END |
| 1448 | 1448 | |
| 1449 | 1449 | /* |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | { |
| 70 | 70 | public: |
| 71 | 71 | panicr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 72 | : driver_device(mconfig, type, tag) { } | |
| 72 | : driver_device(mconfig, type, tag) , | |
| 73 | m_mainram(*this, "mainram"), | |
| 74 | m_spriteram(*this, "spriteram"), | |
| 75 | m_videoram(*this, "videoram"), | |
| 76 | m_scrollram(*this, "scrollram"){ } | |
| 73 | 77 | |
| 74 | UINT8 *m_videoram; | |
| 78 | required_shared_ptr<UINT8> m_mainram; | |
| 79 | required_shared_ptr<UINT8> m_spriteram; | |
| 80 | required_shared_ptr<UINT8> m_videoram; | |
| 81 | required_shared_ptr<UINT8> m_scrollram; | |
| 75 | 82 | tilemap_t *m_bgtilemap; |
| 76 | 83 | tilemap_t *m_txttilemap; |
| 77 | UINT8 *m_scrollram; | |
| 78 | UINT8 *m_mainram; | |
| 79 | UINT8 *m_spriteram; | |
| 80 | 84 | DECLARE_READ8_MEMBER(t5182shared_r); |
| 81 | 85 | DECLARE_WRITE8_MEMBER(t5182shared_w); |
| 82 | 86 | }; |
| r14896 | r14897 | |
| 159 | 163 | static TILE_GET_INFO( get_txttile_info ) |
| 160 | 164 | { |
| 161 | 165 | panicr_state *state = machine.driver_data<panicr_state>(); |
| 162 | UINT8 *videoram = state->m_videoram; | |
| 166 | UINT8 *videoram = state->m_videoram.target(); | |
| 163 | 167 | int code=videoram[tile_index*4]; |
| 164 | 168 | int attr=videoram[tile_index*4+2]; |
| 165 | 169 | int color = attr & 0x07; |
| r14896 | r14897 | |
| 189 | 193 | |
| 190 | 194 | |
| 191 | 195 | static ADDRESS_MAP_START( panicr_map, AS_PROGRAM, 8, panicr_state ) |
| 192 | AM_RANGE(0x00000, 0x01fff) AM_RAM AM_BASE(m_mainram) | |
| 193 | AM_RANGE(0x02000, 0x02fff) AM_RAM AM_BASE(m_spriteram) | |
| 196 | AM_RANGE(0x00000, 0x01fff) AM_RAM AM_SHARE("mainram") | |
| 197 | AM_RANGE(0x02000, 0x02fff) AM_RAM AM_SHARE("spriteram") | |
| 194 | 198 | AM_RANGE(0x03000, 0x03fff) AM_RAM |
| 195 | 199 | AM_RANGE(0x08000, 0x0bfff) AM_RAM AM_REGION("user3", 0) //attribue map ? |
| 196 | AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_ | |
| 200 | AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_ | |
| 197 | 201 | AM_RANGE(0x0d000, 0x0d000) AM_WRITE_LEGACY(t5182_sound_irq_w) |
| 198 | 202 | AM_RANGE(0x0d002, 0x0d002) AM_READ_LEGACY(t5182_sharedram_semaphore_snd_r) |
| 199 | 203 | AM_RANGE(0x0d004, 0x0d004) AM_WRITE_LEGACY(t5182_sharedram_semaphore_main_acquire_w) |
| r14896 | r14897 | |
| 204 | 208 | AM_RANGE(0x0d404, 0x0d404) AM_READ_PORT("START") |
| 205 | 209 | AM_RANGE(0x0d406, 0x0d406) AM_READ_PORT("DSW1") |
| 206 | 210 | AM_RANGE(0x0d407, 0x0d407) AM_READ_PORT("DSW2") |
| 207 | AM_RANGE(0x0d800, 0x0d81f) AM_RAM AM_ | |
| 211 | AM_RANGE(0x0d800, 0x0d81f) AM_RAM AM_ | |
| 208 | 212 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 209 | 213 | ADDRESS_MAP_END |
| 210 | 214 | |
| r14896 | r14897 | |
| 220 | 224 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect ) |
| 221 | 225 | { |
| 222 | 226 | panicr_state *state = machine.driver_data<panicr_state>(); |
| 223 | UINT8 *spriteram = state->m_spriteram; | |
| 227 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 224 | 228 | int offs,flipx,flipy,x,y,color,sprite; |
| 225 | 229 | |
| 226 | 230 | for (offs = 0; offs<0x1000; offs+=16) |
| r14896 | r14897 | |
| 232 | 236 | if (spriteram[offs+1] & 0x40) x -= 0x100; |
| 233 | 237 | |
| 234 | 238 | color = spriteram[offs+1] & 0x0f; |
| 235 | sprite = spriteram[offs+0]+(state->m_scrollram[0x0c]<<8); | |
| 239 | sprite = spriteram[offs+0]+(state->m_scrollram.target()[0x0c]<<8); | |
| 236 | 240 | |
| 237 | 241 | drawgfx_transmask(bitmap,cliprect,machine.gfx[2], |
| 238 | 242 | sprite, |
| r14896 | r14897 | |
| 246 | 250 | panicr_state *state = screen.machine().driver_data<panicr_state>(); |
| 247 | 251 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 248 | 252 | state->m_txttilemap ->mark_all_dirty(); |
| 249 | state->m_bgtilemap->set_scrollx(0, ((state->m_scrollram[0x02]&0x0f)<<12)+((state->m_scrollram[0x02]&0xf0)<<4)+((state->m_scrollram[0x04]&0x7f)<<1)+((state->m_scrollram[0x04]&0x80)>>7) ); | |
| 253 | state->m_bgtilemap->set_scrollx(0, ((state->m_scrollram.target()[0x02]&0x0f)<<12)+((state->m_scrollram.target()[0x02]&0xf0)<<4)+((state->m_scrollram.target()[0x04]&0x7f)<<1)+((state->m_scrollram.target()[0x04]&0x80)>>7) ); | |
| 250 | 254 | state->m_bgtilemap->draw(bitmap, cliprect, 0,0); |
| 251 | 255 | draw_sprites(screen.machine(),bitmap,cliprect); |
| 252 | 256 | state->m_txttilemap->draw(bitmap, cliprect, 0,0); |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | public: |
| 31 | 31 | istellar_state(const machine_config &mconfig, device_type type, const char *tag) |
| 32 | 32 | : driver_device(mconfig, type, tag), |
| 33 | m_laserdisc(*this, "laserdisc") { } | |
| 33 | m_laserdisc(*this, "laserdisc") , | |
| 34 | m_tile_ram(*this, "tile_ram"), | |
| 35 | m_tile_control_ram(*this, "tile_control_ram"), | |
| 36 | m_sprite_ram(*this, "sprite_ram"){ } | |
| 34 | 37 | |
| 35 | 38 | required_device<pioneer_ldv1000_device> m_laserdisc; |
| 36 | UINT8 *m_tile_ram; | |
| 37 | UINT8 *m_tile_control_ram; | |
| 38 | UINT8 *m_sprite_ram; | |
| 39 | required_shared_ptr<UINT8> m_tile_ram; | |
| 40 | required_shared_ptr<UINT8> m_tile_control_ram; | |
| 41 | required_shared_ptr<UINT8> m_sprite_ram; | |
| 39 | 42 | UINT8 m_ldp_latch1; |
| 40 | 43 | UINT8 m_ldp_latch2; |
| 41 | 44 | UINT8 m_z80_2_nmi_enable; |
| r14896 | r14897 | |
| 67 | 70 | /* |
| 68 | 71 | for (charx = 0; charx < 0x400; charx ++) |
| 69 | 72 | { |
| 70 | printf ("%x ", state->m_sprite_ram[charx]) ; | |
| 73 | printf ("%x ", state->m_sprite_ram.target()[charx]) ; | |
| 71 | 74 | } |
| 72 | 75 | printf("\n\n\n"); |
| 73 | 76 | */ |
| r14896 | r14897 | |
| 80 | 83 | int current_screen_character = (chary*32) + charx; |
| 81 | 84 | |
| 82 | 85 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], |
| 83 | state->m_tile_ram[current_screen_character], | |
| 84 | (state->m_tile_control_ram[current_screen_character] & 0x0f), | |
| 86 | state->m_tile_ram.target()[current_screen_character], | |
| 87 | (state->m_tile_control_ram.target()[current_screen_character] & 0x0f), | |
| 85 | 88 | 0, 0, charx*8, chary*8, 0); |
| 86 | 89 | } |
| 87 | 90 | } |
| r14896 | r14897 | |
| 170 | 173 | static ADDRESS_MAP_START( z80_0_mem, AS_PROGRAM, 8, istellar_state ) |
| 171 | 174 | AM_RANGE(0x0000,0x9fff) AM_ROM |
| 172 | 175 | AM_RANGE(0xa000,0xa7ff) AM_RAM |
| 173 | AM_RANGE(0xa800,0xabff) AM_RAM AM_BASE(m_tile_ram) | |
| 174 | AM_RANGE(0xac00,0xafff) AM_RAM AM_BASE(m_tile_control_ram) | |
| 175 | AM_RANGE(0xb000,0xb3ff) AM_RAM AM_BASE(m_sprite_ram) | |
| 176 | AM_RANGE(0xa800,0xabff) AM_RAM AM_SHARE("tile_ram") | |
| 177 | AM_RANGE(0xac00,0xafff) AM_RAM AM_SHARE("tile_control_ram") | |
| 178 | AM_RANGE(0xb000,0xb3ff) AM_RAM AM_SHARE("sprite_ram") | |
| 176 | 179 | ADDRESS_MAP_END |
| 177 | 180 | |
| 178 | 181 | static ADDRESS_MAP_START( z80_1_mem, AS_PROGRAM, 8, istellar_state ) |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | /* Write to the sound latch and generate an IRQ on the sound CPU */ |
| 50 | 50 | WRITE8_MEMBER(lasso_state::sound_command_w) |
| 51 | 51 | { |
| 52 | soundlatch_w(space, offset, data); | |
| 53 | generic_pulse_irq_line(m_audiocpu, 0, 1); | |
| 52 | soundlatch_byte_w(space, offset, data); | |
| 53 | generic_pulse_irq_line(m_audiocpu->execute(), 0, 1); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | WRITE8_MEMBER(lasso_state::pinbo_sound_command_w) |
| 57 | 57 | { |
| 58 | soundlatch_w(space, offset, data); | |
| 58 | soundlatch_byte_w(space, offset, data); | |
| 59 | 59 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 60 | 60 | } |
| 61 | 61 | |
| r14896 | r14897 | |
| 100 | 100 | AM_RANGE(0xb000, 0xb000) AM_WRITEONLY AM_BASE(m_chip_data) |
| 101 | 101 | AM_RANGE(0xb001, 0xb001) AM_WRITE(sound_select_w) |
| 102 | 102 | AM_RANGE(0xb004, 0xb004) AM_READ(sound_status_r) |
| 103 | AM_RANGE(0xb005, 0xb005) AM_READ(soundlatch_r) | |
| 103 | AM_RANGE(0xb005, 0xb005) AM_READ(soundlatch_byte_r) | |
| 104 | 104 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("audiocpu", 0x7000) |
| 105 | 105 | ADDRESS_MAP_END |
| 106 | 106 | |
| r14896 | r14897 | |
| 138 | 138 | AM_RANGE(0xb000, 0xb000) AM_WRITEONLY AM_BASE(m_chip_data) |
| 139 | 139 | AM_RANGE(0xb001, 0xb001) AM_WRITE(sound_select_w) |
| 140 | 140 | AM_RANGE(0xb004, 0xb004) AM_READ(sound_status_r) |
| 141 | AM_RANGE(0xb005, 0xb005) AM_READ(soundlatch_r) | |
| 141 | AM_RANGE(0xb005, 0xb005) AM_READ(soundlatch_byte_r) | |
| 142 | 142 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("audiocpu", 0x7000) |
| 143 | 143 | ADDRESS_MAP_END |
| 144 | 144 | |
| r14896 | r14897 | |
| 169 | 169 | AM_RANGE(0xb001, 0xb001) AM_WRITE(sound_select_w) |
| 170 | 170 | AM_RANGE(0xb003, 0xb003) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 171 | 171 | AM_RANGE(0xb004, 0xb004) AM_READ(sound_status_r) |
| 172 | AM_RANGE(0xb005, 0xb005) AM_READ(soundlatch_r) | |
| 172 | AM_RANGE(0xb005, 0xb005) AM_READ(soundlatch_byte_r) | |
| 173 | 173 | ADDRESS_MAP_END |
| 174 | 174 | |
| 175 | 175 | |
| r14896 | r14897 | |
| 203 | 203 | AM_RANGE(0x02, 0x02) AM_DEVREAD_LEGACY("ay1", ay8910_r) |
| 204 | 204 | AM_RANGE(0x04, 0x05) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 205 | 205 | AM_RANGE(0x06, 0x06) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| 206 | AM_RANGE(0x08, 0x08) AM_READ(soundlatch_r) AM_WRITENOP /* ??? */ | |
| 206 | AM_RANGE(0x08, 0x08) AM_READ(soundlatch_byte_r) AM_WRITENOP /* ??? */ | |
| 207 | 207 | AM_RANGE(0x14, 0x14) AM_WRITENOP /* ??? */ |
| 208 | 208 | ADDRESS_MAP_END |
| 209 | 209 |
| r14896 | r14897 | |
|---|---|---|
| 137 | 137 | { |
| 138 | 138 | memory_set_bankptr(machine(), "bank1", machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 ); |
| 139 | 139 | |
| 140 | st0016_rom_bank=data; | |
| 140 | m_st0016_rom_bank=data; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | WRITE8_MEMBER(macs_state::macs_output_w) |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | public: |
| 50 | 50 | sbowling_state(const machine_config &mconfig, device_type type, const char *tag) |
| 51 | 51 | : driver_device(mconfig, type, tag), |
| 52 | m_maincpu(*this, "maincpu") | |
| 53 | { } | |
| 52 | m_maincpu(*this, "maincpu"), | |
| 53 | m_videoram(*this, "videoram"){ } | |
| 54 | 54 | |
| 55 | 55 | int m_bgmap; |
| 56 | UINT8 *m_videoram; | |
| 56 | required_device<cpu_device> m_maincpu; | |
| 57 | required_shared_ptr<UINT8> m_videoram; | |
| 57 | 58 | |
| 58 | 59 | int m_sbw_system; |
| 59 | 60 | tilemap_t *m_sb_tilemap; |
| r14896 | r14897 | |
| 62 | 63 | UINT8 m_pix_sh; |
| 63 | 64 | UINT8 m_pix[2]; |
| 64 | 65 | |
| 65 | required_device<cpu_device> m_maincpu; | |
| 66 | 66 | DECLARE_WRITE8_MEMBER(sbw_videoram_w); |
| 67 | 67 | DECLARE_WRITE8_MEMBER(pix_shift_w); |
| 68 | 68 | DECLARE_WRITE8_MEMBER(pix_data_w); |
| r14896 | r14897 | |
| 93 | 93 | |
| 94 | 94 | WRITE8_MEMBER(sbowling_state::sbw_videoram_w) |
| 95 | 95 | { |
| 96 | int flip = flip_screen | |
| 96 | int flip = flip_screen | |
| 97 | 97 | int x,y,i,v1,v2; |
| 98 | 98 | |
| 99 | m_videoram[offset] = data; | |
| 99 | m_videoram.target()[offset] = data; | |
| 100 | 100 | |
| 101 | 101 | offset &= 0x1fff; |
| 102 | 102 | |
| 103 | 103 | y = offset / 32; |
| 104 | 104 | x = (offset % 32) * 8; |
| 105 | 105 | |
| 106 | v1 = m_videoram[offset]; | |
| 107 | v2 = m_videoram[offset+0x2000]; | |
| 106 | v1 = m_videoram.target()[offset]; | |
| 107 | v2 = m_videoram.target()[offset+0x2000]; | |
| 108 | 108 | |
| 109 | 109 | for (i = 0; i < 8; i++) |
| 110 | 110 | { |
| r14896 | r14897 | |
| 183 | 183 | */ |
| 184 | 184 | |
| 185 | 185 | |
| 186 | flip_screen_set( | |
| 186 | flip_screen_set( | |
| 187 | 187 | |
| 188 | 188 | if ((m_sbw_system^data)&1) |
| 189 | 189 | { |
| 190 | 190 | int offs; |
| 191 | 191 | for (offs = 0;offs < 0x4000; offs++) |
| 192 | sbw_videoram_w(space, offs, m_videoram[offs]); | |
| 192 | sbw_videoram_w(space, offs, m_videoram.target()[offs]); | |
| 193 | 193 | } |
| 194 | 194 | m_sbw_system = data; |
| 195 | 195 | } |
| r14896 | r14897 | |
| 223 | 223 | |
| 224 | 224 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbowling_state ) |
| 225 | 225 | AM_RANGE(0x0000, 0x2fff) AM_ROM |
| 226 | AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(sbw_videoram_w) AM_ | |
| 226 | AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(sbw_videoram_w) AM_ | |
| 227 | 227 | AM_RANGE(0xf800, 0xf801) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 228 | 228 | AM_RANGE(0xf801, 0xf801) AM_DEVREAD_LEGACY("aysnd", ay8910_r) |
| 229 | 229 | AM_RANGE(0xfc00, 0xffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 319 | 319 | { |
| 320 | 320 | psychic5_state *state = machine.driver_data<psychic5_state>(); |
| 321 | 321 | state->m_bank_latch = 0xff; |
| 322 | flip_screen_set( | |
| 322 | state->flip_screen_set( | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /*************************************************************************** |
| r14896 | r14897 | |
| 386 | 386 | // bit 7 toggles flip screen |
| 387 | 387 | if (data & 0x80) |
| 388 | 388 | { |
| 389 | flip_screen_set( | |
| 389 | flip_screen_set( | |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| r14896 | r14897 | |
| 395 | 395 | // bit 7 toggles flip screen |
| 396 | 396 | if (data & 0x80) |
| 397 | 397 | { |
| 398 | flip_screen_set( | |
| 398 | flip_screen_set( | |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | |
| r14896 | r14897 | |
| 411 | 411 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1") |
| 412 | 412 | AM_RANGE(0xc000, 0xdfff) AM_READWRITE(psychic5_paged_ram_r, psychic5_paged_ram_w) |
| 413 | 413 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 414 | AM_RANGE(0xf000, 0xf000) AM_RAM_WRITE(soundlatch_w) | |
| 414 | AM_RANGE(0xf000, 0xf000) AM_RAM_WRITE(soundlatch_byte_w) | |
| 415 | 415 | AM_RANGE(0xf001, 0xf001) AM_READNOP AM_WRITE(psychic5_coin_counter_w) |
| 416 | 416 | AM_RANGE(0xf002, 0xf002) AM_READWRITE(psychic5_bankselect_r, psychic5_bankselect_w) |
| 417 | 417 | AM_RANGE(0xf003, 0xf003) AM_READWRITE(psychic5_vram_page_select_r, psychic5_vram_page_select_w) |
| r14896 | r14897 | |
| 425 | 425 | static ADDRESS_MAP_START( psychic5_sound_map, AS_PROGRAM, 8, psychic5_state ) |
| 426 | 426 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 427 | 427 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 428 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 428 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 429 | 429 | ADDRESS_MAP_END |
| 430 | 430 | |
| 431 | 431 | static ADDRESS_MAP_START( psychic5_soundport_map, AS_IO, 8, psychic5_state ) |
| r14896 | r14897 | |
| 441 | 441 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 442 | 442 | |
| 443 | 443 | /* ports look like the other games */ |
| 444 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_w) // confirmed | |
| 444 | AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_byte_w) // confirmed | |
| 445 | 445 | AM_RANGE(0xd001, 0xd001) AM_WRITE(bombsa_flipscreen_w) |
| 446 | 446 | AM_RANGE(0xd002, 0xd002) AM_READWRITE(psychic5_bankselect_r, bombsa_bankselect_w) |
| 447 | 447 | AM_RANGE(0xd003, 0xd003) AM_READWRITE(psychic5_vram_page_select_r, psychic5_vram_page_select_w) |
| r14896 | r14897 | |
| 457 | 457 | static ADDRESS_MAP_START( bombsa_sound_map, AS_PROGRAM, 8, psychic5_state ) |
| 458 | 458 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 459 | 459 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 460 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 460 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 461 | 461 | AM_RANGE(0xf000, 0xf000) AM_WRITEONLY // Is this a confirm of some sort? |
| 462 | 462 | ADDRESS_MAP_END |
| 463 | 463 |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | { |
| 40 | 40 | public: |
| 41 | 41 | good_state(const machine_config &mconfig, device_type type, const char *tag) |
| 42 | : driver_device(mconfig, type, tag) { } | |
| 42 | : driver_device(mconfig, type, tag) , | |
| 43 | m_fg_tilemapram(*this, "fg_tilemapram"), | |
| 44 | m_bg_tilemapram(*this, "bg_tilemapram"){ } | |
| 43 | 45 | |
| 44 | 46 | /* memory pointers */ |
| 45 | UINT16 * m_bg_tilemapram; | |
| 46 | UINT16 * m_fg_tilemapram; | |
| 47 | required_shared_ptr<UINT16> m_fg_tilemapram; | |
| 48 | required_shared_ptr<UINT16> m_bg_tilemapram; | |
| 47 | 49 | UINT16 * m_sprites; |
| 48 | 50 | // UINT16 * m_paletteram; // currently this uses generic palette handling |
| 49 | 51 | |
| r14896 | r14897 | |
| 57 | 59 | |
| 58 | 60 | WRITE16_MEMBER(good_state::fg_tilemapram_w) |
| 59 | 61 | { |
| 60 | COMBINE_DATA(&m_fg_tilemapram[offset]); | |
| 62 | COMBINE_DATA(&m_fg_tilemapram.target()[offset]); | |
| 61 | 63 | m_fg_tilemap->mark_tile_dirty(offset / 2); |
| 62 | 64 | } |
| 63 | 65 | |
| 64 | 66 | static TILE_GET_INFO( get_fg_tile_info ) |
| 65 | 67 | { |
| 66 | 68 | good_state *state = machine.driver_data<good_state>(); |
| 67 | int tileno = state->m_fg_tilemapram[tile_index * 2]; | |
| 68 | int attr = state->m_fg_tilemapram[tile_index * 2 + 1] & 0xf; | |
| 69 | int tileno = state->m_fg_tilemapram.target()[tile_index * 2]; | |
| 70 | int attr = state->m_fg_tilemapram.target()[tile_index * 2 + 1] & 0xf; | |
| 69 | 71 | SET_TILE_INFO(0, tileno, attr, 0); |
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | WRITE16_MEMBER(good_state::bg_tilemapram_w) |
| 73 | 75 | { |
| 74 | COMBINE_DATA(&m_bg_tilemapram[offset]); | |
| 76 | COMBINE_DATA(&m_bg_tilemapram.target()[offset]); | |
| 75 | 77 | m_bg_tilemap->mark_tile_dirty(offset / 2); |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | 80 | static TILE_GET_INFO( get_bg_tile_info ) |
| 79 | 81 | { |
| 80 | 82 | good_state *state = machine.driver_data<good_state>(); |
| 81 | int tileno = state->m_bg_tilemapram[tile_index * 2]; | |
| 82 | int attr = state->m_bg_tilemapram[tile_index * 2 + 1] & 0xf; | |
| 83 | int tileno = state->m_bg_tilemapram.target()[tile_index * 2]; | |
| 84 | int attr = state->m_bg_tilemapram.target()[tile_index * 2 + 1] & 0xf; | |
| 83 | 85 | SET_TILE_INFO(1, tileno, attr, 0); |
| 84 | 86 | } |
| 85 | 87 | |
| r14896 | r14897 | |
| 111 | 113 | AM_RANGE(0x280002, 0x280003) AM_READ_PORT("IN1") |
| 112 | 114 | AM_RANGE(0x280004, 0x280005) AM_READ_PORT("IN2") |
| 113 | 115 | |
| 114 | AM_RANGE(0x800000, 0x8007ff) AM_RAM_WRITE(paletteram | |
| 116 | AM_RANGE(0x800000, 0x8007ff) AM_RAM_WRITE(paletteram | |
| 115 | 117 | |
| 116 | AM_RANGE(0x820000, 0x820fff) AM_RAM_WRITE(fg_tilemapram_w) AM_BASE(m_fg_tilemapram) | |
| 117 | AM_RANGE(0x822000, 0x822fff) AM_RAM_WRITE(bg_tilemapram_w) AM_BASE(m_bg_tilemapram) | |
| 118 | AM_RANGE(0x820000, 0x820fff) AM_RAM_WRITE(fg_tilemapram_w) AM_SHARE("fg_tilemapram") | |
| 119 | AM_RANGE(0x822000, 0x822fff) AM_RAM_WRITE(bg_tilemapram_w) AM_SHARE("bg_tilemapram") | |
| 118 | 120 | |
| 119 | 121 | AM_RANGE(0xff0000, 0xffefff) AM_RAM |
| 120 | 122 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 346 | 346 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 347 | 347 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 348 | 348 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 349 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 349 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 350 | 350 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 351 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 351 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 352 | 352 | AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w) |
| 353 | 353 | ADDRESS_MAP_END |
| 354 | 354 | |
| r14896 | r14897 | |
| 412 | 412 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 413 | 413 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 414 | 414 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 415 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 415 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 416 | 416 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 417 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 417 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 418 | 418 | ADDRESS_MAP_END |
| 419 | 419 | |
| 420 | 420 | |
| r14896 | r14897 | |
| 538 | 538 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITENOP |
| 539 | 539 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITENOP |
| 540 | 540 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITENOP |
| 541 | AM_RANGE(0x03, 0x03) AM_WRITE_LEGACY(invadpt2_sh_port_1_w) | |
| 542 | AM_RANGE(0x05, 0x05) AM_WRITE_LEGACY(cosmo_sh_port_2_w) | |
| 541 | AM_RANGE(0x03, 0x03) AM_WRITE(invadpt2_sh_port_1_w) | |
| 542 | AM_RANGE(0x05, 0x05) AM_WRITE(cosmo_sh_port_2_w) | |
| 543 | 543 | AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w) |
| 544 | 544 | AM_RANGE(0x07, 0x07) AM_WRITENOP |
| 545 | 545 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 638 | 638 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 639 | 639 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 640 | 640 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 641 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 641 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 642 | 642 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 643 | 643 | ADDRESS_MAP_END |
| 644 | 644 | |
| r14896 | r14897 | |
| 771 | 771 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 772 | 772 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 773 | 773 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 774 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 774 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 775 | 775 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 776 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 776 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 777 | 777 | ADDRESS_MAP_END |
| 778 | 778 | |
| 779 | 779 | |
| r14896 | r14897 | |
| 910 | 910 | |
| 911 | 911 | |
| 912 | 912 | static ADDRESS_MAP_START( rollingc_io_map, AS_IO, 8, _8080bw_state ) |
| 913 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE | |
| 913 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE | |
| 914 | 914 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 915 | 915 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 916 | 916 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) |
| r14896 | r14897 | |
| 976 | 976 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 977 | 977 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 978 | 978 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 979 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 979 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 980 | 980 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 981 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 981 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 982 | 982 | AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w) |
| 983 | 983 | ADDRESS_MAP_END |
| 984 | 984 | |
| r14896 | r14897 | |
| 1093 | 1093 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 1094 | 1094 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 1095 | 1095 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 1096 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1096 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1097 | 1097 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1098 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1098 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1099 | 1099 | ADDRESS_MAP_END |
| 1100 | 1100 | |
| 1101 | 1101 | |
| r14896 | r14897 | |
| 1232 | 1232 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 1233 | 1233 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 1234 | 1234 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 1235 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1235 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1236 | 1236 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1237 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1237 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1238 | 1238 | AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w) |
| 1239 | 1239 | ADDRESS_MAP_END |
| 1240 | 1240 | |
| r14896 | r14897 | |
| 1559 | 1559 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 1560 | 1560 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 1561 | 1561 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 1562 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1562 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1563 | 1563 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1564 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1564 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1565 | 1565 | ADDRESS_MAP_END |
| 1566 | 1566 | |
| 1567 | 1567 | |
| r14896 | r14897 | |
| 1611 | 1611 | static ADDRESS_MAP_START( yosakdon_io_map, AS_IO, 8, _8080bw_state ) |
| 1612 | 1612 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN0") |
| 1613 | 1613 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") |
| 1614 | AM_RANGE(0x03, 0x03) AM_WRITE_LEGACY(yosakdon_sh_port_1_w) | |
| 1615 | AM_RANGE(0x05, 0x05) AM_WRITE_LEGACY(yosakdon_sh_port_2_w) | |
| 1614 | AM_RANGE(0x03, 0x03) AM_WRITE(yosakdon_sh_port_1_w) | |
| 1615 | AM_RANGE(0x05, 0x05) AM_WRITE(yosakdon_sh_port_2_w) | |
| 1616 | 1616 | AM_RANGE(0x06, 0x06) AM_WRITENOP /* character numbers */ |
| 1617 | 1617 | ADDRESS_MAP_END |
| 1618 | 1618 | |
| r14896 | r14897 | |
| 1724 | 1724 | |
| 1725 | 1725 | */ |
| 1726 | 1726 | |
| 1727 | ||
| 1727 | ||
| 1728 | 1728 | { |
| 1729 | switch(cpu_get_pc(&space | |
| 1729 | switch(cpu_get_pc(&space. | |
| 1730 | 1730 | { |
| 1731 | 1731 | case 0x5fed: return 0x10; |
| 1732 | 1732 | case 0x5ffc: return 0; |
| 1733 | 1733 | } |
| 1734 | logerror("unknown port 0 read @ %x\n",cpu_get_pc(&space->device())); | |
| 1735 | return space->machine().rand(); | |
| 1734 | logerror("unknown port 0 read @ %x\n",cpu_get_pc(&space.device())); | |
| 1735 | return machine().rand(); | |
| 1736 | 1736 | } |
| 1737 | 1737 | |
| 1738 | 1738 | static ADDRESS_MAP_START( indianbt_io_map, AS_IO, 8, _8080bw_state ) |
| 1739 | AM_RANGE(0x00, 0x00) AM_READ | |
| 1739 | AM_RANGE(0x00, 0x00) AM_READ | |
| 1740 | 1740 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN0") |
| 1741 | 1741 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 1742 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1742 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1743 | 1743 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1744 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1744 | AM_RANGE(0x05, 0x05) AM_WRITE | |
| 1745 | 1745 | AM_RANGE(0x06, 0x06) AM_WRITENOP /* sound ? */ |
| 1746 | 1746 | AM_RANGE(0x07, 0x07) AM_DEVWRITE_LEGACY("discrete", indianbt_sh_port_3_w) |
| 1747 | 1747 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1776 | 1776 | /* */ |
| 1777 | 1777 | /*******************************************************/ |
| 1778 | 1778 | |
| 1779 | ||
| 1779 | ||
| 1780 | 1780 | { |
| 1781 | coin_lockout_global_w( | |
| 1781 | coin_lockout_global_w( | |
| 1782 | 1782 | } |
| 1783 | 1783 | |
| 1784 | 1784 | static ADDRESS_MAP_START( steelwkr_io_map, AS_IO, 8, _8080bw_state ) |
| 1785 | 1785 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 1786 | 1786 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) |
| 1787 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1787 | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE | |
| 1788 | 1788 | AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) |
| 1789 | AM_RANGE(0x05, 0x05) AM_WRITE_LEGACY(invadpt2_sh_port_2_w) | |
| 1790 | AM_RANGE(0x06, 0x06) AM_WRITE_LEGACY(steelwkr_sh_port_3_w) | |
| 1789 | AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w) | |
| 1790 | AM_RANGE(0x06, 0x06) AM_WRITE(steelwkr_sh_port_3_w) | |
| 1791 | 1791 | ADDRESS_MAP_END |
| 1792 | 1792 | |
| 1793 | 1793 | static INPUT_PORTS_START( steelwkr ) |
| r14896 | r14897 | |
| 1950 | 1950 | |
| 1951 | 1951 | static ADDRESS_MAP_START( shuttlei_io_map, AS_IO, 8, _8080bw_state ) |
| 1952 | 1952 | AM_RANGE(0xfc, 0xfc) AM_WRITENOP /* game writes 0xAA every so often (perhaps when base hit?) */ |
| 1953 | AM_RANGE(0xfd, 0xfd) AM_WRITE_LEGACY(shuttlei_sh_port_1_w) | |
| 1954 | AM_RANGE(0xfe, 0xfe) AM_READ_PORT("DSW") AM_WRITE_LEGACY(shuttlei_sh_port_2_w) | |
| 1953 | AM_RANGE(0xfd, 0xfd) AM_WRITE(shuttlei_sh_port_1_w) | |
| 1954 | AM_RANGE(0xfe, 0xfe) AM_READ_PORT("DSW") AM_WRITE(shuttlei_sh_port_2_w) | |
| 1955 | 1955 | AM_RANGE(0xff, 0xff) AM_READ_PORT("INPUTS") |
| 1956 | 1956 | // port fd (write) is for sound |
| 1957 | 1957 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | ************************************************************************/ |
| 46 | 46 | |
| 47 | ||
| 47 | ||
| 48 | 48 | { |
| 49 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 50 | state->m_page = offset & 0x03; | |
| 49 | m_page = offset & 0x03; | |
| 51 | 50 | } |
| 52 | 51 | |
| 53 | ||
| 52 | ||
| 54 | 53 | { |
| 55 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 56 | state->m_io_page = offset & 0x03; | |
| 54 | m_io_page = offset & 0x03; | |
| 57 | 55 | } |
| 58 | 56 | |
| 59 | ||
| 57 | ||
| 60 | 58 | { |
| 61 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 62 | 59 | |
| 63 | switch ( | |
| 60 | switch ( | |
| 64 | 61 | { |
| 65 | case 0: state->m_video_ram[offset] = data; break; | |
| 66 | case 1: state->m_color_ram[offset] = data & 7; break; // 3 bits of ram only - 3 x 2102 | |
| 67 | case 2: state->m_effectram[offset] = data; break; | |
| 68 | case 3: state->m_effectcontrol = data; break; | |
| 62 | case 0: m_video_ram[offset] = data; break; | |
| 63 | case 1: m_color_ram[offset] = data & 7; break; // 3 bits of ram only - 3 x 2102 | |
| 64 | case 2: m_effectram[offset] = data; break; | |
| 65 | case 3: m_effectcontrol = data; break; | |
| 69 | 66 | } |
| 70 | 67 | } |
| 71 | 68 | |
| 72 | ||
| 69 | ||
| 73 | 70 | { |
| 74 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 75 | 71 | UINT8 ans = 0; |
| 76 | 72 | |
| 77 | switch ( | |
| 73 | switch ( | |
| 78 | 74 | { |
| 79 | case 0: ans = input_port_read(space->machine(), "IN0"); break; | |
| 80 | case 1: ans = input_port_read(space->machine(), "IN1"); break; | |
| 81 | case 2: ans = input_port_read(space->machine(), "DSW0"); break; | |
| 82 | case 3: ans = input_port_read(space->machine(), "DSW1"); break; | |
| 75 | case 0: ans = input_port_read(machine(), "IN0"); break; | |
| 76 | case 1: ans = input_port_read(machine(), "IN1"); break; | |
| 77 | case 2: ans = input_port_read(machine(), "DSW0"); break; | |
| 78 | case 3: ans = input_port_read(machine(), "DSW1"); break; | |
| 83 | 79 | } |
| 84 | 80 | |
| 85 | 81 | return ans; |
| 86 | 82 | } |
| 87 | 83 | |
| 88 | ||
| 84 | ||
| 89 | 85 | { |
| 90 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 91 | state->m_bullet_ram[offset] = (data ^ 0xff); | |
| 86 | m_bullet_ram[offset] = (data ^ 0xff); | |
| 92 | 87 | } |
| 93 | 88 | |
| 94 | ||
| 89 | ||
| 95 | 90 | { |
| 96 | 91 | // bit 4 = Sound Invader : Linked to an NE555V circuit |
| 97 | 92 | // Not handled yet |
| r14896 | r14897 | |
| 99 | 94 | // lower nibble = command to I8035 |
| 100 | 95 | // not necessarily like this, but it seems to work better than direct mapping |
| 101 | 96 | // (although schematics has it as direct - but then the schematics are wrong elsewhere to!) |
| 102 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 103 | state->soundlatch_w(*space, 0, (data & 8) + ((data >> 1) & 3) + ((data << 2) & 4)); | |
| 97 | soundlatch_byte_w(*&space, 0, (data & 8) + ((data >> 1) & 3) + ((data << 2) & 4)); | |
| 104 | 98 | } |
| 105 | 99 | |
| 106 | ||
| 100 | ||
| 107 | 101 | { |
| 108 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 109 | return state->soundlatch_r(*space, 0) + (input_port_read(space->machine(), "DSW2") & 0x30); | |
| 102 | return soundlatch_byte_r(*&space, 0) + (input_port_read(machine(), "DSW2") & 0x30); | |
| 110 | 103 | } |
| 111 | 104 | |
| 112 | ||
| 105 | ||
| 113 | 106 | { |
| 114 | quasar_state *state = space->machine().driver_data<quasar_state>(); | |
| 115 | return (state->soundlatch_r(*space, 0) == 0); | |
| 107 | return (soundlatch_byte_r(*&space, 0) == 0); | |
| 116 | 108 | } |
| 117 | 109 | |
| 118 | 110 | // memory map taken from the manual |
| 119 | 111 | |
| 120 | 112 | static ADDRESS_MAP_START( quasar, AS_PROGRAM, 8, quasar_state ) |
| 121 | 113 | AM_RANGE(0x0000, 0x13ff) AM_ROM |
| 122 | AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READ(cvs_bullet_ram_or_palette_r) AM_WRITE | |
| 114 | AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READ(cvs_bullet_ram_or_palette_r) AM_WRITE | |
| 123 | 115 | AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_0_or_character_ram_r, cvs_s2636_0_or_character_ram_w) |
| 124 | 116 | AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w) |
| 125 | 117 | AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w) |
| 126 | AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE | |
| 118 | AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE | |
| 127 | 119 | AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM |
| 128 | 120 | AM_RANGE(0x2000, 0x33ff) AM_ROM |
| 129 | 121 | AM_RANGE(0x4000, 0x53ff) AM_ROM |
| r14896 | r14897 | |
| 131 | 123 | ADDRESS_MAP_END |
| 132 | 124 | |
| 133 | 125 | static ADDRESS_MAP_START( quasar_io, AS_IO, 8, quasar_state ) |
| 134 | AM_RANGE(0x00, 0x03) AM_READWRITE_LEGACY(quasar_IO_r, video_page_select_w) | |
| 135 | AM_RANGE(0x08, 0x0b) AM_WRITE_LEGACY(io_page_select_w) | |
| 136 | AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READ(cvs_collision_clear) AM_WRITE_LEGACY(quasar_sh_command_w) | |
| 126 | AM_RANGE(0x00, 0x03) AM_READWRITE(quasar_IO_r, video_page_select_w) | |
| 127 | AM_RANGE(0x08, 0x0b) AM_WRITE(io_page_select_w) | |
| 128 | AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READ(cvs_collision_clear) AM_WRITE(quasar_sh_command_w) | |
| 137 | 129 | AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_READ(cvs_collision_r) AM_WRITENOP |
| 138 | 130 | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE") |
| 139 | 131 | AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_RAM AM_BASE(m_fo_state) |
| r14896 | r14897 | |
| 151 | 143 | |
| 152 | 144 | static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, quasar_state ) |
| 153 | 145 | AM_RANGE(0x00, 0x7f) AM_RAM |
| 154 | AM_RANGE(0x80, 0x80) AM_READ_LEGACY(quasar_sh_command_r) | |
| 155 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_LEGACY(audio_t1_r) | |
| 146 | AM_RANGE(0x80, 0x80) AM_READ(quasar_sh_command_r) | |
| 147 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(audio_t1_r) | |
| 156 | 148 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 157 | 149 | ADDRESS_MAP_END |
| 158 | 150 |
| r14896 | r14897 | |
|---|---|---|
| 59 | 59 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSWA") |
| 60 | 60 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSWB") |
| 61 | 61 | AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r) |
| 62 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w) | |
| 62 | AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_byte_w) | |
| 63 | 63 | AM_RANGE(0xc804, 0xc804) AM_WRITE(c1943_c804_w) // ROM bank switch, screen flip |
| 64 | 64 | AM_RANGE(0xc806, 0xc806) AM_WRITE(watchdog_reset_w) |
| 65 | 65 | AM_RANGE(0xc807, 0xc807) AM_WRITENOP // ??? |
| r14896 | r14897 | |
| 80 | 80 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, _1943_state ) |
| 81 | 81 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 82 | 82 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 83 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) | |
| 83 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) | |
| 84 | 84 | AM_RANGE(0xe000, 0xe001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 85 | 85 | AM_RANGE(0xe002, 0xe003) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 86 | 86 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 187 | 187 | WRITE8_MEMBER(pacland_state::pacland_flipscreen_w) |
| 188 | 188 | { |
| 189 | 189 | int bit = !BIT(offset,11); |
| 190 | /* can't use flip_screen_set(machine(), ) because the visible area is asymmetrical */ | |
| 191 | flip_screen_set_no_update(machine(), bit); | |
| 192 | machine().tilemap().set_flip_all(flip_screen_get(machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 190 | /* can't use flip_screen_set() because the visible area is asymmetrical */ | |
| 191 | flip_screen_set_no_update(bit); | |
| 192 | machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 |
| r14896 | r14897 | |
|---|---|---|
| 43 | 43 | AM_RANGE(0xd900, 0xd900) AM_READWRITE(ra_fake_d800_r,ra_fake_d800_w) /* protection ??*/ |
| 44 | 44 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE(m_videoram) |
| 45 | 45 | AM_RANGE(0xe400, 0xe47f) AM_RAM AM_BASE(m_colorram) |
| 46 | AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_w) | |
| 46 | AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_byte_w) | |
| 47 | 47 | AM_RANGE(0xec00, 0xec0f) AM_NOP /* Analog sound effects ?? ec00 sound enable ?*/ |
| 48 | 48 | AM_RANGE(0xf000, 0xf0ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 49 | 49 | AM_RANGE(0xf400, 0xf400) AM_WRITE(rollrace_backgroundcolor_w) |
| r14896 | r14897 | |
| 64 | 64 | static ADDRESS_MAP_START( rollrace_sound_map, AS_PROGRAM, 8, rollrace_state ) |
| 65 | 65 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 66 | 66 | AM_RANGE(0x2000, 0x2fff) AM_RAM |
| 67 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) AM_WRITE(sound_nmi_mask_w) | |
| 67 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) AM_WRITE(sound_nmi_mask_w) | |
| 68 | 68 | AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 69 | 69 | AM_RANGE(0x5000, 0x5001) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 70 | 70 | AM_RANGE(0x6000, 0x6001) AM_DEVWRITE_LEGACY("ay3", ay8910_address_data_w) |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | m_deco_tilegen1(*this, "tilegen1"), |
| 52 | 52 | m_oki_sfx(*this, "oki_sfx"), |
| 53 | 53 | m_oki_bgm(*this, "oki_bgm"), |
| 54 | m_spriteram(*this, "spriteram") { } | |
| 54 | m_spriteram(*this, "spriteram") , | |
| 55 | m_pf1_rowscroll(*this, "pf1_rowscroll"), | |
| 56 | m_pf2_rowscroll(*this, "pf2_rowscroll"){ } | |
| 55 | 57 | |
| 56 | /* memory pointers */ | |
| 57 | UINT16 * m_pf1_rowscroll; | |
| 58 | UINT16 * m_pf2_rowscroll; | |
| 59 | // UINT16 * m_paletteram; // currently this uses generic palette handling (in decocomn.c) | |
| 60 | 58 | |
| 61 | 59 | /* misc */ |
| 62 | 60 | UINT8 m_mux_data; |
| r14896 | r14897 | |
| 67 | 65 | required_device<okim6295_device> m_oki_sfx; |
| 68 | 66 | required_device<okim6295_device> m_oki_bgm; |
| 69 | 67 | required_device<buffered_spriteram16_device> m_spriteram; |
| 68 | /* memory pointers */ | |
| 69 | required_shared_ptr<UINT16> m_pf1_rowscroll; | |
| 70 | required_shared_ptr<UINT16> m_pf2_rowscroll; | |
| 71 | // UINT16 * m_paletteram; // currently this uses generic palette handling (in decocomn.c) | |
| 70 | 72 | DECLARE_WRITE16_MEMBER(mirage_mux_w); |
| 71 | 73 | DECLARE_READ16_MEMBER(mirage_input_r); |
| 72 | 74 | DECLARE_WRITE16_MEMBER(okim1_rombank_w); |
| r14896 | r14897 | |
| 83 | 85 | miragemi_state *state = screen.machine().driver_data<miragemi_state>(); |
| 84 | 86 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| 85 | 87 | |
| 86 | flip_screen_set( | |
| 88 | state->flip_screen_set( | |
| 87 | 89 | |
| 88 | 90 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400); |
| 89 | 91 | |
| 90 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); | |
| 92 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll.target()); | |
| 91 | 93 | |
| 92 | 94 | bitmap.fill(256, cliprect); /* not verified */ |
| 93 | 95 | |
| r14896 | r14897 | |
| 137 | 139 | AM_RANGE(0x100000, 0x101fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) // 0x100000 - 0x101fff tested |
| 138 | 140 | AM_RANGE(0x102000, 0x103fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) // 0x102000 - 0x102fff tested |
| 139 | 141 | /* linescroll */ |
| 140 | AM_RANGE(0x110000, 0x110bff) AM_RAM AM_BASE(m_pf1_rowscroll) | |
| 141 | AM_RANGE(0x112000, 0x112bff) AM_RAM AM_BASE(m_pf2_rowscroll) | |
| 142 | AM_RANGE(0x110000, 0x110bff) AM_RAM AM_SHARE("pf1_rowscroll") | |
| 143 | AM_RANGE(0x112000, 0x112bff) AM_RAM AM_SHARE("pf2_rowscroll") | |
| 142 | 144 | AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_SHARE("spriteram") |
| 143 | AM_RANGE(0x130000, 0x1307ff) AM_RAM_WRITE(paletteram | |
| 145 | AM_RANGE(0x130000, 0x1307ff) AM_RAM_WRITE(paletteram | |
| 144 | 146 | AM_RANGE(0x140000, 0x14000f) AM_DEVREADWRITE8("oki_sfx", okim6295_device, read, write, 0x00ff) |
| 145 | 147 | AM_RANGE(0x150000, 0x15000f) AM_DEVREADWRITE8("oki_bgm", okim6295_device, read, write, 0x00ff) |
| 146 | 148 | // AM_RANGE(0x140006, 0x140007) AM_READ_LEGACY(random_readers) |
| r14896 | r14897 | |
|---|---|---|
| 328 | 328 | : seta_state(mconfig, type, tag) { } |
| 329 | 329 | |
| 330 | 330 | int m_banknum; |
| 331 | DECLARE_READ16_MEMBER(superman_dsw_input_r); | |
| 332 | DECLARE_READ16_MEMBER(daisenpu_input_r); | |
| 333 | DECLARE_WRITE16_MEMBER(daisenpu_input_w); | |
| 334 | DECLARE_WRITE16_MEMBER(kyustrkr_input_w); | |
| 335 | DECLARE_WRITE8_MEMBER(sound_bankswitch_w); | |
| 331 | 336 | }; |
| 332 | 337 | |
| 333 | ||
| 338 | ||
| 334 | 339 | { |
| 335 | 340 | switch (offset) |
| 336 | 341 | { |
| 337 | 342 | case 0x00: |
| 338 | return input_port_read( | |
| 343 | return input_port_read( | |
| 339 | 344 | case 0x01: |
| 340 | return (input_port_read( | |
| 345 | return (input_port_read( | |
| 341 | 346 | case 0x02: |
| 342 | return input_port_read( | |
| 347 | return input_port_read( | |
| 343 | 348 | case 0x03: |
| 344 | return (input_port_read( | |
| 349 | return (input_port_read( | |
| 345 | 350 | default: |
| 346 | 351 | logerror("taitox unknown dsw read offset: %04x\n", offset); |
| 347 | 352 | return 0x00; |
| 348 | 353 | } |
| 349 | 354 | } |
| 350 | 355 | |
| 351 | ||
| 356 | ||
| 352 | 357 | { |
| 353 | 358 | switch (offset) |
| 354 | 359 | { |
| 355 | 360 | case 0x00: |
| 356 | return input_port_read( | |
| 361 | return input_port_read( | |
| 357 | 362 | case 0x01: |
| 358 | return input_port_read( | |
| 363 | return input_port_read( | |
| 359 | 364 | case 0x02: |
| 360 | return input_port_read( | |
| 365 | return input_port_read( | |
| 361 | 366 | |
| 362 | 367 | default: |
| 363 | 368 | logerror("taitox unknown input read offset: %04x\n", offset); |
| r14896 | r14897 | |
| 365 | 370 | } |
| 366 | 371 | } |
| 367 | 372 | |
| 368 | ||
| 373 | ||
| 369 | 374 | { |
| 370 | 375 | switch (offset) |
| 371 | 376 | { |
| 372 | 377 | case 0x04: /* coin counters and lockout */ |
| 373 | coin_counter_w(space->machine(), 0,data & 0x01); | |
| 374 | coin_counter_w(space->machine(), 1,data & 0x02); | |
| 375 | coin_lockout_w(space->machine(), 0,~data & 0x04); | |
| 376 | coin_lockout_w(space->machine(), 1,~data & 0x08); | |
| 378 | coin_counter_w(machine(), 0,data & 0x01); | |
| 379 | coin_counter_w(machine(), 1,data & 0x02); | |
| 380 | coin_lockout_w(machine(), 0,~data & 0x04); | |
| 381 | coin_lockout_w(machine(), 1,~data & 0x08); | |
| 377 | 382 | //logerror("taitox coin control %04x to offset %04x\n",data,offset); |
| 378 | 383 | break; |
| 379 | 384 | |
| r14896 | r14897 | |
| 383 | 388 | } |
| 384 | 389 | |
| 385 | 390 | |
| 386 | ||
| 391 | ||
| 387 | 392 | { |
| 388 | 393 | switch (offset) |
| 389 | 394 | { |
| 390 | 395 | case 0x04: /* coin counters and lockout */ |
| 391 | coin_counter_w(space->machine(), 0,data & 0x01); | |
| 392 | coin_counter_w(space->machine(), 1,data & 0x02); | |
| 393 | coin_lockout_w(space->machine(), 0,data & 0x04); | |
| 394 | coin_lockout_w(space->machine(), 1,data & 0x08); | |
| 396 | coin_counter_w(machine(), 0,data & 0x01); | |
| 397 | coin_counter_w(machine(), 1,data & 0x02); | |
| 398 | coin_lockout_w(machine(), 0,data & 0x04); | |
| 399 | coin_lockout_w(machine(), 1,data & 0x08); | |
| 395 | 400 | //logerror("taitox coin control %04x to offset %04x\n",data,offset); |
| 396 | 401 | break; |
| 397 | 402 | |
| r14896 | r14897 | |
| 410 | 415 | memory_set_bankptr(machine, "bank2", machine.region("audiocpu")->base() + (state->m_banknum * 0x4000) + 0x10000 ); |
| 411 | 416 | } |
| 412 | 417 | |
| 413 | ||
| 418 | ||
| 414 | 419 | { |
| 415 | taitox_state *state = space->machine().driver_data<taitox_state>(); | |
| 416 | 420 | |
| 417 | state->m_banknum = (data - 1) & 3; | |
| 418 | reset_sound_region(space->machine()); | |
| 421 | m_banknum = (data - 1) & 3; | |
| 422 | reset_sound_region(machine()); | |
| 419 | 423 | } |
| 420 | 424 | |
| 421 | 425 | |
| r14896 | r14897 | |
| 425 | 429 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 426 | 430 | AM_RANGE(0x300000, 0x300001) AM_WRITENOP /* written each frame at $3a9c, mostly 0x10 */ |
| 427 | 431 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP /* written each frame at $3aa2, mostly 0x10 */ |
| 428 | AM_RANGE(0x500000, 0x500007) AM_READ | |
| 432 | AM_RANGE(0x500000, 0x500007) AM_READ | |
| 429 | 433 | AM_RANGE(0x600000, 0x600001) AM_WRITENOP /* written each frame at $3ab0, mostly 0x10 */ |
| 430 | 434 | AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 431 | 435 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 432 | 436 | AM_RANGE(0x900000, 0x9007ff) AM_READWRITE_LEGACY(cchip1_ram_r, cchip1_ram_w) |
| 433 | 437 | AM_RANGE(0x900802, 0x900803) AM_READWRITE_LEGACY(cchip1_ctrl_r, cchip1_ctrl_w) |
| 434 | 438 | AM_RANGE(0x900c00, 0x900c01) AM_WRITE_LEGACY(cchip1_bank_w) |
| 435 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram | |
| 439 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram | |
| 436 | 440 | AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 437 | 441 | AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 438 | 442 | AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| r14896 | r14897 | |
| 442 | 446 | static ADDRESS_MAP_START( daisenpu_map, AS_PROGRAM, 16, taitox_state ) |
| 443 | 447 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 444 | 448 | // AM_RANGE(0x400000, 0x400001) AM_WRITENOP /* written each frame at $2ac, values change */ |
| 445 | AM_RANGE(0x500000, 0x50000f) AM_READ | |
| 449 | AM_RANGE(0x500000, 0x50000f) AM_READ | |
| 446 | 450 | // AM_RANGE(0x600000, 0x600001) AM_WRITENOP /* written each frame at $2a2, values change */ |
| 447 | 451 | AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 448 | 452 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 449 | AM_RANGE(0x900000, 0x90000f) AM_READWRITE_LEGACY(daisenpu_input_r, daisenpu_input_w) | |
| 450 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 453 | AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w) | |
| 454 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 451 | 455 | AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 452 | 456 | AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 453 | 457 | AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| r14896 | r14897 | |
| 457 | 461 | static ADDRESS_MAP_START( gigandes_map, AS_PROGRAM, 16, taitox_state ) |
| 458 | 462 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 459 | 463 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP /* 0x1 written each frame at $d42, watchdog? */ |
| 460 | AM_RANGE(0x500000, 0x500007) AM_READ | |
| 464 | AM_RANGE(0x500000, 0x500007) AM_READ | |
| 461 | 465 | AM_RANGE(0x600000, 0x600001) AM_WRITENOP /* 0x1 written each frame at $d3c, watchdog? */ |
| 462 | 466 | AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 463 | 467 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 464 | AM_RANGE(0x900000, 0x90000f) AM_READWRITE_LEGACY(daisenpu_input_r, daisenpu_input_w) | |
| 465 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 468 | AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w) | |
| 469 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 466 | 470 | AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 467 | 471 | AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 468 | 472 | AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| r14896 | r14897 | |
| 472 | 476 | static ADDRESS_MAP_START( ballbros_map, AS_PROGRAM, 16, taitox_state ) |
| 473 | 477 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 474 | 478 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP /* 0x1 written each frame at $c56, watchdog? */ |
| 475 | AM_RANGE(0x500000, 0x50000f) AM_READ | |
| 479 | AM_RANGE(0x500000, 0x50000f) AM_READ | |
| 476 | 480 | AM_RANGE(0x600000, 0x600001) AM_WRITENOP /* 0x1 written each frame at $c4e, watchdog? */ |
| 477 | 481 | AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff) |
| 478 | 482 | AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 479 | AM_RANGE(0x900000, 0x90000f) AM_READWRITE_LEGACY(daisenpu_input_r, daisenpu_input_w) | |
| 480 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 483 | AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w) | |
| 484 | AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 481 | 485 | AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16) // Sprites Y |
| 482 | 486 | AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16) |
| 483 | 487 | AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr |
| r14896 | r14897 | |
| 498 | 502 | AM_RANGE(0xea00, 0xea00) AM_READNOP |
| 499 | 503 | AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */ |
| 500 | 504 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */ |
| 501 | AM_RANGE(0xf200, 0xf200) AM_WRITE | |
| 505 | AM_RANGE(0xf200, 0xf200) AM_WRITE | |
| 502 | 506 | ADDRESS_MAP_END |
| 503 | 507 | |
| 504 | 508 | static ADDRESS_MAP_START( daisenpu_sound_map, AS_PROGRAM, 8, taitox_state ) |
| r14896 | r14897 | |
| 512 | 516 | AM_RANGE(0xea00, 0xea00) AM_READNOP |
| 513 | 517 | AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */ |
| 514 | 518 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP |
| 515 | AM_RANGE(0xf200, 0xf200) AM_WRITE | |
| 519 | AM_RANGE(0xf200, 0xf200) AM_WRITE | |
| 516 | 520 | ADDRESS_MAP_END |
| 517 | 521 | |
| 518 | 522 | |
| r14896 | r14897 | |
| 1221 | 1225 | |
| 1222 | 1226 | static DRIVER_INIT( kyustrkr ) |
| 1223 | 1227 | { |
| 1224 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x90000f, FUNC(kyustrkr_input_w)); | |
| 1228 | taitox_state *state = machine.driver_data<taitox_state>(); | |
| 1229 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x900000, 0x90000f, write16_delegate(FUNC(taitox_state::kyustrkr_input_w),state)); | |
| 1225 | 1230 | } |
| 1226 | 1231 | |
| 1227 | 1232 |
| r14896 | r14897 | |
|---|---|---|
| 232 | 232 | |
| 233 | 233 | WRITE8_MEMBER(djboy_state::trigger_nmi_on_sound_cpu2) |
| 234 | 234 | { |
| 235 | soundlatch_w(space, 0, data); | |
| 235 | soundlatch_byte_w(space, 0, data); | |
| 236 | 236 | device_set_input_line(m_cpu2, INPUT_LINE_NMI, PULSE_LINE); |
| 237 | 237 | } /* trigger_nmi_on_sound_cpu2 */ |
| 238 | 238 | |
| r14896 | r14897 | |
| 293 | 293 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 294 | 294 | AM_RANGE(0x00, 0x00) AM_WRITE(cpu2_bankswitch_w) |
| 295 | 295 | AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 296 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) | |
| 296 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) | |
| 297 | 297 | AM_RANGE(0x06, 0x06) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 298 | 298 | AM_RANGE(0x07, 0x07) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 299 | 299 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | WRITE8_MEMBER(ladyfrog_state::sound_command_w) |
| 84 | 84 | { |
| 85 | soundlatch_w(space, 0, data); | |
| 85 | soundlatch_byte_w(space, 0, data); | |
| 86 | 86 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 87 | 87 | } |
| 88 | 88 | |
| r14896 | r14897 | |
| 157 | 157 | AM_RANGE(0xca00, 0xca00) AM_WRITENOP |
| 158 | 158 | AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP |
| 159 | 159 | AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP |
| 160 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) AM_WRITE(to_main_w) | |
| 160 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w) | |
| 161 | 161 | AM_RANGE(0xd200, 0xd200) AM_READNOP AM_WRITE(nmi_enable_w) |
| 162 | 162 | AM_RANGE(0xd400, 0xd400) AM_WRITE(nmi_disable_w) |
| 163 | 163 | AM_RANGE(0xd600, 0xd600) AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 72 | 72 | static ADDRESS_MAP_START( sidearms_map, AS_PROGRAM, 8, sidearms_state ) |
| 73 | 73 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 74 | 74 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 75 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_SHARE("paletteram") | |
| 76 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_SHARE("paletteram2") | |
| 77 | AM_RANGE(0xc800, 0xc800) AM_READ_PORT("SYSTEM") AM_WRITE(soundlatch_w) | |
| 75 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_lo_w) AM_SHARE("paletteram") | |
| 76 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 77 | AM_RANGE(0xc800, 0xc800) AM_READ_PORT("SYSTEM") AM_WRITE(soundlatch_byte_w) | |
| 78 | 78 | AM_RANGE(0xc801, 0xc801) AM_READ_PORT("P1") AM_WRITE(sidearms_bankswitch_w) |
| 79 | 79 | AM_RANGE(0xc802, 0xc802) AM_READ_PORT("P2") AM_WRITE(watchdog_reset_w) |
| 80 | 80 | AM_RANGE(0xc803, 0xc803) AM_READ_PORT("DSW0") |
| r14896 | r14897 | |
| 95 | 95 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 96 | 96 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 97 | 97 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("spriteram") |
| 98 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_SHARE("paletteram") | |
| 99 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_SHARE("paletteram2") | |
| 98 | AM_RANGE(0xe000, 0xe3ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_lo_w) AM_SHARE("paletteram") | |
| 99 | AM_RANGE(0xe400, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 100 | 100 | AM_RANGE(0xe800, 0xe807) AM_READ(turtship_ports_r) |
| 101 | AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_w) | |
| 101 | AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_byte_w) | |
| 102 | 102 | AM_RANGE(0xe801, 0xe801) AM_WRITE(sidearms_bankswitch_w) |
| 103 | 103 | AM_RANGE(0xe802, 0xe802) AM_WRITE(watchdog_reset_w) |
| 104 | 104 | AM_RANGE(0xe804, 0xe804) AM_WRITE(sidearms_c804_w) |
| r14896 | r14897 | |
| 114 | 114 | static ADDRESS_MAP_START( sidearms_sound_map, AS_PROGRAM, 8, sidearms_state ) |
| 115 | 115 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 116 | 116 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 117 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) | |
| 117 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) | |
| 118 | 118 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r,ym2203_w) |
| 119 | 119 | AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE_LEGACY("ym2", ym2203_r,ym2203_w) |
| 120 | 120 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 142 | 142 | static ADDRESS_MAP_START( whizz_map, AS_PROGRAM, 8, sidearms_state ) |
| 143 | 143 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 144 | 144 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 145 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_SHARE("paletteram") | |
| 146 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_SHARE("paletteram2") | |
| 147 | AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_w) | |
| 145 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_lo_w) AM_SHARE("paletteram") | |
| 146 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 147 | AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW0") AM_WRITE(soundlatch_byte_w) | |
| 148 | 148 | AM_RANGE(0xc801, 0xc801) AM_READ_PORT("DSW1") AM_WRITE(whizz_bankswitch_w) |
| 149 | 149 | AM_RANGE(0xc802, 0xc802) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset_w) |
| 150 | 150 | AM_RANGE(0xc803, 0xc803) AM_READ_PORT("IN0") AM_WRITENOP |
| r14896 | r14897 | |
| 172 | 172 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 173 | 173 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 174 | 174 | AM_RANGE(0x40, 0x40) AM_WRITENOP |
| 175 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) | |
| 175 | AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_byte_r) | |
| 176 | 176 | ADDRESS_MAP_END |
| 177 | 177 | |
| 178 | 178 |
| r14896 | r14897 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | WRITE16_MEMBER(tumblep_state::tumblep_sound_w) |
| 72 | 72 | { |
| 73 | soundlatch_w(space, 0, data & 0xff); | |
| 73 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 74 | 74 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | #ifdef UNUSED_FUNCTION |
| 78 | 78 | WRITE16_MEMBER(tumblep_state::jumppop_sound_w) |
| 79 | 79 | { |
| 80 | soundlatch_w(space, 0, data & 0xff); | |
| 80 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 81 | 81 | cputag_set_input_line(m_audiocpu, 0, ASSERT_LINE ); |
| 82 | 82 | } |
| 83 | 83 | #endif |
| r14896 | r14897 | |
| 113 | 113 | #endif |
| 114 | 114 | AM_RANGE(0x100000, 0x100001) AM_WRITE(tumblep_sound_w) |
| 115 | 115 | AM_RANGE(0x120000, 0x123fff) AM_RAM |
| 116 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 116 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram | |
| 117 | 117 | AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepop_controls_r) |
| 118 | 118 | AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP |
| 119 | 119 | AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 133 | 133 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 134 | 134 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 135 | 135 | AM_RANGE(0x130000, 0x130001) AM_NOP /* This board only has 1 oki chip */ |
| 136 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 136 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 137 | 137 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 138 | 138 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 139 | 139 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | AM_RANGE(0x110000, 0x110001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 38 | 38 | AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 39 | 39 | AM_RANGE(0x130000, 0x130001) AM_NOP /* This board only has 1 oki chip */ |
| 40 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r) | |
| 40 | AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_byte_r) | |
| 41 | 41 | AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") |
| 42 | 42 | AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE_LEGACY(h6280_timer_w) |
| 43 | 43 | AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w) |
| r14896 | r14897 | |
|---|---|---|
| 245 | 245 | for (i=0; i<8; i++) |
| 246 | 246 | if ( changed & (1 << i) ) MechMtr_update(i, data & (1 << i) ); |
| 247 | 247 | |
| 248 | if ( data ) generic_pulse_irq_line(machine().device("maincpu"), M6809_FIRQ_LINE, 1); | |
| 248 | if ( data ) generic_pulse_irq_line(machine().device("maincpu")->execute(), M6809_FIRQ_LINE, 1); | |
| 249 | 249 | } |
| 250 | 250 | /////////////////////////////////////////////////////////////////////////// |
| 251 | 251 |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | WRITE8_MEMBER(kingofb_state::sound_command_w) |
| 41 | 41 | { |
| 42 | soundlatch_w(space, 0, data); | |
| 42 | soundlatch_byte_w(space, 0, data); | |
| 43 | 43 | device_set_input_line_and_vector(m_audio_cpu, 0, HOLD_LINE, 0xff); |
| 44 | 44 | } |
| 45 | 45 | |
| r14896 | r14897 | |
| 439 | 439 | { |
| 440 | 440 | AY8910_LEGACY_OUTPUT, |
| 441 | 441 | AY8910_DEFAULT_LOADS, |
| 442 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r) | |
| 442 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r) | |
| 443 | 443 | }; |
| 444 | 444 | |
| 445 | 445 | static INTERRUPT_GEN( kingofb_interrupt ) |
| r14896 | r14897 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | if (ACCESSING_BITS_0_7) |
| 81 | 81 | { |
| 82 | soundlatch_w(space, offset, data & 0xff); | |
| 82 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 83 | 83 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 84 | 84 | } |
| 85 | 85 | } |
| r14896 | r14897 | |
| 147 | 147 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 148 | 148 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 149 | 149 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 150 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 150 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 151 | 151 | ADDRESS_MAP_END |
| 152 | 152 | |
| 153 | 153 |
| r14896 | r14897 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | WRITE8_MEMBER(tsamurai_state::flip_screen_w) |
| 99 | 99 | { |
| 100 | flip_screen_set( | |
| 100 | flip_screen_set( | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | WRITE8_MEMBER(tsamurai_state::tsamurai_coin_counter_w) |
| r14896 | r14897 | |
| 299 | 299 | |
| 300 | 300 | WRITE8_MEMBER(tsamurai_state::vsgongf_sound_command_w) |
| 301 | 301 | { |
| 302 | soundlatch_w(space, offset, data); | |
| 302 | soundlatch_byte_w(space, offset, data); | |
| 303 | 303 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 304 | 304 | } |
| 305 | 305 | |
| r14896 | r14897 | |
| 333 | 333 | static ADDRESS_MAP_START( sound_vsgongf_map, AS_PROGRAM, 8, tsamurai_state ) |
| 334 | 334 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 335 | 335 | AM_RANGE(0x6000, 0x63ff) AM_RAM /* work RAM */ |
| 336 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) AM_WRITE(vsgongf_sound_nmi_enable_w) /* NMI enable */ | |
| 336 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) AM_WRITE(vsgongf_sound_nmi_enable_w) /* NMI enable */ | |
| 337 | 337 | AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("dac", dac_w) |
| 338 | 338 | ADDRESS_MAP_END |
| 339 | 339 |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | { |
| 36 | 36 | public: |
| 37 | 37 | ettrivia_state(const machine_config &mconfig, device_type type, const char *tag) |
| 38 | : driver_device(mconfig, type, tag) { } | |
| 38 | : driver_device(mconfig, type, tag) , | |
| 39 | m_fg_videoram(*this, "fg_videoram"), | |
| 40 | m_bg_videoram(*this, "bg_videoram"){ } | |
| 39 | 41 | |
| 40 | 42 | int m_palreg; |
| 41 | 43 | int m_gfx_bank; |
| r14896 | r14897 | |
| 43 | 45 | int m_b000_val; |
| 44 | 46 | int m_b000_ret; |
| 45 | 47 | int m_b800_prev; |
| 46 | UINT8 *m_bg_videoram; | |
| 47 | UINT8 *m_fg_videoram; | |
| 48 | required_shared_ptr<UINT8> m_fg_videoram; | |
| 49 | required_shared_ptr<UINT8> m_bg_videoram; | |
| 48 | 50 | tilemap_t *m_bg_tilemap; |
| 49 | 51 | tilemap_t *m_fg_tilemap; |
| 50 | 52 | DECLARE_WRITE8_MEMBER(ettrivia_fg_w); |
| r14896 | r14897 | |
| 59 | 61 | |
| 60 | 62 | WRITE8_MEMBER(ettrivia_state::ettrivia_fg_w) |
| 61 | 63 | { |
| 62 | m_fg_videoram[offset] = data; | |
| 64 | m_fg_videoram.target()[offset] = data; | |
| 63 | 65 | m_fg_tilemap->mark_tile_dirty(offset); |
| 64 | 66 | } |
| 65 | 67 | |
| 66 | 68 | WRITE8_MEMBER(ettrivia_state::ettrivia_bg_w) |
| 67 | 69 | { |
| 68 | m_bg_videoram[offset] = data; | |
| 70 | m_bg_videoram.target()[offset] = data; | |
| 69 | 71 | m_bg_tilemap->mark_tile_dirty(offset); |
| 70 | 72 | } |
| 71 | 73 | |
| r14896 | r14897 | |
| 80 | 82 | |
| 81 | 83 | coin_counter_w(machine(), 0, data & 0x80); |
| 82 | 84 | |
| 83 | flip_screen_set( | |
| 85 | flip_screen_set( | |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | READ8_MEMBER(ettrivia_state::ettrivia_question_r) |
| r14896 | r14897 | |
| 139 | 141 | AM_RANGE(0xa000, 0xa000) AM_WRITENOP |
| 140 | 142 | AM_RANGE(0xb000, 0xb000) AM_READ(b000_r) AM_WRITE(b000_w) |
| 141 | 143 | AM_RANGE(0xb800, 0xb800) AM_WRITE(b800_w) |
| 142 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(ettrivia_fg_w) AM_BASE(m_fg_videoram) | |
| 143 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(ettrivia_bg_w) AM_BASE(m_bg_videoram) | |
| 144 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(ettrivia_fg_w) AM_SHARE("fg_videoram") | |
| 145 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(ettrivia_bg_w) AM_SHARE("bg_videoram") | |
| 144 | 146 | ADDRESS_MAP_END |
| 145 | 147 | |
| 146 | 148 | static ADDRESS_MAP_START( io_map, AS_IO, 8, ettrivia_state ) |
| r14896 | r14897 | |
|---|---|---|
| 118 | 118 | { |
| 119 | 119 | public: |
| 120 | 120 | jalmah_state(const machine_config &mconfig, device_type type, const char *tag) |
| 121 | : driver_device(mconfig, type, tag) { } | |
| 121 | : driver_device(mconfig, type, tag) , | |
| 122 | m_sc0_vram(*this, "sc0_vram"), | |
| 123 | m_sc1_vram(*this, "sc1_vram"), | |
| 124 | m_sc2_vram(*this, "sc2_vram"), | |
| 125 | m_sc3_vram(*this, "sc3_vram"), | |
| 126 | m_jm_shared_ram(*this, "jshared_ram"), | |
| 127 | m_jm_mcu_code(*this, "jmcu_code"){ } | |
| 122 | 128 | |
| 123 | 129 | tilemap_t *m_sc0_tilemap_0; |
| 124 | 130 | tilemap_t *m_sc0_tilemap_1; |
| r14896 | r14897 | |
| 135 | 141 | tilemap_t *m_sc3_tilemap_0; |
| 136 | 142 | tilemap_t *m_sc3_tilemap_2; |
| 137 | 143 | tilemap_t *m_sc3_tilemap_3; |
| 138 | UINT16 *m_sc0_vram; | |
| 139 | UINT16 *m_sc1_vram; | |
| 140 | UINT16 *m_sc2_vram; | |
| 141 | UINT16 *m_sc3_vram; | |
| 144 | required_shared_ptr<UINT16> m_sc0_vram; | |
| 145 | required_shared_ptr<UINT16> m_sc1_vram; | |
| 146 | required_shared_ptr<UINT16> m_sc2_vram; | |
| 147 | required_shared_ptr<UINT16> m_sc3_vram; | |
| 142 | 148 | UINT16 *m_jm_scrollram; |
| 143 | 149 | UINT16 *m_jm_vregs; |
| 144 | 150 | UINT16 m_sc0bank; |
| r14896 | r14897 | |
| 147 | 153 | UINT8 m_sc1_prin; |
| 148 | 154 | UINT8 m_sc2_prin; |
| 149 | 155 | UINT8 m_sc3_prin; |
| 150 | UINT16 *m_jm_shared_ram; | |
| 151 | UINT16 *m_jm_mcu_code; | |
| 156 | required_shared_ptr<UINT16> m_jm_shared_ram; | |
| 157 | required_shared_ptr<UINT16> m_jm_mcu_code; | |
| 152 | 158 | UINT8 m_mcu_prg; |
| 153 | 159 | int m_respcount; |
| 154 | 160 | UINT8 m_test_mode; |
| r14896 | r14897 | |
| 233 | 239 | static TILE_GET_INFO( get_sc0_tile_info ) |
| 234 | 240 | { |
| 235 | 241 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 236 | int code = state->m_sc0_vram[tile_index]; | |
| 242 | int code = state->m_sc0_vram.target()[tile_index]; | |
| 237 | 243 | SET_TILE_INFO( |
| 238 | 244 | 3, |
| 239 | 245 | (code & 0xfff) + ((state->m_sc0bank & 3) << 12), |
| r14896 | r14897 | |
| 244 | 250 | static TILE_GET_INFO( get_sc1_tile_info ) |
| 245 | 251 | { |
| 246 | 252 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 247 | int code = state->m_sc1_vram[tile_index]; | |
| 253 | int code = state->m_sc1_vram.target()[tile_index]; | |
| 248 | 254 | SET_TILE_INFO( |
| 249 | 255 | 2, |
| 250 | 256 | code & 0xfff, |
| r14896 | r14897 | |
| 255 | 261 | static TILE_GET_INFO( get_sc2_tile_info ) |
| 256 | 262 | { |
| 257 | 263 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 258 | int code = state->m_sc2_vram[tile_index]; | |
| 264 | int code = state->m_sc2_vram.target()[tile_index]; | |
| 259 | 265 | SET_TILE_INFO( |
| 260 | 266 | 1, |
| 261 | 267 | code & 0xfff, |
| r14896 | r14897 | |
| 266 | 272 | static TILE_GET_INFO( get_sc3_tile_info ) |
| 267 | 273 | { |
| 268 | 274 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 269 | int code = state->m_sc3_vram[tile_index]; | |
| 275 | int code = state->m_sc3_vram.target()[tile_index]; | |
| 270 | 276 | SET_TILE_INFO( |
| 271 | 277 | 0, |
| 272 | 278 | code & 0xfff, |
| r14896 | r14897 | |
| 496 | 502 | |
| 497 | 503 | WRITE16_MEMBER(jalmah_state::sc0_vram_w) |
| 498 | 504 | { |
| 499 | COMBINE_DATA(&m_sc0_vram[offset]); | |
| 505 | COMBINE_DATA(&m_sc0_vram.target()[offset]); | |
| 500 | 506 | /*2048x256 tilemap*/ |
| 501 | 507 | m_sc0_tilemap_0->mark_tile_dirty(offset); |
| 502 | 508 | /*1024x512 tilemap*/ |
| r14896 | r14897 | |
| 509 | 515 | |
| 510 | 516 | WRITE16_MEMBER(jalmah_state::sc3_vram_w) |
| 511 | 517 | { |
| 512 | COMBINE_DATA(&m_sc3_vram[offset]); | |
| 518 | COMBINE_DATA(&m_sc3_vram.target()[offset]); | |
| 513 | 519 | /*2048x256 tilemap*/ |
| 514 | 520 | m_sc3_tilemap_0->mark_tile_dirty(offset); |
| 515 | 521 | /*1024x512 tilemap*/ |
| r14896 | r14897 | |
| 520 | 526 | |
| 521 | 527 | WRITE16_MEMBER(jalmah_state::sc1_vram_w) |
| 522 | 528 | { |
| 523 | COMBINE_DATA(&m_sc1_vram[offset]); | |
| 529 | COMBINE_DATA(&m_sc1_vram.target()[offset]); | |
| 524 | 530 | /*2048x256 tilemap*/ |
| 525 | 531 | m_sc1_tilemap_0->mark_tile_dirty(offset); |
| 526 | 532 | /*1024x512 tilemap*/ |
| r14896 | r14897 | |
| 533 | 539 | |
| 534 | 540 | WRITE16_MEMBER(jalmah_state::sc2_vram_w) |
| 535 | 541 | { |
| 536 | COMBINE_DATA(&m_sc2_vram[offset]); | |
| 542 | COMBINE_DATA(&m_sc2_vram.target()[offset]); | |
| 537 | 543 | /*2048x256 tilemap*/ |
| 538 | 544 | m_sc2_tilemap_0->mark_tile_dirty(offset); |
| 539 | 545 | /*1024x512 tilemap*/ |
| r14896 | r14897 | |
| 611 | 617 | |
| 612 | 618 | WRITE16_MEMBER(jalmah_state::urashima_sc0_vram_w) |
| 613 | 619 | { |
| 614 | COMBINE_DATA(&m_sc0_vram[offset]); | |
| 620 | COMBINE_DATA(&m_sc0_vram.target()[offset]); | |
| 615 | 621 | m_sc0_tilemap_0->mark_tile_dirty(offset); |
| 616 | 622 | } |
| 617 | 623 | |
| 618 | 624 | WRITE16_MEMBER(jalmah_state::urashima_sc3_vram_w) |
| 619 | 625 | { |
| 620 | COMBINE_DATA(&m_sc3_vram[offset]); | |
| 626 | COMBINE_DATA(&m_sc3_vram.target()[offset]); | |
| 621 | 627 | m_sc3_tilemap_0->mark_tile_dirty(offset); |
| 622 | 628 | } |
| 623 | 629 | |
| r14896 | r14897 | |
| 733 | 739 | static void daireika_mcu_run(running_machine &machine) |
| 734 | 740 | { |
| 735 | 741 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 736 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; | |
| 742 | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); | |
| 737 | 743 | |
| 738 | 744 | if(((jm_shared_ram[0x550/2] & 0xf00) == 0x700) && ((jm_shared_ram[0x540/2] & 0xf00) != state->m_dma_old)) |
| 739 | 745 | { |
| r14896 | r14897 | |
| 783 | 789 | static void mjzoomin_mcu_run(running_machine &machine) |
| 784 | 790 | { |
| 785 | 791 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 786 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; | |
| 792 | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); | |
| 787 | 793 | |
| 788 | 794 | if(state->m_test_mode) //service_mode |
| 789 | 795 | { |
| r14896 | r14897 | |
| 828 | 834 | static void urashima_mcu_run(running_machine &machine) |
| 829 | 835 | { |
| 830 | 836 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 831 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; | |
| 837 | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); | |
| 832 | 838 | |
| 833 | 839 | if(state->m_test_mode) //service_mode |
| 834 | 840 | { |
| r14896 | r14897 | |
| 873 | 879 | static void second_mcu_run(running_machine &machine) |
| 874 | 880 | { |
| 875 | 881 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 876 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; | |
| 882 | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); | |
| 877 | 883 | if(state->m_test_mode) //service_mode |
| 878 | 884 | { |
| 879 | 885 | jm_shared_ram[0x200/2] = input_port_read(machine, "KEY0"); |
| r14896 | r14897 | |
| 974 | 980 | WRITE16_MEMBER(jalmah_state::jalmah_flip_screen_w) |
| 975 | 981 | { |
| 976 | 982 | /*---- ----x flip screen*/ |
| 977 | flip_screen_set( | |
| 983 | flip_screen_set( | |
| 978 | 984 | |
| 979 | 985 | // popmessage("%04x",data); |
| 980 | 986 | } |
| r14896 | r14897 | |
| 993 | 999 | /**/AM_RANGE(0x080020, 0x08003f) AM_RAM_WRITE(jalmah_scroll_w) |
| 994 | 1000 | AM_RANGE(0x080040, 0x080041) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 995 | 1001 | // 0x084000, 0x084001 ? |
| 996 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") /* Palette RAM */ | |
| 997 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(m_sc0_vram) | |
| 998 | AM_RANGE(0x094000, 0x097fff) AM_RAM_WRITE(sc1_vram_w) AM_BASE(m_sc1_vram) | |
| 999 | AM_RANGE(0x098000, 0x09bfff) AM_RAM_WRITE(sc2_vram_w) AM_BASE(m_sc2_vram) | |
| 1000 | AM_RANGE(0x09c000, 0x09ffff) AM_RAM_WRITE(sc3_vram_w) AM_BASE(m_sc3_vram) | |
| 1001 | AM_RANGE(0x0f0000, 0x0f0fff) AM_RAM AM_BASE(m_jm_shared_ram)/*shared with MCU*/ | |
| 1002 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") /* Palette RAM */ | |
| 1003 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(sc0_vram_w) AM_SHARE("sc0_vram") | |
| 1004 | AM_RANGE(0x094000, 0x097fff) AM_RAM_WRITE(sc1_vram_w) AM_SHARE("sc1_vram") | |
| 1005 | AM_RANGE(0x098000, 0x09bfff) AM_RAM_WRITE(sc2_vram_w) AM_SHARE("sc2_vram") | |
| 1006 | AM_RANGE(0x09c000, 0x09ffff) AM_RAM_WRITE(sc3_vram_w) AM_SHARE("sc3_vram") | |
| 1007 | AM_RANGE(0x0f0000, 0x0f0fff) AM_RAM AM_SHARE("jshared_ram")/*shared with MCU*/ | |
| 1002 | 1008 | AM_RANGE(0x0f1000, 0x0fffff) AM_RAM /*Work Ram*/ |
| 1003 | AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_ | |
| 1009 | AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_ | |
| 1004 | 1010 | ADDRESS_MAP_END |
| 1005 | 1011 | |
| 1006 | 1012 | static ADDRESS_MAP_START( urashima, AS_PROGRAM, 16, jalmah_state ) |
| r14896 | r14897 | |
| 1017 | 1023 | /**/AM_RANGE(0x08001c, 0x08001d) AM_RAM_WRITE(urashima_bank_w) |
| 1018 | 1024 | AM_RANGE(0x080040, 0x080041) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 1019 | 1025 | // 0x084000, 0x084001 ? |
| 1020 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") /* Palette RAM */ | |
| 1021 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(urashima_sc0_vram_w) AM_BASE(m_sc0_vram) | |
| 1026 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") /* Palette RAM */ | |
| 1027 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(urashima_sc0_vram_w) AM_SHARE("sc0_vram") | |
| 1022 | 1028 | AM_RANGE(0x094000, 0x097fff) AM_RAM_WRITE(urashima_sc0_vram_w) |
| 1023 | 1029 | AM_RANGE(0x098000, 0x09bfff) AM_RAM_WRITE(urashima_sc0_vram_w) |
| 1024 | // AM_RANGE(0x094000, 0x097fff) AM_RAM_WRITE_LEGACY(urashima_sc1_vram_w) AM_BASE(m_sc1_vram)/*unused*/ | |
| 1025 | // AM_RANGE(0x098000, 0x09bfff) AM_RAM_WRITE_LEGACY(urashima_sc2_vram_w) AM_BASE(m_sc2_vram)/*unused*/ | |
| 1030 | // AM_RANGE(0x094000, 0x097fff) AM_RAM_WRITE_LEGACY(urashima_sc1_vram_w) AM_SHARE("sc1_vram")/*unused*/ | |
| 1031 | // AM_RANGE(0x098000, 0x09bfff) AM_RAM_WRITE_LEGACY(urashima_sc2_vram_w) AM_SHARE("sc2_vram")/*unused*/ | |
| 1026 | 1032 | /*$9c000-$9cfff Video Registers*/ |
| 1027 | 1033 | /**/AM_RANGE(0x09c000, 0x09dfff) AM_WRITE(urashima_vregs_w) |
| 1028 | 1034 | /**///AM_RANGE(0x09c480, 0x09c49f) AM_RAM_WRITE_LEGACY(urashima_sc2vregs_w) |
| 1029 | AM_RANGE(0x09e000, 0x0a1fff) AM_RAM_WRITE(urashima_sc3_vram_w) AM_BASE(m_sc3_vram) | |
| 1030 | AM_RANGE(0x0f0000, 0x0f0fff) AM_RAM AM_BASE(m_jm_shared_ram)/*shared with MCU*/ | |
| 1035 | AM_RANGE(0x09e000, 0x0a1fff) AM_RAM_WRITE(urashima_sc3_vram_w) AM_SHARE("sc3_vram") | |
| 1036 | AM_RANGE(0x0f0000, 0x0f0fff) AM_RAM AM_SHARE("jshared_ram")/*shared with MCU*/ | |
| 1031 | 1037 | AM_RANGE(0x0f1000, 0x0fffff) AM_RAM /*Work Ram*/ |
| 1032 | AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_ | |
| 1038 | AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_ | |
| 1033 | 1039 | ADDRESS_MAP_END |
| 1034 | 1040 | |
| 1035 | 1041 | static INPUT_PORTS_START( common ) |
| r14896 | r14897 | |
| 1753 | 1759 | */ |
| 1754 | 1760 | WRITE16_MEMBER(jalmah_state::urashima_mcu_w) |
| 1755 | 1761 | { |
| 1756 | UINT16 *jm_shared_ram = m_jm_shared_ram; | |
| 1757 | UINT16 *jm_mcu_code = m_jm_mcu_code; | |
| 1762 | UINT16 *jm_shared_ram = m_jm_shared_ram.target(); | |
| 1763 | UINT16 *jm_mcu_code = m_jm_mcu_code.target(); | |
| 1758 | 1764 | if(ACCESSING_BITS_0_7 && data) |
| 1759 | 1765 | { |
| 1760 | 1766 | /******************************************************* |
| r14896 | r14897 | |
| 1974 | 1980 | |
| 1975 | 1981 | WRITE16_MEMBER(jalmah_state::daireika_mcu_w) |
| 1976 | 1982 | { |
| 1977 | UINT16 *jm_shared_ram = m_jm_shared_ram; | |
| 1978 | UINT16 *jm_mcu_code = m_jm_mcu_code; | |
| 1983 | UINT16 *jm_shared_ram = m_jm_shared_ram.target(); | |
| 1984 | UINT16 *jm_mcu_code = m_jm_mcu_code.target(); | |
| 1979 | 1985 | UINT16 i; |
| 1980 | 1986 | |
| 1981 | 1987 | if(ACCESSING_BITS_0_7 && data) |
| r14896 | r14897 | |
| 2250 | 2256 | */ |
| 2251 | 2257 | WRITE16_MEMBER(jalmah_state::mjzoomin_mcu_w) |
| 2252 | 2258 | { |
| 2253 | UINT16 *jm_shared_ram = m_jm_shared_ram; | |
| 2254 | UINT16 *jm_mcu_code = m_jm_mcu_code; | |
| 2259 | UINT16 *jm_shared_ram = m_jm_shared_ram.target(); | |
| 2260 | UINT16 *jm_mcu_code = m_jm_mcu_code.target(); | |
| 2255 | 2261 | if(ACCESSING_BITS_0_7 && data) |
| 2256 | 2262 | { |
| 2257 | 2263 | /****************************************************** |
| r14896 | r14897 | |
|---|---|---|
| 71 | 71 | if (ACCESSING_BITS_0_7) |
| 72 | 72 | { |
| 73 | 73 | m_pending_command = 1; |
| 74 | soundlatch_w(space, offset, data & 0xff); | |
| 74 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 75 | 75 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 76 | 76 | } |
| 77 | 77 | } |
| r14896 | r14897 | |
| 103 | 103 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM // WORK RAM-1 |
| 104 | 104 | AM_RANGE(0xffc000, 0xffcfff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(m_sharedram) // DUAL RAM |
| 105 | 105 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(f1gp_fgvideoram_w) AM_BASE(m_fgvideoram) // CHARACTER |
| 106 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 106 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 107 | 107 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("INPUTS") |
| 108 | 108 | AM_RANGE(0xfff000, 0xfff001) AM_WRITE(f1gp_gfxctrl_w) |
| 109 | 109 | // AM_RANGE(0xfff002, 0xfff003) analog wheel? |
| r14896 | r14897 | |
| 125 | 125 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM // WORK RAM-1 |
| 126 | 126 | AM_RANGE(0xffc000, 0xffcfff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(m_sharedram) // DUAL RAM |
| 127 | 127 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(f1gp_fgvideoram_w) AM_BASE(m_fgvideoram) // CHARACTER |
| 128 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 128 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 129 | 129 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("INPUTS") AM_WRITE(f1gp2_gfxctrl_w) |
| 130 | 130 | // AM_RANGE(0xfff002, 0xfff003) analog wheel? |
| 131 | 131 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 152 | 152 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 153 | 153 | AM_RANGE(0x00, 0x00) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp |
| 154 | 154 | AM_RANGE(0x0c, 0x0c) AM_WRITE(f1gp_sh_bankswitch_w) // f1gp2 |
| 155 | AM_RANGE(0x14, 0x14) AM_READ(soundlatch_r) AM_WRITE(pending_command_clear_w) | |
| 155 | AM_RANGE(0x14, 0x14) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w) | |
| 156 | 156 | AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 157 | 157 | ADDRESS_MAP_END |
| 158 | 158 | |
| r14896 | r14897 | |
| 198 | 198 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM |
| 199 | 199 | AM_RANGE(0xffc000, 0xffcfff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(m_sharedram) |
| 200 | 200 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(f1gp_fgvideoram_w) AM_BASE(m_fgvideoram) |
| 201 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 201 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 202 | 202 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("INPUTS") |
| 203 | 203 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW1") |
| 204 | 204 | AM_RANGE(0xfff006, 0xfff007) AM_READ_PORT("DSW2") |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | { |
| 70 | 70 | public: |
| 71 | 71 | supdrapo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 72 | : driver_device(mconfig, type, tag) { } | |
| 72 | : driver_device(mconfig, type, tag) , | |
| 73 | m_col_line(*this, "col_line"), | |
| 74 | m_videoram(*this, "videoram"), | |
| 75 | m_char_bank(*this, "char_bank"){ } | |
| 73 | 76 | |
| 74 | UINT8 *m_char_bank; | |
| 75 | UINT8 *m_col_line; | |
| 76 | UINT8 *m_videoram; | |
| 77 | required_shared_ptr<UINT8> m_col_line; | |
| 78 | required_shared_ptr<UINT8> m_videoram; | |
| 79 | required_shared_ptr<UINT8> m_char_bank; | |
| 77 | 80 | UINT8 m_wdog; |
| 78 | 81 | DECLARE_READ8_MEMBER(sdpoker_rng_r); |
| 79 | 82 | DECLARE_WRITE8_MEMBER(wdog8000_w); |
| r14896 | r14897 | |
| 106 | 109 | { |
| 107 | 110 | for(x = 0; x < 32; x++) |
| 108 | 111 | { |
| 109 | int tile = state->m_videoram[count] + state->m_char_bank[count] * 0x100; | |
| 112 | int tile = state->m_videoram.target()[count] + state->m_char_bank.target()[count] * 0x100; | |
| 110 | 113 | /* Global Column Coloring, GUESS! */ |
| 111 | color = state->m_col_line[(x*2) + 1] ? (state->m_col_line[(x*2) + 1] - 1) & 7 : 0; | |
| 114 | color = state->m_col_line.target()[(x*2) + 1] ? (state->m_col_line.target()[(x*2) + 1] - 1) & 7 : 0; | |
| 112 | 115 | |
| 113 | 116 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile,color, 0, 0, x*8, y*8); |
| 114 | 117 | |
| r14896 | r14897 | |
| 251 | 254 | AM_RANGE(0x0000, 0x4fff) AM_ROM |
| 252 | 255 | AM_RANGE(0x5000, 0x50ff) AM_RAM AM_SHARE("share1") |
| 253 | 256 | AM_RANGE(0x57ff, 0x57ff) AM_RAM AM_SHARE("share1") |
| 254 | AM_RANGE(0x5800, 0x58ff) AM_RAM AM_SHARE("share1") AM_ | |
| 257 | AM_RANGE(0x5800, 0x58ff) AM_RAM AM_SHARE("share1") AM_ | |
| 255 | 258 | AM_RANGE(0x6000, 0x67ff) AM_RAM //work ram |
| 256 | AM_RANGE(0x6800, 0x6bff) AM_RAM AM_BASE(m_videoram) | |
| 257 | AM_RANGE(0x6c00, 0x6fff) AM_RAM AM_BASE(m_char_bank) | |
| 259 | AM_RANGE(0x6800, 0x6bff) AM_RAM AM_SHARE("videoram") | |
| 260 | AM_RANGE(0x6c00, 0x6fff) AM_RAM AM_SHARE("char_bank") | |
| 258 | 261 | AM_RANGE(0x7000, 0x7bff) AM_RAM //$7600 seems watchdog |
| 259 | 262 | AM_RANGE(0x7c00, 0x7c00) AM_WRITE(debug7c00_w) |
| 260 | 263 | AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN4") AM_WRITE(wdog8000_w) |
| r14896 | r14897 | |
|---|---|---|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | flip_screen_set( | |
| 62 | flip_screen_set( | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | WRITE8_MEMBER(exzisus_state::exzisus_cpub_bankswitch_w) |
| r14896 | r14897 | |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | flip_screen_set( | |
| 78 | flip_screen_set( | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | WRITE8_MEMBER(exzisus_state::exzisus_coincounter_w) |
| r14896 | r14897 | |
| 137 | 137 | static ADDRESS_MAP_START( cpua_map, AS_PROGRAM, 8, exzisus_state ) |
| 138 | 138 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 139 | 139 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") |
| 140 | AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_1_r, exzisus_objectram_1_w) AM_BASE(m_objectram1 | |
| 140 | AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_1_r, exzisus_objectram_1_w) AM_BASE_SIZE(m_objectram1, | |
| 141 | 141 | AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_1_r, exzisus_videoram_1_w) AM_BASE(m_videoram1) |
| 142 | 142 | AM_RANGE(0xe000, 0xefff) AM_READWRITE(exzisus_sharedram_ac_r, exzisus_sharedram_ac_w) AM_BASE(m_sharedram_ac) |
| 143 | 143 | AM_RANGE(0xf400, 0xf400) AM_WRITE(exzisus_cpua_bankswitch_w) |
| r14896 | r14897 | |
| 148 | 148 | static ADDRESS_MAP_START( cpub_map, AS_PROGRAM, 8, exzisus_state ) |
| 149 | 149 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 150 | 150 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 151 | AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_0_r, exzisus_objectram_0_w) AM_BASE(m_objectram0 | |
| 151 | AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_0_r, exzisus_objectram_0_w) AM_BASE_SIZE(m_objectram0, | |
| 152 | 152 | AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_0_r, exzisus_videoram_0_w) AM_BASE(m_videoram0) |
| 153 | 153 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 154 | 154 | AM_RANGE(0xf000, 0xf000) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_port_w) |
| r14896 | r14897 | |
|---|---|---|
| 59 | 59 | *************************************/ |
| 60 | 60 | |
| 61 | 61 | /* Main CPU and Z80 synchronisation */ |
| 62 | ||
| 62 | ||
| 63 | 63 | { |
| 64 | cputag_set_input_line( | |
| 64 | cputag_set_input_line( | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | ||
| 67 | ||
| 68 | 68 | { |
| 69 | cputag_set_input_line( | |
| 69 | cputag_set_input_line( | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | ||
| 72 | ||
| 73 | 73 | { |
| 74 | cputag_set_input_line( | |
| 74 | cputag_set_input_line( | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /* Z80 can trigger its own interrupts */ |
| 78 | ||
| 78 | ||
| 79 | 79 | { |
| 80 | cputag_set_input_line( | |
| 80 | cputag_set_input_line( | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /* Periodic Z80 interrupt */ |
| r14896 | r14897 | |
| 86 | 86 | device_set_input_line(device, 0, HOLD_LINE); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | ||
| 89 | ||
| 90 | 90 | { |
| 91 | address_space *cpu2space = | |
| 91 | address_space *cpu2space = | |
| 92 | 92 | return cpu2space->read_byte(offset); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | ||
| 95 | ||
| 96 | 96 | { |
| 97 | address_space *cpu2space = | |
| 97 | address_space *cpu2space = | |
| 98 | 98 | cpu2space->write_byte(offset, data & 0xff); |
| 99 | 99 | } |
| 100 | 100 | |
| r14896 | r14897 | |
| 379 | 379 | PORT_BIT( 0x1f, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) |
| 380 | 380 | INPUT_PORTS_END |
| 381 | 381 | |
| 382 | ||
| 382 | ||
| 383 | 383 | { |
| 384 | tx1_state *state = space->machine().driver_data<tx1_state>(); | |
| 385 | return (input_port_read(space->machine(), "DSW") & 0xfffe) | state->m_ts; | |
| 384 | return (input_port_read(machine(), "DSW") & 0xfffe) | m_ts; | |
| 386 | 385 | } |
| 387 | 386 | |
| 388 | 387 | /* |
| 389 | 388 | (TODO) TS: Connected in place of dipswitch A bit 0 |
| 390 | 389 | Accessed on startup as some sort of acknowledgement |
| 391 | 390 | */ |
| 392 | ||
| 391 | ||
| 393 | 392 | { |
| 394 | tx1_state *state = space->machine().driver_data<tx1_state>(); | |
| 395 | 393 | // TS = 1; |
| 396 | | |
| 394 | | |
| 397 | 395 | } |
| 398 | 396 | |
| 399 | ||
| 397 | ||
| 400 | 398 | { |
| 401 | tx1_state *state = space->machine().driver_data<tx1_state>(); | |
| 402 | 399 | // TS = 1; |
| 403 | return | |
| 400 | return | |
| 404 | 401 | } |
| 405 | 402 | |
| 406 | 403 | |
| r14896 | r14897 | |
| 418 | 415 | // coin_counter_w(device->machine(), 2, data & 0x04); |
| 419 | 416 | } |
| 420 | 417 | |
| 421 | ||
| 418 | ||
| 422 | 419 | { |
| 423 | tx1_state *state = space->machine().driver_data<tx1_state>(); | |
| 424 | state->m_ppi_latch_a = ((input_port_read(space->machine(), "AN_BRAKE") & 0xf) << 4) | (input_port_read(space->machine(), "AN_ACCELERATOR") & 0xf); | |
| 425 | state->m_ppi_latch_b = input_port_read(space->machine(), "AN_STEERING"); | |
| 420 | m_ppi_latch_a = ((input_port_read(machine(), "AN_BRAKE") & 0xf) << 4) | (input_port_read(machine(), "AN_ACCELERATOR") & 0xf); | |
| 421 | m_ppi_latch_b = input_port_read(machine(), "AN_STEERING"); | |
| 426 | 422 | } |
| 427 | 423 | |
| 428 | 424 | static READ8_DEVICE_HANDLER( tx1_ppi_porta_r ) |
| r14896 | r14897 | |
| 447 | 443 | return val; |
| 448 | 444 | } |
| 449 | 445 | |
| 450 | ||
| 446 | ||
| 451 | 447 | { |
| 452 | 448 | if (offset == 0) |
| 453 | return bit_reverse8(((input_port_read( | |
| 449 | return bit_reverse8(((input_port_read( | |
| 454 | 450 | else |
| 455 | return bit_reverse8((input_port_read( | |
| 451 | return bit_reverse8((input_port_read( | |
| 456 | 452 | } |
| 457 | 453 | |
| 458 | ||
| 454 | ||
| 459 | 455 | { |
| 460 | 456 | if (offset == 0) |
| 461 | return ((input_port_read( | |
| 457 | return ((input_port_read( | |
| 462 | 458 | else |
| 463 | return (input_port_read( | |
| 459 | return (input_port_read( | |
| 464 | 460 | } |
| 465 | 461 | |
| 466 | 462 | |
| r14896 | r14897 | |
| 506 | 502 | AM_RANGE(0x06000, 0x06fff) AM_READWRITE(tx1_crtc_r, tx1_crtc_w) |
| 507 | 503 | AM_RANGE(0x08000, 0x09fff) AM_RAM AM_BASE(m_vram) |
| 508 | 504 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("share1") AM_BASE(m_rcram) |
| 509 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE | |
| 505 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE | |
| 510 | 506 | AM_RANGE(0x0c000, 0x0c001) AM_WRITE(tx1_scolst_w) |
| 511 | 507 | AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w) |
| 512 | 508 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(tx1_slock_w) |
| 513 | AM_RANGE(0x0f000, 0x0f001) AM_READ(watchdog_reset16_r) AM_WRITE_LEGACY(resume_math_w) | |
| 514 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE_LEGACY(z80_shared_r, z80_shared_w) | |
| 509 | AM_RANGE(0x0f000, 0x0f001) AM_READ(watchdog_reset16_r) AM_WRITE(resume_math_w) | |
| 510 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(z80_shared_r, z80_shared_w) | |
| 515 | 511 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 516 | 512 | ADDRESS_MAP_END |
| 517 | 513 | |
| r14896 | r14897 | |
| 521 | 517 | AM_RANGE(0x01000, 0x01fff) AM_RAM AM_SHARE("share1") |
| 522 | 518 | AM_RANGE(0x02000, 0x022ff) AM_RAM AM_BASE(m_objram) |
| 523 | 519 | AM_RANGE(0x02400, 0x027ff) AM_WRITE(tx1_bankcs_w) |
| 524 | AM_RANGE(0x02800, 0x02bff) AM_WRITE | |
| 520 | AM_RANGE(0x02800, 0x02bff) AM_WRITE | |
| 525 | 521 | AM_RANGE(0x02C00, 0x02fff) AM_WRITE(tx1_flgcs_w) |
| 526 | 522 | AM_RANGE(0x03000, 0x03fff) AM_READWRITE(tx1_math_r, tx1_math_w) |
| 527 | 523 | AM_RANGE(0x05000, 0x07fff) AM_READ(tx1_spcs_rom_r) |
| r14896 | r14897 | |
| 533 | 529 | static ADDRESS_MAP_START( tx1_sound_prg, AS_PROGRAM, 8, tx1_state ) |
| 534 | 530 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 535 | 531 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_MIRROR(0x800) AM_BASE(m_z80_ram) |
| 536 | AM_RANGE(0x4000, 0x4000) AM_WRITE | |
| 532 | AM_RANGE(0x4000, 0x4000) AM_WRITE | |
| 537 | 533 | AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE_LEGACY("ppi8255", ppi8255_r, ppi8255_w) |
| 538 | 534 | AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE_LEGACY("tx1", tx1_pit8253_r, tx1_pit8253_w) |
| 539 | AM_RANGE(0x7000, 0x7fff) AM_WRITE_LEGACY(tx1_ppi_latch_w) | |
| 540 | AM_RANGE(0xb000, 0xbfff) AM_READWRITE_LEGACY(ts_r, ts_w) | |
| 535 | AM_RANGE(0x7000, 0x7fff) AM_WRITE(tx1_ppi_latch_w) | |
| 536 | AM_RANGE(0xb000, 0xbfff) AM_READWRITE(ts_r, ts_w) | |
| 541 | 537 | ADDRESS_MAP_END |
| 542 | 538 | |
| 543 | 539 | static ADDRESS_MAP_START( tx1_sound_io, AS_IO, 8, tx1_state ) |
| r14896 | r14897 | |
| 557 | 553 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(tx1_crtc_r, tx1_crtc_w) |
| 558 | 554 | AM_RANGE(0x08000, 0x09fff) AM_RAM AM_BASE(m_vram) |
| 559 | 555 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("share1") AM_BASE(m_rcram) |
| 560 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE | |
| 556 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE | |
| 561 | 557 | AM_RANGE(0x0c000, 0x0c001) AM_WRITE(buggyboy_scolst_w) |
| 562 | 558 | AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w) |
| 563 | 559 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(buggyboy_sky_w) |
| 564 | AM_RANGE(0x0f000, 0x0f003) AM_READ(watchdog_reset16_r) AM_WRITE_LEGACY(resume_math_w) | |
| 565 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE_LEGACY(z80_shared_r, z80_shared_w) | |
| 560 | AM_RANGE(0x0f000, 0x0f003) AM_READ(watchdog_reset16_r) AM_WRITE(resume_math_w) | |
| 561 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(z80_shared_r, z80_shared_w) | |
| 566 | 562 | AM_RANGE(0x20000, 0x2ffff) AM_ROM |
| 567 | 563 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 568 | 564 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 572 | 568 | AM_RANGE(0x04000, 0x04fff) AM_READWRITE(tx1_crtc_r, tx1_crtc_w) |
| 573 | 569 | AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE(m_vram) |
| 574 | 570 | AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("share1") AM_BASE(m_rcram) |
| 575 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE | |
| 571 | AM_RANGE(0x0b000, 0x0b001) AM_READWRITE | |
| 576 | 572 | AM_RANGE(0x0c000, 0x0c001) AM_WRITE(buggyboy_scolst_w) |
| 577 | 573 | AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w) |
| 578 | 574 | AM_RANGE(0x0e000, 0x0e001) AM_WRITE(buggyboy_sky_w) |
| 579 | AM_RANGE(0x0f000, 0x0f003) AM_READ(watchdog_reset16_r) AM_WRITE_LEGACY(resume_math_w) | |
| 580 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE_LEGACY(z80_shared_r, z80_shared_w) | |
| 575 | AM_RANGE(0x0f000, 0x0f003) AM_READ(watchdog_reset16_r) AM_WRITE(resume_math_w) | |
| 576 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(z80_shared_r, z80_shared_w) | |
| 581 | 577 | AM_RANGE(0x20000, 0x2ffff) AM_ROM |
| 582 | 578 | AM_RANGE(0xf0000, 0xfffff) AM_ROM |
| 583 | 579 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 600 | 596 | static ADDRESS_MAP_START( buggyboy_sound_prg, AS_PROGRAM, 8, tx1_state ) |
| 601 | 597 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 602 | 598 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(m_z80_ram) |
| 603 | AM_RANGE(0x6000, 0x6001) AM_READ | |
| 599 | AM_RANGE(0x6000, 0x6001) AM_READ | |
| 604 | 600 | AM_RANGE(0x6800, 0x6803) AM_DEVREADWRITE_LEGACY("ppi8255", ppi8255_r, ppi8255_w) |
| 605 | 601 | AM_RANGE(0x7000, 0x7003) AM_DEVREADWRITE_LEGACY("buggyboy", tx1_pit8253_r, tx1_pit8253_w) |
| 606 | AM_RANGE(0x7800, 0x7800) AM_WRITE_LEGACY(z80_intreq_w) | |
| 607 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE_LEGACY(ts_r, ts_w) | |
| 602 | AM_RANGE(0x7800, 0x7800) AM_WRITE(z80_intreq_w) | |
| 603 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(ts_r, ts_w) | |
| 608 | 604 | ADDRESS_MAP_END |
| 609 | 605 | |
| 610 | 606 | /* Buggy Boy Jr Sound PCB TC043 */ |
| r14896 | r14897 | |
| 612 | 608 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 613 | 609 | AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(m_z80_ram) |
| 614 | 610 | AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE_LEGACY("buggyboy", tx1_pit8253_r, tx1_pit8253_w) |
| 615 | AM_RANGE(0x6000, 0x6001) AM_READ_LEGACY(bbjr_analog_r) | |
| 616 | AM_RANGE(0x7000, 0x7000) AM_WRITE_LEGACY(z80_intreq_w) | |
| 617 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE_LEGACY(ts_r, ts_w) | |
| 611 | AM_RANGE(0x6000, 0x6001) AM_READ(bbjr_analog_r) | |
| 612 | AM_RANGE(0x7000, 0x7000) AM_WRITE(z80_intreq_w) | |
| 613 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(ts_r, ts_w) | |
| 618 | 614 | ADDRESS_MAP_END |
| 619 | 615 | |
| 620 | 616 | /* Common */ |
| r14896 | r14897 | |
|---|---|---|
| 58 | 58 | { |
| 59 | 59 | public: |
| 60 | 60 | merit_state(const machine_config &mconfig, device_type type, const char *tag) |
| 61 | : driver_device(mconfig, type, tag) { } | |
| 61 | : driver_device(mconfig, type, tag) , | |
| 62 | m_ram_attr(*this, "raattr"), | |
| 63 | m_ram_video(*this, "ravideo"), | |
| 64 | m_backup_ram(*this, "backup_ram"){ } | |
| 62 | 65 | |
| 63 | 66 | void dodge_nvram_init(nvram_device &nvram, void *base, size_t size); |
| 64 | 67 | pen_t m_pens[NUM_PENS]; |
| 65 | UINT8 *m_ram_attr; | |
| 66 | UINT8 *m_ram_video; | |
| 68 | required_shared_ptr<UINT8> m_ram_attr; | |
| 69 | required_shared_ptr<UINT8> m_ram_video; | |
| 67 | 70 | UINT8 *m_ram_palette; |
| 68 | 71 | UINT8 m_lscnblk; |
| 69 | 72 | int m_extra_video_bank_bit; |
| 70 | 73 | int m_question_address; |
| 71 | 74 | int m_decryption_key; |
| 72 | UINT8 | |
| 75 | required_shared_ptr<UINT8> | |
| 73 | 76 | DECLARE_READ8_MEMBER(questions_r); |
| 74 | 77 | DECLARE_WRITE8_MEMBER(low_offset_w); |
| 75 | 78 | DECLARE_WRITE8_MEMBER(med_offset_w); |
| r14896 | r14897 | |
| 171 | 174 | { |
| 172 | 175 | int co; |
| 173 | 176 | |
| 174 | co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 177 | co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 175 | 178 | return m_ram_palette[co]; |
| 176 | 179 | } |
| 177 | 180 | |
| r14896 | r14897 | |
| 182 | 185 | machine().primary_screen->update_now(); |
| 183 | 186 | data &= 0x0f; |
| 184 | 187 | |
| 185 | co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 188 | co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 186 | 189 | m_ram_palette[co] = data; |
| 187 | 190 | |
| 188 | 191 | } |
| r14896 | r14897 | |
| 225 | 228 | for (cx = 0; cx < x_count; cx++) |
| 226 | 229 | { |
| 227 | 230 | int i; |
| 228 | int attr = state->m_ram_attr[ma & 0x7ff]; | |
| 231 | int attr = state->m_ram_attr.target()[ma & 0x7ff]; | |
| 229 | 232 | int region = (attr & 0x40) >> 6; |
| 230 | int addr = ((state->m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (state->m_extra_video_bank_bit)) << 4) | (ra & 0x0f); | |
| 233 | int addr = ((state->m_ram_video.target()[ma & 0x7ff] | ((attr & 0x80) << 1) | (state->m_extra_video_bank_bit)) << 4) | (ra & 0x0f); | |
| 231 | 234 | int colour = (attr & 0x7f) << 3; |
| 232 | 235 | UINT8 *data; |
| 233 | 236 | |
| r14896 | r14897 | |
| 308 | 311 | static WRITE8_DEVICE_HANDLER( misc_w ) |
| 309 | 312 | { |
| 310 | 313 | merit_state *state = device->machine().driver_data<merit_state>(); |
| 311 | flip_screen_set( | |
| 314 | state->flip_screen_set( | |
| 312 | 315 | state->m_extra_video_bank_bit = (data & 2) << 8; |
| 313 | 316 | state->m_lscnblk = (data >> 3) & 1; |
| 314 | 317 | |
| r14896 | r14897 | |
| 318 | 321 | static WRITE8_DEVICE_HANDLER( misc_couple_w ) |
| 319 | 322 | { |
| 320 | 323 | merit_state *state = device->machine().driver_data<merit_state>(); |
| 321 | flip_screen_set( | |
| 324 | state->flip_screen_set( | |
| 322 | 325 | state->m_extra_video_bank_bit = (data & 2) << 8; |
| 323 | 326 | state->m_lscnblk = (data >> 3) & 1; |
| 324 | 327 | |
| 325 | 328 | /* other bits unknown */ |
| 326 | 329 | |
| 327 | 330 | /*kludge to avoid jumps on ram area in The Couples*/ |
| 328 | state->m_backup_ram[0x1011] = 0xc9; //ret | |
| 331 | state->m_backup_ram.target()[0x1011] = 0xc9; //ret | |
| 329 | 332 | } |
| 330 | 333 | |
| 331 | 334 | WRITE8_MEMBER(merit_state::casino5_bank_w) |
| r14896 | r14897 | |
| 358 | 361 | AM_RANGE(0xc000, 0xc003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 359 | 362 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 360 | 363 | AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 361 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 362 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 364 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 365 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 363 | 366 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 364 | 367 | ADDRESS_MAP_END |
| 365 | 368 | |
| r14896 | r14897 | |
| 374 | 377 | AM_RANGE(0xc000, 0xc003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 375 | 378 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 376 | 379 | AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 377 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 378 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 380 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 381 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 379 | 382 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 380 | 383 | ADDRESS_MAP_END |
| 381 | 384 | |
| r14896 | r14897 | |
| 386 | 389 | AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 387 | 390 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 388 | 391 | AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 389 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 390 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 392 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 393 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 391 | 394 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 392 | 395 | ADDRESS_MAP_END |
| 393 | 396 | |
| r14896 | r14897 | |
| 398 | 401 | AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 399 | 402 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 400 | 403 | AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 401 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 402 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 404 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 405 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 403 | 406 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 404 | 407 | ADDRESS_MAP_END |
| 405 | 408 | |
| r14896 | r14897 | |
| 418 | 421 | AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x1df0) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 419 | 422 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 420 | 423 | AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 421 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 422 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 424 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 425 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 423 | 426 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 424 | 427 | ADDRESS_MAP_END |
| 425 | 428 | |
| r14896 | r14897 | |
| 439 | 442 | AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w) |
| 440 | 443 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 441 | 444 | AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 442 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 443 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 445 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 446 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 444 | 447 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 445 | 448 | ADDRESS_MAP_END |
| 446 | 449 | |
| r14896 | r14897 | |
| 460 | 463 | AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w) |
| 461 | 464 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 462 | 465 | AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 463 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 464 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 466 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 467 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 465 | 468 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 466 | 469 | ADDRESS_MAP_END |
| 467 | 470 | |
| r14896 | r14897 | |
| 481 | 484 | AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w) |
| 482 | 485 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 483 | 486 | AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 484 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 485 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 487 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 488 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 486 | 489 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 487 | 490 | ADDRESS_MAP_END |
| 488 | 491 | |
| r14896 | r14897 | |
| 497 | 500 | AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w) |
| 498 | 501 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 499 | 502 | AM_RANGE(0xe001, 0xe001) AM_MIRROR(0x05f0) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 500 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 501 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 503 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 504 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 502 | 505 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 503 | 506 | ADDRESS_MAP_END |
| 504 | 507 | |
| 505 | 508 | static ADDRESS_MAP_START( couple_map, AS_PROGRAM, 8, merit_state ) |
| 506 | 509 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 507 | 510 | AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") |
| 508 | AM_RANGE(0xa000, 0xbfff) AM_RAM AM_ | |
| 511 | AM_RANGE(0xa000, 0xbfff) AM_RAM AM_ | |
| 509 | 512 | AM_RANGE(0xc004, 0xc007) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w) |
| 510 | 513 | AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w) |
| 511 | 514 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 512 | 515 | AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 513 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 514 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 516 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 517 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 515 | 518 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 516 | 519 | ADDRESS_MAP_END |
| 517 | 520 |
| r14896 | r14897 | |
|---|---|---|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| 44 | ||
| 44 | ||
| 45 | 45 | { |
| 46 | atarigen_halt_until_hblank_0(* | |
| 46 | atarigen_halt_until_hblank_0(* | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r14896 | r14897 | |
| 71 | 71 | * |
| 72 | 72 | *************************************/ |
| 73 | 73 | |
| 74 | ||
| 74 | ||
| 75 | 75 | { |
| 76 | 76 | static const char *const iptnames[] = { "IN0", "IN1" }; |
| 77 | blstroid_state *state = space->machine().driver_data<blstroid_state>(); | |
| 78 | int temp = input_port_read(space->machine(), iptnames[offset & 1]); | |
| 77 | int temp = input_port_read(machine(), iptnames[offset & 1]); | |
| 79 | 78 | |
| 80 | if (state->m_cpu_to_sound_ready) temp ^= 0x0040; | |
| 81 | if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0010; | |
| 79 | if (m_cpu_to_sound_ready) temp ^= 0x0040; | |
| 80 | if (atarigen_get_hblank(*machine().primary_screen)) temp ^= 0x0010; | |
| 82 | 81 | return temp; |
| 83 | 82 | } |
| 84 | 83 | |
| r14896 | r14897 | |
| 101 | 100 | AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITEONLY AM_BASE(m_priorityram) |
| 102 | 101 | AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_sound_w) |
| 103 | 102 | AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 104 | AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE | |
| 103 | AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE | |
| 105 | 104 | AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ_LEGACY(atarigen_sound_r) |
| 106 | 105 | AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL0") |
| 107 | 106 | AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL1") |
| 108 | AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ_LEGACY(inputs_r) | |
| 109 | AM_RANGE(0xffa000, 0xffa3ff) AM_MIRROR(0x7f8c00) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 107 | AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ(inputs_r) | |
| 108 | AM_RANGE(0xffa000, 0xffa3ff) AM_MIRROR(0x7f8c00) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 110 | 109 | AM_RANGE(0xffb000, 0xffb3ff) AM_MIRROR(0x7f8c00) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 111 | 110 | AM_RANGE(0xffc000, 0xffcfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 112 | 111 | AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w) |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | AM_RANGE(0x6001, 0x6001) AM_READ_PORT("P2") |
| 47 | 47 | AM_RANGE(0x6002, 0x6002) AM_READ_PORT("DSW") |
| 48 | 48 | AM_RANGE(0x6004, 0x6004) AM_WRITE(gotya_video_control_w) |
| 49 | AM_RANGE(0x6005, 0x6005) AM_WRITE | |
| 49 | AM_RANGE(0x6005, 0x6005) AM_WRITE | |
| 50 | 50 | AM_RANGE(0x6006, 0x6006) AM_WRITEONLY AM_BASE(m_scroll) |
| 51 | 51 | AM_RANGE(0x6007, 0x6007) AM_WRITE(watchdog_reset_w) |
| 52 | 52 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(gotya_videoram_w) AM_BASE(m_videoram) |
| r14896 | r14897 | |
|---|---|---|
| 80 | 80 | AM_RANGE(0x022000, 0x0220ff) AM_READ(nvram_r) AM_WRITEONLY AM_SHARE("nvram") |
| 81 | 81 | AM_RANGE(0x027000, 0x027001) AM_READ(joystick_r) |
| 82 | 82 | AM_RANGE(0x027004, 0x027005) AM_READ_PORT("INPUTS") |
| 83 | AM_RANGE(0x027008, 0x027009) AM_READWRITE | |
| 83 | AM_RANGE(0x027008, 0x027009) AM_READWRITE | |
| 84 | 84 | AM_RANGE(0x02700c, 0x02700d) AM_READ_PORT("DIAL") |
| 85 | 85 | AM_RANGE(0x02700e, 0x02700f) AM_READ(watchdog_reset16_r) |
| 86 | 86 | AM_RANGE(0xff8000, 0xffafff) AM_RAM AM_BASE(m_vectorram) |
| r14896 | r14897 | |
| 99 | 99 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, aztarac_state ) |
| 100 | 100 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 101 | 101 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 102 | AM_RANGE(0x8800, 0x8800) AM_READ | |
| 102 | AM_RANGE(0x8800, 0x8800) AM_READ | |
| 103 | 103 | AM_RANGE(0x8c00, 0x8c01) AM_DEVREADWRITE_LEGACY("ay1", ay8910_r, ay8910_data_address_w) |
| 104 | 104 | AM_RANGE(0x8c02, 0x8c03) AM_DEVREADWRITE_LEGACY("ay2", ay8910_r, ay8910_data_address_w) |
| 105 | 105 | AM_RANGE(0x8c04, 0x8c05) AM_DEVREADWRITE_LEGACY("ay3", ay8910_r, ay8910_data_address_w) |
| 106 | 106 | AM_RANGE(0x8c06, 0x8c07) AM_DEVREADWRITE_LEGACY("ay4", ay8910_r, ay8910_data_address_w) |
| 107 | AM_RANGE(0x9000, 0x9000) AM_READWRITE | |
| 107 | AM_RANGE(0x9000, 0x9000) AM_READWRITE | |
| 108 | 108 | ADDRESS_MAP_END |
| 109 | 109 | |
| 110 | 110 |
| r14896 | r14897 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | WRITE8_MEMBER(retofinv_state::soundcommand_w) |
| 67 | 67 | { |
| 68 | soundlatch_w(space, 0, data); | |
| 68 | soundlatch_byte_w(space, 0, data); | |
| 69 | 69 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 70 | 70 | } |
| 71 | 71 | |
| r14896 | r14897 | |
| 135 | 135 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, retofinv_state ) |
| 136 | 136 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 137 | 137 | AM_RANGE(0x2000, 0x27ff) AM_RAM |
| 138 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r) | |
| 138 | AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r) | |
| 139 | 139 | AM_RANGE(0x6000, 0x6000) AM_WRITE(cpu2_m6000_w) |
| 140 | 140 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("sn1", sn76496_w) |
| 141 | 141 | AM_RANGE(0xa000, 0xa000) AM_DEVWRITE_LEGACY("sn2", sn76496_w) |
| r14896 | r14897 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | public: |
| 30 | 30 | dotrikun_state(const machine_config &mconfig, device_type type, const char *tag) |
| 31 | : driver_device(mconfig, type, tag) { } | |
| 31 | : driver_device(mconfig, type, tag) , | |
| 32 | m_dotrikun_bitmap(*this, "dotrikun_bitmap"){ } | |
| 32 | 33 | |
| 33 | 34 | /* memory pointers */ |
| 34 | UINT8 | |
| 35 | required_shared_ptr<UINT8> | |
| 35 | 36 | |
| 36 | 37 | /* video-related */ |
| 37 | 38 | UINT8 m_color; |
| r14896 | r14897 | |
| 71 | 72 | { |
| 72 | 73 | for (x = 0; x < 256; x+=16) |
| 73 | 74 | { |
| 74 | UINT8 data = state->m_dotrikun_bitmap[((x/16)+((y/2)*16))]; | |
| 75 | UINT8 data = state->m_dotrikun_bitmap.target()[((x/16)+((y/2)*16))]; | |
| 75 | 76 | |
| 76 | 77 | for (i = 0; i < 8; i++) |
| 77 | 78 | { |
| r14896 | r14897 | |
| 98 | 99 | |
| 99 | 100 | static ADDRESS_MAP_START( dotrikun_map, AS_PROGRAM, 8, dotrikun_state ) |
| 100 | 101 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 101 | AM_RANGE(0x8000, 0x85ff) AM_RAM AM_ | |
| 102 | AM_RANGE(0x8000, 0x85ff) AM_RAM AM_ | |
| 102 | 103 | AM_RANGE(0x8600, 0x87ff) AM_RAM |
| 103 | 104 | ADDRESS_MAP_END |
| 104 | 105 |
| r14896 | r14897 | |
|---|---|---|
| 642 | 642 | static ADDRESS_MAP_START( driversnd_68k_map, AS_PROGRAM, 16, harddriv_state ) |
| 643 | 643 | ADDRESS_MAP_UNMAP_HIGH |
| 644 | 644 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 645 | AM_RANGE(0xff0000, 0xff0fff) AM_READWRITE_LEGACY(hdsnd68k_data_r, hdsnd68k_data_w) | |
| 646 | AM_RANGE(0xff1000, 0xff1fff) AM_READWRITE_LEGACY(hdsnd68k_switches_r, hdsnd68k_latches_w) | |
| 647 | AM_RANGE(0xff2000, 0xff2fff) AM_READWRITE_LEGACY(hdsnd68k_320port_r, hdsnd68k_speech_w) | |
| 648 | AM_RANGE(0xff3000, 0xff3fff) AM_READWRITE_LEGACY(hdsnd68k_status_r, hdsnd68k_irqclr_w) | |
| 649 | AM_RANGE(0xff4000, 0xff5fff) AM_READWRITE_LEGACY(hdsnd68k_320ram_r, hdsnd68k_320ram_w) | |
| 650 | AM_RANGE(0xff6000, 0xff7fff) AM_READWRITE_LEGACY(hdsnd68k_320ports_r, hdsnd68k_320ports_w) | |
| 651 | AM_RANGE(0xff8000, 0xffbfff) AM_READWRITE_LEGACY(hdsnd68k_320com_r, hdsnd68k_320com_w) | |
| 645 | AM_RANGE(0xff0000, 0xff0fff) AM_READWRITE(hdsnd68k_data_r, hdsnd68k_data_w) | |
| 646 | AM_RANGE(0xff1000, 0xff1fff) AM_READWRITE(hdsnd68k_switches_r, hdsnd68k_latches_w) | |
| 647 | AM_RANGE(0xff2000, 0xff2fff) AM_READWRITE(hdsnd68k_320port_r, hdsnd68k_speech_w) | |
| 648 | AM_RANGE(0xff3000, 0xff3fff) AM_READWRITE(hdsnd68k_status_r, hdsnd68k_irqclr_w) | |
| 649 | AM_RANGE(0xff4000, 0xff5fff) AM_READWRITE(hdsnd68k_320ram_r, hdsnd68k_320ram_w) | |
| 650 | AM_RANGE(0xff6000, 0xff7fff) AM_READWRITE(hdsnd68k_320ports_r, hdsnd68k_320ports_w) | |
| 651 | AM_RANGE(0xff8000, 0xffbfff) AM_READWRITE(hdsnd68k_320com_r, hdsnd68k_320com_w) | |
| 652 | 652 | AM_RANGE(0xffc000, 0xffffff) AM_RAM |
| 653 | 653 | ADDRESS_MAP_END |
| 654 | 654 | |
| r14896 | r14897 | |
| 663 | 663 | |
| 664 | 664 | |
| 665 | 665 | static ADDRESS_MAP_START( driversnd_dsp_io_map, AS_IO, 16, harddriv_state ) |
| 666 | AM_RANGE(0, 0) AM_READ_LEGACY(hdsnddsp_rom_r) AM_DEVWRITE_LEGACY("dac", hdsnddsp_dac_w) | |
| 667 | AM_RANGE(1, 1) AM_READ_LEGACY(hdsnddsp_comram_r) | |
| 668 | AM_RANGE(2, 2) AM_READ_LEGACY(hdsnddsp_compare_r) | |
| 666 | AM_RANGE(0, 0) AM_READ(hdsnddsp_rom_r) AM_DEVWRITE_LEGACY("dac", hdsnddsp_dac_w) | |
| 667 | AM_RANGE(1, 1) AM_READ(hdsnddsp_comram_r) | |
| 668 | AM_RANGE(2, 2) AM_READ(hdsnddsp_compare_r) | |
| 669 | 669 | AM_RANGE(1, 2) AM_WRITENOP |
| 670 | AM_RANGE(3, 3) AM_WRITE_LEGACY(hdsnddsp_comport_w) | |
| 671 | AM_RANGE(4, 4) AM_WRITE_LEGACY(hdsnddsp_mute_w) | |
| 672 | AM_RANGE(5, 5) AM_WRITE_LEGACY(hdsnddsp_gen68kirq_w) | |
| 673 | AM_RANGE(6, 7) AM_WRITE_LEGACY(hdsnddsp_soundaddr_w) | |
| 674 | AM_RANGE(TMS32010_BIO, TMS32010_BIO) AM_READ_LEGACY(hdsnddsp_get_bio) | |
| 670 | AM_RANGE(3, 3) AM_WRITE(hdsnddsp_comport_w) | |
| 671 | AM_RANGE(4, 4) AM_WRITE(hdsnddsp_mute_w) | |
| 672 | AM_RANGE(5, 5) AM_WRITE(hdsnddsp_gen68kirq_w) | |
| 673 | AM_RANGE(6, 7) AM_WRITE(hdsnddsp_soundaddr_w) | |
| 674 | AM_RANGE(TMS32010_BIO, TMS32010_BIO) AM_READ(hdsnddsp_get_bio) | |
| 675 | 675 | ADDRESS_MAP_END |
| 676 | 676 | |
| 677 | 677 | |
| r14896 | r14897 | |
| 4010 | 4010 | hdsnd_init(machine); |
| 4011 | 4011 | |
| 4012 | 4012 | /* install sound handlers */ |
| 4013 | state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x840000, 0x840001, FUNC(hd68k_snd_data_r), FUNC(hd68k_snd_data_w)); | |
| 4014 | state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x844000, 0x844001, FUNC(hd68k_snd_status_r)); | |
| 4015 | state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x84c000, 0x84c001, FUNC(hd68k_snd_reset_w)); | |
| 4013 | state->m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x840000, 0x840001, read16_delegate(FUNC(harddriv_state::hd68k_snd_data_r),state), write16_delegate(FUNC(harddriv_state::hd68k_snd_data_w),state)); | |
| 4014 | state->m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x844000, 0x844001, read16_delegate(FUNC(harddriv_state::hd68k_snd_status_r),state)); | |
| 4015 | state->m_maincpu->memory().space(AS_PROGRAM)->install_write_handler(0x84c000, 0x84c001, write16_delegate(FUNC(harddriv_state::hd68k_snd_reset_w),state)); | |
| 4016 | 4016 | } |
| 4017 | 4017 | |
| 4018 | 4018 | |
| r14896 | r14897 | |
| 4152 | 4152 | |
| 4153 | 4153 | |
| 4154 | 4154 | |
| 4155 | ||
| 4155 | ||
| 4156 | 4156 | { |
| 4157 | 4157 | /* this is required so that INT 4 is recongized as a sound INT */ |
| 4158 | 4158 | return ~0; |
| r14896 | r14897 | |
| 4169 | 4169 | init_dspcom(machine); |
| 4170 | 4170 | atarijsa_init(machine, "IN0", 0x0020); |
| 4171 | 4171 | |
| 4172 | state->m_maincpu->memory().space(AS_PROGRAM)->install_ | |
| 4172 | state->m_maincpu->memory().space(AS_PROGRAM)->install_ | |
| 4173 | 4173 | |
| 4174 | 4174 | /* set up the SLOOP */ |
| 4175 | 4175 | if (!proto_sloop) |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | { |
| 27 | 27 | public: |
| 28 | 28 | spoker_state(const machine_config &mconfig, device_type type, const char *tag) |
| 29 | : driver_device(mconfig, type, tag) { } | |
| 29 | : driver_device(mconfig, type, tag) , | |
| 30 | m_bg_tile_ram(*this, "bg_tile_ram"), | |
| 31 | m_fg_tile_ram(*this, "fg_tile_ram"), | |
| 32 | m_fg_color_ram(*this, "fg_color_ram"){ } | |
| 30 | 33 | |
| 31 | UINT8 | |
| 34 | required_shared_ptr<UINT8> | |
| 32 | 35 | tilemap_t *m_bg_tilemap; |
| 33 | 36 | |
| 34 | UINT8 *m_fg_tile_ram; | |
| 35 | UINT8 *m_fg_color_ram; | |
| 37 | required_shared_ptr<UINT8> m_fg_tile_ram; | |
| 38 | required_shared_ptr<UINT8> m_fg_color_ram; | |
| 36 | 39 | tilemap_t *m_fg_tilemap; |
| 37 | 40 | |
| 38 | 41 | int m_video_enable; |
| r14896 | r14897 | |
| 54 | 57 | WRITE8_MEMBER(spoker_state::bg_tile_w) |
| 55 | 58 | { |
| 56 | 59 | |
| 57 | m_bg_tile_ram[offset] = data; | |
| 60 | m_bg_tile_ram.target()[offset] = data; | |
| 58 | 61 | m_bg_tilemap->mark_tile_dirty(offset); |
| 59 | 62 | } |
| 60 | 63 | |
| 61 | 64 | static TILE_GET_INFO( get_bg_tile_info ) |
| 62 | 65 | { |
| 63 | 66 | spoker_state *state = machine.driver_data<spoker_state>(); |
| 64 | int code = state->m_bg_tile_ram[tile_index]; | |
| 67 | int code = state->m_bg_tile_ram.target()[tile_index]; | |
| 65 | 68 | SET_TILE_INFO(1 + (tile_index & 3), code & 0xff, 0, 0); |
| 66 | 69 | } |
| 67 | 70 | |
| 68 | 71 | static TILE_GET_INFO( get_fg_tile_info ) |
| 69 | 72 | { |
| 70 | 73 | spoker_state *state = machine.driver_data<spoker_state>(); |
| 71 | int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8); | |
| 74 | int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8); | |
| 72 | 75 | SET_TILE_INFO(0, code, (4*(code >> 14)+3), 0); |
| 73 | 76 | } |
| 74 | 77 | |
| 75 | 78 | WRITE8_MEMBER(spoker_state::fg_tile_w) |
| 76 | 79 | { |
| 77 | 80 | |
| 78 | m_fg_tile_ram[offset] = data; | |
| 81 | m_fg_tile_ram.target()[offset] = data; | |
| 79 | 82 | m_fg_tilemap->mark_tile_dirty(offset); |
| 80 | 83 | } |
| 81 | 84 | |
| 82 | 85 | WRITE8_MEMBER(spoker_state::fg_color_w) |
| 83 | 86 | { |
| 84 | 87 | |
| 85 | m_fg_color_ram[offset] = data; | |
| 88 | m_fg_color_ram.target()[offset] = data; | |
| 86 | 89 | m_fg_tilemap->mark_tile_dirty(offset); |
| 87 | 90 | } |
| 88 | 91 | |
| r14896 | r14897 | |
| 224 | 227 | static ADDRESS_MAP_START( spoker_portmap, AS_IO, 8, spoker_state ) |
| 225 | 228 | AM_RANGE( 0x0000, 0x003f ) AM_RAM // Z180 internal regs |
| 226 | 229 | |
| 227 | AM_RANGE( 0x2000, 0x23ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 228 | AM_RANGE( 0x2400, 0x27ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 230 | AM_RANGE( 0x2000, 0x23ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 231 | AM_RANGE( 0x2400, 0x27ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 229 | 232 | |
| 230 | 233 | AM_RANGE( 0x3000, 0x33ff ) AM_RAM_WRITE(bg_tile_w ) AM_BASE(m_bg_tile_ram ) |
| 231 | 234 | |
| r14896 | r14897 | |
| 255 | 258 | static ADDRESS_MAP_START( 3super8_portmap, AS_IO, 8, spoker_state ) |
| 256 | 259 | // AM_RANGE( 0x1000, 0x1fff ) AM_WRITENOP |
| 257 | 260 | |
| 258 | AM_RANGE( 0x2000, 0x27ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_SHARE("paletteram") | |
| 259 | AM_RANGE( 0x2800, 0x2fff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_SHARE("paletteram2") | |
| 261 | AM_RANGE( 0x2000, 0x27ff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) AM_SHARE("paletteram") | |
| 262 | AM_RANGE( 0x2800, 0x2fff ) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) AM_SHARE("paletteram2") | |
| 260 | 263 | |
| 261 | 264 | AM_RANGE( 0x3000, 0x33ff ) AM_RAM_WRITE(bg_tile_w ) AM_BASE(m_bg_tile_ram ) |
| 262 | 265 |
| r14896 | r14897 | |
|---|---|---|
| 428 | 428 | AM_RANGE(0x300000, 0x300001) AM_READ8(mjyuugi_irq4_ack_r,0x00ff) /* irq ack lv 4? */ |
| 429 | 429 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW3-1") /* DSW 3-1 */ |
| 430 | 430 | AM_RANGE(0x500010, 0x500011) AM_READ_PORT("DSW3-2") /* DSW 3-2 */ |
| 431 | AM_RANGE(0x700000, 0x7003ff) AM_RAM_WRITE(paletteram | |
| 431 | AM_RANGE(0x700000, 0x7003ff) AM_RAM_WRITE(paletteram | |
| 432 | 432 | AM_RANGE(0x800000, 0x800001) AM_READNOP /* ??? */ |
| 433 | 433 | AM_RANGE(0x900000, 0x900001) AM_READWRITE8(iox_mux_r, iox_command_w,0x00ff) /* key matrix | I/O */ |
| 434 | 434 | AM_RANGE(0x900002, 0x900003) AM_READWRITE8(iox_status_r,iox_data_w,0x00ff) |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | AM_RANGE(0x308000, 0x30ffff) AM_RAM |
| 46 | 46 | AM_RANGE(0x400000, 0x400001) AM_WRITE(ohmygod_scrollx_w) |
| 47 | 47 | AM_RANGE(0x400002, 0x400003) AM_WRITE(ohmygod_scrolly_w) |
| 48 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE(paletteram | |
| 48 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE(paletteram | |
| 49 | 49 | AM_RANGE(0x700000, 0x703fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 50 | 50 | AM_RANGE(0x704000, 0x707fff) AM_RAM |
| 51 | 51 | AM_RANGE(0x708000, 0x70ffff) AM_RAM /* Work RAM */ |
| r14896 | r14897 | |
|---|---|---|
| 108 | 108 | { |
| 109 | 109 | if (ACCESSING_BITS_8_15) |
| 110 | 110 | { |
| 111 | soundlatch_w(space, 0, data >> 8); | |
| 111 | soundlatch_byte_w(space, 0, data >> 8); | |
| 112 | 112 | cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 113 | 113 | } |
| 114 | 114 | } |
| r14896 | r14897 | |
| 159 | 159 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, snk68_state ) |
| 160 | 160 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 161 | 161 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 162 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) AM_WRITE(sound_status_w) | |
| 162 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) AM_WRITE(sound_status_w) | |
| 163 | 163 | ADDRESS_MAP_END |
| 164 | 164 | |
| 165 | 165 | static WRITE8_DEVICE_HANDLER( D7759_write_port_0_w ) |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | AM_RANGE(0x2900, 0x2fff) AM_WRITENOP // cleared along with sprite RAM |
| 84 | 84 | AM_RANGE(0x2973, 0x2973) AM_READ(aeroboto_2973_r) // protection read |
| 85 | 85 | AM_RANGE(0x3000, 0x3000) AM_READWRITE(aeroboto_in0_r, aeroboto_3000_w) |
| 86 | AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_w) | |
| 87 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_w) | |
| 86 | AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_byte_w) | |
| 87 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_byte_w) | |
| 88 | 88 | AM_RANGE(0x3003, 0x3003) AM_WRITEONLY AM_BASE(m_vscroll) |
| 89 | 89 | AM_RANGE(0x3004, 0x3004) AM_READ(aeroboto_201_r) AM_WRITEONLY AM_BASE(m_starx) |
| 90 | 90 | AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_BASE(m_stary) // usable but probably wrong |
| r14896 | r14897 | |
| 217 | 217 | { |
| 218 | 218 | AY8910_LEGACY_OUTPUT, |
| 219 | 219 | AY8910_DEFAULT_LOADS, |
| 220 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 221 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_r), | |
| 220 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 221 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r), | |
| 222 | 222 | DEVCB_NULL, |
| 223 | 223 | DEVCB_NULL |
| 224 | 224 | }; |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | WRITE8_MEMBER(madalien_state::madalien_sound_command_w) |
| 56 | 56 | { |
| 57 | 57 | cputag_set_input_line(machine(), "audiocpu", 0, ASSERT_LINE); |
| 58 | soundlatch_w(space, offset, data); | |
| 58 | soundlatch_byte_w(space, offset, data); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | READ8_MEMBER(madalien_state::madalien_sound_command_r) |
| 63 | 63 | { |
| 64 | 64 | cputag_set_input_line(machine(), "audiocpu", 0, CLEAR_LINE); |
| 65 | return soundlatch_r(space, offset); | |
| 65 | return soundlatch_byte_r(space, offset); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| r14896 | r14897 | |
| 87 | 87 | AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 88 | 88 | AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x0ff0) AM_WRITEONLY AM_BASE(m_video_control) |
| 89 | 89 | AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x0ff0) AM_WRITE(madalien_output_w) |
| 90 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x0ff0) AM_READ(soundlatch2_r) AM_WRITE(madalien_sound_command_w) | |
| 90 | AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x0ff0) AM_READ(soundlatch2_byte_r) AM_WRITE(madalien_sound_command_w) | |
| 91 | 91 | AM_RANGE(0x8008, 0x8008) AM_MIRROR(0x07f0) AM_RAM_READ(shift_r) AM_BASE(m_shift_hi) |
| 92 | 92 | AM_RANGE(0x8009, 0x8009) AM_MIRROR(0x07f0) AM_RAM_READ(shift_rev_r) AM_BASE(m_shift_lo) |
| 93 | 93 | AM_RANGE(0x800b, 0x800b) AM_MIRROR(0x07f0) AM_WRITEONLY AM_BASE(m_video_flags) |
| r14896 | r14897 | |
| 109 | 109 | AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x1ffc) AM_RAM /* unknown device in an epoxy block, might be tilt detection */ |
| 110 | 110 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1ffc) AM_READ(madalien_sound_command_r) |
| 111 | 111 | AM_RANGE(0x8000, 0x8001) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) |
| 112 | AM_RANGE(0x8002, 0x8002) AM_MIRROR(0x1ffc) AM_WRITE(soundlatch2_w) | |
| 112 | AM_RANGE(0x8002, 0x8002) AM_MIRROR(0x1ffc) AM_WRITE(soundlatch2_byte_w) | |
| 113 | 113 | AM_RANGE(0xf800, 0xffff) AM_ROM |
| 114 | 114 | ADDRESS_MAP_END |
| 115 | 115 |
| r14896 | r14897 | |
|---|---|---|
| 145 | 145 | sharp_lh28f400_device *m_flash16[4]; |
| 146 | 146 | |
| 147 | 147 | UINT8 m_sector_buffer[ 4096 ]; |
| 148 | DECLARE_WRITE32_MEMBER(mb89371_w); | |
| 149 | DECLARE_READ32_MEMBER(mb89371_r); | |
| 150 | DECLARE_READ32_MEMBER(flash_r); | |
| 151 | DECLARE_WRITE32_MEMBER(flash_w); | |
| 152 | DECLARE_READ32_MEMBER(trackball_r); | |
| 153 | DECLARE_READ32_MEMBER(unknown_r); | |
| 154 | DECLARE_READ32_MEMBER(btcflash_r); | |
| 155 | DECLARE_WRITE32_MEMBER(btcflash_w); | |
| 156 | DECLARE_READ32_MEMBER(btc_trackball_r); | |
| 157 | DECLARE_WRITE32_MEMBER(btc_trackball_w); | |
| 158 | DECLARE_READ32_MEMBER(tokimeki_serial_r); | |
| 159 | DECLARE_WRITE32_MEMBER(tokimeki_serial_w); | |
| 160 | DECLARE_WRITE32_MEMBER(kdeadeye_0_w); | |
| 148 | 161 | }; |
| 149 | 162 | |
| 150 | 163 | /* EEPROM handlers */ |
| r14896 | r14897 | |
| 157 | 170 | eeprom->set_cs_line((data&0x02) ? CLEAR_LINE : ASSERT_LINE); |
| 158 | 171 | } |
| 159 | 172 | |
| 160 | ||
| 173 | ||
| 161 | 174 | { |
| 162 | 175 | } |
| 163 | 176 | |
| 164 | ||
| 177 | ||
| 165 | 178 | { |
| 166 | 179 | return 0xffffffff; |
| 167 | 180 | } |
| r14896 | r14897 | |
| 173 | 186 | AM_RANGE(0x1f100004, 0x1f100007) AM_READ_PORT("P2") |
| 174 | 187 | AM_RANGE(0x1f100008, 0x1f10000b) AM_READ_PORT("P3_P4") |
| 175 | 188 | AM_RANGE(0x1f180000, 0x1f180003) AM_DEVWRITE_LEGACY("eeprom", eeprom_w) |
| 176 | AM_RANGE(0x1f680000, 0x1f68001f) AM_READWRITE | |
| 189 | AM_RANGE(0x1f680000, 0x1f68001f) AM_READWRITE | |
| 177 | 190 | AM_RANGE(0x1f780000, 0x1f780003) AM_WRITENOP /* watchdog? */ |
| 178 | 191 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_SHARE("share2") AM_REGION("user1", 0) /* bios */ |
| 179 | 192 | AM_RANGE(0x80000000, 0x801fffff) AM_RAM AM_SHARE("share1") /* ram mirror */ |
| r14896 | r14897 | |
| 414 | 427 | |
| 415 | 428 | /* Simpsons Bowling */ |
| 416 | 429 | |
| 417 | ||
| 430 | ||
| 418 | 431 | { |
| 419 | konamigv_state *state = space->machine().driver_data<konamigv_state>(); | |
| 420 | 432 | int reg = offset*2; |
| 421 | 433 | //int shift = 0; |
| 422 | 434 | |
| r14896 | r14897 | |
| 428 | 440 | |
| 429 | 441 | if (reg == 4) // set odd address |
| 430 | 442 | { |
| 431 | | |
| 443 | | |
| 432 | 444 | } |
| 433 | 445 | |
| 434 | 446 | if (reg == 0) |
| 435 | 447 | { |
| 436 | int chip = ( | |
| 448 | int chip = ( | |
| 437 | 449 | int ret; |
| 438 | 450 | |
| 439 | ret = state->m_flash8[chip]->read(state->m_flash_address & 0x1fffff) & 0xff; | |
| 440 | ret |= state->m_flash8[chip+1]->read(state->m_flash_address & 0x1fffff)<<8; | |
| 441 | state->m_flash_address++; | |
| 451 | ret = m_flash8[chip]->read(m_flash_address & 0x1fffff) & 0xff; | |
| 452 | ret |= m_flash8[chip+1]->read(m_flash_address & 0x1fffff)<<8; | |
| 453 | m_flash_address++; | |
| 442 | 454 | |
| 443 | 455 | return ret; |
| 444 | 456 | } |
| 445 | 457 | return 0; |
| 446 | 458 | } |
| 447 | 459 | |
| 448 | ||
| 460 | ||
| 449 | 461 | { |
| 450 | konamigv_state *state = space->machine().driver_data<konamigv_state>(); | |
| 451 | 462 | int reg = offset*2; |
| 452 | 463 | int chip; |
| 453 | 464 | |
| r14896 | r14897 | |
| 460 | 471 | switch (reg) |
| 461 | 472 | { |
| 462 | 473 | case 0: |
| 463 | chip = (state->m_flash_address >= 0x200000) ? 2 : 0; | |
| 464 | state->m_flash8[chip]->write(state->m_flash_address & 0x1fffff, data&0xff); | |
| 465 | state->m_flash8[chip+1]->write(state->m_flash_address & 0x1fffff, (data>>8)&0xff); | |
| 474 | chip = (m_flash_address >= 0x200000) ? 2 : 0; | |
| 475 | m_flash8[chip]->write(m_flash_address & 0x1fffff, data&0xff); | |
| 476 | m_flash8[chip+1]->write(m_flash_address & 0x1fffff, (data>>8)&0xff); | |
| 466 | 477 | break; |
| 467 | 478 | |
| 468 | 479 | case 1: |
| 469 | state->m_flash_address = 0; | |
| 470 | state->m_flash_address |= (data<<1); | |
| 480 | m_flash_address = 0; | |
| 481 | m_flash_address |= (data<<1); | |
| 471 | 482 | break; |
| 472 | 483 | case 2: |
| 473 | state->m_flash_address &= 0xff00ff; | |
| 474 | state->m_flash_address |= (data<<8); | |
| 484 | m_flash_address &= 0xff00ff; | |
| 485 | m_flash_address |= (data<<8); | |
| 475 | 486 | break; |
| 476 | 487 | case 3: |
| 477 | state->m_flash_address &= 0x00ffff; | |
| 478 | state->m_flash_address |= (data<<15); | |
| 488 | m_flash_address &= 0x00ffff; | |
| 489 | m_flash_address |= (data<<15); | |
| 479 | 490 | break; |
| 480 | 491 | } |
| 481 | 492 | } |
| 482 | 493 | |
| 483 | ||
| 494 | ||
| 484 | 495 | { |
| 485 | konamigv_state *state = space->machine().driver_data<konamigv_state>(); | |
| 486 | 496 | |
| 487 | 497 | if( offset == 0 && mem_mask == 0x0000ffff ) |
| 488 | 498 | { |
| r14896 | r14897 | |
| 493 | 503 | |
| 494 | 504 | for( axis = 0; axis < 2; axis++ ) |
| 495 | 505 | { |
| 496 | value = input_port_read(space->machine(), axisnames[axis]); | |
| 497 | diff = value - state->m_trackball_prev[ axis ]; | |
| 498 | state->m_trackball_prev[ axis ] = value; | |
| 499 | state->m_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 ); | |
| 506 | value = input_port_read(machine(), axisnames[axis]); | |
| 507 | diff = value - m_trackball_prev[ axis ]; | |
| 508 | m_trackball_prev[ axis ] = value; | |
| 509 | m_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 ); | |
| 500 | 510 | } |
| 501 | 511 | } |
| 502 | return | |
| 512 | return | |
| 503 | 513 | } |
| 504 | 514 | |
| 505 | ||
| 515 | ||
| 506 | 516 | { |
| 507 | 517 | return 0xffffffff; |
| 508 | 518 | } |
| r14896 | r14897 | |
| 516 | 526 | state->m_flash8[2] = machine.device<fujitsu_29f016a_device>("flash2"); |
| 517 | 527 | state->m_flash8[3] = machine.device<fujitsu_29f016a_device>("flash3"); |
| 518 | 528 | |
| 519 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(flash_r), FUNC(flash_w) ); | |
| 520 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c0, 0x1f6800c7, FUNC(trackball_r) ); | |
| 521 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c8, 0x1f6800cb, FUNC(unknown_r) ); /* ?? */ | |
| 529 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f680080, 0x1f68008f, read32_delegate(FUNC(konamigv_state::flash_r),state), write32_delegate(FUNC(konamigv_state::flash_w),state) ); | |
| 530 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1f6800c0, 0x1f6800c7, read32_delegate(FUNC(konamigv_state::trackball_r),state)); | |
| 531 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1f6800c8, 0x1f6800cb, read32_delegate(FUNC(konamigv_state::unknown_r),state)); /* ?? */ | |
| 522 | 532 | |
| 523 | 533 | DRIVER_INIT_CALL(konamigv); |
| 524 | 534 | } |
| r14896 | r14897 | |
| 543 | 553 | |
| 544 | 554 | /* Beat the Champ */ |
| 545 | 555 | |
| 546 | ||
| 556 | ||
| 547 | 557 | { |
| 548 | konamigv_state *state = space->machine().driver_data<konamigv_state>(); | |
| 549 | 558 | |
| 550 | 559 | if (mem_mask == 0x0000ffff) |
| 551 | 560 | { |
| 552 | return | |
| 561 | return | |
| 553 | 562 | } |
| 554 | 563 | else if (mem_mask == 0xffff0000) |
| 555 | 564 | { |
| 556 | return | |
| 565 | return | |
| 557 | 566 | } |
| 558 | 567 | |
| 559 | 568 | return 0; |
| 560 | 569 | } |
| 561 | 570 | |
| 562 | ||
| 571 | ||
| 563 | 572 | { |
| 564 | konamigv_state *state = space->machine().driver_data<konamigv_state>(); | |
| 565 | 573 | |
| 566 | 574 | if (mem_mask == 0x0000ffff) |
| 567 | 575 | { |
| 568 | | |
| 576 | | |
| 569 | 577 | } |
| 570 | 578 | else if (mem_mask == 0xffff0000) |
| 571 | 579 | { |
| 572 | | |
| 580 | | |
| 573 | 581 | } |
| 574 | 582 | } |
| 575 | 583 | |
| 576 | ||
| 584 | ||
| 577 | 585 | { |
| 578 | konamigv_state *state = space->machine().driver_data<konamigv_state>(); | |
| 579 | 586 | |
| 580 | // mame_printf_debug( "r %08x %08x %08x\n", cpu_get_pc(&space | |
| 587 | // mame_printf_debug( "r %08x %08x %08x\n", cpu_get_pc(&space. | |
| 581 | 588 | |
| 582 | 589 | if( offset == 1 && mem_mask == 0xffff0000 ) |
| 583 | 590 | { |
| r14896 | r14897 | |
| 588 | 595 | |
| 589 | 596 | for( axis = 0; axis < 4; axis++ ) |
| 590 | 597 | { |
| 591 | value = input_port_read(space->machine(), axisnames[axis]); | |
| 592 | diff = value - state->m_btc_trackball_prev[ axis ]; | |
| 593 | state->m_btc_trackball_prev[ axis ] = value; | |
| 594 | state->m_btc_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 ); | |
| 598 | value = input_port_read(machine(), axisnames[axis]); | |
| 599 | diff = value - m_btc_trackball_prev[ axis ]; | |
| 600 | m_btc_trackball_prev[ axis ] = value; | |
| 601 | m_btc_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 ); | |
| 595 | 602 | } |
| 596 | 603 | } |
| 597 | 604 | |
| 598 | return | |
| 605 | return | |
| 599 | 606 | } |
| 600 | 607 | |
| 601 | ||
| 608 | ||
| 602 | 609 | { |
| 603 | // mame_printf_debug( "w %08x %08x %08x %08x\n", cpu_get_pc(&space | |
| 610 | // mame_printf_debug( "w %08x %08x %08x %08x\n", cpu_get_pc(&space. | |
| 604 | 611 | } |
| 605 | 612 | |
| 606 | 613 | static DRIVER_INIT( btchamp ) |
| r14896 | r14897 | |
| 609 | 616 | |
| 610 | 617 | state->m_flash16[0] = machine.device<sharp_lh28f400_device>("flash"); |
| 611 | 618 | |
| 612 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 619 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 613 | 620 | machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f6800e0, 0x1f6800e3); |
| 614 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 621 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 615 | 622 | |
| 616 | 623 | DRIVER_INIT_CALL(konamigv); |
| 617 | 624 | } |
| r14896 | r14897 | |
| 638 | 645 | |
| 639 | 646 | /* Tokimeki Memorial games - have a mouse and printer and who knows what else */ |
| 640 | 647 | |
| 641 | ||
| 648 | ||
| 642 | 649 | { |
| 643 | 650 | // bits checked: 0x80 and 0x20 for periodic status (800b6968 and 800b69e0 in tokimosh) |
| 644 | 651 | // 0x08 for reading the serial device (8005e624) |
| r14896 | r14897 | |
| 646 | 653 | return 0xffffffff; |
| 647 | 654 | } |
| 648 | 655 | |
| 649 | ||
| 656 | ||
| 650 | 657 | { |
| 651 | 658 | /* |
| 652 | 659 | serial EEPROM-like device here: when mem_mask == 0x000000ff only, |
| r14896 | r14897 | |
| 664 | 671 | |
| 665 | 672 | static DRIVER_INIT( tokimosh ) |
| 666 | 673 | { |
| 667 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f680080, 0x1f680083, FUNC(tokimeki_serial_r) ); | |
| 668 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f680090, 0x1f680093, FUNC(tokimeki_serial_w) ); | |
| 674 | konamigv_state *state = machine.driver_data<konamigv_state>(); | |
| 675 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler ( 0x1f680080, 0x1f680083, read32_delegate(FUNC(konamigv_state::tokimeki_serial_r),state)); | |
| 676 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler( 0x1f680090, 0x1f680093, write32_delegate(FUNC(konamigv_state::tokimeki_serial_w),state)); | |
| 669 | 677 | |
| 670 | 678 | DRIVER_INIT_CALL(konamigv); |
| 671 | 679 | } |
| r14896 | r14897 | |
| 680 | 688 | A01 |
| 681 | 689 | */ |
| 682 | 690 | |
| 683 | ||
| 691 | ||
| 684 | 692 | { |
| 685 | 693 | } |
| 686 | 694 | |
| r14896 | r14897 | |
| 695 | 703 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800a0, 0x1f6800a3, "GUNX2" ); |
| 696 | 704 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800b0, 0x1f6800b3, "GUNY2" ); |
| 697 | 705 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800c0, 0x1f6800c3, "BUTTONS" ); |
| 698 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1f6800e0, 0x1f6800e3, FUNC(kdeadeye_0_w) ); | |
| 699 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) ); | |
| 706 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler ( 0x1f6800e0, 0x1f6800e3, write32_delegate(FUNC(konamigv_state::kdeadeye_0_w),state) ); | |
| 707 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f380000, 0x1f3fffff, read32_delegate(FUNC(konamigv_state::btcflash_r),state), write32_delegate(FUNC(konamigv_state::btcflash_w),state)); | |
| 700 | 708 | |
| 701 | 709 | DRIVER_INIT_CALL(konamigv); |
| 702 | 710 | } |
| r14896 | r14897 | |
|---|---|---|
| 303 | 303 | |
| 304 | 304 | WRITE8_MEMBER(firetrap_state::firetrap_sound_command_w) |
| 305 | 305 | { |
| 306 | soundlatch_w(space, offset, data); | |
| 306 | soundlatch_byte_w(space, offset, data); | |
| 307 | 307 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 308 | 308 | } |
| 309 | 309 | |
| r14896 | r14897 | |
| 337 | 337 | |
| 338 | 338 | WRITE8_MEMBER(firetrap_state::flip_screen_w) |
| 339 | 339 | { |
| 340 | flip_screen_set( | |
| 340 | flip_screen_set( | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
| r14896 | r14897 | |
| 400 | 400 | AM_RANGE(0x2000, 0x2000) AM_WRITE(firetrap_adpcm_data_w) /* ADPCM data for the MSM5205 chip */ |
| 401 | 401 | AM_RANGE(0x2400, 0x2400) AM_WRITE(firetrap_sound_2400_w) |
| 402 | 402 | AM_RANGE(0x2800, 0x2800) AM_WRITE(firetrap_sound_bankselect_w) |
| 403 | AM_RANGE(0x3400, 0x3400) AM_READ(soundlatch_r) | |
| 403 | AM_RANGE(0x3400, 0x3400) AM_READ(soundlatch_byte_r) | |
| 404 | 404 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2") |
| 405 | 405 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 406 | 406 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | WRITE8_MEMBER(thedeep_state::thedeep_sound_w) |
| 47 | 47 | { |
| 48 | soundlatch_w(space, 0, data); | |
| 48 | soundlatch_byte_w(space, 0, data); | |
| 49 | 49 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 50 | 50 | } |
| 51 | 51 | |
| r14896 | r14897 | |
| 70 | 70 | switch (m_protection_command) |
| 71 | 71 | { |
| 72 | 72 | case 0x11: |
| 73 | flip_screen_set( | |
| 73 | flip_screen_set( | |
| 74 | 74 | break; |
| 75 | 75 | |
| 76 | 76 | case 0x20: |
| 77 | flip_screen_set( | |
| 77 | flip_screen_set( | |
| 78 | 78 | break; |
| 79 | 79 | |
| 80 | 80 | case 0x30: |
| r14896 | r14897 | |
| 177 | 177 | static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, thedeep_state ) |
| 178 | 178 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 179 | 179 | AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ymsnd", ym2203_w) // |
| 180 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) // From Main CPU | |
| 180 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 181 | 181 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 182 | 182 | ADDRESS_MAP_END |
| 183 | 183 | |
| r14896 | r14897 | |
| 207 | 207 | |
| 208 | 208 | WRITE8_MEMBER(thedeep_state::thedeep_p1_w) |
| 209 | 209 | { |
| 210 | flip_screen_set( | |
| 210 | flip_screen_set( | |
| 211 | 211 | thedeep_maincpu_bankswitch(machine(),(data & 6) >> 1); |
| 212 | 212 | logerror("P1 %02x\n",data); |
| 213 | 213 | } |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | static ADDRESS_MAP_START( oneshot_map, AS_PROGRAM, 16, oneshot_state ) |
| 104 | 104 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 105 | 105 | AM_RANGE(0x080000, 0x087fff) AM_RAM |
| 106 | AM_RANGE(0x0c0000, 0x0c07ff) AM_RAM_WRITE(paletteram | |
| 106 | AM_RANGE(0x0c0000, 0x0c07ff) AM_RAM_WRITE(paletteram | |
| 107 | 107 | AM_RANGE(0x120000, 0x120fff) AM_RAM AM_BASE(m_sprites) |
| 108 | 108 | AM_RANGE(0x180000, 0x180fff) AM_RAM_WRITE(oneshot_mid_videoram_w) AM_BASE(m_mid_videoram) // some people , girl etc. |
| 109 | 109 | AM_RANGE(0x181000, 0x181fff) AM_RAM_WRITE(oneshot_fg_videoram_w) AM_BASE(m_fg_videoram) // credits etc. |
| r14896 | r14897 | |
| 125 | 125 | |
| 126 | 126 | static ADDRESS_MAP_START( oneshot_sound_map, AS_PROGRAM, 8, oneshot_state ) |
| 127 | 127 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 128 | AM_RANGE(0x8000, 0x8000) AM_READWRITE(soundlatch_r,soundlatch_w) | |
| 128 | AM_RANGE(0x8000, 0x8000) AM_READWRITE(soundlatch_byte_r,soundlatch_byte_w) | |
| 129 | 129 | AM_RANGE(0x8001, 0x87ff) AM_RAM |
| 130 | 130 | AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r,ym3812_w) |
| 131 | 131 | AM_RANGE(0xe010, 0xe010) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | AM_RANGE(0x103400, 0x1037ff) AM_RAM AM_BASE(m_mlow_scrollram) |
| 102 | 102 | AM_RANGE(0x103800, 0x103bff) AM_RAM AM_BASE(m_mhigh_scrollram) |
| 103 | 103 | AM_RANGE(0x103c00, 0x103fff) AM_RAM AM_BASE(m_vidattrram) |
| 104 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 104 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 105 | 105 | AM_RANGE(0x105000, 0x107fff) AM_RAM /* unknown / ram */ |
| 106 | 106 | AM_RANGE(0x108000, 0x108fff) AM_RAM AM_BASE(m_spriteram) |
| 107 | 107 | AM_RANGE(0x109000, 0x11ffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 181 | 181 | { |
| 182 | 182 | public: |
| 183 | 183 | zr107_state(const machine_config &mconfig, device_type type, const char *tag) |
| 184 | : driver_device(mconfig, type, tag) { } | |
| 184 | : driver_device(mconfig, type, tag) , | |
| 185 | m_workram(*this, "workram"){ } | |
| 185 | 186 | |
| 186 | 187 | UINT8 m_led_reg0; |
| 187 | 188 | UINT8 m_led_reg1; |
| 188 | 189 | int m_ccu_vcth; |
| 189 | 190 | int m_ccu_vctl; |
| 190 | UINT32 | |
| 191 | required_shared_ptr<UINT32> | |
| 191 | 192 | UINT32 *m_sharc_dataram; |
| 192 | 193 | DECLARE_WRITE32_MEMBER(paletteram32_w); |
| 193 | 194 | DECLARE_READ8_MEMBER(sysreg_r); |
| r14896 | r14897 | |
| 404 | 405 | ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); |
| 405 | 406 | |
| 406 | 407 | /* configure fast RAM regions for DRC */ |
| 407 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_workram); | |
| 408 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_workram.target()); | |
| 408 | 409 | } |
| 409 | 410 | |
| 410 | 411 | static ADDRESS_MAP_START( zr107_map, AS_PROGRAM, 32, zr107_state ) |
| 411 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_ | |
| 412 | AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_ | |
| 412 | 413 | AM_RANGE(0x74000000, 0x74003fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_long_r, k056832_ram_long_w) |
| 413 | 414 | AM_RANGE(0x74020000, 0x7402003f) AM_DEVREADWRITE_LEGACY("k056832", k056832_long_r, k056832_long_w) |
| 414 | 415 | AM_RANGE(0x74060000, 0x7406003f) AM_READWRITE(ccu_r, ccu_w) |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | { |
| 69 | 69 | public: |
| 70 | 70 | dominob_state(const machine_config &mconfig, device_type type, const char *tag) |
| 71 | : driver_device(mconfig, type, tag) { } | |
| 71 | : driver_device(mconfig, type, tag) , | |
| 72 | m_videoram(*this, "videoram"), | |
| 73 | m_spriteram(*this, "spriteram"), | |
| 74 | m_bgram(*this, "bgram"){ } | |
| 72 | 75 | |
| 73 | 76 | /* memory pointers */ |
| 74 | UINT8 * m_spriteram; | |
| 75 | UINT8 * m_videoram; | |
| 76 | UINT8 * m_bgram; | |
| 77 | required_shared_ptr<UINT8> m_videoram; | |
| 78 | required_shared_ptr<UINT8> m_spriteram; | |
| 79 | required_shared_ptr<UINT8> m_bgram; | |
| 77 | 80 | // UINT8 * m_paletteram; // currently this uses generic palette handling |
| 78 | size_t m_spriteram_size; | |
| 79 | 81 | |
| 80 | 82 | /* input-related */ |
| 81 | 83 | //UINT8 m_paddle_select; |
| r14896 | r14897 | |
| 94 | 96 | dominob_state *state = machine.driver_data<dominob_state>(); |
| 95 | 97 | int offs; |
| 96 | 98 | |
| 97 | for (offs = 0; offs < state->m_spriteram | |
| 99 | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) | |
| 98 | 100 | { |
| 99 | 101 | int sx, sy, code; |
| 100 | 102 | |
| 101 | sx = state->m_spriteram[offs]; | |
| 102 | sy = 248 - state->m_spriteram[offs + 1]; | |
| 103 | if (flip_screen_x_get(machine)) sx = 248 - sx; | |
| 104 | if (flip_screen_y_get(machine)) sy = 248 - sy; | |
| 103 | sx = state->m_spriteram.target()[offs]; | |
| 104 | sy = 248 - state->m_spriteram.target()[offs + 1]; | |
| 105 | if (state->flip_screen_x()) sx = 248 - sx; | |
| 106 | if (state->flip_screen_y()) sy = 248 - sy; | |
| 105 | 107 | |
| 106 | code = state->m_spriteram[offs + 3] + ((state->m_spriteram[offs + 2] & 0x03) << 8) ; | |
| 108 | code = state->m_spriteram.target()[offs + 3] + ((state->m_spriteram.target()[offs + 2] & 0x03) << 8) ; | |
| 107 | 109 | |
| 108 | 110 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 109 | 111 | 2 * code, |
| 110 | ((state->m_spriteram[offs + 2] & 0xf8) >> 3) , | |
| 111 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 112 | sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0); | |
| 112 | ((state->m_spriteram.target()[offs + 2] & 0xf8) >> 3) , | |
| 113 | state->flip_screen_x(),state->flip_screen_y(), | |
| 114 | sx,sy + (state->flip_screen_y() ? 8 : -8),0); | |
| 113 | 115 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 114 | 116 | 2 * code + 1, |
| 115 | ((state->m_spriteram[offs + 2] & 0xf8) >> 3) , | |
| 116 | flip_screen_x_get(machine),flip_screen_y_get(machine), | |
| 117 | ((state->m_spriteram.target()[offs + 2] & 0xf8) >> 3) , | |
| 118 | state->flip_screen_x(),state->flip_screen_y(), | |
| 117 | 119 | sx,sy,0); |
| 118 | 120 | } |
| 119 | 121 | } |
| r14896 | r14897 | |
| 133 | 135 | drawgfx_opaque(bitmap, |
| 134 | 136 | cliprect, |
| 135 | 137 | screen.machine().gfx[1], |
| 136 | state->m_bgram[index] + 256 * (state->m_bgram[index + 1] & 0xf), | |
| 137 | state->m_bgram[index + 1] >> 4, | |
| 138 | state->m_bgram.target()[index] + 256 * (state->m_bgram.target()[index + 1] & 0xf), | |
| 139 | state->m_bgram.target()[index + 1] >> 4, | |
| 138 | 140 | 0, 0, |
| 139 | 141 | x * 32, y * 32); |
| 140 | 142 | index += 2; |
| r14896 | r14897 | |
| 148 | 150 | drawgfx_transpen( bitmap, |
| 149 | 151 | cliprect, |
| 150 | 152 | screen.machine().gfx[0], |
| 151 | state->m_videoram[(y * 32 + x) * 2 + 1] + (state->m_videoram[(y * 32 + x) * 2] & 7) * 256, | |
| 152 | (state->m_videoram[(y * 32 + x) * 2] >> 3), | |
| 153 | state->m_videoram.target()[(y * 32 + x) * 2 + 1] + (state->m_videoram.target()[(y * 32 + x) * 2] & 7) * 256, | |
| 154 | (state->m_videoram.target()[(y * 32 + x) * 2] >> 3), | |
| 153 | 155 | 0, 0, |
| 154 | 156 | x * 8, y * 8,0); |
| 155 | 157 | } |
| r14896 | r14897 | |
| 177 | 179 | AM_RANGE(0xd010, 0xd010) AM_READ_PORT("IN1") AM_WRITENOP |
| 178 | 180 | AM_RANGE(0xd018, 0xd018) AM_READ_PORT("IN2") AM_WRITENOP |
| 179 | 181 | |
| 180 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(m_videoram) | |
| 181 | AM_RANGE(0xe800, 0xe83f) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 182 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("videoram") | |
| 183 | AM_RANGE(0xe800, 0xe83f) AM_RAM AM_SHARE("spriteram") | |
| 182 | 184 | AM_RANGE(0xe840, 0xefff) AM_RAM |
| 183 | AM_RANGE(0xf000, 0xf07f) AM_RAM AM_ | |
| 185 | AM_RANGE(0xf000, 0xf07f) AM_RAM AM_ | |
| 184 | 186 | AM_RANGE(0xf080, 0xf7ff) AM_RAM |
| 185 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_SHARE("paletteram") | |
| 187 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 186 | 188 | AM_RANGE(0xfc00, 0xffff) AM_RAM |
| 187 | 189 | ADDRESS_MAP_END |
| 188 | 190 |
| r14896 | r14897 | |
|---|---|---|
| 468 | 468 | DECLARE_CUSTOM_INPUT_MEMBER(gn845pwbb_read); |
| 469 | 469 | DECLARE_CUSTOM_INPUT_MEMBER(gunmania_tank_shutter_sensor); |
| 470 | 470 | DECLARE_CUSTOM_INPUT_MEMBER(gunmania_cable_holder_sensor); |
| 471 | DECLARE_WRITE32_MEMBER(mb89371_w); | |
| 472 | DECLARE_READ32_MEMBER(mb89371_r); | |
| 473 | DECLARE_READ32_MEMBER(jamma_r); | |
| 474 | DECLARE_READ32_MEMBER(control_r); | |
| 475 | DECLARE_WRITE32_MEMBER(control_w); | |
| 476 | DECLARE_READ32_MEMBER(atapi_r); | |
| 477 | DECLARE_WRITE32_MEMBER(atapi_w); | |
| 478 | DECLARE_WRITE32_MEMBER(atapi_reset_w); | |
| 479 | DECLARE_WRITE32_MEMBER(security_w); | |
| 480 | DECLARE_READ32_MEMBER(security_r); | |
| 481 | DECLARE_READ32_MEMBER(flash_r); | |
| 482 | DECLARE_WRITE32_MEMBER(flash_w); | |
| 483 | DECLARE_READ32_MEMBER(ge765pwbba_r); | |
| 484 | DECLARE_WRITE32_MEMBER(ge765pwbba_w); | |
| 485 | DECLARE_READ32_MEMBER(gx700pwbf_io_r); | |
| 486 | DECLARE_WRITE32_MEMBER(gx700pwbf_io_w); | |
| 487 | DECLARE_READ32_MEMBER(gtrfrks_io_r); | |
| 488 | DECLARE_WRITE32_MEMBER(gtrfrks_io_w); | |
| 489 | DECLARE_READ32_MEMBER(gx894pwbba_r); | |
| 490 | DECLARE_WRITE32_MEMBER(gx894pwbba_w); | |
| 491 | DECLARE_WRITE32_MEMBER(dmx_io_w); | |
| 492 | DECLARE_WRITE32_MEMBER(mamboagg_io_w); | |
| 493 | DECLARE_WRITE32_MEMBER(gunmania_w); | |
| 494 | DECLARE_READ32_MEMBER(gunmania_r); | |
| 471 | 495 | }; |
| 472 | 496 | |
| 473 | 497 | INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) |
| r14896 | r14897 | |
| 485 | 509 | |
| 486 | 510 | static const char *const diskregions[] = { ":cdrom0", ":cdrom1" }; |
| 487 | 511 | |
| 488 | ||
| 512 | ||
| 489 | 513 | { |
| 490 | verboselog( | |
| 514 | verboselog( | |
| 491 | 515 | } |
| 492 | 516 | |
| 493 | ||
| 517 | ||
| 494 | 518 | { |
| 495 | 519 | UINT32 data = 0xffffffff; |
| 496 | verboselog( | |
| 520 | verboselog( | |
| 497 | 521 | return data; |
| 498 | 522 | } |
| 499 | 523 | |
| 500 | ||
| 524 | ||
| 501 | 525 | { |
| 502 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 503 | running_machine &machine = space->machine(); | |
| 504 | int security_cart_number = state->m_security_cart_number; | |
| 505 | UINT32 data = input_port_read(machine, "IN1"); | |
| 526 | int security_cart_number = m_security_cart_number; | |
| 527 | UINT32 data = input_port_read(machine(), "IN1"); | |
| 506 | 528 | data |= 0x000000c0; |
| 507 | 529 | |
| 508 | ds2401_device *ds2401 = space->machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id"); | |
| 509 | device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom"); | |
| 530 | ds2401_device *ds2401 = machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id"); | |
| 531 | device_secure_serial_flash *secflash = machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom"); | |
| 510 | 532 | |
| 511 | 533 | if( ds2401 ) |
| 512 | 534 | { |
| r14896 | r14897 | |
| 516 | 538 | if( secflash ) |
| 517 | 539 | data |= secflash->sda_r() << 18; |
| 518 | 540 | |
| 519 | if( | |
| 541 | if( | |
| 520 | 542 | { |
| 521 | 543 | data |= ( 1 << 26 ); |
| 522 | 544 | } |
| 523 | if( | |
| 545 | if( | |
| 524 | 546 | { |
| 525 | 547 | data |= ( 1 << 27 ); |
| 526 | 548 | } |
| 527 | 549 | |
| 528 | verboselog( machine, 2, "jamma_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 550 | verboselog( machine(), 2, "jamma_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 529 | 551 | |
| 530 | 552 | return data; |
| 531 | 553 | } |
| 532 | 554 | |
| 533 | ||
| 555 | ||
| 534 | 556 | { |
| 535 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 536 | 557 | |
| 537 | verboselog( | |
| 558 | verboselog( | |
| 538 | 559 | |
| 539 | return | |
| 560 | return | |
| 540 | 561 | } |
| 541 | 562 | |
| 542 | ||
| 563 | ||
| 543 | 564 | { |
| 544 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 545 | 565 | UINT32 control; |
| 546 | int old_bank = | |
| 566 | int old_bank = | |
| 547 | 567 | |
| 548 | COMBINE_DATA(&state->m_control); | |
| 549 | control = state->m_control; | |
| 568 | COMBINE_DATA(&m_control); | |
| 569 | control = m_control; | |
| 550 | 570 | |
| 551 | verboselog( | |
| 571 | verboselog( | |
| 552 | 572 | |
| 553 | | |
| 573 | | |
| 554 | 574 | |
| 555 | 575 | // zs01 only, others are reached through security_w |
| 556 | device_secure_serial_flash *secflash = | |
| 576 | device_secure_serial_flash *secflash = | |
| 557 | 577 | if( dynamic_cast<zs01_device *>(secflash) ) |
| 558 | 578 | secflash->sda_w( !( ( control >> 6 ) & 1 ) ); /* 0x40 */ |
| 559 | 579 | |
| 560 | if( | |
| 580 | if( | |
| 561 | 581 | { |
| 562 | state->m_flash_bank = (0 << 8) + ( ( control & 3 ) * 2 ); | |
| 563 | if( state->m_flash_bank != old_bank ) verboselog( space->machine(), 1, "onboard %d\n", control & 3 ); | |
| 582 | m_flash_bank = (0 << 8) + ( ( control & 3 ) * 2 ); | |
| 583 | if( m_flash_bank != old_bank ) verboselog( machine(), 1, "onboard %d\n", control & 3 ); | |
| 564 | 584 | } |
| 565 | else if( | |
| 585 | else if( | |
| 566 | 586 | { |
| 567 | state->m_flash_bank = (1 << 8) + ( ( control & 7 ) * 2 ); | |
| 568 | if( state->m_flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard1 %d\n", control & 7 ); | |
| 587 | m_flash_bank = (1 << 8) + ( ( control & 7 ) * 2 ); | |
| 588 | if( m_flash_bank != old_bank ) verboselog( machine(), 1, "pccard1 %d\n", control & 7 ); | |
| 569 | 589 | } |
| 570 | else if( | |
| 590 | else if( | |
| 571 | 591 | { |
| 572 | state->m_flash_bank = (2 << 8) + ( ( control & 7 ) * 2 ); | |
| 573 | if( state->m_flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard2 %d\n", control & 7 ); | |
| 592 | m_flash_bank = (2 << 8) + ( ( control & 7 ) * 2 ); | |
| 593 | if( m_flash_bank != old_bank ) verboselog( machine(), 1, "pccard2 %d\n", control & 7 ); | |
| 574 | 594 | } |
| 575 | else if( | |
| 595 | else if( | |
| 576 | 596 | { |
| 577 | state->m_flash_bank = (3 << 8) + ( ( control & 7 ) * 2 ); | |
| 578 | if( state->m_flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard3 %d\n", control & 7 ); | |
| 597 | m_flash_bank = (3 << 8) + ( ( control & 7 ) * 2 ); | |
| 598 | if( m_flash_bank != old_bank ) verboselog( machine(), 1, "pccard3 %d\n", control & 7 ); | |
| 579 | 599 | } |
| 580 | else if( | |
| 600 | else if( | |
| 581 | 601 | { |
| 582 | state->m_flash_bank = (4 << 8) + ( ( control & 7 ) * 2 ); | |
| 583 | if( state->m_flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard4 %d\n", control & 7 ); | |
| 602 | m_flash_bank = (4 << 8) + ( ( control & 7 ) * 2 ); | |
| 603 | if( m_flash_bank != old_bank ) verboselog( machine(), 1, "pccard4 %d\n", control & 7 ); | |
| 584 | 604 | } |
| 585 | 605 | } |
| 586 | 606 | |
| r14896 | r14897 | |
| 652 | 672 | verboselog( machine, 2, "atapi_xfer_end: %d %d\n", state->m_atapi_xferlen, state->m_atapi_xfermod ); |
| 653 | 673 | } |
| 654 | 674 | |
| 655 | ||
| 675 | ||
| 656 | 676 | { |
| 657 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 658 | UINT8 *atapi_regs = state->m_atapi_regs; | |
| 659 | running_machine &machine = space->machine(); | |
| 677 | UINT8 *atapi_regs = m_atapi_regs; | |
| 660 | 678 | int reg, data; |
| 661 | 679 | |
| 662 | 680 | if (mem_mask == 0x0000ffff) // word-wide command read |
| r14896 | r14897 | |
| 664 | 682 | // mame_printf_debug("ATAPI: packet read = %04x\n", atapi_data[atapi_data_ptr]); |
| 665 | 683 | |
| 666 | 684 | // assert IRQ and drop DRQ |
| 667 | if ( | |
| 685 | if ( | |
| 668 | 686 | { |
| 669 | 687 | // get the data from the device |
| 670 | if( | |
| 688 | if( | |
| 671 | 689 | { |
| 672 | SCSIReadData( state->m_inserted_cdrom, state->m_atapi_data, state->m_atapi_xferlen ); | |
| 673 | state->m_atapi_data_len = state->m_atapi_xferlen; | |
| 690 | SCSIReadData( m_inserted_cdrom, m_atapi_data, m_atapi_xferlen ); | |
| 691 | m_atapi_data_len = m_atapi_xferlen; | |
| 674 | 692 | } |
| 675 | 693 | |
| 676 | if ( | |
| 694 | if ( | |
| 677 | 695 | { |
| 678 | state->m_atapi_xferlen = MAX_TRANSFER_SIZE; | |
| 679 | state->m_atapi_xfermod = state->m_atapi_xfermod - MAX_TRANSFER_SIZE; | |
| 696 | m_atapi_xferlen = MAX_TRANSFER_SIZE; | |
| 697 | m_atapi_xfermod = m_atapi_xfermod - MAX_TRANSFER_SIZE; | |
| 680 | 698 | } |
| 681 | 699 | else |
| 682 | 700 | { |
| 683 | state->m_atapi_xferlen = state->m_atapi_xfermod; | |
| 684 | state->m_atapi_xfermod = 0; | |
| 701 | m_atapi_xferlen = m_atapi_xfermod; | |
| 702 | m_atapi_xfermod = 0; | |
| 685 | 703 | } |
| 686 | 704 | |
| 687 | verboselog( machine, 2, "atapi_r: atapi_xferlen=%d\n", state->m_atapi_xferlen ); | |
| 688 | if( state->m_atapi_xferlen != 0 ) | |
| 705 | verboselog( machine(), 2, "atapi_r: atapi_xferlen=%d\n", m_atapi_xferlen ); | |
| 706 | if( m_atapi_xferlen != 0 ) | |
| 689 | 707 | { |
| 690 | 708 | atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ | ATAPI_STAT_SERVDSC; |
| 691 | 709 | atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO; |
| r14896 | r14897 | |
| 697 | 715 | atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO; |
| 698 | 716 | } |
| 699 | 717 | |
| 700 | atapi_regs[ATAPI_REG_COUNTLOW] = state->m_atapi_xferlen & 0xff; | |
| 701 | atapi_regs[ATAPI_REG_COUNTHIGH] = (state->m_atapi_xferlen>>8)&0xff; | |
| 718 | atapi_regs[ATAPI_REG_COUNTLOW] = m_atapi_xferlen & 0xff; | |
| 719 | atapi_regs[ATAPI_REG_COUNTHIGH] = (m_atapi_xferlen>>8)&0xff; | |
| 702 | 720 | |
| 703 | psx_irq_set( | |
| 721 | psx_irq_set( | |
| 704 | 722 | } |
| 705 | 723 | |
| 706 | if( | |
| 724 | if( | |
| 707 | 725 | { |
| 708 | data = state->m_atapi_data[state->m_atapi_data_ptr++]; | |
| 709 | data |= ( state->m_atapi_data[state->m_atapi_data_ptr++] << 8 ); | |
| 710 | if( state->m_atapi_data_ptr >= state->m_atapi_data_len ) | |
| 726 | data = m_atapi_data[m_atapi_data_ptr++]; | |
| 727 | data |= ( m_atapi_data[m_atapi_data_ptr++] << 8 ); | |
| 728 | if( m_atapi_data_ptr >= m_atapi_data_len ) | |
| 711 | 729 | { |
| 712 | // verboselog( machine, 2, "atapi_r: read all bytes\n" ); | |
| 713 | state->m_atapi_data_ptr = 0; | |
| 714 | state->m_atapi_data_len = 0; | |
| 730 | // verboselog( machine(), 2, "atapi_r: read all bytes\n" ); | |
| 731 | m_atapi_data_ptr = 0; | |
| 732 | m_atapi_data_len = 0; | |
| 715 | 733 | |
| 716 | if( | |
| 734 | if( | |
| 717 | 735 | { |
| 718 | 736 | atapi_regs[ATAPI_REG_CMDSTATUS] = 0; |
| 719 | 737 | atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO; |
| 720 | psx_irq_set( | |
| 738 | psx_irq_set( | |
| 721 | 739 | } |
| 722 | 740 | } |
| 723 | 741 | } |
| r14896 | r14897 | |
| 742 | 760 | switch( reg ) |
| 743 | 761 | { |
| 744 | 762 | case ATAPI_REG_DATA: |
| 745 | verboselog( machine, 1, "atapi_r: data=%02x\n", data ); | |
| 763 | verboselog( machine(), 1, "atapi_r: data=%02x\n", data ); | |
| 746 | 764 | break; |
| 747 | 765 | case ATAPI_REG_ERRFEAT: |
| 748 | verboselog( machine, 1, "atapi_r: errfeat=%02x\n", data ); | |
| 766 | verboselog( machine(), 1, "atapi_r: errfeat=%02x\n", data ); | |
| 749 | 767 | break; |
| 750 | 768 | case ATAPI_REG_INTREASON: |
| 751 | verboselog( machine, 1, "atapi_r: intreason=%02x\n", data ); | |
| 769 | verboselog( machine(), 1, "atapi_r: intreason=%02x\n", data ); | |
| 752 | 770 | break; |
| 753 | 771 | case ATAPI_REG_SAMTAG: |
| 754 | verboselog( machine, 1, "atapi_r: samtag=%02x\n", data ); | |
| 772 | verboselog( machine(), 1, "atapi_r: samtag=%02x\n", data ); | |
| 755 | 773 | break; |
| 756 | 774 | case ATAPI_REG_COUNTLOW: |
| 757 | verboselog( machine, 1, "atapi_r: countlow=%02x\n", data ); | |
| 775 | verboselog( machine(), 1, "atapi_r: countlow=%02x\n", data ); | |
| 758 | 776 | break; |
| 759 | 777 | case ATAPI_REG_COUNTHIGH: |
| 760 | verboselog( machine, 1, "atapi_r: counthigh=%02x\n", data ); | |
| 778 | verboselog( machine(), 1, "atapi_r: counthigh=%02x\n", data ); | |
| 761 | 779 | break; |
| 762 | 780 | case ATAPI_REG_DRIVESEL: |
| 763 | verboselog( machine, 1, "atapi_r: drivesel=%02x\n", data ); | |
| 781 | verboselog( machine(), 1, "atapi_r: drivesel=%02x\n", data ); | |
| 764 | 782 | break; |
| 765 | 783 | case ATAPI_REG_CMDSTATUS: |
| 766 | verboselog( machine, 1, "atapi_r: cmdstatus=%02x\n", data ); | |
| 784 | verboselog( machine(), 1, "atapi_r: cmdstatus=%02x\n", data ); | |
| 767 | 785 | break; |
| 768 | 786 | } |
| 769 | 787 | |
| 770 | // mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, cpu_get_pc(&space | |
| 788 | // mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, cpu_get_pc(&space. | |
| 771 | 789 | |
| 772 | 790 | data <<= shift; |
| 773 | 791 | } |
| 774 | 792 | |
| 775 | verboselog( machine, 2, "atapi_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 793 | verboselog( machine(), 2, "atapi_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 776 | 794 | return data; |
| 777 | 795 | } |
| 778 | 796 | |
| 779 | ||
| 797 | ||
| 780 | 798 | { |
| 781 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 782 | UINT8 *atapi_regs = state->m_atapi_regs; | |
| 783 | UINT8 *atapi_data = state->m_atapi_data; | |
| 784 | running_machine &machine = space->machine(); | |
| 799 | UINT8 *atapi_regs = m_atapi_regs; | |
| 800 | UINT8 *atapi_data = m_atapi_data; | |
| 785 | 801 | int reg; |
| 786 | 802 | |
| 787 | verboselog( machine, 2, "atapi_w( %08x, %08x, %08x )\n", offset, mem_mask, data ); | |
| 803 | verboselog( machine(), 2, "atapi_w( %08x, %08x, %08x )\n", offset, mem_mask, data ); | |
| 788 | 804 | |
| 789 | 805 | if (mem_mask == 0x0000ffff) // word-wide command write |
| 790 | 806 | { |
| 791 | verboselog( machine, 2, "atapi_w: data=%04x\n", data ); | |
| 807 | verboselog( machine(), 2, "atapi_w: data=%04x\n", data ); | |
| 792 | 808 | |
| 793 | 809 | // mame_printf_debug("ATAPI: packet write %04x\n", data); |
| 794 | atapi_data[state->m_atapi_data_ptr++] = data & 0xff; | |
| 795 | atapi_data[state->m_atapi_data_ptr++] = data >> 8; | |
| 810 | atapi_data[m_atapi_data_ptr++] = data & 0xff; | |
| 811 | atapi_data[m_atapi_data_ptr++] = data >> 8; | |
| 796 | 812 | |
| 797 | if ( | |
| 813 | if ( | |
| 798 | 814 | { |
| 799 | // mame_printf_debug("ATAPI: waiting, ptr %d wait %d\n", state->m_atapi_data_ptr, state->m_atapi_cdata_wait); | |
| 800 | if (state->m_atapi_data_ptr == state->m_atapi_cdata_wait) | |
| 815 | // mame_printf_debug("ATAPI: waiting, ptr %d wait %d\n", m_atapi_data_ptr, m_atapi_cdata_wait); | |
| 816 | if (m_atapi_data_ptr == m_atapi_cdata_wait) | |
| 801 | 817 | { |
| 802 | 818 | // send it to the device |
| 803 | SCSIWriteData( | |
| 819 | SCSIWriteData( | |
| 804 | 820 | |
| 805 | 821 | // assert IRQ |
| 806 | psx_irq_set( | |
| 822 | psx_irq_set( | |
| 807 | 823 | |
| 808 | 824 | // not sure here, but clear DRQ at least? |
| 809 | 825 | atapi_regs[ATAPI_REG_CMDSTATUS] = 0; |
| 810 | 826 | } |
| 811 | 827 | } |
| 812 | 828 | |
| 813 | else if ( | |
| 829 | else if ( | |
| 814 | 830 | { |
| 815 | 831 | int phase; |
| 816 | 832 | |
| 817 | verboselog( machine, 2, "atapi_w: command %02x\n", atapi_data[0]&0xff ); | |
| 833 | verboselog( machine(), 2, "atapi_w: command %02x\n", atapi_data[0]&0xff ); | |
| 818 | 834 | |
| 819 | 835 | // reset data pointer for reading SCSI results |
| 820 | state->m_atapi_data_ptr = 0; | |
| 821 | state->m_atapi_data_len = 0; | |
| 836 | m_atapi_data_ptr = 0; | |
| 837 | m_atapi_data_len = 0; | |
| 822 | 838 | |
| 823 | 839 | // send it to the SCSI device |
| 824 | SCSISetCommand( state->m_inserted_cdrom, state->m_atapi_data, 12 ); | |
| 825 | SCSIExecCommand( state->m_inserted_cdrom, &state->m_atapi_xferlen ); | |
| 826 | SCSIGetPhase( state->m_inserted_cdrom, &phase ); | |
| 840 | SCSISetCommand( m_inserted_cdrom, m_atapi_data, 12 ); | |
| 841 | SCSIExecCommand( m_inserted_cdrom, &m_atapi_xferlen ); | |
| 842 | SCSIGetPhase( m_inserted_cdrom, &phase ); | |
| 827 | 843 | |
| 828 | if ( | |
| 844 | if ( | |
| 829 | 845 | { |
| 830 | // mame_printf_debug("ATAPI: SCSI command %02x returned %d bytes from the device\n", atapi_data[0]&0xff, | |
| 846 | // mame_printf_debug("ATAPI: SCSI command %02x returned %d bytes from the device\n", atapi_data[0]&0xff, | |
| 831 | 847 | |
| 832 | 848 | // store the returned command length in the ATAPI regs, splitting into |
| 833 | 849 | // multiple transfers if necessary |
| 834 | state->m_atapi_xfermod = 0; | |
| 835 | if (state->m_atapi_xferlen > MAX_TRANSFER_SIZE) | |
| 850 | m_atapi_xfermod = 0; | |
| 851 | if (m_atapi_xferlen > MAX_TRANSFER_SIZE) | |
| 836 | 852 | { |
| 837 | state->m_atapi_xfermod = state->m_atapi_xferlen - MAX_TRANSFER_SIZE; | |
| 838 | state->m_atapi_xferlen = MAX_TRANSFER_SIZE; | |
| 853 | m_atapi_xfermod = m_atapi_xferlen - MAX_TRANSFER_SIZE; | |
| 854 | m_atapi_xferlen = MAX_TRANSFER_SIZE; | |
| 839 | 855 | } |
| 840 | 856 | |
| 841 | atapi_regs[ATAPI_REG_COUNTLOW] = state->m_atapi_xferlen & 0xff; | |
| 842 | atapi_regs[ATAPI_REG_COUNTHIGH] = (state->m_atapi_xferlen>>8)&0xff; | |
| 857 | atapi_regs[ATAPI_REG_COUNTLOW] = m_atapi_xferlen & 0xff; | |
| 858 | atapi_regs[ATAPI_REG_COUNTHIGH] = (m_atapi_xferlen>>8)&0xff; | |
| 843 | 859 | |
| 844 | if ( | |
| 860 | if ( | |
| 845 | 861 | { |
| 846 | 862 | // if no data to return, set the registers properly |
| 847 | 863 | atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRDY; |
| r14896 | r14897 | |
| 857 | 873 | switch( phase ) |
| 858 | 874 | { |
| 859 | 875 | case SCSI_PHASE_DATAOUT: |
| 860 | | |
| 876 | | |
| 861 | 877 | break; |
| 862 | 878 | } |
| 863 | 879 | |
| r14896 | r14897 | |
| 871 | 887 | |
| 872 | 888 | case 0x45: // PLAY |
| 873 | 889 | atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_BSY; |
| 874 | | |
| 890 | | |
| 875 | 891 | break; |
| 876 | 892 | } |
| 877 | 893 | |
| 878 | 894 | // assert IRQ |
| 879 | psx_irq_set( | |
| 895 | psx_irq_set( | |
| 880 | 896 | } |
| 881 | 897 | else |
| 882 | 898 | { |
| r14896 | r14897 | |
| 901 | 917 | switch( reg ) |
| 902 | 918 | { |
| 903 | 919 | case ATAPI_REG_DATA: |
| 904 | verboselog( machine, 1, "atapi_w: data=%02x\n", data ); | |
| 920 | verboselog( machine(), 1, "atapi_w: data=%02x\n", data ); | |
| 905 | 921 | break; |
| 906 | 922 | case ATAPI_REG_ERRFEAT: |
| 907 | verboselog( machine, 1, "atapi_w: errfeat=%02x\n", data ); | |
| 923 | verboselog( machine(), 1, "atapi_w: errfeat=%02x\n", data ); | |
| 908 | 924 | break; |
| 909 | 925 | case ATAPI_REG_INTREASON: |
| 910 | verboselog( machine, 1, "atapi_w: intreason=%02x\n", data ); | |
| 926 | verboselog( machine(), 1, "atapi_w: intreason=%02x\n", data ); | |
| 911 | 927 | break; |
| 912 | 928 | case ATAPI_REG_SAMTAG: |
| 913 | verboselog( machine, 1, "atapi_w: samtag=%02x\n", data ); | |
| 929 | verboselog( machine(), 1, "atapi_w: samtag=%02x\n", data ); | |
| 914 | 930 | break; |
| 915 | 931 | case ATAPI_REG_COUNTLOW: |
| 916 | verboselog( machine, 1, "atapi_w: countlow=%02x\n", data ); | |
| 932 | verboselog( machine(), 1, "atapi_w: countlow=%02x\n", data ); | |
| 917 | 933 | break; |
| 918 | 934 | case ATAPI_REG_COUNTHIGH: |
| 919 | verboselog( machine, 1, "atapi_w: counthigh=%02x\n", data ); | |
| 935 | verboselog( machine(), 1, "atapi_w: counthigh=%02x\n", data ); | |
| 920 | 936 | break; |
| 921 | 937 | case ATAPI_REG_DRIVESEL: |
| 922 | verboselog( machine, 1, "atapi_w: drivesel=%02x\n", data ); | |
| 938 | verboselog( machine(), 1, "atapi_w: drivesel=%02x\n", data ); | |
| 923 | 939 | break; |
| 924 | 940 | case ATAPI_REG_CMDSTATUS: |
| 925 | verboselog( machine, 1, "atapi_w: cmdstatus=%02x\n", data ); | |
| 941 | verboselog( machine(), 1, "atapi_w: cmdstatus=%02x\n", data ); | |
| 926 | 942 | break; |
| 927 | 943 | } |
| 928 | 944 | |
| 929 | 945 | atapi_regs[reg] = data; |
| 930 | // mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, cpu_get_pc(&space | |
| 946 | // mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, cpu_get_pc(&space. | |
| 931 | 947 | |
| 932 | 948 | if (reg == ATAPI_REG_CMDSTATUS) |
| 933 | 949 | { |
| 934 | // mame_printf_debug("ATAPI command %x issued! (PC=%x)\n", data, cpu_get_pc(&space | |
| 950 | // mame_printf_debug("ATAPI command %x issued! (PC=%x)\n", data, cpu_get_pc(&space. | |
| 935 | 951 | |
| 936 | 952 | switch (data) |
| 937 | 953 | { |
| r14896 | r14897 | |
| 939 | 955 | atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ; |
| 940 | 956 | atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_COMMAND; |
| 941 | 957 | |
| 942 | state->m_atapi_data_ptr = 0; | |
| 943 | state->m_atapi_data_len = 0; | |
| 958 | m_atapi_data_ptr = 0; | |
| 959 | m_atapi_data_len = 0; | |
| 944 | 960 | |
| 945 | 961 | /* we have no data */ |
| 946 | state->m_atapi_xferlen = 0; | |
| 947 | state->m_atapi_xfermod = 0; | |
| 962 | m_atapi_xferlen = 0; | |
| 963 | m_atapi_xfermod = 0; | |
| 948 | 964 | |
| 949 | | |
| 965 | | |
| 950 | 966 | break; |
| 951 | 967 | |
| 952 | 968 | case 0xa1: // IDENTIFY PACKET DEVICE |
| 953 | 969 | atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_DRQ; |
| 954 | 970 | |
| 955 | state->m_atapi_data_ptr = 0; | |
| 956 | state->m_atapi_data_len = 512; | |
| 971 | m_atapi_data_ptr = 0; | |
| 972 | m_atapi_data_len = 512; | |
| 957 | 973 | |
| 958 | 974 | /* we have no data */ |
| 959 | state->m_atapi_xferlen = 0; | |
| 960 | state->m_atapi_xfermod = 0; | |
| 975 | m_atapi_xferlen = 0; | |
| 976 | m_atapi_xfermod = 0; | |
| 961 | 977 | |
| 962 | memset( atapi_data, 0, | |
| 978 | memset( atapi_data, 0, | |
| 963 | 979 | |
| 964 | 980 | atapi_data[ 0 ^ 1 ] = 0x85; // ATAPI device, cmd set 5 compliant, DRQ within 3 ms of PACKET command |
| 965 | 981 | atapi_data[ 1 ^ 1 ] = 0x00; |
| r14896 | r14897 | |
| 993 | 1009 | atapi_regs[ATAPI_REG_COUNTLOW] = 0; |
| 994 | 1010 | atapi_regs[ATAPI_REG_COUNTHIGH] = 2; |
| 995 | 1011 | |
| 996 | psx_irq_set( | |
| 1012 | psx_irq_set( | |
| 997 | 1013 | break; |
| 998 | 1014 | |
| 999 | 1015 | case 0xef: // SET FEATURES |
| 1000 | 1016 | atapi_regs[ATAPI_REG_CMDSTATUS] = 0; |
| 1001 | 1017 | |
| 1002 | state->m_atapi_data_ptr = 0; | |
| 1003 | state->m_atapi_data_len = 0; | |
| 1018 | m_atapi_data_ptr = 0; | |
| 1019 | m_atapi_data_len = 0; | |
| 1004 | 1020 | |
| 1005 | psx_irq_set( | |
| 1021 | psx_irq_set( | |
| 1006 | 1022 | break; |
| 1007 | 1023 | |
| 1008 | 1024 | default: |
| r14896 | r14897 | |
| 1068 | 1084 | state->save_item( NAME(state->m_atapi_xfermod) ); |
| 1069 | 1085 | } |
| 1070 | 1086 | |
| 1071 | ||
| 1087 | ||
| 1072 | 1088 | { |
| 1073 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 1074 | UINT8 *atapi_regs = state->m_atapi_regs; | |
| 1089 | UINT8 *atapi_regs = m_atapi_regs; | |
| 1075 | 1090 | |
| 1076 | verboselog( | |
| 1091 | verboselog( | |
| 1077 | 1092 | |
| 1078 | 1093 | if (data) |
| 1079 | 1094 | { |
| 1080 | verboselog( | |
| 1095 | verboselog( | |
| 1081 | 1096 | |
| 1082 | 1097 | // mame_printf_debug("ATAPI reset\n"); |
| 1083 | 1098 | |
| r14896 | r14897 | |
| 1086 | 1101 | atapi_regs[ATAPI_REG_COUNTLOW] = 0x14; |
| 1087 | 1102 | atapi_regs[ATAPI_REG_COUNTHIGH] = 0xeb; |
| 1088 | 1103 | |
| 1089 | state->m_atapi_data_ptr = 0; | |
| 1090 | state->m_atapi_data_len = 0; | |
| 1091 | state->m_atapi_cdata_wait = 0; | |
| 1104 | m_atapi_data_ptr = 0; | |
| 1105 | m_atapi_data_len = 0; | |
| 1106 | m_atapi_cdata_wait = 0; | |
| 1092 | 1107 | |
| 1093 | state->m_atapi_xferlen = 0; | |
| 1094 | state->m_atapi_xfermod = 0; | |
| 1108 | m_atapi_xferlen = 0; | |
| 1109 | m_atapi_xfermod = 0; | |
| 1095 | 1110 | } |
| 1096 | 1111 | } |
| 1097 | 1112 | |
| r14896 | r14897 | |
| 1114 | 1129 | state->m_atapi_timer->adjust(state->machine().device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->m_atapi_xferlen/2048)))); |
| 1115 | 1130 | } |
| 1116 | 1131 | |
| 1117 | ||
| 1132 | ||
| 1118 | 1133 | { |
| 1119 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 1120 | int security_cart_number = state->m_security_cart_number; | |
| 1121 | running_machine &machine = space->machine(); | |
| 1122 | COMBINE_DATA( &state->m_n_security_control ); | |
| 1134 | int security_cart_number = m_security_cart_number; | |
| 1135 | COMBINE_DATA( &m_n_security_control ); | |
| 1123 | 1136 | |
| 1124 | verboselog( | |
| 1137 | verboselog( | |
| 1125 | 1138 | |
| 1126 | 1139 | if( ACCESSING_BITS_0_15 ) |
| 1127 | 1140 | { |
| 1128 | ds2401_device *ds2401 = space->machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id"); | |
| 1129 | device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom"); | |
| 1141 | ds2401_device *ds2401 = machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id"); | |
| 1142 | device_secure_serial_flash *secflash = machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom"); | |
| 1130 | 1143 | |
| 1131 | 1144 | if( secflash ) { |
| 1132 | 1145 | if( !dynamic_cast<zs01_device *>(secflash) ) |
| r14896 | r14897 | |
| 1141 | 1154 | ds2401->write(!( ( data >> 4 ) & 1 )); |
| 1142 | 1155 | } |
| 1143 | 1156 | |
| 1144 | if( | |
| 1157 | if( | |
| 1145 | 1158 | { |
| 1146 | (* | |
| 1159 | (* | |
| 1147 | 1160 | } |
| 1148 | 1161 | } |
| 1149 | 1162 | |
| 1150 | input_port_write_safe( machine, "OUT1", data, mem_mask ); | |
| 1163 | input_port_write_safe( machine(), "OUT1", data, mem_mask ); | |
| 1151 | 1164 | } |
| 1152 | 1165 | |
| 1153 | ||
| 1166 | ||
| 1154 | 1167 | { |
| 1155 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 1156 | 1168 | |
| 1157 | UINT32 data = state->m_n_security_control; | |
| 1158 | verboselog( space->machine(), 2, "security_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 1169 | UINT32 data = m_n_security_control; | |
| 1170 | verboselog( machine(), 2, "security_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 1159 | 1171 | return data; |
| 1160 | 1172 | } |
| 1161 | 1173 | |
| 1162 | ||
| 1174 | ||
| 1163 | 1175 | { |
| 1164 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 1165 | 1176 | UINT32 data = 0; |
| 1166 | 1177 | |
| 1167 | if( | |
| 1178 | if( | |
| 1168 | 1179 | { |
| 1169 | mame_printf_debug( "%08x: flash_r( %08x, %08x ) no bank selected %08x\n", cpu_get_pc(&space | |
| 1180 | mame_printf_debug( "%08x: flash_r( %08x, %08x ) no bank selected %08x\n", cpu_get_pc(&space. | |
| 1170 | 1181 | data = 0xffffffff; |
| 1171 | 1182 | } |
| 1172 | 1183 | else |
| 1173 | 1184 | { |
| 1174 | fujitsu_29f016a_device **flash_base = & | |
| 1185 | fujitsu_29f016a_device **flash_base = & | |
| 1175 | 1186 | int adr = offset * 2; |
| 1176 | 1187 | |
| 1177 | 1188 | if( ACCESSING_BITS_0_7 ) |
| r14896 | r14897 | |
| 1192 | 1203 | } |
| 1193 | 1204 | } |
| 1194 | 1205 | |
| 1195 | verboselog( | |
| 1206 | verboselog( | |
| 1196 | 1207 | |
| 1197 | 1208 | return data; |
| 1198 | 1209 | } |
| 1199 | 1210 | |
| 1200 | ||
| 1211 | ||
| 1201 | 1212 | { |
| 1202 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 1203 | 1213 | |
| 1204 | verboselog( | |
| 1214 | verboselog( | |
| 1205 | 1215 | |
| 1206 | if( | |
| 1216 | if( | |
| 1207 | 1217 | { |
| 1208 | mame_printf_debug( "%08x: flash_w( %08x, %08x, %08x ) no bank selected %08x\n", cpu_get_pc(&space | |
| 1218 | mame_printf_debug( "%08x: flash_w( %08x, %08x, %08x ) no bank selected %08x\n", cpu_get_pc(&space. | |
| 1209 | 1219 | } |
| 1210 | 1220 | else |
| 1211 | 1221 | { |
| 1212 | fujitsu_29f016a_device **flash_base = & | |
| 1222 | fujitsu_29f016a_device **flash_base = & | |
| 1213 | 1223 | int adr = offset * 2; |
| 1214 | 1224 | |
| 1215 | 1225 | if( ACCESSING_BITS_0_7 ) |
| r14896 | r14897 | |
| 1233 | 1243 | |
| 1234 | 1244 | static ADDRESS_MAP_START( konami573_map, AS_PROGRAM, 32, ksys573_state ) |
| 1235 | 1245 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE("share1") /* ram */ |
| 1236 | AM_RANGE(0x1f000000, 0x1f3fffff) AM_READWRITE | |
| 1246 | AM_RANGE(0x1f000000, 0x1f3fffff) AM_READWRITE | |
| 1237 | 1247 | AM_RANGE(0x1f400000, 0x1f400003) AM_READ_PORT( "IN0" ) AM_WRITE_PORT( "OUT0" ) |
| 1238 | AM_RANGE(0x1f400004, 0x1f400007) AM_READ | |
| 1248 | AM_RANGE(0x1f400004, 0x1f400007) AM_READ | |
| 1239 | 1249 | AM_RANGE(0x1f400008, 0x1f40000b) AM_READ_PORT( "IN2" ) |
| 1240 | 1250 | AM_RANGE(0x1f40000c, 0x1f40000f) AM_READ_PORT( "IN3" ) |
| 1241 | AM_RANGE(0x1f480000, 0x1f48000f) AM_READWRITE_LEGACY(atapi_r, atapi_w ) // IDE controller, used mostly in ATAPI mode (only 3 pure IDE commands seen so far) | |
| 1242 | AM_RANGE(0x1f500000, 0x1f500003) AM_READWRITE_LEGACY(control_r, control_w ) // Konami can't make a game without a "control" register. | |
| 1243 | AM_RANGE(0x1f560000, 0x1f560003) AM_WRITE_LEGACY(atapi_reset_w ) | |
| 1251 | AM_RANGE(0x1f480000, 0x1f48000f) AM_READWRITE(atapi_r, atapi_w ) // IDE controller, used mostly in ATAPI mode (only 3 pure IDE commands seen so far) | |
| 1252 | AM_RANGE(0x1f500000, 0x1f500003) AM_READWRITE(control_r, control_w ) // Konami can't make a game without a "control" register. | |
| 1253 | AM_RANGE(0x1f560000, 0x1f560003) AM_WRITE(atapi_reset_w ) | |
| 1244 | 1254 | AM_RANGE(0x1f5c0000, 0x1f5c0003) AM_WRITENOP // watchdog? |
| 1245 | 1255 | AM_RANGE(0x1f620000, 0x1f623fff) AM_DEVREADWRITE8_LEGACY("m48t58", timekeeper_r, timekeeper_w, 0x00ff00ff) |
| 1246 | AM_RANGE(0x1f680000, 0x1f68001f) AM_READWRITE_LEGACY(mb89371_r, mb89371_w) | |
| 1247 | AM_RANGE(0x1f6a0000, 0x1f6a0003) AM_READWRITE_LEGACY(security_r, security_w ) | |
| 1256 | AM_RANGE(0x1f680000, 0x1f68001f) AM_READWRITE(mb89371_r, mb89371_w) | |
| 1257 | AM_RANGE(0x1f6a0000, 0x1f6a0003) AM_READWRITE(security_r, security_w ) | |
| 1248 | 1258 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_SHARE("share2") AM_REGION("bios", 0) |
| 1249 | 1259 | AM_RANGE(0x80000000, 0x803fffff) AM_RAM AM_SHARE("share1") /* ram mirror */ |
| 1250 | 1260 | AM_RANGE(0x9fc00000, 0x9fc7ffff) AM_ROM AM_SHARE("share2") /* bios mirror */ |
| r14896 | r14897 | |
| 1398 | 1408 | |
| 1399 | 1409 | */ |
| 1400 | 1410 | |
| 1401 | ||
| 1411 | ||
| 1402 | 1412 | { |
| 1403 | device_t *upd4701 = | |
| 1413 | device_t *upd4701 = | |
| 1404 | 1414 | UINT32 data = 0; |
| 1405 | 1415 | |
| 1406 | 1416 | switch (offset) |
| 1407 | 1417 | { |
| 1408 | 1418 | case 0x26: |
| 1409 | upd4701_y_add(upd4701, 0, input_port_read_safe(space->machine(), "uPD4701_y", 0), 0xffff); | |
| 1410 | upd4701_switches_set(upd4701, 0, input_port_read_safe(space->machine(), "uPD4701_switches", 0)); | |
| 1419 | upd4701_y_add(upd4701, 0, input_port_read_safe(machine(), "uPD4701_y", 0), 0xffff); | |
| 1420 | upd4701_switches_set(upd4701, 0, input_port_read_safe(machine(), "uPD4701_switches", 0)); | |
| 1411 | 1421 | |
| 1412 | 1422 | upd4701_cs_w(upd4701, 0, 0); |
| 1413 | 1423 | upd4701_xy_w(upd4701, 0, 1); |
| r14896 | r14897 | |
| 1428 | 1438 | break; |
| 1429 | 1439 | |
| 1430 | 1440 | default: |
| 1431 | verboselog( | |
| 1441 | verboselog( | |
| 1432 | 1442 | break; |
| 1433 | 1443 | } |
| 1434 | 1444 | |
| 1435 | verboselog( | |
| 1445 | verboselog( | |
| 1436 | 1446 | return data; |
| 1437 | 1447 | } |
| 1438 | 1448 | |
| 1439 | ||
| 1449 | ||
| 1440 | 1450 | { |
| 1441 | device_t *upd4701 = | |
| 1451 | device_t *upd4701 = | |
| 1442 | 1452 | switch (offset) |
| 1443 | 1453 | { |
| 1444 | 1454 | case 0x04: |
| r14896 | r14897 | |
| 1467 | 1477 | break; |
| 1468 | 1478 | |
| 1469 | 1479 | default: |
| 1470 | verboselog( | |
| 1480 | verboselog( | |
| 1471 | 1481 | break; |
| 1472 | 1482 | } |
| 1473 | 1483 | |
| 1474 | verboselog( | |
| 1484 | verboselog( | |
| 1475 | 1485 | } |
| 1476 | 1486 | |
| 1477 | 1487 | static DRIVER_INIT( ge765pwbba ) |
| 1478 | 1488 | { |
| 1489 | ksys573_state *state = machine.driver_data<ksys573_state>(); | |
| 1479 | 1490 | DRIVER_INIT_CALL(konami573); |
| 1480 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1491 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1481 | 1492 | } |
| 1482 | 1493 | |
| 1483 | 1494 | /* |
| r14896 | r14897 | |
| 1488 | 1499 | |
| 1489 | 1500 | */ |
| 1490 | 1501 | |
| 1491 | ||
| 1502 | ||
| 1492 | 1503 | { |
| 1493 | 1504 | UINT32 data = 0; |
| 1494 | 1505 | switch( offset ) |
| r14896 | r14897 | |
| 1514 | 1525 | break; |
| 1515 | 1526 | } |
| 1516 | 1527 | |
| 1517 | verboselog( | |
| 1528 | verboselog( | |
| 1518 | 1529 | |
| 1519 | 1530 | return data; |
| 1520 | 1531 | } |
| r14896 | r14897 | |
| 1540 | 1551 | state->m_gx700pwbf_output_data[ offset ] = data; |
| 1541 | 1552 | } |
| 1542 | 1553 | |
| 1543 | ||
| 1554 | ||
| 1544 | 1555 | { |
| 1545 | verboselog( | |
| 1556 | verboselog( | |
| 1546 | 1557 | |
| 1547 | 1558 | switch( offset ) |
| 1548 | 1559 | { |
| r14896 | r14897 | |
| 1550 | 1561 | |
| 1551 | 1562 | if( ACCESSING_BITS_0_15 ) |
| 1552 | 1563 | { |
| 1553 | gx700pwbf_output( | |
| 1564 | gx700pwbf_output( | |
| 1554 | 1565 | } |
| 1555 | 1566 | break; |
| 1556 | 1567 | |
| 1557 | 1568 | case 0x22: |
| 1558 | 1569 | if( ACCESSING_BITS_0_15 ) |
| 1559 | 1570 | { |
| 1560 | gx700pwbf_output( | |
| 1571 | gx700pwbf_output( | |
| 1561 | 1572 | } |
| 1562 | 1573 | break; |
| 1563 | 1574 | |
| 1564 | 1575 | case 0x24: |
| 1565 | 1576 | if( ACCESSING_BITS_0_15 ) |
| 1566 | 1577 | { |
| 1567 | gx700pwbf_output( | |
| 1578 | gx700pwbf_output( | |
| 1568 | 1579 | } |
| 1569 | 1580 | break; |
| 1570 | 1581 | |
| 1571 | 1582 | case 0x26: |
| 1572 | 1583 | if( ACCESSING_BITS_0_15 ) |
| 1573 | 1584 | { |
| 1574 | gx700pwbf_output( | |
| 1585 | gx700pwbf_output( | |
| 1575 | 1586 | } |
| 1576 | 1587 | break; |
| 1577 | 1588 | |
| r14896 | r14897 | |
| 1589 | 1600 | |
| 1590 | 1601 | state->m_gx700pwfbf_output_callback = output_callback_func; |
| 1591 | 1602 | |
| 1592 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1603 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1593 | 1604 | |
| 1594 | 1605 | state->save_item( NAME(state->m_gx700pwbf_output_data) ); |
| 1595 | 1606 | } |
| r14896 | r14897 | |
| 1786 | 1797 | |
| 1787 | 1798 | */ |
| 1788 | 1799 | |
| 1789 | ||
| 1800 | ||
| 1790 | 1801 | { |
| 1791 | 1802 | UINT32 data = 0; |
| 1792 | 1803 | switch( offset ) |
| r14896 | r14897 | |
| 1795 | 1806 | break; |
| 1796 | 1807 | |
| 1797 | 1808 | default: |
| 1798 | verboselog( | |
| 1809 | verboselog( | |
| 1799 | 1810 | break; |
| 1800 | 1811 | } |
| 1801 | 1812 | |
| 1802 | verboselog( | |
| 1813 | verboselog( | |
| 1803 | 1814 | return data; |
| 1804 | 1815 | } |
| 1805 | 1816 | |
| 1806 | ||
| 1817 | ||
| 1807 | 1818 | { |
| 1808 | verboselog( | |
| 1819 | verboselog( | |
| 1809 | 1820 | |
| 1810 | 1821 | switch( offset ) |
| 1811 | 1822 | { |
| r14896 | r14897 | |
| 1820 | 1831 | break; |
| 1821 | 1832 | |
| 1822 | 1833 | default: |
| 1823 | verboselog( | |
| 1834 | verboselog( | |
| 1824 | 1835 | break; |
| 1825 | 1836 | } |
| 1826 | 1837 | } |
| r14896 | r14897 | |
| 1828 | 1839 | static DRIVER_INIT( gtrfrks ) |
| 1829 | 1840 | { |
| 1830 | 1841 | DRIVER_INIT_CALL(konami573); |
| 1831 | ||
| 1832 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) ); | |
| 1842 | ksys573_state *state = machine.driver_data<ksys573_state>(); | |
| 1843 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f600000, 0x1f6000ff, read32_delegate(FUNC(ksys573_state::gtrfrks_io_r),state), write32_delegate(FUNC(ksys573_state::gtrfrks_io_w),state)); | |
| 1833 | 1844 | } |
| 1834 | 1845 | |
| 1835 | 1846 | /* GX894 digital i/o */ |
| 1836 | 1847 | |
| 1837 | ||
| 1848 | ||
| 1838 | 1849 | { |
| 1839 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 1840 | 1850 | UINT32 data = 0; |
| 1841 | 1851 | |
| 1842 | 1852 | switch( offset ) |
| r14896 | r14897 | |
| 1853 | 1863 | case 0x2b: |
| 1854 | 1864 | if( ACCESSING_BITS_0_15 ) |
| 1855 | 1865 | { |
| 1856 | mas3507d_device *mas3507d = | |
| 1866 | mas3507d_device *mas3507d = | |
| 1857 | 1867 | data |= mas3507d->i2c_scl_r() << 13; |
| 1858 | 1868 | data |= mas3507d->i2c_sda_r() << 12; |
| 1859 | 1869 | } |
| r14896 | r14897 | |
| 1865 | 1875 | case 0x2d: |
| 1866 | 1876 | if( ACCESSING_BITS_0_15 ) |
| 1867 | 1877 | { |
| 1868 | data |= state->m_gx894_ram[ state->m_gx894_ram_read_offset / 2 ]; | |
| 1869 | state->m_gx894_ram_read_offset += 2; | |
| 1878 | data |= m_gx894_ram[ m_gx894_ram_read_offset / 2 ]; | |
| 1879 | m_gx894_ram_read_offset += 2; | |
| 1870 | 1880 | } |
| 1871 | 1881 | if( ACCESSING_BITS_16_31 ) |
| 1872 | 1882 | { |
| r14896 | r14897 | |
| 1914 | 1924 | case 0x3b: |
| 1915 | 1925 | if( ACCESSING_BITS_16_31 ) |
| 1916 | 1926 | { |
| 1917 | data |= | |
| 1927 | data |= | |
| 1918 | 1928 | } |
| 1919 | 1929 | break; |
| 1920 | 1930 | case 0x3d: |
| r14896 | r14897 | |
| 1937 | 1947 | break; |
| 1938 | 1948 | } |
| 1939 | 1949 | |
| 1940 | verboselog( space->machine(), 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 1941 | // printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", cpu_get_pc(&space->device()), offset, mem_mask, data ); | |
| 1950 | verboselog( machine(), 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); | |
| 1951 | // printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", cpu_get_pc(&space.device()), offset, mem_mask, data ); | |
| 1942 | 1952 | return data; |
| 1943 | 1953 | } |
| 1944 | 1954 | |
| r14896 | r14897 | |
| 1974 | 1984 | state->m_gx894pwbba_output_data[ offset ] = data; |
| 1975 | 1985 | } |
| 1976 | 1986 | |
| 1977 | ||
| 1987 | ||
| 1978 | 1988 | { |
| 1979 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 1980 | 1989 | char buff[33]; |
| 1981 | UINT32 olda= | |
| 1990 | UINT32 olda= | |
| 1982 | 1991 | |
| 1983 | 1992 | // printf( "gx894pwbba_w( %08x, %08x, %08x )\n", offset, mem_mask, data ); |
| 1984 | 1993 | |
| r14896 | r14897 | |
| 1987 | 1996 | return; |
| 1988 | 1997 | } |
| 1989 | 1998 | |
| 1990 | verboselog( | |
| 1999 | verboselog( | |
| 1991 | 2000 | |
| 1992 | 2001 | switch( offset ) |
| 1993 | 2002 | { |
| r14896 | r14897 | |
| 2009 | 2018 | break; |
| 2010 | 2019 | case 0x2b: |
| 2011 | 2020 | if(ACCESSING_BITS_0_15) { |
| 2012 | mas3507d_device *mas3507d = | |
| 2021 | mas3507d_device *mas3507d = | |
| 2013 | 2022 | mas3507d->i2c_scl_w(data & 0x2000); |
| 2014 | 2023 | mas3507d->i2c_sda_w(data & 0x1000); |
| 2015 | 2024 | } |
| r14896 | r14897 | |
| 2024 | 2033 | case 0x2c: |
| 2025 | 2034 | if( ACCESSING_BITS_0_15 ) |
| 2026 | 2035 | { |
| 2027 | state->m_gx894_ram_write_offset &= 0x0000ffff; | |
| 2028 | state->m_gx894_ram_write_offset |= ( data & 0x0000ffff ) << 16; | |
| 2036 | m_gx894_ram_write_offset &= 0x0000ffff; | |
| 2037 | m_gx894_ram_write_offset |= ( data & 0x0000ffff ) << 16; | |
| 2029 | 2038 | } |
| 2030 | 2039 | if( ACCESSING_BITS_16_31 ) |
| 2031 | 2040 | { |
| 2032 | state->m_gx894_ram_write_offset &= 0xffff0000; | |
| 2033 | state->m_gx894_ram_write_offset |= ( data & 0xffff0000 ) >> 16; | |
| 2041 | m_gx894_ram_write_offset &= 0xffff0000; | |
| 2042 | m_gx894_ram_write_offset |= ( data & 0xffff0000 ) >> 16; | |
| 2034 | 2043 | } |
| 2035 | 2044 | break; |
| 2036 | 2045 | case 0x2d: |
| 2037 | 2046 | if( ACCESSING_BITS_0_15 ) |
| 2038 | 2047 | { |
| 2039 | state->m_gx894_ram[ state->m_gx894_ram_write_offset / 2 ] = data & 0xffff; | |
| 2040 | state->m_gx894_ram_write_offset += 2; | |
| 2048 | m_gx894_ram[ m_gx894_ram_write_offset / 2 ] = data & 0xffff; | |
| 2049 | m_gx894_ram_write_offset += 2; | |
| 2041 | 2050 | } |
| 2042 | 2051 | if( ACCESSING_BITS_16_31 ) |
| 2043 | 2052 | { |
| 2044 | state->m_gx894_ram_read_offset &= 0x0000ffff; | |
| 2045 | state->m_gx894_ram_read_offset |= ( data & 0xffff0000 ) << 0; | |
| 2053 | m_gx894_ram_read_offset &= 0x0000ffff; | |
| 2054 | m_gx894_ram_read_offset |= ( data & 0xffff0000 ) << 0; | |
| 2046 | 2055 | } |
| 2047 | 2056 | break; |
| 2048 | 2057 | case 0x2e: |
| 2049 | 2058 | if( ACCESSING_BITS_0_15 ) |
| 2050 | 2059 | { |
| 2051 | state->m_gx894_ram_read_offset &= 0xffff0000; | |
| 2052 | state->m_gx894_ram_read_offset |= ( data & 0x0000ffff ) >> 0; | |
| 2060 | m_gx894_ram_read_offset &= 0xffff0000; | |
| 2061 | m_gx894_ram_read_offset |= ( data & 0x0000ffff ) >> 0; | |
| 2053 | 2062 | } |
| 2054 | 2063 | if( ACCESSING_BITS_16_31 ) |
| 2055 | 2064 | { |
| r14896 | r14897 | |
| 2059 | 2068 | case 0x38: |
| 2060 | 2069 | if( ACCESSING_BITS_16_31 ) |
| 2061 | 2070 | { |
| 2062 | gx894pwbba_output( | |
| 2071 | gx894pwbba_output( | |
| 2063 | 2072 | } |
| 2064 | 2073 | if( ACCESSING_BITS_0_15 ) |
| 2065 | 2074 | { |
| 2066 | gx894pwbba_output( | |
| 2075 | gx894pwbba_output( | |
| 2067 | 2076 | } |
| 2068 | COMBINE_DATA( & | |
| 2077 | COMBINE_DATA( & | |
| 2069 | 2078 | break; |
| 2070 | 2079 | case 0x39: |
| 2071 | 2080 | if( ACCESSING_BITS_16_31 ) |
| 2072 | 2081 | { |
| 2073 | gx894pwbba_output( | |
| 2082 | gx894pwbba_output( | |
| 2074 | 2083 | } |
| 2075 | 2084 | if( ACCESSING_BITS_0_15 ) |
| 2076 | 2085 | { |
| 2077 | gx894pwbba_output( | |
| 2086 | gx894pwbba_output( | |
| 2078 | 2087 | } |
| 2079 | COMBINE_DATA( & | |
| 2088 | COMBINE_DATA( & | |
| 2080 | 2089 | break; |
| 2081 | 2090 | case 0x3a: |
| 2082 | 2091 | if( ACCESSING_BITS_16_31 ) |
| r14896 | r14897 | |
| 2087 | 2096 | logerror("FPGA MPEG key 3/3 %02x\n", data & 0xff); |
| 2088 | 2097 | if( ACCESSING_BITS_16_31 ) |
| 2089 | 2098 | { |
| 2090 | | |
| 2099 | | |
| 2091 | 2100 | } |
| 2092 | 2101 | break; |
| 2093 | 2102 | case 0x3e: |
| r14896 | r14897 | |
| 2099 | 2108 | /* 15 */ |
| 2100 | 2109 | |
| 2101 | 2110 | /* fpga */ |
| 2102 | state->m_s = ( state->m_s >> 1 ) | ( ( data & 0x8000 ) >> 8 ); | |
| 2103 | state->m_f++; | |
| 2104 | if( state->m_f == 8 ) | |
| 2111 | m_s = ( m_s >> 1 ) | ( ( data & 0x8000 ) >> 8 ); | |
| 2112 | m_f++; | |
| 2113 | if( m_f == 8 ) | |
| 2105 | 2114 | { |
| 2106 | 2115 | // printf( "%04x %02x\n", o, s ); |
| 2107 | state->m_c = 0; | |
| 2108 | state->m_f = 0; | |
| 2109 | state->m_o++; | |
| 2116 | m_c = 0; | |
| 2117 | m_f = 0; | |
| 2118 | m_o++; | |
| 2110 | 2119 | } |
| 2111 | 2120 | } |
| 2112 | 2121 | |
| 2113 | 2122 | if( ACCESSING_BITS_16_31 ) |
| 2114 | 2123 | { |
| 2115 | gx894pwbba_output( | |
| 2124 | gx894pwbba_output( | |
| 2116 | 2125 | } |
| 2117 | COMBINE_DATA( & | |
| 2126 | COMBINE_DATA( & | |
| 2118 | 2127 | break; |
| 2119 | 2128 | case 0x3f: |
| 2120 | 2129 | if( ACCESSING_BITS_16_31 ) |
| 2121 | 2130 | { |
| 2122 | gx894pwbba_output( | |
| 2131 | gx894pwbba_output( | |
| 2123 | 2132 | } |
| 2124 | 2133 | if( ACCESSING_BITS_0_15 ) |
| 2125 | 2134 | { |
| 2126 | gx894pwbba_output( | |
| 2135 | gx894pwbba_output( | |
| 2127 | 2136 | } |
| 2128 | COMBINE_DATA( & | |
| 2137 | COMBINE_DATA( & | |
| 2129 | 2138 | break; |
| 2130 | 2139 | default: |
| 2131 | 2140 | // printf( "write offset %08x\n", offset ); |
| 2132 | 2141 | break; |
| 2133 | 2142 | } |
| 2134 | if( | |
| 2143 | if( | |
| 2135 | 2144 | { |
| 2136 | 2145 | // printf( "%08x %08x %08x %08x\n", a, b, c, d ); |
| 2137 | 2146 | } |
| r14896 | r14897 | |
| 2144 | 2153 | |
| 2145 | 2154 | state->m_gx894pwbba_output_callback = output_callback_func; |
| 2146 | 2155 | |
| 2147 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2156 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2148 | 2157 | |
| 2149 | 2158 | state->m_gx894_ram_write_offset = 0; |
| 2150 | 2159 | state->m_gx894_ram_read_offset = 0; |
| r14896 | r14897 | |
| 2170 | 2179 | DRIVER_INIT_CALL(konami573); |
| 2171 | 2180 | |
| 2172 | 2181 | gx894pwbba_init( machine, NULL ); |
| 2173 | ||
| 2174 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) ); | |
| 2182 | ksys573_state *state = machine.driver_data<ksys573_state>(); | |
| 2183 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f600000, 0x1f6000ff, read32_delegate(FUNC(ksys573_state::gtrfrks_io_r),state), write32_delegate(FUNC(ksys573_state::gtrfrks_io_w),state) ); | |
| 2175 | 2184 | } |
| 2176 | 2185 | |
| 2177 | 2186 | /* ddr solo */ |
| r14896 | r14897 | |
| 2436 | 2445 | } |
| 2437 | 2446 | } |
| 2438 | 2447 | |
| 2439 | ||
| 2448 | ||
| 2440 | 2449 | { |
| 2441 | verboselog( | |
| 2450 | verboselog( | |
| 2442 | 2451 | |
| 2443 | 2452 | switch( offset ) |
| 2444 | 2453 | { |
| r14896 | r14897 | |
| 2453 | 2462 | break; |
| 2454 | 2463 | |
| 2455 | 2464 | default: |
| 2456 | verboselog( | |
| 2465 | verboselog( | |
| 2457 | 2466 | break; |
| 2458 | 2467 | } |
| 2459 | 2468 | } |
| r14896 | r14897 | |
| 2463 | 2472 | DRIVER_INIT_CALL(konami573); |
| 2464 | 2473 | |
| 2465 | 2474 | gx894pwbba_init( machine, dmx_output_callback ); |
| 2466 | ||
| 2467 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(dmx_io_w) ); | |
| 2475 | ksys573_state *state = machine.driver_data<ksys573_state>(); | |
| 2476 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1f600000, 0x1f6000ff, write32_delegate(FUNC(ksys573_state::dmx_io_w),state) ); | |
| 2468 | 2477 | } |
| 2469 | 2478 | |
| 2470 | 2479 | /* salary man champ */ |
| r14896 | r14897 | |
| 2600 | 2609 | } |
| 2601 | 2610 | } |
| 2602 | 2611 | |
| 2603 | ||
| 2612 | ||
| 2604 | 2613 | { |
| 2605 | verboselog( | |
| 2614 | verboselog( | |
| 2606 | 2615 | |
| 2607 | 2616 | switch( offset ) |
| 2608 | 2617 | { |
| r14896 | r14897 | |
| 2613 | 2622 | break; |
| 2614 | 2623 | |
| 2615 | 2624 | default: |
| 2616 | verboselog( | |
| 2625 | verboselog( | |
| 2617 | 2626 | break; |
| 2618 | 2627 | } |
| 2619 | 2628 | } |
| r14896 | r14897 | |
| 2623 | 2632 | DRIVER_INIT_CALL(konami573); |
| 2624 | 2633 | |
| 2625 | 2634 | gx894pwbba_init( machine, mamboagg_output_callback ); |
| 2626 | ||
| 2627 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(mamboagg_io_w) ); | |
| 2635 | ksys573_state *state = machine.driver_data<ksys573_state>(); | |
| 2636 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x1f600000, 0x1f6000ff, write32_delegate(FUNC(ksys573_state::mamboagg_io_w),state)); | |
| 2628 | 2637 | } |
| 2629 | 2638 | |
| 2630 | 2639 | |
| r14896 | r14897 | |
| 2806 | 2815 | |
| 2807 | 2816 | /* GunMania */ |
| 2808 | 2817 | |
| 2809 | ||
| 2818 | ||
| 2810 | 2819 | { |
| 2811 | 2820 | char s[ 1024 ] = ""; |
| 2812 | ksys573_state *state = space->machine().driver_data<ksys573_state>(); | |
| 2813 | ds2401_device *ds2401 = space->machine().device<ds2401_device>("gunmania_id"); | |
| 2821 | ds2401_device *ds2401 = machine().device<ds2401_device>("gunmania_id"); | |
| 2814 | 2822 | |
| 2815 | 2823 | switch( offset ) |
| 2816 | 2824 | { |
| r14896 | r14897 | |
| 2824 | 2832 | case 0x20: |
| 2825 | 2833 | strcat( s, "cable holder motor release " ); |
| 2826 | 2834 | |
| 2827 | | |
| 2835 | | |
| 2828 | 2836 | break; |
| 2829 | 2837 | |
| 2830 | 2838 | case 0x80: |
| 2831 | 2839 | strcat( s, "cable holder motor catch " ); |
| 2832 | 2840 | |
| 2833 | | |
| 2841 | | |
| 2834 | 2842 | break; |
| 2835 | 2843 | |
| 2836 | 2844 | case 0xa0: |
| r14896 | r14897 | |
| 2858 | 2866 | case 0x02: |
| 2859 | 2867 | strcat( s, "tank shutter motor close " ); |
| 2860 | 2868 | |
| 2861 | if( | |
| 2869 | if( | |
| 2862 | 2870 | { |
| 2863 | | |
| 2871 | | |
| 2864 | 2872 | } |
| 2865 | 2873 | |
| 2866 | 2874 | break; |
| r14896 | r14897 | |
| 2868 | 2876 | case 0x08: |
| 2869 | 2877 | strcat( s, "tank shutter motor open " ); |
| 2870 | 2878 | |
| 2871 | if( | |
| 2879 | if( | |
| 2872 | 2880 | { |
| 2873 | | |
| 2881 | | |
| 2874 | 2882 | } |
| 2875 | 2883 | |
| 2876 | 2884 | break; |
| r14896 | r14897 | |
| 2895 | 2903 | break; |
| 2896 | 2904 | } |
| 2897 | 2905 | |
| 2898 | verboselog( | |
| 2906 | verboselog( | |
| 2899 | 2907 | } |
| 2900 | 2908 | |
| 2901 | 2909 | CUSTOM_INPUT_MEMBER(ksys573_state::gunmania_tank_shutter_sensor) |
| r14896 | r14897 | |
| 2915 | 2923 | return m_cable_holder_release; |
| 2916 | 2924 | } |
| 2917 | 2925 | |
| 2918 | ||
| 2926 | ||
| 2919 | 2927 | { |
| 2920 | 2928 | UINT32 data = 0; |
| 2921 | ds2401_device *ds2401 = | |
| 2929 | ds2401_device *ds2401 = | |
| 2922 | 2930 | |
| 2923 | 2931 | switch( offset ) |
| 2924 | 2932 | { |
| 2925 | 2933 | case 0x20: |
| 2926 | data = input_port_read( | |
| 2934 | data = input_port_read( | |
| 2927 | 2935 | break; |
| 2928 | 2936 | |
| 2929 | 2937 | case 0x22: |
| 2930 | data = input_port_read( | |
| 2938 | data = input_port_read( | |
| 2931 | 2939 | break; |
| 2932 | 2940 | |
| 2933 | 2941 | case 0x34: |
| 2934 | data = input_port_read( | |
| 2942 | data = input_port_read( | |
| 2935 | 2943 | popmessage( "encoder %04x", data ); |
| 2936 | 2944 | break; |
| 2937 | 2945 | } |
| 2938 | 2946 | |
| 2939 | verboselog( | |
| 2947 | verboselog( | |
| 2940 | 2948 | return data; |
| 2941 | 2949 | } |
| 2942 | 2950 | |
| 2943 | 2951 | static DRIVER_INIT( gunmania ) |
| 2944 | 2952 | { |
| 2945 | 2953 | DRIVER_INIT_CALL(konami573); |
| 2946 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gunmania_r), FUNC(gunmania_w) ); | |
| 2954 | ksys573_state *state = machine.driver_data<ksys573_state>(); | |
| 2955 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler( 0x1f640000, 0x1f6400ff, read32_delegate(FUNC(ksys573_state::gunmania_r),state), write32_delegate(FUNC(ksys573_state::gunmania_w),state)); | |
| 2947 | 2956 | } |
| 2948 | 2957 | |
| 2949 | 2958 | /* ADC0834 Interface */ |
| r14896 | r14897 | |
|---|---|---|
| 41 | 41 | { |
| 42 | 42 | public: |
| 43 | 43 | sbrkout_state(const machine_config &mconfig, device_type type, const char *tag) |
| 44 | : driver_device(mconfig, type, tag) { } | |
| 44 | : driver_device(mconfig, type, tag) , | |
| 45 | m_videoram(*this, "videoram"){ } | |
| 45 | 46 | |
| 46 | UINT8 | |
| 47 | required_shared_ptr<UINT8> | |
| 47 | 48 | emu_timer *m_scanline_timer; |
| 48 | 49 | emu_timer *m_pot_timer; |
| 49 | 50 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 97 | 98 | static MACHINE_START( sbrkout ) |
| 98 | 99 | { |
| 99 | 100 | sbrkout_state *state = machine.driver_data<sbrkout_state>(); |
| 100 | UINT8 *videoram = state->m_videoram; | |
| 101 | UINT8 *videoram = state->m_videoram.target(); | |
| 101 | 102 | memory_set_bankptr(machine, "bank1", &videoram[0x380]); |
| 102 | 103 | state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback)); |
| 103 | 104 | state->m_pot_timer = machine.scheduler().timer_alloc(FUNC(pot_trigger_callback)); |
| r14896 | r14897 | |
| 125 | 126 | static TIMER_CALLBACK( scanline_callback ) |
| 126 | 127 | { |
| 127 | 128 | sbrkout_state *state = machine.driver_data<sbrkout_state>(); |
| 128 | UINT8 *videoram = state->m_videoram; | |
| 129 | UINT8 *videoram = state->m_videoram.target(); | |
| 129 | 130 | int scanline = param; |
| 130 | 131 | |
| 131 | 132 | /* force a partial update before anything happens */ |
| r14896 | r14897 | |
| 298 | 299 | static TILE_GET_INFO( get_bg_tile_info ) |
| 299 | 300 | { |
| 300 | 301 | sbrkout_state *state = machine.driver_data<sbrkout_state>(); |
| 301 | UINT8 *videoram = state->m_videoram; | |
| 302 | UINT8 *videoram = state->m_videoram.target(); | |
| 302 | 303 | int code = (videoram[tile_index] & 0x80) ? videoram[tile_index] : 0; |
| 303 | 304 | SET_TILE_INFO(0, code, 0, 0); |
| 304 | 305 | } |
| r14896 | r14897 | |
| 313 | 314 | |
| 314 | 315 | WRITE8_MEMBER(sbrkout_state::sbrkout_videoram_w) |
| 315 | 316 | { |
| 316 | UINT8 *videoram = m_videoram; | |
| 317 | UINT8 *videoram = m_videoram.target(); | |
| 317 | 318 | videoram[offset] = data; |
| 318 | 319 | m_bg_tilemap->mark_tile_dirty(offset); |
| 319 | 320 | } |
| r14896 | r14897 | |
| 329 | 330 | static SCREEN_UPDATE_IND16( sbrkout ) |
| 330 | 331 | { |
| 331 | 332 | sbrkout_state *state = screen.machine().driver_data<sbrkout_state>(); |
| 332 | UINT8 *videoram = state->m_videoram; | |
| 333 | UINT8 *videoram = state->m_videoram.target(); | |
| 333 | 334 | int ball; |
| 334 | 335 | |
| 335 | 336 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| r14896 | r14897 | |
| 357 | 358 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbrkout_state ) |
| 358 | 359 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 359 | 360 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x380) AM_RAMBANK("bank1") |
| 360 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(sbrkout_videoram_w) AM_ | |
| 361 | AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(sbrkout_videoram_w) AM_ | |
| 361 | 362 | AM_RANGE(0x0800, 0x083f) AM_READ(switches_r) |
| 362 | 363 | AM_RANGE(0x0840, 0x0840) AM_MIRROR(0x003f) AM_READ_PORT("COIN") |
| 363 | 364 | AM_RANGE(0x0880, 0x0880) AM_MIRROR(0x003f) AM_READ_PORT("START") |
| r14896 | r14897 | |
|---|---|---|
| 90 | 90 | WRITE8_MEMBER(bladestl_state::bladestl_sh_irqtrigger_w) |
| 91 | 91 | { |
| 92 | 92 | |
| 93 | soundlatch_w(space, offset, data); | |
| 93 | soundlatch_byte_w(space, offset, data); | |
| 94 | 94 | device_set_input_line(m_audiocpu, M6809_IRQ_LINE, HOLD_LINE); |
| 95 | 95 | //logerror("(sound) write %02x\n", data); |
| 96 | 96 | } |
| r14896 | r14897 | |
| 146 | 146 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE_LEGACY("upd", bladestl_speech_ctrl_w) /* UPD7759 */ |
| 147 | 147 | AM_RANGE(0x4000, 0x4000) AM_DEVREAD_LEGACY("upd", bladestl_speech_busy_r) /* UPD7759 */ |
| 148 | 148 | AM_RANGE(0x5000, 0x5000) AM_WRITENOP /* ??? */ |
| 149 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 149 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 150 | 150 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 151 | 151 | ADDRESS_MAP_END |
| 152 | 152 |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | AM_RANGE(0x400b, 0x400b) AM_READ_PORT("DSW1") |
| 84 | 84 | AM_RANGE(0x400c, 0x400c) AM_READ_PORT("DSW2") |
| 85 | 85 | AM_RANGE(0x400a, 0x400d) AM_WRITE(srumbler_scroll_w) |
| 86 | AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_w) | |
| 86 | AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_byte_w) | |
| 87 | 87 | AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000") AM_WRITE(srumbler_foreground_w) AM_BASE(m_foregroundram) /* Banked ROM */ |
| 88 | 88 | AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("6000") /* Banked ROM */ |
| 89 | 89 | AM_RANGE(0x6000, 0x6fff) AM_WRITENOP /* Video RAM 2 ??? (not used) */ |
| 90 | 90 | AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("7000") /* Banked ROM */ |
| 91 | AM_RANGE(0x7000, 0x73ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_SHARE("paletteram") | |
| 91 | AM_RANGE(0x7000, 0x73ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram") | |
| 92 | 92 | AM_RANGE(0x8000, 0x8fff) AM_ROMBANK("8000") /* Banked ROM */ |
| 93 | 93 | AM_RANGE(0x9000, 0x9fff) AM_ROMBANK("9000") /* Banked ROM */ |
| 94 | 94 | AM_RANGE(0xa000, 0xafff) AM_ROMBANK("a000") /* Banked ROM */ |
| r14896 | r14897 | |
| 104 | 104 | AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 105 | 105 | AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ym2", ym2203_w) |
| 106 | 106 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 107 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 107 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 108 | 108 | ADDRESS_MAP_END |
| 109 | 109 | |
| 110 | 110 |
| r14896 | r14897 | |
|---|---|---|
| 86 | 86 | { |
| 87 | 87 | public: |
| 88 | 88 | re900_state(const machine_config &mconfig, device_type type, const char *tag) |
| 89 | : driver_device(mconfig, type, tag) { } | |
| 89 | : driver_device(mconfig, type, tag) , | |
| 90 | m_rom(*this, "rom"){ } | |
| 90 | 91 | |
| 91 | UINT8 | |
| 92 | required_shared_ptr<UINT8> | |
| 92 | 93 | UINT8 m_psg_pa; |
| 93 | 94 | UINT8 m_psg_pb; |
| 94 | 95 | UINT8 m_mux_data; |
| r14896 | r14897 | |
| 173 | 174 | |
| 174 | 175 | READ8_MEMBER(re900_state::rom_r) |
| 175 | 176 | { |
| 176 | return m_rom[offset]; | |
| 177 | return m_rom.target()[offset]; | |
| 177 | 178 | } |
| 178 | 179 | |
| 179 | 180 | |
| r14896 | r14897 | |
| 224 | 225 | *******************************/ |
| 225 | 226 | |
| 226 | 227 | static ADDRESS_MAP_START( mem_prg, AS_PROGRAM, 8, re900_state ) |
| 227 | AM_RANGE(0x0000, 0xffff) AM_ROM AM_ | |
| 228 | AM_RANGE(0x0000, 0xffff) AM_ROM AM_ | |
| 228 | 229 | ADDRESS_MAP_END |
| 229 | 230 | |
| 230 | 231 | static ADDRESS_MAP_START( mem_io, AS_IO, 8, re900_state ) |
| r14896 | r14897 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | WRITE8_MEMBER(pbaction_state::pbaction_sh_command_w) |
| 74 | 74 | { |
| 75 | soundlatch_w(space, offset, data); | |
| 75 | soundlatch_byte_w(space, offset, data); | |
| 76 | 76 | device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0x00); |
| 77 | 77 | } |
| 78 | 78 | |
| r14896 | r14897 | |
| 91 | 91 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(pbaction_videoram_w) AM_BASE(m_videoram) |
| 92 | 92 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(pbaction_colorram_w) AM_BASE(m_colorram) |
| 93 | 93 | AM_RANGE(0xe000, 0xe07f) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 94 | AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 94 | AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 95 | 95 | AM_RANGE(0xe600, 0xe600) AM_READ_PORT("P1") AM_WRITE(nmi_mask_w) |
| 96 | 96 | AM_RANGE(0xe601, 0xe601) AM_READ_PORT("P2") |
| 97 | 97 | AM_RANGE(0xe602, 0xe602) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 104 | 104 | static ADDRESS_MAP_START( pbaction_sound_map, AS_PROGRAM, 8, pbaction_state ) |
| 105 | 105 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 106 | 106 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 107 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) | |
| 107 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) | |
| 108 | 108 | AM_RANGE(0xffff, 0xffff) AM_WRITENOP /* watchdog? */ |
| 109 | 109 | ADDRESS_MAP_END |
| 110 | 110 |
| r14896 | r14897 | |
|---|---|---|
| 58 | 58 | #include "audio/mcr.h" |
| 59 | 59 | #include "audio/williams.h" |
| 60 | 60 | #include "machine/nvram.h" |
| 61 | #include "includes/mcr.h" | |
| 61 | 62 | #include "includes/mcr68.h" |
| 62 | 63 | |
| 63 | 64 | |
| r14896 | r14897 | |
| 103 | 104 | { |
| 104 | 105 | COMBINE_DATA(&m_control_word); |
| 105 | 106 | /* soundsgood_reset_w(~m_control_word & 0x0020);*/ |
| 106 | soundsgood_data_w( | |
| 107 | soundsgood_data_w( | |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | |
| r14896 | r14897 | |
| 118 | 119 | { |
| 119 | 120 | COMBINE_DATA(&m_control_word); |
| 120 | 121 | /* soundsgood_reset_w(~m_control_word & 0x0020);*/ |
| 121 | soundsgood_data_w( | |
| 122 | soundsgood_data_w( | |
| 122 | 123 | } |
| 123 | 124 | |
| 124 | 125 | |
| r14896 | r14897 | |
| 136 | 137 | int which = (m_control_word >> 3) & 3; |
| 137 | 138 | int analog = input_port_read(machine(), portnames[which]); |
| 138 | 139 | |
| 139 | return result | ((soundsgood_status_r( | |
| 140 | return result | ((soundsgood_status_r( | |
| 140 | 141 | } |
| 141 | 142 | |
| 142 | 143 | |
| 143 | 144 | READ16_MEMBER(mcr68_state::spyhunt2_port_1_r) |
| 144 | 145 | { |
| 145 | 146 | int result = input_port_read(machine(), "IN1"); |
| 146 | return result | ((turbocs_status_r( | |
| 147 | return result | ((turbocs_status_r( | |
| 147 | 148 | } |
| 148 | 149 | |
| 149 | 150 | |
| r14896 | r14897 | |
| 152 | 153 | COMBINE_DATA(&m_control_word); |
| 153 | 154 | |
| 154 | 155 | /* turbocs_reset_w(~m_control_word & 0x0080);*/ |
| 155 | turbocs_data_w( | |
| 156 | turbocs_data_w( | |
| 156 | 157 | |
| 157 | 158 | soundsgood_reset_w(machine(), ~m_control_word & 0x2000); |
| 158 | soundsgood_data_w( | |
| 159 | soundsgood_data_w( | |
| 159 | 160 | } |
| 160 | 161 | |
| 161 | 162 |
| r14896 | r14897 | |
|---|---|---|
| 157 | 157 | static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state ) |
| 158 | 158 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 159 | 159 | AM_RANGE(0x040000, 0x043fff) AM_RAM /* work RAM */ |
| 160 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(paletteram | |
| 160 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(paletteram | |
| 161 | 161 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("INPUTS") |
| 162 | 162 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("SYSTEM") |
| 163 | 163 | AM_RANGE(0x0e0000, 0x0e0001) AM_WRITENOP /* unknown (always 0x30) */ |
| r14896 | r14897 | |
|---|---|---|
| 25 | 25 | { |
| 26 | 26 | public: |
| 27 | 27 | jackpool_state(const machine_config &mconfig, device_type type, const char *tag) |
| 28 | : driver_device(mconfig, type, tag) { } | |
| 28 | : driver_device(mconfig, type, tag) , | |
| 29 | m_vram(*this, "vram"), | |
| 30 | m_io(*this, "io"){ } | |
| 29 | 31 | |
| 30 | UINT16 | |
| 32 | required_shared_ptr<UINT16> | |
| 31 | 33 | UINT8 m_map_vreg; |
| 32 | UINT16 | |
| 34 | required_shared_ptr<UINT16> | |
| 33 | 35 | DECLARE_READ16_MEMBER(jackpool_ff_r); |
| 34 | 36 | DECLARE_READ16_MEMBER(jackpool_io_r); |
| 35 | 37 | DECLARE_WRITE16_MEMBER(jackpool_io_w); |
| r14896 | r14897 | |
| 54 | 56 | { |
| 55 | 57 | for (x=0;x<64;x++) |
| 56 | 58 | { |
| 57 | int tile = (state->m_vram[count+(0x2000/2)] & 0x7fff); | |
| 58 | int attr = (state->m_vram[count+(0x2000/2)+0x800] & 0x1f00)>>8; | |
| 59 | int tile = (state->m_vram.target()[count+(0x2000/2)] & 0x7fff); | |
| 60 | int attr = (state->m_vram.target()[count+(0x2000/2)+0x800] & 0x1f00)>>8; | |
| 59 | 61 | |
| 60 | 62 | drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8); |
| 61 | 63 | count++; |
| r14896 | r14897 | |
| 67 | 69 | { |
| 68 | 70 | for (x=0;x<64;x++) |
| 69 | 71 | { |
| 70 | int tile = (state->m_vram[count] & 0x7fff); | |
| 72 | int tile = (state->m_vram.target()[count] & 0x7fff); | |
| 71 | 73 | |
| 72 | 74 | if(tile != 0) |
| 73 | 75 | { |
| 74 | int attr = (state->m_vram[count+0x800] & 0x1f00)>>8; | |
| 75 | int t_pen = (state->m_vram[count+0x800] & 0x1000); | |
| 76 | int attr = (state->m_vram.target()[count+0x800] & 0x1f00)>>8; | |
| 77 | int t_pen = (state->m_vram.target()[count+0x800] & 0x1000); | |
| 76 | 78 | |
| 77 | 79 | drawgfx_transpen(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8,(t_pen) ? 0 : -1); |
| 78 | 80 | } |
| r14896 | r14897 | |
| 117 | 119 | } |
| 118 | 120 | |
| 119 | 121 | // printf("R %02x\n",offset*2); |
| 120 | return m_io[offset]; | |
| 122 | return m_io.target()[offset]; | |
| 121 | 123 | } |
| 122 | 124 | |
| 123 | 125 | WRITE16_MEMBER(jackpool_state::jackpool_io_w) |
| 124 | 126 | { |
| 125 | COMBINE_DATA(&m_io[offset]); | |
| 127 | COMBINE_DATA(&m_io.target()[offset]); | |
| 126 | 128 | |
| 127 | 129 | switch(offset*2) |
| 128 | 130 | { |
| r14896 | r14897 | |
| 171 | 173 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 172 | 174 | AM_RANGE(0x100000, 0x10ffff) AM_RAM |
| 173 | 175 | AM_RANGE(0x120000, 0x1200ff) AM_RAM |
| 174 | AM_RANGE(0x340000, 0x347fff) AM_RAM AM_ | |
| 176 | AM_RANGE(0x340000, 0x347fff) AM_RAM AM_ | |
| 175 | 177 | AM_RANGE(0x348000, 0x34ffff) AM_RAM //<- vram banks 2 & 3? |
| 176 | 178 | |
| 177 | AM_RANGE(0x360000, 0x3603ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram") | |
| 178 | AM_RANGE(0x380000, 0x380061) AM_READWRITE(jackpool_io_r,jackpool_io_w) AM_BASE(m_io)//AM_READ(jackpool_io_r) | |
| 179 | AM_RANGE(0x360000, 0x3603ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram") | |
| 180 | AM_RANGE(0x380000, 0x380061) AM_READWRITE(jackpool_io_r,jackpool_io_w) AM_SHARE("io")//AM_READ(jackpool_io_r) | |
| 179 | 181 | |
| 180 | 182 | AM_RANGE(0x800000, 0x80000f) AM_READ(jackpool_ff_r) AM_WRITENOP //UART |
| 181 | 183 | AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | static ADDRESS_MAP_START( spcforce_map, AS_PROGRAM, 8, spcforce_state ) |
| 88 | 88 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 89 | 89 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 90 | AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW") AM_WRITE(soundlatch_w) | |
| 90 | AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW") AM_WRITE(soundlatch_byte_w) | |
| 91 | 91 | AM_RANGE(0x7001, 0x7001) AM_READ_PORT("P1") AM_WRITE(spcforce_soundtrigger_w) |
| 92 | 92 | AM_RANGE(0x7002, 0x7002) AM_READ_PORT("P2") |
| 93 | 93 | AM_RANGE(0x700b, 0x700b) AM_WRITE(spcforce_flip_screen_w) |
| r14896 | r14897 | |
| 103 | 103 | ADDRESS_MAP_END |
| 104 | 104 | |
| 105 | 105 | static ADDRESS_MAP_START( spcforce_sound_io_map, AS_IO, 8, spcforce_state ) |
| 106 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(soundlatch_r) | |
| 106 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(soundlatch_byte_r) | |
| 107 | 107 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(spcforce_SN76496_latch_w) |
| 108 | 108 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(spcforce_SN76496_select_r, spcforce_SN76496_select_w) |
| 109 | 109 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(spcforce_t0_r) |
| r14896 | r14897 | |
|---|---|---|
| 168 | 168 | /* CPU 2 memory hack */ |
| 169 | 169 | /* (402E) timeout upcount must be under 0AH */ |
| 170 | 170 | /* (4004,4005) clear down counter , if (4004,4005)==0 then (402E)=0 */ |
| 171 | ||
| 171 | ||
| 172 | 172 | { |
| 173 | gsword_state *state = space->machine().driver_data<gsword_state>(); | |
| 174 | UINT8 data = state->m_cpu2_ram[offset + 4]; | |
| 173 | UINT8 data = m_cpu2_ram[offset + 4]; | |
| 175 | 174 | |
| 176 | /*if(offset==1)mame_printf_debug("CNT %02X%02X\n", | |
| 175 | /*if(offset==1)mame_printf_debug("CNT %02X%02X\n", | |
| 177 | 176 | |
| 178 | 177 | /* speedup timeout cound down */ |
| 179 | if( | |
| 178 | if( | |
| 180 | 179 | { |
| 181 | 180 | switch(offset) |
| 182 | 181 | { |
| r14896 | r14897 | |
| 324 | 323 | msm5205_vclk_w(device,(data>>4)&1); /* bit 4 */ |
| 325 | 324 | } |
| 326 | 325 | |
| 327 | ||
| 326 | ||
| 328 | 327 | { |
| 329 | gsword_state *state = space->machine().driver_data<gsword_state>(); | |
| 330 | state->soundlatch_w(*space, 0, data); | |
| 331 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 328 | soundlatch_byte_w(*&space, 0, data); | |
| 329 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); | |
| 332 | 330 | } |
| 333 | 331 | |
| 334 | 332 | static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM , 8, gsword_state ) |
| r14896 | r14897 | |
| 337 | 335 | AM_RANGE(0xa000, 0xa37f) AM_RAM |
| 338 | 336 | AM_RANGE(0xa380, 0xa3ff) AM_RAM AM_BASE(m_spritetile_ram) |
| 339 | 337 | AM_RANGE(0xa400, 0xa77f) AM_RAM |
| 340 | AM_RANGE(0xa780, 0xa7ff) AM_RAM AM_BASE(m_spritexy_ram | |
| 338 | AM_RANGE(0xa780, 0xa7ff) AM_RAM AM_BASE_SIZE(m_spritexy_ram, | |
| 341 | 339 | AM_RANGE(0xa980, 0xa980) AM_WRITE(gsword_charbank_w) |
| 342 | 340 | AM_RANGE(0xaa80, 0xaa80) AM_WRITE(gsword_videoctrl_w) /* flip screen, char palette bank */ |
| 343 | 341 | AM_RANGE(0xab00, 0xab00) AM_WRITE(gsword_scroll_w) |
| r14896 | r14897 | |
| 359 | 357 | static ADDRESS_MAP_START( cpu2_map, AS_PROGRAM, 8, gsword_state ) |
| 360 | 358 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 361 | 359 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(m_cpu2_ram) |
| 362 | AM_RANGE(0x6000, 0x6000) AM_WRITE | |
| 360 | AM_RANGE(0x6000, 0x6000) AM_WRITE | |
| 363 | 361 | ADDRESS_MAP_END |
| 364 | 362 | |
| 365 | 363 | static ADDRESS_MAP_START( cpu2_io_map, AS_IO, 8, gsword_state ) |
| r14896 | r14897 | |
| 382 | 380 | static ADDRESS_MAP_START( cpu3_map, AS_PROGRAM, 8, gsword_state ) |
| 383 | 381 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 384 | 382 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("msm", gsword_adpcm_data_w) |
| 385 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 383 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 386 | 384 | ADDRESS_MAP_END |
| 387 | 385 | |
| 388 | 386 | |
| r14896 | r14897 | |
| 395 | 393 | AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN2") // 2PL / ACK |
| 396 | 394 | AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN0") // START |
| 397 | 395 | |
| 398 | // AM_RANGE(0x6000, 0x6000) AM_WRITE | |
| 396 | // AM_RANGE(0x6000, 0x6000) AM_WRITE | |
| 399 | 397 | AM_RANGE(0xA000, 0xA001) AM_WRITE_LEGACY(josvolly_8741_1_w) AM_READ_LEGACY(josvolly_8741_1_r) |
| 400 | 398 | ADDRESS_MAP_END |
| 401 | 399 | |
| r14896 | r14897 | |
| 913 | 911 | #endif |
| 914 | 912 | #if 1 |
| 915 | 913 | /* hack for sound protection or time out function */ |
| 916 | machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r)); | |
| 914 | gsword_state *state = machine.driver_data<gsword_state>(); | |
| 915 | machine.device("sub")->memory().space(AS_PROGRAM)->install_read_handler(0x4004, 0x4005, read8_delegate(FUNC(gsword_state::gsword_hack_r),state)); | |
| 917 | 916 | #endif |
| 918 | 917 | } |
| 919 | 918 | |
| r14896 | r14897 | |
| 928 | 927 | #endif |
| 929 | 928 | #if 1 |
| 930 | 929 | /* hack for sound protection or time out function */ |
| 931 | machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r)); | |
| 930 | gsword_state *state = machine.driver_data<gsword_state>(); | |
| 931 | machine.device("sub")->memory().space(AS_PROGRAM)->install_read_handler(0x4004, 0x4005, read8_delegate(FUNC(gsword_state::gsword_hack_r),state)); | |
| 932 | 932 | #endif |
| 933 | 933 | } |
| 934 | 934 |
| r14896 | r14897 | |
|---|---|---|
| 230 | 230 | { |
| 231 | 231 | public: |
| 232 | 232 | nmg5_state(const machine_config &mconfig, device_type type, const char *tag) |
| 233 | : driver_device(mconfig, type, tag) { } | |
| 233 | : driver_device(mconfig, type, tag) , | |
| 234 | m_spriteram(*this, "spriteram"), | |
| 235 | m_scroll_ram(*this, "scroll_ram"), | |
| 236 | m_bg_videoram(*this, "bg_videoram"), | |
| 237 | m_fg_videoram(*this, "fg_videoram"), | |
| 238 | m_bitmap(*this, "bitmap"){ } | |
| 234 | 239 | |
| 235 | 240 | /* memory pointers */ |
| 236 | UINT16 * m_fg_videoram; | |
| 237 | UINT16 * m_bg_videoram; | |
| 238 | UINT16 * m_scroll_ram; | |
| 239 | UINT16 * m_bitmap; | |
| 240 | UINT16 * m_spriteram; | |
| 241 | required_shared_ptr<UINT16> m_spriteram; | |
| 242 | required_shared_ptr<UINT16> m_scroll_ram; | |
| 243 | required_shared_ptr<UINT16> m_bg_videoram; | |
| 244 | required_shared_ptr<UINT16> m_fg_videoram; | |
| 245 | required_shared_ptr<UINT16> m_bitmap; | |
| 241 | 246 | // UINT16 * m_paletteram; // currently this uses generic palette handling |
| 242 | size_t m_spriteram_size; | |
| 243 | 247 | |
| 244 | 248 | /* video-related */ |
| 245 | 249 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 267 | 271 | |
| 268 | 272 | WRITE16_MEMBER(nmg5_state::fg_videoram_w) |
| 269 | 273 | { |
| 270 | COMBINE_DATA(&m_fg_videoram[offset]); | |
| 274 | COMBINE_DATA(&m_fg_videoram.target()[offset]); | |
| 271 | 275 | m_fg_tilemap->mark_tile_dirty(offset); |
| 272 | 276 | } |
| 273 | 277 | |
| 274 | 278 | WRITE16_MEMBER(nmg5_state::bg_videoram_w) |
| 275 | 279 | { |
| 276 | COMBINE_DATA(&m_bg_videoram[offset]); | |
| 280 | COMBINE_DATA(&m_bg_videoram.target()[offset]); | |
| 277 | 281 | m_bg_tilemap->mark_tile_dirty(offset); |
| 278 | 282 | } |
| 279 | 283 | |
| r14896 | r14897 | |
| 282 | 286 | |
| 283 | 287 | if (ACCESSING_BITS_0_7) |
| 284 | 288 | { |
| 285 | soundlatch_w(space, 0, data & 0xff); | |
| 289 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 286 | 290 | device_set_input_line(m_soundcpu, INPUT_LINE_NMI, PULSE_LINE); |
| 287 | 291 | } |
| 288 | 292 | } |
| r14896 | r14897 | |
| 330 | 334 | static ADDRESS_MAP_START( nmg5_map, AS_PROGRAM, 16, nmg5_state ) |
| 331 | 335 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 332 | 336 | AM_RANGE(0x120000, 0x12ffff) AM_RAM |
| 333 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 334 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 337 | AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 338 | AM_RANGE(0x160000, 0x1607ff) AM_RAM AM_SHARE("spriteram") | |
| 335 | 339 | AM_RANGE(0x180000, 0x180001) AM_WRITE(nmg5_soundlatch_w) |
| 336 | 340 | AM_RANGE(0x180002, 0x180003) AM_WRITENOP |
| 337 | 341 | AM_RANGE(0x180004, 0x180005) AM_READWRITE(prot_r, prot_w) |
| r14896 | r14897 | |
| 340 | 344 | AM_RANGE(0x18000a, 0x18000b) AM_READ_PORT("SYSTEM") |
| 341 | 345 | AM_RANGE(0x18000c, 0x18000d) AM_READ_PORT("INPUTS") |
| 342 | 346 | AM_RANGE(0x18000e, 0x18000f) AM_WRITE(priority_reg_w) |
| 343 | AM_RANGE(0x300002, 0x300009) AM_WRITEONLY AM_ | |
| 347 | AM_RANGE(0x300002, 0x300009) AM_WRITEONLY AM_ | |
| 344 | 348 | AM_RANGE(0x30000a, 0x30000f) AM_WRITENOP |
| 345 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(m_bg_videoram) | |
| 346 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(m_fg_videoram) | |
| 347 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(m_bitmap) | |
| 349 | AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram") | |
| 350 | AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram") | |
| 351 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("bitmap") | |
| 348 | 352 | ADDRESS_MAP_END |
| 349 | 353 | |
| 350 | 354 | static ADDRESS_MAP_START( pclubys_map, AS_PROGRAM, 16, nmg5_state ) |
| 351 | 355 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 352 | 356 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 353 | AM_RANGE(0x440000, 0x4407ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 354 | AM_RANGE(0x460000, 0x4607ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) | |
| 357 | AM_RANGE(0x440000, 0x4407ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") | |
| 358 | AM_RANGE(0x460000, 0x4607ff) AM_RAM AM_SHARE("spriteram") | |
| 355 | 359 | AM_RANGE(0x480000, 0x480001) AM_WRITE(nmg5_soundlatch_w) |
| 356 | 360 | AM_RANGE(0x480002, 0x480003) AM_WRITENOP |
| 357 | 361 | AM_RANGE(0x480004, 0x480005) AM_READWRITE(prot_r, prot_w) |
| r14896 | r14897 | |
| 360 | 364 | AM_RANGE(0x48000a, 0x48000b) AM_READ_PORT("SYSTEM") |
| 361 | 365 | AM_RANGE(0x48000c, 0x48000d) AM_READ_PORT("INPUTS") |
| 362 | 366 | AM_RANGE(0x48000e, 0x48000f) AM_WRITE(priority_reg_w) |
| 363 | AM_RANGE(0x500002, 0x500009) AM_WRITEONLY AM_BASE(m_scroll_ram) | |
| 364 | AM_RANGE(0x520000, 0x521fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(m_bg_videoram) | |
| 365 | AM_RANGE(0x522000, 0x523fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(m_fg_videoram) | |
| 366 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(m_bitmap) | |
| 367 | AM_RANGE(0x500002, 0x500009) AM_WRITEONLY AM_SHARE("scroll_ram") | |
| 368 | AM_RANGE(0x520000, 0x521fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram") | |
| 369 | AM_RANGE(0x522000, 0x523fff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram") | |
| 370 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("bitmap") | |
| 367 | 371 | ADDRESS_MAP_END |
| 368 | 372 | |
| 369 | 373 | /******************************************************************* |
| r14896 | r14897 | |
| 386 | 390 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 387 | 391 | AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("oki", oki_banking_w) |
| 388 | 392 | AM_RANGE(0x10, 0x11) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) |
| 389 | AM_RANGE(0x18, 0x18) AM_READ(soundlatch_r) | |
| 393 | AM_RANGE(0x18, 0x18) AM_READ(soundlatch_byte_r) | |
| 390 | 394 | AM_RANGE(0x1c, 0x1c) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 391 | 395 | ADDRESS_MAP_END |
| 392 | 396 | |
| r14896 | r14897 | |
| 862 | 866 | { |
| 863 | 867 | for (x = 0; x < xxx; x++) |
| 864 | 868 | { |
| 865 | pix = (state->m_bitmap[count] & 0xf000) >> 12; | |
| 869 | pix = (state->m_bitmap.target()[count] & 0xf000) >> 12; | |
| 866 | 870 | if (pix) bitmap.pix16(y + yoff, x * 4 + 0 + xoff) = pix + 0x300; |
| 867 | pix = (state->m_bitmap[count] & 0x0f00) >> 8; | |
| 871 | pix = (state->m_bitmap.target()[count] & 0x0f00) >> 8; | |
| 868 | 872 | if (pix) bitmap.pix16(y + yoff, x * 4 + 1 + xoff) = pix + 0x300; |
| 869 | pix = (state->m_bitmap[count] & 0x00f0) >> 4; | |
| 873 | pix = (state->m_bitmap.target()[count] & 0x00f0) >> 4; | |
| 870 | 874 | if (pix) bitmap.pix16(y + yoff, x * 4 + 2 + xoff) = pix + 0x300; |
| 871 | pix = (state->m_bitmap[count] & 0x000f) >> 0; | |
| 875 | pix = (state->m_bitmap.target()[count] & 0x000f) >> 0; | |
| 872 | 876 | if (pix) bitmap.pix16(y + yoff, x * 4 + 3 + xoff) = pix + 0x300; |
| 873 | 877 | |
| 874 | 878 | count++; |
| r14896 | r14897 | |
| 881 | 885 | { |
| 882 | 886 | nmg5_state *state = screen.machine().driver_data<nmg5_state>(); |
| 883 | 887 | |
| 884 | state->m_bg_tilemap->set_scrolly(0, state->m_scroll_ram[3] + 9); | |
| 885 | state->m_bg_tilemap->set_scrollx(0, state->m_scroll_ram[2] + 3); | |
| 886 | state->m_fg_tilemap->set_scrolly(0, state->m_scroll_ram[1] + 9); | |
| 887 | state->m_fg_tilemap->set_scrollx(0, state->m_scroll_ram[0] - 1); | |
| 888 | state->m_bg_tilemap->set_scrolly(0, state->m_scroll_ram.target()[3] + 9); | |
| 889 | state->m_bg_tilemap->set_scrollx(0, state->m_scroll_ram.target()[2] + 3); | |
| 890 | state->m_fg_tilemap->set_scrolly(0, state->m_scroll_ram.target()[1] + 9); | |
| 891 | state->m_fg_tilemap->set_scrollx(0, state->m_scroll_ram.target()[0] - 1); | |
| 888 | 892 | |
| 889 | 893 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 890 | 894 |
| r14896 | r14897 | |
|---|---|---|
| 145 | 145 | AM_RANGE(0x7e83, 0x7e83) AM_WRITE(mario_palettebank_w) |
| 146 | 146 | AM_RANGE(0x7e84, 0x7e84) AM_WRITE(nmi_mask_w) |
| 147 | 147 | AM_RANGE(0x7e85, 0x7e85) AM_DEVWRITE_LEGACY("z80dma", mario_z80dma_rdy_w) /* ==> DMA Chip */ |
| 148 | AM_RANGE(0x7f00, 0x7f07) AM_WRITE | |
| 148 | AM_RANGE(0x7f00, 0x7f07) AM_WRITE | |
| 149 | 149 | AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW") /* DSW */ |
| 150 | AM_RANGE(0x7e00, 0x7e00) AM_WRITE | |
| 150 | AM_RANGE(0x7e00, 0x7e00) AM_WRITE | |
| 151 | 151 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 152 | 152 | ADDRESS_MAP_END |
| 153 | 153 | |
| r14896 | r14897 | |
| 159 | 159 | AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") |
| 160 | 160 | AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") |
| 161 | 161 | AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w) |
| 162 | AM_RANGE(0x7e00, 0x7e00) AM_WRITE(soundlatch_w) | |
| 162 | AM_RANGE(0x7e00, 0x7e00) AM_WRITE(soundlatch_byte_w) | |
| 163 | 163 | AM_RANGE(0x7e80, 0x7e80) AM_WRITE(mario_gfxbank_w) |
| 164 | 164 | AM_RANGE(0x7e82, 0x7e82) AM_WRITE(mario_flip_w) |
| 165 | 165 | AM_RANGE(0x7e83, 0x7e83) AM_WRITE(mario_palettebank_w) |
| 166 | 166 | AM_RANGE(0x7e84, 0x7e84) AM_WRITE(nmi_mask_w) |
| 167 | 167 | AM_RANGE(0x7e85, 0x7e85) AM_DEVWRITE_LEGACY("z80dma", mario_z80dma_rdy_w) /* ==> DMA Chip */ |
| 168 | AM_RANGE(0x7f00, 0x7f00) AM_WRITE | |
| 168 | AM_RANGE(0x7f00, 0x7f00) AM_WRITE | |
| 169 | 169 | AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW") /* DSW */ |
| 170 | 170 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 171 | 171 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | READ16_MEMBER(xmen_state::sound_status_r) |
| 69 | 69 | { |
| 70 | return soundlatch2_r(space, 0); | |
| 70 | return soundlatch2_byte_r(space, 0); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | WRITE16_MEMBER(xmen_state::sound_cmd_w) |
| r14896 | r14897 | |
| 75 | 75 | if (ACCESSING_BITS_0_7) |
| 76 | 76 | { |
| 77 | 77 | data &= 0xff; |
| 78 | soundlatch_w(space, 0, data); | |
| 78 | soundlatch_byte_w(space, 0, data); | |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| r14896 | r14897 | |
| 112 | 112 | AM_RANGE(0x080000, 0x0fffff) AM_ROM |
| 113 | 113 | AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("k053246", k053247_word_r, k053247_word_w) |
| 114 | 114 | AM_RANGE(0x101000, 0x101fff) AM_RAM |
| 115 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 115 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 116 | 116 | AM_RANGE(0x108000, 0x108001) AM_WRITE(eeprom_w) |
| 117 | 117 | AM_RANGE(0x108020, 0x108027) AM_DEVWRITE_LEGACY("k053246", k053246_word_w) |
| 118 | 118 | AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w) |
| r14896 | r14897 | |
| 134 | 134 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 135 | 135 | AM_RANGE(0xe000, 0xe22f) AM_DEVREADWRITE("k054539", k054539_device, read, write) |
| 136 | 136 | AM_RANGE(0xe800, 0xe801) AM_MIRROR(0x0400) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 137 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch2_w) | |
| 138 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 137 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch2_byte_w) | |
| 138 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r) | |
| 139 | 139 | AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w) |
| 140 | 140 | ADDRESS_MAP_END |
| 141 | 141 | |
| r14896 | r14897 | |
| 147 | 147 | AM_RANGE(0x101000, 0x101fff) AM_RAM |
| 148 | 148 | AM_RANGE(0x102000, 0x102fff) AM_RAM AM_BASE(m_xmen6p_spriteramright) /* sprites (screen 2) */ |
| 149 | 149 | AM_RANGE(0x103000, 0x103fff) AM_RAM /* 6p - a buffer? */ |
| 150 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 150 | AM_RANGE(0x104000, 0x104fff) AM_RAM_WRITE(paletteram | |
| 151 | 151 | AM_RANGE(0x108000, 0x108001) AM_WRITE(eeprom_w) |
| 152 | 152 | AM_RANGE(0x108020, 0x108027) AM_DEVWRITE_LEGACY("k053246", k053246_word_w) /* sprites */ |
| 153 | 153 | AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w) |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | public: |
| 23 | 23 | wink_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | : driver_device(mconfig, type, tag) { } | |
| 24 | : driver_device(mconfig, type, tag) , | |
| 25 | m_videoram(*this, "videoram"){ } | |
| 25 | 26 | |
| 26 | UINT8 | |
| 27 | required_shared_ptr<UINT8> | |
| 27 | 28 | tilemap_t *m_bg_tilemap; |
| 28 | 29 | UINT8 m_sound_flag; |
| 29 | 30 | UINT8 m_tile_bank; |
| r14896 | r14897 | |
| 42 | 43 | static TILE_GET_INFO( get_bg_tile_info ) |
| 43 | 44 | { |
| 44 | 45 | wink_state *state = machine.driver_data<wink_state>(); |
| 45 | UINT8 *videoram = state->m_videoram; | |
| 46 | UINT8 *videoram = state->m_videoram.target(); | |
| 46 | 47 | int code = videoram[tile_index]; |
| 47 | 48 | code |= 0x200 * state->m_tile_bank; |
| 48 | 49 | |
| r14896 | r14897 | |
| 70 | 71 | |
| 71 | 72 | WRITE8_MEMBER(wink_state::bgram_w) |
| 72 | 73 | { |
| 73 | UINT8 *videoram = m_videoram; | |
| 74 | UINT8 *videoram = m_videoram.target(); | |
| 74 | 75 | videoram[offset] = data; |
| 75 | 76 | m_bg_tilemap->mark_tile_dirty(offset); |
| 76 | 77 | } |
| r14896 | r14897 | |
| 113 | 114 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 114 | 115 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 115 | 116 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_SHARE("nvram") |
| 116 | AM_RANGE(0xa000, 0xa3ff) AM_RAM_WRITE(bgram_w) AM_ | |
| 117 | AM_RANGE(0xa000, 0xa3ff) AM_RAM_WRITE(bgram_w) AM_ | |
| 117 | 118 | ADDRESS_MAP_END |
| 118 | 119 | |
| 119 | 120 | |
| r14896 | r14897 | |
| 144 | 145 | |
| 145 | 146 | static ADDRESS_MAP_START( wink_io, AS_IO, 8, wink_state ) |
| 146 | 147 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 147 | AM_RANGE(0x00, 0x1f) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_le_w) AM_SHARE("paletteram") //0x10-0x1f is likely to be something else | |
| 148 | AM_RANGE(0x00, 0x1f) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_le_w) AM_SHARE("paletteram") //0x10-0x1f is likely to be something else | |
| 148 | 149 | // AM_RANGE(0x20, 0x20) AM_WRITENOP //??? seems unused.. |
| 149 | 150 | AM_RANGE(0x21, 0x21) AM_WRITE(player_mux_w) //??? no mux on the pcb. |
| 150 | 151 | AM_RANGE(0x22, 0x22) AM_WRITE(tile_banking_w) |
| 151 | 152 | // AM_RANGE(0x23, 0x23) AM_WRITENOP //? |
| 152 | 153 | // AM_RANGE(0x24, 0x24) AM_WRITENOP //cab Knocker like in q-bert! |
| 153 | 154 | AM_RANGE(0x25, 0x27) AM_WRITE(wink_coin_counter_w) |
| 154 | AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch_w) | |
| 155 | AM_RANGE(0x40, 0x40) AM_WRITE(soundlatch_byte_w) | |
| 155 | 156 | AM_RANGE(0x60, 0x60) AM_WRITE(sound_irq_w) |
| 156 | 157 | AM_RANGE(0x80, 0x80) AM_READ(analog_port_r) |
| 157 | 158 | AM_RANGE(0xa0, 0xa0) AM_READ(player_inputs_r) |
| r14896 | r14897 | |
| 168 | 169 | static ADDRESS_MAP_START( wink_sound_map, AS_PROGRAM, 8, wink_state ) |
| 169 | 170 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 170 | 171 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 171 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) | |
| 172 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) | |
| 172 | 173 | ADDRESS_MAP_END |
| 173 | 174 | |
| 174 | 175 | static ADDRESS_MAP_START( wink_sound_io, AS_IO, 8, wink_state ) |
| r14896 | r14897 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | WRITE8_MEMBER(lethal_state::sound_cmd_w) |
| 215 | 215 | { |
| 216 | soundlatch_w(space, 0, data); | |
| 216 | soundlatch_byte_w(space, 0, data); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | WRITE8_MEMBER(lethal_state::sound_irq_w) |
| r14896 | r14897 | |
| 326 | 326 | |
| 327 | 327 | if (m_cur_control2 & 0x10) // RAM enable |
| 328 | 328 | { |
| 329 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 329 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 330 | 330 | } |
| 331 | 331 | else |
| 332 | 332 | { |
| r14896 | r14897 | |
| 417 | 417 | // use one more palette entry for the BG color |
| 418 | 418 | WRITE8_MEMBER(lethal_state::le_bgcolor_w) |
| 419 | 419 | { |
| 420 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, 0x3800 + offset, data); | |
| 420 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, 0x3800 + offset, data); | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | READ8_MEMBER(lethal_state::guns_r) |
| r14896 | r14897 | |
| 479 | 479 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 480 | 480 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 481 | 481 | AM_RANGE(0xf800, 0xfa2f) AM_DEVREADWRITE("k054539", k054539_device, read, write) |
| 482 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(soundlatch2_w) | |
| 483 | AM_RANGE(0xfc02, 0xfc02) AM_READ(soundlatch_r) | |
| 482 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(soundlatch2_byte_w) | |
| 483 | AM_RANGE(0xfc02, 0xfc02) AM_READ(soundlatch_byte_r) | |
| 484 | 484 | AM_RANGE(0xfc03, 0xfc03) AM_READNOP |
| 485 | 485 | ADDRESS_MAP_END |
| 486 | 486 |
| r14896 | r14897 | |
|---|---|---|
| 232 | 232 | |
| 233 | 233 | WRITE8_MEMBER(exprraid_state::sound_cpu_command_w) |
| 234 | 234 | { |
| 235 | soundlatch_w(space, 0, data); | |
| 235 | soundlatch_byte_w(space, 0, data); | |
| 236 | 236 | device_set_input_line(m_slave, INPUT_LINE_NMI, PULSE_LINE); |
| 237 | 237 | } |
| 238 | 238 | |
| r14896 | r14897 | |
| 272 | 272 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 273 | 273 | AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE_LEGACY("ym1", ym2203_r, ym2203_w) |
| 274 | 274 | AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE_LEGACY("ym2", ym3526_r, ym3526_w) |
| 275 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 275 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 276 | 276 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 277 | 277 | ADDRESS_MAP_END |
| 278 | 278 |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | if (ACCESSING_BITS_0_7) |
| 38 | 38 | { |
| 39 | soundlatch_w(space, 0x00, data & 0xff); | |
| 39 | soundlatch_byte_w(space, 0x00, data & 0xff); | |
| 40 | 40 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 41 | 41 | } |
| 42 | 42 | } |
| r14896 | r14897 | |
| 53 | 53 | AM_RANGE(0x121800, 0x121fff) AM_RAM_WRITE(tecmo16_colorram2_w) AM_BASE(m_colorram2) |
| 54 | 54 | AM_RANGE(0x122000, 0x127fff) AM_RAM /* work area */ |
| 55 | 55 | AM_RANGE(0x130000, 0x130fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 56 | AM_RANGE(0x140000, 0x141fff) AM_RAM_WRITE(paletteram | |
| 56 | AM_RANGE(0x140000, 0x141fff) AM_RAM_WRITE(paletteram | |
| 57 | 57 | AM_RANGE(0x150000, 0x150001) AM_WRITE(tecmo16_flipscreen_w) |
| 58 | 58 | AM_RANGE(0x150010, 0x150011) AM_WRITE(tecmo16_sound_command_w) |
| 59 | 59 | AM_RANGE(0x150030, 0x150031) AM_READ_PORT("DSW2") AM_WRITENOP /* ??? */ |
| r14896 | r14897 | |
| 76 | 76 | AM_RANGE(0x123000, 0x123fff) AM_RAM_WRITE(tecmo16_colorram2_w) AM_BASE(m_colorram2) |
| 77 | 77 | AM_RANGE(0x124000, 0x124fff) AM_RAM /* extra RAM for Riot */ |
| 78 | 78 | AM_RANGE(0x130000, 0x130fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 79 | AM_RANGE(0x140000, 0x141fff) AM_RAM_WRITE(paletteram | |
| 79 | AM_RANGE(0x140000, 0x141fff) AM_RAM_WRITE(paletteram | |
| 80 | 80 | AM_RANGE(0x150000, 0x150001) AM_WRITE(tecmo16_flipscreen_w) |
| 81 | 81 | AM_RANGE(0x150010, 0x150011) AM_WRITE(tecmo16_sound_command_w) |
| 82 | 82 | AM_RANGE(0x150020, 0x150021) AM_READ_PORT("EXTRA") AM_WRITENOP /* ??? */ |
| r14896 | r14897 | |
| 96 | 96 | AM_RANGE(0xf000, 0xfbff) AM_RAM /* Sound RAM */ |
| 97 | 97 | AM_RANGE(0xfc00, 0xfc00) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 98 | 98 | AM_RANGE(0xfc04, 0xfc05) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 99 | AM_RANGE(0xfc08, 0xfc08) AM_READ(soundlatch_r) | |
| 99 | AM_RANGE(0xfc08, 0xfc08) AM_READ(soundlatch_byte_r) | |
| 100 | 100 | AM_RANGE(0xfc0c, 0xfc0c) AM_NOP |
| 101 | 101 | AM_RANGE(0xfffe, 0xffff) AM_RAM |
| 102 | 102 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 207 | 207 | AM_RANGE(0x430000, 0x43ffff) AM_READWRITE(f3_pivot_r,f3_pivot_w) |
| 208 | 208 | AM_RANGE(0x460000, 0x46000f) AM_WRITE(f3_control_0_w) |
| 209 | 209 | AM_RANGE(0x460010, 0x46001f) AM_WRITE(f3_control_1_w) |
| 210 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(paletteram | |
| 210 | AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(paletteram | |
| 211 | 211 | AM_RANGE(0x502022, 0x502023) AM_WRITENOP //countinously switches between 0 and 2 |
| 212 | 212 | AM_RANGE(0x600000, 0x600007) AM_DEVREADWRITE8_LEGACY("ymsnd", ym2610_r, ym2610_w, 0x00ff) |
| 213 | 213 | AM_RANGE(0x60000c, 0x60000d) AM_READWRITE(drill_irq_r,drill_irq_w) |
| r14896 | r14897 | |
|---|---|---|
| 486 | 486 | |
| 487 | 487 | WRITE8_MEMBER(corona_state::sound_latch_w) |
| 488 | 488 | { |
| 489 | soundlatch_w(space, 0, data & 0xff); | |
| 489 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 490 | 490 | cputag_set_input_line(machine(), "soundcpu", 0, ASSERT_LINE); |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | READ8_MEMBER(corona_state::sound_latch_r) |
| 494 | 494 | { |
| 495 | 495 | cputag_set_input_line(machine(), "soundcpu", 0, CLEAR_LINE); |
| 496 | return soundlatch_r(space, 0); | |
| 496 | return soundlatch_byte_r(space, 0); | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | device_t *m_pic8259_2; |
| 61 | 61 | device_t *m_dma8237_1; |
| 62 | 62 | device_t *m_dma8237_2; |
| 63 | DECLARE_WRITE32_MEMBER(pnp_config_w); | |
| 64 | DECLARE_WRITE32_MEMBER(pnp_data_w); | |
| 65 | DECLARE_WRITE32_MEMBER(bios_ram_w); | |
| 66 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 67 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 68 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 69 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 63 | 70 | }; |
| 64 | 71 | |
| 65 | 72 | #if !ENABLE_VGA |
| r14896 | r14897 | |
| 262 | 269 | } |
| 263 | 270 | |
| 264 | 271 | // ISA Plug-n-Play |
| 265 | ||
| 272 | ||
| 266 | 273 | { |
| 267 | 274 | if (ACCESSING_BITS_8_15) |
| 268 | 275 | { |
| r14896 | r14897 | |
| 270 | 277 | } |
| 271 | 278 | } |
| 272 | 279 | |
| 273 | ||
| 280 | ||
| 274 | 281 | { |
| 275 | 282 | if (ACCESSING_BITS_8_15) |
| 276 | 283 | { |
| r14896 | r14897 | |
| 303 | 310 | |
| 304 | 311 | |
| 305 | 312 | |
| 306 | ||
| 313 | ||
| 307 | 314 | { |
| 308 | taitowlf_state *state = space->machine().driver_data<taitowlf_state>(); | |
| 309 | if (state->m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled | |
| 315 | if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled | |
| 310 | 316 | { |
| 311 | COMBINE_DATA( | |
| 317 | COMBINE_DATA( | |
| 312 | 318 | } |
| 313 | 319 | } |
| 314 | 320 | |
| r14896 | r14897 | |
| 321 | 327 | |
| 322 | 328 | |
| 323 | 329 | |
| 324 | ||
| 330 | ||
| 325 | 331 | { |
| 326 | taitowlf_state *state = space->machine().driver_data<taitowlf_state>(); | |
| 327 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 332 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 328 | 333 | |
| 329 | 334 | switch(offset % 8) |
| 330 | 335 | { |
| 331 | 336 | case 1: |
| 332 | data = | |
| 337 | data = | |
| 333 | 338 | break; |
| 334 | 339 | case 2: |
| 335 | data = | |
| 340 | data = | |
| 336 | 341 | break; |
| 337 | 342 | case 3: |
| 338 | data = | |
| 343 | data = | |
| 339 | 344 | break; |
| 340 | 345 | case 7: |
| 341 | data = | |
| 346 | data = | |
| 342 | 347 | break; |
| 343 | 348 | } |
| 344 | 349 | return data; |
| 345 | 350 | } |
| 346 | 351 | |
| 347 | 352 | |
| 348 | ||
| 353 | ||
| 349 | 354 | { |
| 350 | taitowlf_state *state = space->machine().driver_data<taitowlf_state>(); | |
| 351 | state->m_at_pages[offset % 0x10] = data; | |
| 355 | m_at_pages[offset % 0x10] = data; | |
| 352 | 356 | |
| 353 | 357 | switch(offset % 8) |
| 354 | 358 | { |
| 355 | 359 | case 1: |
| 356 | | |
| 360 | | |
| 357 | 361 | break; |
| 358 | 362 | case 2: |
| 359 | | |
| 363 | | |
| 360 | 364 | break; |
| 361 | 365 | case 3: |
| 362 | | |
| 366 | | |
| 363 | 367 | break; |
| 364 | 368 | case 7: |
| 365 | | |
| 369 | | |
| 366 | 370 | break; |
| 367 | 371 | } |
| 368 | 372 | } |
| r14896 | r14897 | |
| 377 | 381 | } |
| 378 | 382 | |
| 379 | 383 | |
| 380 | ||
| 384 | ||
| 381 | 385 | { |
| 382 | taitowlf_state *state = space->machine().driver_data<taitowlf_state>(); | |
| 383 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 386 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 384 | 387 | & 0xFF0000; |
| 385 | 388 | |
| 386 | return space | |
| 389 | return space. | |
| 387 | 390 | } |
| 388 | 391 | |
| 389 | 392 | |
| 390 | ||
| 393 | ||
| 391 | 394 | { |
| 392 | taitowlf_state *state = space->machine().driver_data<taitowlf_state>(); | |
| 393 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 395 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 394 | 396 | & 0xFF0000; |
| 395 | 397 | |
| 396 | space | |
| 398 | space. | |
| 397 | 399 | } |
| 398 | 400 | |
| 399 | 401 | |
| r14896 | r14897 | |
| 425 | 427 | { |
| 426 | 428 | DEVCB_LINE(pc_dma_hrq_changed), |
| 427 | 429 | DEVCB_NULL, |
| 428 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 429 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 430 | DEVCB_DRIVER_MEMBER(taitowlf_state, pc_dma_read_byte), | |
| 431 | DEVCB_DRIVER_MEMBER(taitowlf_state, pc_dma_write_byte), | |
| 430 | 432 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 431 | 433 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 432 | 434 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 443 | 445 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL } |
| 444 | 446 | }; |
| 445 | 447 | |
| 446 | static READ32_HANDLER(at_page32_r) | |
| 447 | { | |
| 448 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 449 | } | |
| 450 | ||
| 451 | ||
| 452 | static WRITE32_HANDLER(at_page32_w) | |
| 453 | { | |
| 454 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 455 | } | |
| 456 | ||
| 457 | ||
| 458 | 448 | /*****************************************************************************/ |
| 459 | 449 | |
| 460 | 450 | static ADDRESS_MAP_START( taitowlf_map, AS_PROGRAM, 32, taitowlf_state ) |
| r14896 | r14897 | |
| 467 | 457 | #endif |
| 468 | 458 | AM_RANGE(0x000e0000, 0x000effff) AM_RAM |
| 469 | 459 | AM_RANGE(0x000f0000, 0x000fffff) AM_ROMBANK("bank1") |
| 470 | AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE | |
| 460 | AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE | |
| 471 | 461 | AM_RANGE(0x00100000, 0x01ffffff) AM_RAM |
| 472 | 462 | AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("user1", 0) /* System BIOS */ |
| 473 | 463 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 478 | 468 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 479 | 469 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 480 | 470 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) |
| 481 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 471 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 482 | 472 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 483 | 473 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 484 | 474 | AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| 485 | 475 | AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE_LEGACY("ide", ide_r, ide_w) |
| 486 | 476 | AM_RANGE(0x0300, 0x03af) AM_NOP |
| 487 | 477 | AM_RANGE(0x03b0, 0x03df) AM_NOP |
| 488 | AM_RANGE(0x0278, 0x027b) AM_WRITE | |
| 478 | AM_RANGE(0x0278, 0x027b) AM_WRITE | |
| 489 | 479 | AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE_LEGACY("ide", fdc_r, fdc_w) |
| 490 | AM_RANGE(0x0a78, 0x0a7b) AM_WRITE | |
| 480 | AM_RANGE(0x0a78, 0x0a7b) AM_WRITE | |
| 491 | 481 | AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE_LEGACY("pcibus", pci_32le_r, pci_32le_w) |
| 492 | 482 | ADDRESS_MAP_END |
| 493 | 483 |
| r14896 | r14897 | |
|---|---|---|
| 357 | 357 | |
| 358 | 358 | UINT32 m_coin_info; |
| 359 | 359 | UINT32 m_mux_data; |
| 360 | DECLARE_WRITE32_MEMBER(rf5c296_io_w); | |
| 361 | DECLARE_READ32_MEMBER(rf5c296_io_r); | |
| 362 | DECLARE_READ32_MEMBER(rf5c296_mem_r); | |
| 363 | DECLARE_WRITE32_MEMBER(rf5c296_mem_w); | |
| 364 | DECLARE_READ32_MEMBER(flash_subbios_r); | |
| 365 | DECLARE_WRITE32_MEMBER(flash_subbios_w); | |
| 366 | DECLARE_READ32_MEMBER(flash_mn102_r); | |
| 367 | DECLARE_WRITE32_MEMBER(flash_mn102_w); | |
| 368 | DECLARE_READ32_MEMBER(flash_s1_r); | |
| 369 | DECLARE_WRITE32_MEMBER(flash_s1_w); | |
| 370 | DECLARE_READ32_MEMBER(flash_s2_r); | |
| 371 | DECLARE_WRITE32_MEMBER(flash_s2_w); | |
| 372 | DECLARE_READ32_MEMBER(flash_s3_r); | |
| 373 | DECLARE_WRITE32_MEMBER(flash_s3_w); | |
| 374 | DECLARE_READ32_MEMBER(control_r); | |
| 375 | DECLARE_WRITE32_MEMBER(control_w); | |
| 376 | DECLARE_WRITE32_MEMBER(control2_w); | |
| 377 | DECLARE_READ32_MEMBER(control3_r); | |
| 378 | DECLARE_WRITE32_MEMBER(control3_w); | |
| 379 | DECLARE_READ32_MEMBER(gn_1fb70000_r); | |
| 380 | DECLARE_WRITE32_MEMBER(gn_1fb70000_w); | |
| 381 | DECLARE_READ32_MEMBER(hack1_r); | |
| 382 | DECLARE_READ32_MEMBER(znsecsel_r); | |
| 383 | DECLARE_WRITE32_MEMBER(znsecsel_w); | |
| 384 | DECLARE_READ32_MEMBER(boardconfig_r); | |
| 385 | DECLARE_WRITE32_MEMBER(coin_w); | |
| 386 | DECLARE_READ32_MEMBER(coin_r); | |
| 387 | DECLARE_READ32_MEMBER(gnet_mahjong_panel_r); | |
| 360 | 388 | }; |
| 361 | 389 | |
| 362 | 390 | |
| r14896 | r14897 | |
| 390 | 418 | return 0x00; |
| 391 | 419 | } |
| 392 | 420 | |
| 393 | ||
| 421 | ||
| 394 | 422 | { |
| 395 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 396 | 423 | |
| 397 | 424 | if(offset < 2) { |
| 398 | ide_controller32_pcmcia_w( | |
| 425 | ide_controller32_pcmcia_w( | |
| 399 | 426 | return; |
| 400 | 427 | } |
| 401 | 428 | |
| 402 | 429 | if(offset == 0x3e0/4) { |
| 403 | 430 | if(ACCESSING_BITS_0_7) |
| 404 | | |
| 431 | | |
| 405 | 432 | if(ACCESSING_BITS_8_15) |
| 406 | rf5c296_reg_w( | |
| 433 | rf5c296_reg_w( | |
| 407 | 434 | } |
| 408 | 435 | } |
| 409 | 436 | |
| 410 | ||
| 437 | ||
| 411 | 438 | { |
| 412 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 413 | 439 | |
| 414 | 440 | if(offset < 2) |
| 415 | return ide_controller32_pcmcia_r( | |
| 441 | return ide_controller32_pcmcia_r( | |
| 416 | 442 | |
| 417 | 443 | offset *= 4; |
| 418 | 444 | |
| 419 | 445 | if(offset == 0x3e0/4) { |
| 420 | 446 | UINT32 res = 0xffff0000; |
| 421 | 447 | if(ACCESSING_BITS_0_7) |
| 422 | res |= | |
| 448 | res |= | |
| 423 | 449 | if(ACCESSING_BITS_8_15) |
| 424 | res |= rf5c296_reg_r( | |
| 450 | res |= rf5c296_reg_r( | |
| 425 | 451 | return res; |
| 426 | 452 | } |
| 427 | 453 | |
| r14896 | r14897 | |
| 430 | 456 | |
| 431 | 457 | // Hardcoded to reach the pcmcia CIS |
| 432 | 458 | |
| 433 | ||
| 459 | ||
| 434 | 460 | { |
| 435 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 436 | 461 | |
| 437 | 462 | if(offset < 0x80) |
| 438 | return ( | |
| 463 | return ( | |
| 439 | 464 | |
| 440 | 465 | switch(offset) { |
| 441 | 466 | case 0x080: return 0x00800041; |
| 442 | 467 | case 0x081: return 0x0000002e; |
| 443 | case 0x100: return | |
| 468 | case 0x100: return | |
| 444 | 469 | default: |
| 445 | 470 | return 0; |
| 446 | 471 | } |
| 447 | 472 | } |
| 448 | 473 | |
| 449 | ||
| 474 | ||
| 450 | 475 | { |
| 451 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 452 | 476 | |
| 453 | 477 | if(offset >= 0x140 && offset <= 0x144) { |
| 454 | 478 | dynamic_buffer key; |
| r14896 | r14897 | |
| 460 | 484 | pos++; |
| 461 | 485 | } else |
| 462 | 486 | v = data; |
| 463 | get_disk_handle( | |
| 487 | get_disk_handle( | |
| 464 | 488 | k = pos < key.count() ? key[pos] : 0; |
| 465 | 489 | if(v == k) |
| 466 | | |
| 490 | | |
| 467 | 491 | else |
| 468 | state->m_locked |= 1 << pos; | |
| 469 | if (!state->m_locked) { | |
| 470 | ide_set_gnet_readlock (space->machine().device(":card"), 0); | |
| 492 | m_locked |= 1 << pos; | |
| 493 | if (!m_locked) { | |
| 494 | ide_set_gnet_readlock (machine().device(":card"), 0); | |
| 471 | 495 | } |
| 472 | 496 | } |
| 473 | 497 | } |
| r14896 | r14897 | |
| 496 | 520 | } |
| 497 | 521 | |
| 498 | 522 | |
| 499 | ||
| 523 | ||
| 500 | 524 | { |
| 501 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 502 | 525 | |
| 503 | return gen_flash_r( | |
| 526 | return gen_flash_r( | |
| 504 | 527 | } |
| 505 | 528 | |
| 506 | ||
| 529 | ||
| 507 | 530 | { |
| 508 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 509 | 531 | |
| 510 | gen_flash_w( | |
| 532 | gen_flash_w( | |
| 511 | 533 | } |
| 512 | 534 | |
| 513 | ||
| 535 | ||
| 514 | 536 | { |
| 515 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 516 | 537 | |
| 517 | return gen_flash_r( | |
| 538 | return gen_flash_r( | |
| 518 | 539 | } |
| 519 | 540 | |
| 520 | ||
| 541 | ||
| 521 | 542 | { |
| 522 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 523 | 543 | |
| 524 | gen_flash_w( | |
| 544 | gen_flash_w( | |
| 525 | 545 | } |
| 526 | 546 | |
| 527 | ||
| 547 | ||
| 528 | 548 | { |
| 529 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 530 | 549 | |
| 531 | return gen_flash_r( | |
| 550 | return gen_flash_r( | |
| 532 | 551 | } |
| 533 | 552 | |
| 534 | ||
| 553 | ||
| 535 | 554 | { |
| 536 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 537 | 555 | |
| 538 | gen_flash_w( | |
| 556 | gen_flash_w( | |
| 539 | 557 | } |
| 540 | 558 | |
| 541 | ||
| 559 | ||
| 542 | 560 | { |
| 543 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 544 | 561 | |
| 545 | return gen_flash_r( | |
| 562 | return gen_flash_r( | |
| 546 | 563 | } |
| 547 | 564 | |
| 548 | ||
| 565 | ||
| 549 | 566 | { |
| 550 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 551 | 567 | |
| 552 | gen_flash_w( | |
| 568 | gen_flash_w( | |
| 553 | 569 | } |
| 554 | 570 | |
| 555 | ||
| 571 | ||
| 556 | 572 | { |
| 557 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 558 | 573 | |
| 559 | return gen_flash_r( | |
| 574 | return gen_flash_r( | |
| 560 | 575 | } |
| 561 | 576 | |
| 562 | ||
| 577 | ||
| 563 | 578 | { |
| 564 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 565 | 579 | |
| 566 | gen_flash_w( | |
| 580 | gen_flash_w( | |
| 567 | 581 | } |
| 568 | 582 | |
| 569 | 583 | static void install_handlers(running_machine &machine, int mode) |
| 570 | 584 | { |
| 585 | taitogn_state *state = machine.driver_data<taitogn_state>(); | |
| 571 | 586 | address_space *a = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 572 | 587 | if(mode == 0) { |
| 573 | 588 | // Mode 0 has access to the subbios, the mn102 flash and the rf5c296 mem zone |
| 574 | a->install_legacy_readwrite_handler(0x1f000000, 0x1f1fffff, FUNC(flash_subbios_r), FUNC(flash_subbios_w)); | |
| 575 | a->install_legacy_readwrite_handler(0x1f200000, 0x1f2fffff, FUNC(rf5c296_mem_r), FUNC(rf5c296_mem_w)); | |
| 576 | a->install_legacy_readwrite_handler(0x1f300000, 0x1f37ffff, FUNC(flash_mn102_r), FUNC(flash_mn102_w)); | |
| 589 | a->install_readwrite_handler(0x1f000000, 0x1f1fffff, read32_delegate(FUNC(taitogn_state::flash_subbios_r),state), write32_delegate(FUNC(taitogn_state::flash_subbios_w),state)); | |
| 590 | a->install_readwrite_handler(0x1f200000, 0x1f2fffff, read32_delegate(FUNC(taitogn_state::rf5c296_mem_r),state), write32_delegate(FUNC(taitogn_state::rf5c296_mem_w),state)); | |
| 591 | a->install_readwrite_handler(0x1f300000, 0x1f37ffff, read32_delegate(FUNC(taitogn_state::flash_mn102_r),state), write32_delegate(FUNC(taitogn_state::flash_mn102_w),state)); | |
| 577 | 592 | a->nop_readwrite(0x1f380000, 0x1f5fffff); |
| 578 | 593 | |
| 579 | 594 | } else { |
| 580 | 595 | // Mode 1 has access to the 3 samples flashes |
| 581 | a->install_legacy_readwrite_handler(0x1f000000, 0x1f1fffff, FUNC(flash_s1_r), FUNC(flash_s1_w)); | |
| 582 | a->install_legacy_readwrite_handler(0x1f200000, 0x1f3fffff, FUNC(flash_s2_r), FUNC(flash_s2_w)); | |
| 583 | a->install_legacy_readwrite_handler(0x1f400000, 0x1f5fffff, FUNC(flash_s3_r), FUNC(flash_s3_w)); | |
| 596 | a->install_readwrite_handler(0x1f000000, 0x1f1fffff, read32_delegate(FUNC(taitogn_state::flash_s1_r),state), write32_delegate(FUNC(taitogn_state::flash_s1_w),state)); | |
| 597 | a->install_readwrite_handler(0x1f200000, 0x1f3fffff, read32_delegate(FUNC(taitogn_state::flash_s2_r),state), write32_delegate(FUNC(taitogn_state::flash_s2_w),state)); | |
| 598 | a->install_readwrite_handler(0x1f400000, 0x1f5fffff, read32_delegate(FUNC(taitogn_state::flash_s3_r),state), write32_delegate(FUNC(taitogn_state::flash_s3_w),state)); | |
| 584 | 599 | } |
| 585 | 600 | } |
| 586 | 601 | |
| 587 | 602 | // Misc. controls |
| 588 | 603 | |
| 589 | ||
| 604 | ||
| 590 | 605 | { |
| 591 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 592 | 606 | |
| 593 | // fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, space->machine().describe_context()); | |
| 594 | return state->m_control; | |
| 607 | // fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, machine().describe_context()); | |
| 608 | return m_control; | |
| 595 | 609 | } |
| 596 | 610 | |
| 597 | ||
| 611 | ||
| 598 | 612 | { |
| 599 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 600 | 613 | |
| 601 | 614 | // 20 = watchdog |
| 602 | 615 | // 04 = select bank |
| r14896 | r14897 | |
| 604 | 617 | // According to the rom code, bits 1-0 may be part of the bank |
| 605 | 618 | // selection too, but they're always 0. |
| 606 | 619 | |
| 607 | UINT32 p = state->m_control; | |
| 608 | device_t *mb3773 = space->machine().device("mb3773"); | |
| 620 | UINT32 p = m_control; | |
| 621 | device_t *mb3773 = machine().device("mb3773"); | |
| 609 | 622 | |
| 610 | COMBINE_DATA(& | |
| 623 | COMBINE_DATA(& | |
| 611 | 624 | |
| 612 | mb3773_set_ck(mb3773, ( | |
| 625 | mb3773_set_ck(mb3773, ( | |
| 613 | 626 | |
| 614 | 627 | #if 0 |
| 615 | 628 | if((p ^ control) & ~0x20) |
| r14896 | r14897 | |
| 621 | 634 | control & 0x04 ? 'f' : '-', |
| 622 | 635 | control & 0x02 ? '1' : '0', |
| 623 | 636 | control & 0x01 ? '1' : '0', |
| 624 | | |
| 637 | | |
| 625 | 638 | #endif |
| 626 | 639 | |
| 627 | if((p ^ state->m_control) & 0x04) | |
| 628 | install_handlers(space->machine(), state->m_control & 4 ? 1 : 0); | |
| 640 | if((p ^ m_control) & 0x04) | |
| 641 | install_handlers(machine(), m_control & 4 ? 1 : 0); | |
| 629 | 642 | } |
| 630 | 643 | |
| 631 | ||
| 644 | ||
| 632 | 645 | { |
| 633 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 634 | 646 | |
| 635 | COMBINE_DATA(& | |
| 647 | COMBINE_DATA(& | |
| 636 | 648 | } |
| 637 | 649 | |
| 638 | ||
| 650 | ||
| 639 | 651 | { |
| 640 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 641 | 652 | |
| 642 | return | |
| 653 | return | |
| 643 | 654 | } |
| 644 | 655 | |
| 645 | ||
| 656 | ||
| 646 | 657 | { |
| 647 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 648 | 658 | |
| 649 | COMBINE_DATA(& | |
| 659 | COMBINE_DATA(& | |
| 650 | 660 | } |
| 651 | 661 | |
| 652 | ||
| 662 | ||
| 653 | 663 | { |
| 654 | 664 | // (1328) 1348 tests mask 0002, 8 times. |
| 655 | 665 | // Called by 1434, exit at 143c |
| r14896 | r14897 | |
| 661 | 671 | return 2; |
| 662 | 672 | } |
| 663 | 673 | |
| 664 | ||
| 674 | ||
| 665 | 675 | { |
| 666 | 676 | // Writes 0 or 1 all the time, it *may* have somthing to do with |
| 667 | 677 | // i/o port width, but then maybe not |
| 668 | 678 | } |
| 669 | 679 | |
| 670 | ||
| 680 | ||
| 671 | 681 | { |
| 672 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 673 | 682 | |
| 674 | | |
| 683 | | |
| 675 | 684 | // Probably something to do with sound |
| 676 | return | |
| 685 | return | |
| 677 | 686 | } |
| 678 | 687 | |
| 679 | 688 | |
| r14896 | r14897 | |
| 683 | 692 | static const UINT8 tt10[ 8 ] = { 0x80, 0x20, 0x38, 0x08, 0xf1, 0x03, 0xfe, 0xfc }; |
| 684 | 693 | static const UINT8 tt16[ 8 ] = { 0xc0, 0x04, 0xf9, 0xe1, 0x60, 0x70, 0xf2, 0x02 }; |
| 685 | 694 | |
| 686 | ||
| 695 | ||
| 687 | 696 | { |
| 688 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 689 | 697 | |
| 690 | return | |
| 698 | return | |
| 691 | 699 | } |
| 692 | 700 | |
| 693 | 701 | static void sio_znsec0_handler( running_machine &machine, int n_data ) |
| r14896 | r14897 | |
| 759 | 767 | } |
| 760 | 768 | } |
| 761 | 769 | |
| 762 | ||
| 770 | ||
| 763 | 771 | { |
| 764 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 765 | 772 | |
| 766 | COMBINE_DATA( & | |
| 773 | COMBINE_DATA( & | |
| 767 | 774 | |
| 768 | if( ( | |
| 775 | if( ( | |
| 769 | 776 | { |
| 770 | psx_sio_install_handler( space->machine(), 0, sio_pad_handler ); | |
| 771 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 777 | psx_sio_install_handler( machine(), 0, sio_pad_handler ); | |
| 778 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 772 | 779 | } |
| 773 | else if( ( | |
| 780 | else if( ( | |
| 774 | 781 | { |
| 775 | 782 | znsec_start( 1 ); |
| 776 | psx_sio_install_handler( space->machine(), 0, sio_znsec1_handler ); | |
| 777 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 783 | psx_sio_install_handler( machine(), 0, sio_znsec1_handler ); | |
| 784 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 778 | 785 | } |
| 779 | else if( ( | |
| 786 | else if( ( | |
| 780 | 787 | { |
| 781 | 788 | znsec_start( 0 ); |
| 782 | psx_sio_install_handler( space->machine(), 0, sio_znsec0_handler ); | |
| 783 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 789 | psx_sio_install_handler( machine(), 0, sio_znsec0_handler ); | |
| 790 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 784 | 791 | } |
| 785 | 792 | else |
| 786 | 793 | { |
| 787 | state->m_n_dip_bit = 0; | |
| 788 | state->m_b_lastclock = 1; | |
| 794 | m_n_dip_bit = 0; | |
| 795 | m_b_lastclock = 1; | |
| 789 | 796 | |
| 790 | psx_sio_install_handler( space->machine(), 0, sio_dip_handler ); | |
| 791 | psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 797 | psx_sio_install_handler( machine(), 0, sio_dip_handler ); | |
| 798 | psx_sio_input( machine(), 0, PSX_SIO_IN_DSR, 0 ); | |
| 792 | 799 | |
| 793 | | |
| 800 | | |
| 794 | 801 | } |
| 795 | 802 | } |
| 796 | 803 | |
| r14896 | r14897 | |
| 807 | 814 | } |
| 808 | 815 | |
| 809 | 816 | |
| 810 | ||
| 817 | ||
| 811 | 818 | { |
| 812 | 819 | /* |
| 813 | 820 | ------00 mem=4M |
| r14896 | r14897 | |
| 832 | 839 | } |
| 833 | 840 | |
| 834 | 841 | |
| 835 | ||
| 842 | ||
| 836 | 843 | { |
| 837 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 838 | 844 | |
| 839 | 845 | /* 0x01=counter |
| 840 | 846 | 0x02=coin lock 1 |
| r14896 | r14897 | |
| 842 | 848 | 0x20=coin lock 2 |
| 843 | 849 | 0x80=?? |
| 844 | 850 | */ |
| 845 | COMBINE_DATA (& | |
| 851 | COMBINE_DATA (& | |
| 846 | 852 | } |
| 847 | 853 | |
| 848 | ||
| 854 | ||
| 849 | 855 | { |
| 850 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 851 | 856 | |
| 852 | return | |
| 857 | return | |
| 853 | 858 | } |
| 854 | 859 | |
| 855 | 860 | /* mahjong panel handler (for Usagi & Mahjong Oh) */ |
| 856 | ||
| 861 | ||
| 857 | 862 | { |
| 858 | taitogn_state *state = space->machine().driver_data<taitogn_state>(); | |
| 859 | 863 | |
| 860 | state->m_mux_data = state->m_coin_info; | |
| 861 | state->m_mux_data &= 0xcc; | |
| 864 | m_mux_data = m_coin_info; | |
| 865 | m_mux_data &= 0xcc; | |
| 862 | 866 | |
| 863 | switch( | |
| 867 | switch( | |
| 864 | 868 | { |
| 865 | case 0x04: return input_port_read(space->machine(), "KEY0"); | |
| 866 | case 0x08: return input_port_read(space->machine(), "KEY1"); | |
| 867 | case 0x40: return input_port_read(space->machine(), "KEY2"); | |
| 868 | case 0x80: return input_port_read(space->machine(), "KEY3"); | |
| 869 | case 0x04: return input_port_read(machine(), "KEY0"); | |
| 870 | case 0x08: return input_port_read(machine(), "KEY1"); | |
| 871 | case 0x40: return input_port_read(machine(), "KEY2"); | |
| 872 | case 0x80: return input_port_read(machine(), "KEY3"); | |
| 869 | 873 | } |
| 870 | 874 | |
| 871 | 875 | /* mux disabled */ |
| 872 | return input_port_read( | |
| 876 | return input_port_read( | |
| 873 | 877 | } |
| 874 | 878 | |
| 875 | 879 | // Init and reset |
| r14896 | r14897 | |
| 899 | 903 | static DRIVER_INIT( coh3002t_mp ) |
| 900 | 904 | { |
| 901 | 905 | DRIVER_INIT_CALL(coh3002t); |
| 902 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1fa10100, 0x1fa10103, FUNC(gnet_mahjong_panel_r) ); | |
| 906 | taitogn_state *state = machine.driver_data<taitogn_state>(); | |
| 907 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x1fa10100, 0x1fa10103, read32_delegate(FUNC(taitogn_state::gnet_mahjong_panel_r),state)); | |
| 903 | 908 | } |
| 904 | 909 | |
| 905 | 910 | static MACHINE_RESET( coh3002t ) |
| r14896 | r14897 | |
| 920 | 925 | static ADDRESS_MAP_START( taitogn_map, AS_PROGRAM, 32, taitogn_state ) |
| 921 | 926 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE("share1") /* ram */ |
| 922 | 927 | AM_RANGE(0x00400000, 0x007fffff) AM_RAM AM_SHARE("share1") /* ram mirror */ |
| 923 | AM_RANGE(0x1f000000, 0x1f1fffff) AM_READWRITE_LEGACY(flash_s1_r, flash_s1_w) | |
| 924 | AM_RANGE(0x1f200000, 0x1f3fffff) AM_READWRITE_LEGACY(flash_s2_r, flash_s2_w) | |
| 925 | AM_RANGE(0x1f400000, 0x1f5fffff) AM_READWRITE_LEGACY(flash_s3_r, flash_s3_w) | |
| 928 | AM_RANGE(0x1f000000, 0x1f1fffff) AM_READWRITE(flash_s1_r, flash_s1_w) | |
| 929 | AM_RANGE(0x1f200000, 0x1f3fffff) AM_READWRITE(flash_s2_r, flash_s2_w) | |
| 930 | AM_RANGE(0x1f400000, 0x1f5fffff) AM_READWRITE(flash_s3_r, flash_s3_w) | |
| 926 | 931 | AM_RANGE(0x1fa00000, 0x1fa00003) AM_READ_PORT("P1") |
| 927 | 932 | AM_RANGE(0x1fa00100, 0x1fa00103) AM_READ_PORT("P2") |
| 928 | 933 | AM_RANGE(0x1fa00200, 0x1fa00203) AM_READ_PORT("SERVICE") |
| 929 | 934 | AM_RANGE(0x1fa00300, 0x1fa00303) AM_READ_PORT("SYSTEM") |
| 930 | 935 | AM_RANGE(0x1fa10000, 0x1fa10003) AM_READ_PORT("P3") |
| 931 | 936 | AM_RANGE(0x1fa10100, 0x1fa10103) AM_READ_PORT("P4") |
| 932 | AM_RANGE(0x1fa10200, 0x1fa10203) AM_READ_LEGACY(boardconfig_r) | |
| 933 | AM_RANGE(0x1fa10300, 0x1fa10303) AM_READWRITE_LEGACY(znsecsel_r, znsecsel_w) | |
| 934 | AM_RANGE(0x1fa20000, 0x1fa20003) AM_READWRITE_LEGACY(coin_r, coin_w) | |
| 935 | AM_RANGE(0x1fa30000, 0x1fa30003) AM_READWRITE_LEGACY(control3_r, control3_w) | |
| 937 | AM_RANGE(0x1fa10200, 0x1fa10203) AM_READ(boardconfig_r) | |
| 938 | AM_RANGE(0x1fa10300, 0x1fa10303) AM_READWRITE(znsecsel_r, znsecsel_w) | |
| 939 | AM_RANGE(0x1fa20000, 0x1fa20003) AM_READWRITE(coin_r, coin_w) | |
| 940 | AM_RANGE(0x1fa30000, 0x1fa30003) AM_READWRITE(control3_r, control3_w) | |
| 936 | 941 | AM_RANGE(0x1fa51c00, 0x1fa51dff) AM_READWRITE16_LEGACY(spu_r, spu_w, 0xffffffff) // systematic read at spu_address + 250000, result dropped, maybe other accesses |
| 937 | AM_RANGE(0x1fa60000, 0x1fa60003) AM_READ | |
| 942 | AM_RANGE(0x1fa60000, 0x1fa60003) AM_READ | |
| 938 | 943 | AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0xffffffff) /* eeprom */ |
| 939 | AM_RANGE(0x1fb00000, 0x1fb0ffff) AM_READWRITE_LEGACY(rf5c296_io_r, rf5c296_io_w) | |
| 940 | AM_RANGE(0x1fb40000, 0x1fb40003) AM_READWRITE_LEGACY(control_r, control_w) | |
| 941 | AM_RANGE(0x1fb60000, 0x1fb60003) AM_WRITE_LEGACY(control2_w) | |
| 942 | AM_RANGE(0x1fb70000, 0x1fb70003) AM_READWRITE_LEGACY(gn_1fb70000_r, gn_1fb70000_w) | |
| 944 | AM_RANGE(0x1fb00000, 0x1fb0ffff) AM_READWRITE(rf5c296_io_r, rf5c296_io_w) | |
| 945 | AM_RANGE(0x1fb40000, 0x1fb40003) AM_READWRITE(control_r, control_w) | |
| 946 | AM_RANGE(0x1fb60000, 0x1fb60003) AM_WRITE(control2_w) | |
| 947 | AM_RANGE(0x1fb70000, 0x1fb70003) AM_READWRITE(gn_1fb70000_r, gn_1fb70000_w) | |
| 943 | 948 | AM_RANGE(0x1fbe0000, 0x1fbe01ff) AM_RAM // 256 bytes com zone with the mn102, low bytes of words only, with additional comm at 1fb80000 |
| 944 | 949 | AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_SHARE("share2") AM_REGION("mainbios", 0) /* bios */ |
| 945 | 950 | AM_RANGE(0x80000000, 0x803fffff) AM_RAM AM_SHARE("share1") /* ram mirror */ |
| r14896 | r14897 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | |
| 45 | 45 | m_irq_enable = data & 0x02; |
| 46 | flip_screen_set( | |
| 46 | flip_screen_set( | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | static INTERRUPT_GEN( scotrsht_interrupt ) |
| r14896 | r14897 | |
| 56 | 56 | |
| 57 | 57 | WRITE8_MEMBER(scotrsht_state::scotrsht_soundlatch_w) |
| 58 | 58 | { |
| 59 | soundlatch_w(space, 0, data); | |
| 59 | soundlatch_byte_w(space, 0, data); | |
| 60 | 60 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 61 | 61 | } |
| 62 | 62 | |
| r14896 | r14897 | |
| 87 | 87 | static ADDRESS_MAP_START( scotrsht_sound_map, AS_PROGRAM, 8, scotrsht_state ) |
| 88 | 88 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 89 | 89 | AM_RANGE(0x4000, 0x43ff) AM_RAM |
| 90 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) | |
| 90 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) | |
| 91 | 91 | ADDRESS_MAP_END |
| 92 | 92 | |
| 93 | 93 | static ADDRESS_MAP_START( scotrsht_sound_port, AS_IO, 8, scotrsht_state ) |
| r14896 | r14897 | |
|---|---|---|
| 1586 | 1586 | AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 1587 | 1587 | AM_RANGE(0x600000, 0x600001) AM_WRITE(cpua_ctrl_w) |
| 1588 | 1588 | AM_RANGE(0x800000, 0x800007) AM_READWRITE(bshark_stick_r, bshark_stick_w) |
| 1589 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 1589 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 1590 | 1590 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 1591 | 1591 | AM_RANGE(0xd00000, 0xd0ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1592 | 1592 | AM_RANGE(0xd20000, 0xd2000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| r14896 | r14897 | |
| 1599 | 1599 | AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_r, tc0220ioc_w, 0x00ff) |
| 1600 | 1600 | AM_RANGE(0x600000, 0x600001) AM_WRITE(cpua_ctrl_w) |
| 1601 | 1601 | // AM_RANGE(0x800000, 0x800007) AM_READWRITE(bshark_stick_r, bshark_stick_w) /* No analog stick, this is the Joystick version */ |
| 1602 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 1602 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram | |
| 1603 | 1603 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 1604 | 1604 | AM_RANGE(0xd00000, 0xd0ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1605 | 1605 | AM_RANGE(0xd20000, 0xd2000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| r14896 | r14897 | |
| 1627 | 1627 | AM_RANGE(0x200010, 0x20001f) AM_READ(sci_steer_input_r) |
| 1628 | 1628 | // AM_RANGE(0x400000, 0x400001) AM_WRITE(cpua_ctrl_w) // ?? doesn't seem to fit what's written |
| 1629 | 1629 | AM_RANGE(0x420000, 0x420003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) |
| 1630 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 1630 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 1631 | 1631 | AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1632 | 1632 | AM_RANGE(0xa20000, 0xa2000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1633 | 1633 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| r14896 | r14897 | |
| 1721 | 1721 | AM_RANGE(0x400010, 0x40001f) AM_READ(dblaxle_steer_input_r) |
| 1722 | 1722 | AM_RANGE(0x600000, 0x600001) AM_WRITE(cpua_ctrl_w) /* could this be causing int6 ? */ |
| 1723 | 1723 | AM_RANGE(0x620000, 0x620003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) |
| 1724 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 1724 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram | |
| 1725 | 1725 | AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemap mirror */ |
| 1726 | 1726 | AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ |
| 1727 | 1727 | AM_RANGE(0xa30000, 0xa3002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) |
| r14896 | r14897 | |
| 1746 | 1746 | AM_RANGE(0x300010, 0x30001f) AM_READ(dblaxle_steer_input_r) |
| 1747 | 1747 | AM_RANGE(0x500002, 0x500003) AM_WRITE(cpua_ctrl_w) |
| 1748 | 1748 | AM_RANGE(0x520000, 0x520003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w) |
| 1749 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1749 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 1750 | 1750 | AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w) /* tilemaps */ |
| 1751 | 1751 | AM_RANGE(0x930000, 0x93002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w) |
| 1752 | 1752 | AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* mostly unused ? */ |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | WRITE8_MEMBER(msisaac_state::sound_command_w) |
| 35 | 35 | { |
| 36 | soundlatch_w(space, 0, data); | |
| 36 | soundlatch_byte_w(space, 0, data); | |
| 37 | 37 | machine().scheduler().synchronize(FUNC(nmi_callback), data); |
| 38 | 38 | } |
| 39 | 39 | |
| r14896 | r14897 | |
| 55 | 55 | #if 0 |
| 56 | 56 | WRITE8_MEMBER(msisaac_state::flip_screen_w) |
| 57 | 57 | { |
| 58 | flip_screen_set( | |
| 58 | flip_screen_set( | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | WRITE8_MEMBER(msisaac_state::msisaac_coin_counter_w) |
| r14896 | r14897 | |
| 174 | 174 | static ADDRESS_MAP_START( msisaac_map, AS_PROGRAM, 8, msisaac_state ) |
| 175 | 175 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 176 | 176 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 177 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_le_w) AM_SHARE("paletteram") | |
| 177 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 178 | 178 | AM_RANGE(0xf000, 0xf000) AM_WRITE(msisaac_bg2_textbank_w) |
| 179 | 179 | AM_RANGE(0xf001, 0xf001) AM_WRITENOP //??? |
| 180 | 180 | AM_RANGE(0xf002, 0xf002) AM_WRITENOP //??? |
| r14896 | r14897 | |
| 267 | 267 | AM_RANGE(0x8010, 0x801d) AM_DEVWRITE_LEGACY("msm", msm5232_w) |
| 268 | 268 | AM_RANGE(0x8020, 0x8020) AM_DEVWRITE_LEGACY("msm", sound_control_0_w) |
| 269 | 269 | AM_RANGE(0x8030, 0x8030) AM_WRITE(sound_control_1_w) |
| 270 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) | |
| 270 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) | |
| 271 | 271 | AM_RANGE(0xc001, 0xc001) AM_WRITE(nmi_enable_w) |
| 272 | 272 | AM_RANGE(0xc002, 0xc002) AM_WRITE(nmi_disable_w) |
| 273 | 273 | AM_RANGE(0xc003, 0xc003) AM_WRITENOP /*???*/ /* this is NOT mixer_enable */ |
| r14896 | r14897 | |
|---|---|---|
| 690 | 690 | break; |
| 691 | 691 | |
| 692 | 692 | case 0x04: /* FLIP */ |
| 693 | flip_screen_set( | |
| 693 | flip_screen_set( | |
| 694 | 694 | break; |
| 695 | 695 | |
| 696 | 696 | case 0x06: /* SOUND ON */ |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | { |
| 56 | 56 | public: |
| 57 | 57 | safarir_state(const machine_config &mconfig, device_type type, const char *tag) |
| 58 | : driver_device(mconfig, type, tag) { } | |
| 58 | : driver_device(mconfig, type, tag) , | |
| 59 | m_bg_scroll(*this, "bg_scroll"){ } | |
| 59 | 60 | |
| 60 | 61 | UINT8 *m_ram_1; |
| 61 | 62 | UINT8 *m_ram_2; |
| r14896 | r14897 | |
| 63 | 64 | UINT8 m_ram_bank; |
| 64 | 65 | tilemap_t *m_bg_tilemap; |
| 65 | 66 | tilemap_t *m_fg_tilemap; |
| 66 | UINT8 | |
| 67 | required_shared_ptr<UINT8> | |
| 67 | 68 | UINT8 m_port_last; |
| 68 | 69 | UINT8 m_port_last2; |
| 69 | 70 | samples_device *m_samples; |
| r14896 | r14897 | |
| 200 | 201 | { |
| 201 | 202 | safarir_state *state = screen.machine().driver_data<safarir_state>(); |
| 202 | 203 | |
| 203 | state->m_bg_tilemap->set_scrollx(0, *state->m_bg_scroll); | |
| 204 | state->m_bg_tilemap->set_scrollx(0, *state->m_bg_scroll.target()); | |
| 204 | 205 | |
| 205 | 206 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 206 | 207 | state->m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| r14896 | r14897 | |
| 341 | 342 | AM_RANGE(0x0000, 0x17ff) AM_ROM |
| 342 | 343 | AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ram_r, ram_w) AM_SIZE(m_ram_size) |
| 343 | 344 | AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_READNOP AM_WRITE(ram_bank_w) |
| 344 | AM_RANGE(0x2c00, 0x2cff) AM_MIRROR(0x03ff) AM_READNOP AM_WRITEONLY AM_ | |
| 345 | AM_RANGE(0x2c00, 0x2cff) AM_MIRROR(0x03ff) AM_READNOP AM_WRITEONLY AM_ | |
| 345 | 346 | AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0x03ff) AM_WRITE(safarir_audio_w) /* goes to SN76477 */ |
| 346 | 347 | AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITENOP /* cleared at the beginning */ |
| 347 | 348 | AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x03ff) AM_READ_PORT("INPUTS") AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 205 | 205 | static ADDRESS_MAP_START( rastan_map, AS_PROGRAM, 16, rastan_state ) |
| 206 | 206 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 207 | 207 | AM_RANGE(0x10c000, 0x10ffff) AM_RAM |
| 208 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 208 | AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram | |
| 209 | 209 | AM_RANGE(0x350008, 0x350009) AM_WRITENOP /* 0 only (often) ? */ |
| 210 | 210 | AM_RANGE(0x380000, 0x380001) AM_WRITE(rastan_spritectrl_w) /* sprite palette bank, coin counters & lockout */ |
| 211 | 211 | AM_RANGE(0x390000, 0x390001) AM_READ_PORT("P1") |
| r14896 | r14897 | |
|---|---|---|
| 23 | 23 | { |
| 24 | 24 | public: |
| 25 | 25 | pzletime_state(const machine_config &mconfig, device_type type, const char *tag) |
| 26 | : driver_device(mconfig, type, tag) { } | |
| 26 | : driver_device(mconfig, type, tag) , | |
| 27 | m_video_regs(*this, "video_regs"), | |
| 28 | m_tilemap_regs(*this, "tilemap_regs"), | |
| 29 | m_bg_videoram(*this, "bg_videoram"), | |
| 30 | m_mid_videoram(*this, "mid_videoram"), | |
| 31 | m_txt_videoram(*this, "txt_videoram"), | |
| 32 | m_spriteram(*this, "spriteram"){ } | |
| 27 | 33 | |
| 28 | 34 | /* memory pointers */ |
| 29 | UINT16 * m_bg_videoram; | |
| 30 | UINT16 * m_mid_videoram; | |
| 31 | UINT16 * m_txt_videoram; | |
| 32 | UINT16 * m_tilemap_regs; | |
| 33 | UINT16 * m_video_regs; | |
| 34 | UINT16 * m_spriteram; | |
| 35 | required_shared_ptr<UINT16> m_video_regs; | |
| 36 | required_shared_ptr<UINT16> m_tilemap_regs; | |
| 37 | required_shared_ptr<UINT16> m_bg_videoram; | |
| 38 | required_shared_ptr<UINT16> m_mid_videoram; | |
| 39 | required_shared_ptr<UINT16> m_txt_videoram; | |
| 40 | required_shared_ptr<UINT16> m_spriteram; | |
| 35 | 41 | // UINT16 * m_paletteram; // currently this uses generic palette handling |
| 36 | 42 | |
| 37 | 43 | /* video-related */ |
| r14896 | r14897 | |
| 51 | 57 | static TILE_GET_INFO( get_mid_tile_info ) |
| 52 | 58 | { |
| 53 | 59 | pzletime_state *state = machine.driver_data<pzletime_state>(); |
| 54 | int tileno = state->m_mid_videoram[tile_index] & 0x0fff; | |
| 55 | int colour = state->m_mid_videoram[tile_index] & 0xf000; | |
| 60 | int tileno = state->m_mid_videoram.target()[tile_index] & 0x0fff; | |
| 61 | int colour = state->m_mid_videoram.target()[tile_index] & 0xf000; | |
| 56 | 62 | colour = colour >> 12; |
| 57 | 63 | SET_TILE_INFO(2, tileno, colour, 0); |
| 58 | 64 | } |
| r14896 | r14897 | |
| 60 | 66 | static TILE_GET_INFO( get_txt_tile_info ) |
| 61 | 67 | { |
| 62 | 68 | pzletime_state *state = machine.driver_data<pzletime_state>(); |
| 63 | int tileno = state->m_txt_videoram[tile_index] & 0x0fff; | |
| 64 | int colour = state->m_txt_videoram[tile_index] & 0xf000; | |
| 69 | int tileno = state->m_txt_videoram.target()[tile_index] & 0x0fff; | |
| 70 | int colour = state->m_txt_videoram.target()[tile_index] & 0xf000; | |
| 65 | 71 | colour = colour >> 12; |
| 66 | 72 | |
| 67 | 73 | SET_TILE_INFO(0, tileno, colour, 0); |
| r14896 | r14897 | |
| 88 | 94 | |
| 89 | 95 | bitmap.fill(screen.machine().pens[0], cliprect); //bg pen |
| 90 | 96 | |
| 91 | state->m_txt_tilemap->set_scrolly(0, state->m_tilemap_regs[0] - 3); | |
| 92 | state->m_txt_tilemap->set_scrollx(0, state->m_tilemap_regs[1]); | |
| 97 | state->m_txt_tilemap->set_scrolly(0, state->m_tilemap_regs.target()[0] - 3); | |
| 98 | state->m_txt_tilemap->set_scrollx(0, state->m_tilemap_regs.target()[1]); | |
| 93 | 99 | |
| 94 | state->m_mid_tilemap->set_scrolly(0, state->m_tilemap_regs[2] - 3); | |
| 95 | state->m_mid_tilemap->set_scrollx(0, state->m_tilemap_regs[3] - 7); | |
| 100 | state->m_mid_tilemap->set_scrolly(0, state->m_tilemap_regs.target()[2] - 3); | |
| 101 | state->m_mid_tilemap->set_scrollx(0, state->m_tilemap_regs.target()[3] - 7); | |
| 96 | 102 | |
| 97 | if (state->m_video_regs[2] & 1) | |
| 103 | if (state->m_video_regs.target()[2] & 1) | |
| 98 | 104 | { |
| 99 | 105 | count = 0; |
| 100 | 106 | |
| r14896 | r14897 | |
| 102 | 108 | { |
| 103 | 109 | for (x = 0; x < 512; x++) |
| 104 | 110 | { |
| 105 | if (state->m_bg_videoram[count] & 0x8000) | |
| 106 | bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (state->m_bg_videoram[count] & 0x7fff); | |
| 111 | if (state->m_bg_videoram.target()[count] & 0x8000) | |
| 112 | bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (state->m_bg_videoram.target()[count] & 0x7fff); | |
| 107 | 113 | |
| 108 | 114 | count++; |
| 109 | 115 | } |
| r14896 | r14897 | |
| 113 | 119 | state->m_mid_tilemap->draw(bitmap, cliprect, 0, 0); |
| 114 | 120 | |
| 115 | 121 | { |
| 116 | UINT16 *spriteram = state->m_spriteram; | |
| 122 | UINT16 *spriteram = state->m_spriteram.target(); | |
| 117 | 123 | int offs, spr_offs, colour, sx, sy; |
| 118 | 124 | |
| 119 | 125 | for(offs = 0; offs < 0x2000 / 2; offs += 4) |
| r14896 | r14897 | |
| 141 | 147 | |
| 142 | 148 | WRITE16_MEMBER(pzletime_state::mid_videoram_w) |
| 143 | 149 | { |
| 144 | COMBINE_DATA(&m_mid_videoram[offset]); | |
| 150 | COMBINE_DATA(&m_mid_videoram.target()[offset]); | |
| 145 | 151 | m_mid_tilemap->mark_tile_dirty(offset); |
| 146 | 152 | } |
| 147 | 153 | |
| 148 | 154 | WRITE16_MEMBER(pzletime_state::txt_videoram_w) |
| 149 | 155 | { |
| 150 | COMBINE_DATA(&m_txt_videoram[offset]); | |
| 156 | COMBINE_DATA(&m_txt_videoram.target()[offset]); | |
| 151 | 157 | m_txt_tilemap->mark_tile_dirty(offset); |
| 152 | 158 | } |
| 153 | 159 | |
| r14896 | r14897 | |
| 173 | 179 | { |
| 174 | 180 | int i; |
| 175 | 181 | |
| 176 | COMBINE_DATA(&m_video_regs[offset]); | |
| 182 | COMBINE_DATA(&m_video_regs.target()[offset]); | |
| 177 | 183 | |
| 178 | 184 | if (offset == 0) |
| 179 | 185 | { |
| 180 | if (m_video_regs[0] > 0) | |
| 186 | if (m_video_regs.target()[0] > 0) | |
| 181 | 187 | { |
| 182 | 188 | for (i = 0; i < 0x300; i++) |
| 183 | 189 | { |
| 184 | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs[0]); | |
| 190 | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs.target()[0]); | |
| 185 | 191 | } |
| 186 | 192 | } |
| 187 | 193 | } |
| 188 | 194 | else if (offset == 1) |
| 189 | 195 | { |
| 190 | if (m_video_regs[1] > 0) | |
| 196 | if (m_video_regs.target()[1] > 0) | |
| 191 | 197 | { |
| 192 | 198 | for (i = 0x300; i < 32768 + 0x300; i++) |
| 193 | 199 | { |
| 194 | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs[1]); | |
| 200 | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs.target()[1]); | |
| 195 | 201 | } |
| 196 | 202 | } |
| 197 | 203 | } |
| r14896 | r14897 | |
| 209 | 215 | |
| 210 | 216 | static ADDRESS_MAP_START( pzletime_map, AS_PROGRAM, 16, pzletime_state ) |
| 211 | 217 | AM_RANGE(0x000000, 0x3fffff) AM_ROM |
| 212 | AM_RANGE(0x700000, 0x700005) AM_RAM_WRITE(video_regs_w) AM_ | |
| 218 | AM_RANGE(0x700000, 0x700005) AM_RAM_WRITE(video_regs_w) AM_ | |
| 213 | 219 | AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 214 | AM_RANGE(0x900000, 0x9005ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 215 | AM_RANGE(0xa00000, 0xa00007) AM_RAM AM_BASE(m_tilemap_regs) | |
| 216 | AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_BASE(m_bg_videoram) | |
| 217 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(mid_videoram_w) AM_BASE(m_mid_videoram) | |
| 218 | AM_RANGE(0xc01000, 0xc01fff) AM_RAM_WRITE(txt_videoram_w) AM_BASE(m_txt_videoram) | |
| 219 | AM_RANGE(0xd00000, 0xd01fff) AM_RAM AM_BASE(m_spriteram) | |
| 220 | AM_RANGE(0x900000, 0x9005ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") | |
| 221 | AM_RANGE(0xa00000, 0xa00007) AM_RAM AM_SHARE("tilemap_regs") | |
| 222 | AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_SHARE("bg_videoram") | |
| 223 | AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(mid_videoram_w) AM_SHARE("mid_videoram") | |
| 224 | AM_RANGE(0xc01000, 0xc01fff) AM_RAM_WRITE(txt_videoram_w) AM_SHARE("txt_videoram") | |
| 225 | AM_RANGE(0xd00000, 0xd01fff) AM_RAM AM_SHARE("spriteram") | |
| 220 | 226 | AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("INPUT") AM_DEVWRITE_LEGACY("eeprom", eeprom_w) |
| 221 | 227 | AM_RANGE(0xe00002, 0xe00003) AM_READ_PORT("SYSTEM") AM_WRITE(ticket_w) |
| 222 | 228 | AM_RANGE(0xe00004, 0xe00005) AM_DEVWRITE_LEGACY("oki", oki_bank_w) |
| r14896 | r14897 | |
|---|---|---|
| 142 | 142 | int m_touchscr[5]; |
| 143 | 143 | |
| 144 | 144 | required_device<cpu_device> m_maincpu; |
| 145 | DECLARE_WRITE16_MEMBER(pntnpuzl_200000_w); | |
| 146 | DECLARE_WRITE16_MEMBER(pntnpuzl_280018_w); | |
| 147 | DECLARE_READ16_MEMBER(pntnpuzl_280014_r); | |
| 148 | DECLARE_READ16_MEMBER(pntnpuzl_28001a_r); | |
| 149 | DECLARE_READ16_MEMBER(irq1_ack_r); | |
| 150 | DECLARE_READ16_MEMBER(irq2_ack_r); | |
| 151 | DECLARE_READ16_MEMBER(irq4_ack_r); | |
| 145 | 152 | }; |
| 146 | 153 | |
| 147 | 154 | |
| r14896 | r14897 | |
| 204 | 211 | 01 03 46 31 38 0d ---> 80 0c |
| 205 | 212 | */ |
| 206 | 213 | |
| 207 | ||
| 214 | ||
| 208 | 215 | { |
| 209 | pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>(); | |
| 210 | 216 | // logerror("200000: %04x\n",data); |
| 211 | 217 | // bit 12: set to 1 when going to serial output to 280018 |
| 212 | if (( | |
| 218 | if (( | |
| 213 | 219 | { |
| 214 | state->m_serial_out = (state->m_serial>>1) & 0xff; | |
| 215 | state->m_read_count = 0; | |
| 216 | logerror("serial out: %02x\n",state->m_serial_out); | |
| 220 | m_serial_out = (m_serial>>1) & 0xff; | |
| 221 | m_read_count = 0; | |
| 222 | logerror("serial out: %02x\n",m_serial_out); | |
| 217 | 223 | } |
| 218 | 224 | |
| 219 | | |
| 225 | | |
| 220 | 226 | } |
| 221 | 227 | |
| 222 | ||
| 228 | ||
| 223 | 229 | { |
| 224 | pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>(); | |
| 225 | // logerror("%04x: 280018: %04x\n",cpu_get_pc(&space->device()),data); | |
| 226 | state->m_serial >>= 1; | |
| 230 | // logerror("%04x: 280018: %04x\n",cpu_get_pc(&space.device()),data); | |
| 231 | m_serial >>= 1; | |
| 227 | 232 | if (data & 0x2000) |
| 228 | | |
| 233 | | |
| 229 | 234 | } |
| 230 | 235 | |
| 231 | ||
| 236 | ||
| 232 | 237 | { |
| 233 | pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>(); | |
| 234 | 238 | static const int startup[3] = { 0x80, 0x0c, 0x00 }; |
| 235 | 239 | int res; |
| 236 | 240 | |
| 237 | if ( | |
| 241 | if ( | |
| 238 | 242 | { |
| 239 | if (input_port_read( | |
| 243 | if (input_port_read( | |
| 240 | 244 | { |
| 241 | state->m_touchscr[0] = 0x1b; | |
| 242 | state->m_touchscr[2] = BITSWAP8(input_port_read(space->machine(), "TOUCHX"),0,1,2,3,4,5,6,7); | |
| 243 | state->m_touchscr[4] = BITSWAP8(input_port_read(space->machine(), "TOUCHY"),0,1,2,3,4,5,6,7); | |
| 245 | m_touchscr[0] = 0x1b; | |
| 246 | m_touchscr[2] = BITSWAP8(input_port_read(machine(), "TOUCHX"),0,1,2,3,4,5,6,7); | |
| 247 | m_touchscr[4] = BITSWAP8(input_port_read(machine(), "TOUCHY"),0,1,2,3,4,5,6,7); | |
| 244 | 248 | } |
| 245 | 249 | else |
| 246 | | |
| 250 | | |
| 247 | 251 | |
| 248 | if (state->m_read_count >= 10) state->m_read_count = 0; | |
| 249 | res = state->m_touchscr[state->m_read_count/2]; | |
| 250 | state->m_read_count++; | |
| 252 | if (m_read_count >= 10) m_read_count = 0; | |
| 253 | res = m_touchscr[m_read_count/2]; | |
| 254 | m_read_count++; | |
| 251 | 255 | } |
| 252 | 256 | else |
| 253 | 257 | { |
| 254 | if (state->m_read_count >= 6) state->m_read_count = 0; | |
| 255 | res = startup[state->m_read_count/2]; | |
| 256 | state->m_read_count++; | |
| 258 | if (m_read_count >= 6) m_read_count = 0; | |
| 259 | res = startup[m_read_count/2]; | |
| 260 | m_read_count++; | |
| 257 | 261 | } |
| 258 | 262 | logerror("read 280014: %02x\n",res); |
| 259 | 263 | return res << 8; |
| 260 | 264 | } |
| 261 | 265 | |
| 262 | ||
| 266 | ||
| 263 | 267 | { |
| 264 | 268 | return 0x4c00; |
| 265 | 269 | } |
| 266 | 270 | |
| 267 | ||
| 271 | ||
| 268 | 272 | { |
| 269 | // pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>(); | |
| 270 | // device_set_input_line(state->m_maincpu, 1, CLEAR_LINE); | |
| 273 | // device_set_input_line(m_maincpu, 1, CLEAR_LINE); | |
| 271 | 274 | return 0; |
| 272 | 275 | } |
| 273 | 276 | |
| 274 | ||
| 277 | ||
| 275 | 278 | { |
| 276 | // pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>(); | |
| 277 | // device_set_input_line(state->m_maincpu, 2, CLEAR_LINE); | |
| 279 | // device_set_input_line(m_maincpu, 2, CLEAR_LINE); | |
| 278 | 280 | return 0; |
| 279 | 281 | } |
| 280 | 282 | |
| 281 | ||
| 283 | ||
| 282 | 284 | { |
| 283 | // pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>(); | |
| 284 | // device_set_input_line(state->m_maincpu, 4, CLEAR_LINE); | |
| 285 | // device_set_input_line(m_maincpu, 4, CLEAR_LINE); | |
| 285 | 286 | return 0; |
| 286 | 287 | } |
| 287 | 288 | |
| 288 | 289 | |
| 289 | 290 | static ADDRESS_MAP_START( pntnpuzl_map, AS_PROGRAM, 16, pntnpuzl_state ) |
| 290 | 291 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 291 | AM_RANGE(0x080000, 0x080001) AM_READ_LEGACY(irq1_ack_r) | |
| 292 | AM_RANGE(0x100000, 0x100001) AM_READ_LEGACY(irq2_ack_r) | |
| 293 | AM_RANGE(0x180000, 0x180001) AM_READ_LEGACY(irq4_ack_r) | |
| 294 | AM_RANGE(0x200000, 0x200001) AM_WRITE_LEGACY(pntnpuzl_200000_w) | |
| 292 | AM_RANGE(0x080000, 0x080001) AM_READ(irq1_ack_r) | |
| 293 | AM_RANGE(0x100000, 0x100001) AM_READ(irq2_ack_r) | |
| 294 | AM_RANGE(0x180000, 0x180001) AM_READ(irq4_ack_r) | |
| 295 | AM_RANGE(0x200000, 0x200001) AM_WRITE(pntnpuzl_200000_w) | |
| 295 | 296 | AM_RANGE(0x280000, 0x280001) AM_DEVREAD_LEGACY("eeprom", pntnpuzl_eeprom_r) |
| 296 | 297 | AM_RANGE(0x280002, 0x280003) AM_READ_PORT("IN2") |
| 297 | 298 | AM_RANGE(0x280000, 0x280001) AM_DEVWRITE_LEGACY("eeprom", pntnpuzl_eeprom_w) |
| r14896 | r14897 | |
| 299 | 300 | AM_RANGE(0x28000a, 0x28000b) AM_WRITENOP |
| 300 | 301 | AM_RANGE(0x280010, 0x280011) AM_WRITENOP |
| 301 | 302 | AM_RANGE(0x280012, 0x280013) AM_WRITENOP |
| 302 | AM_RANGE(0x280014, 0x280015) AM_READ | |
| 303 | AM_RANGE(0x280014, 0x280015) AM_READ | |
| 303 | 304 | AM_RANGE(0x280016, 0x280017) AM_WRITENOP |
| 304 | AM_RANGE(0x280018, 0x280019) AM_WRITE_LEGACY(pntnpuzl_280018_w) | |
| 305 | AM_RANGE(0x28001a, 0x28001b) AM_READ_LEGACY(pntnpuzl_28001a_r) | |
| 305 | AM_RANGE(0x280018, 0x280019) AM_WRITE(pntnpuzl_280018_w) | |
| 306 | AM_RANGE(0x28001a, 0x28001b) AM_READ(pntnpuzl_28001a_r) | |
| 306 | 307 | AM_RANGE(0x28001a, 0x28001b) AM_WRITENOP |
| 307 | 308 | |
| 308 | 309 | /* standard VGA */ |
| r14896 | r14897 | |
|---|---|---|
| 94 | 94 | m_dma8237_2(*this, "dma8237_2"), |
| 95 | 95 | m_pic8259_1(*this, "pic8259_1"), |
| 96 | 96 | m_pic8259_2(*this, "pic8259_2"), |
| 97 | m_voodoo(*this, "voodoo_0") | |
| 98 | { } | |
| 97 | m_voodoo(*this, "voodoo_0"), | |
| 98 | m_unk_ram(*this, "unk_ram"){ } | |
| 99 | 99 | |
| 100 | 100 | int m_dma_channel; |
| 101 | 101 | UINT8 m_dma_offset[2][4]; |
| r14896 | r14897 | |
| 105 | 105 | UINT8 m_funkball_config_regs[256]; |
| 106 | 106 | UINT32 m_cx5510_regs[256/4]; |
| 107 | 107 | UINT16 m_flash_addr; |
| 108 | UINT32 *m_unk_ram; | |
| 109 | 108 | UINT8 *m_bios_ram; |
| 110 | 109 | UINT8 m_flash_cmd; |
| 111 | 110 | UINT8 m_flash_data_cmd; |
| r14896 | r14897 | |
| 121 | 120 | required_device<pic8259_device> m_pic8259_2; |
| 122 | 121 | required_device<voodoo_device> m_voodoo; |
| 123 | 122 | |
| 123 | required_shared_ptr<UINT32> m_unk_ram; | |
| 124 | ||
| 124 | 125 | DECLARE_READ8_MEMBER( get_slave_ack ); |
| 125 | 126 | DECLARE_WRITE8_MEMBER( flash_w ); |
| 126 | 127 | DECLARE_READ8_MEMBER( flash_data_r ); |
| r14896 | r14897 | |
| 142 | 143 | |
| 143 | 144 | UINT32 init_enable; |
| 144 | 145 | } m_voodoo_pci_regs; |
| 146 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 147 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 148 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 149 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 150 | DECLARE_READ32_MEMBER(biu_ctrl_r); | |
| 151 | DECLARE_WRITE32_MEMBER(biu_ctrl_w); | |
| 152 | DECLARE_WRITE8_MEMBER(bios_ram_w); | |
| 145 | 153 | }; |
| 146 | 154 | |
| 147 | 155 | void funkball_state::video_start() |
| r14896 | r14897 | |
| 265 | 273 | } |
| 266 | 274 | |
| 267 | 275 | |
| 268 | ||
| 276 | ||
| 269 | 277 | { |
| 270 | funkball_state *state = space->machine().driver_data<funkball_state>(); | |
| 271 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 278 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 272 | 279 | |
| 273 | 280 | switch(offset % 8) { |
| 274 | 281 | case 1: |
| 275 | data = | |
| 282 | data = | |
| 276 | 283 | break; |
| 277 | 284 | case 2: |
| 278 | data = | |
| 285 | data = | |
| 279 | 286 | break; |
| 280 | 287 | case 3: |
| 281 | data = | |
| 288 | data = | |
| 282 | 289 | break; |
| 283 | 290 | case 7: |
| 284 | data = | |
| 291 | data = | |
| 285 | 292 | break; |
| 286 | 293 | } |
| 287 | 294 | return data; |
| 288 | 295 | } |
| 289 | 296 | |
| 290 | 297 | |
| 291 | ||
| 298 | ||
| 292 | 299 | { |
| 293 | funkball_state *state = space->machine().driver_data<funkball_state>(); | |
| 294 | state->m_at_pages[offset % 0x10] = data; | |
| 300 | m_at_pages[offset % 0x10] = data; | |
| 295 | 301 | |
| 296 | 302 | switch(offset % 8) { |
| 297 | 303 | case 1: |
| 298 | | |
| 304 | | |
| 299 | 305 | break; |
| 300 | 306 | case 2: |
| 301 | | |
| 307 | | |
| 302 | 308 | break; |
| 303 | 309 | case 3: |
| 304 | | |
| 310 | | |
| 305 | 311 | break; |
| 306 | 312 | case 7: |
| 307 | | |
| 313 | | |
| 308 | 314 | break; |
| 309 | 315 | } |
| 310 | 316 | } |
| 311 | 317 | |
| 312 | static READ32_HANDLER(at_page32_r) | |
| 313 | { | |
| 314 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 315 | } | |
| 316 | 318 | |
| 317 | ||
| 318 | static WRITE32_HANDLER(at_page32_w) | |
| 319 | { | |
| 320 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 321 | } | |
| 322 | ||
| 323 | 319 | static READ8_DEVICE_HANDLER(at_dma8237_2_r) |
| 324 | 320 | { |
| 325 | 321 | return i8237_r(device, offset / 2); |
| r14896 | r14897 | |
| 352 | 348 | } |
| 353 | 349 | |
| 354 | 350 | |
| 355 | ||
| 351 | ||
| 356 | 352 | { |
| 357 | funkball_state *state = space->machine().driver_data<funkball_state>(); | |
| 358 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 353 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 359 | 354 | & 0xFF0000; |
| 360 | 355 | |
| 361 | return space | |
| 356 | return space. | |
| 362 | 357 | } |
| 363 | 358 | |
| 364 | 359 | |
| 365 | ||
| 360 | ||
| 366 | 361 | { |
| 367 | funkball_state *state = space->machine().driver_data<funkball_state>(); | |
| 368 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 362 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 369 | 363 | & 0xFF0000; |
| 370 | 364 | |
| 371 | space | |
| 365 | space. | |
| 372 | 366 | } |
| 373 | 367 | |
| 374 | 368 | static void set_dma_channel(device_t *device, int channel, int state) |
| r14896 | r14897 | |
| 386 | 380 | { |
| 387 | 381 | DEVCB_LINE(pc_dma_hrq_changed), |
| 388 | 382 | DEVCB_NULL, |
| 389 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 390 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 383 | DEVCB_DRIVER_MEMBER(funkball_state, pc_dma_read_byte), | |
| 384 | DEVCB_DRIVER_MEMBER(funkball_state, pc_dma_write_byte), | |
| 391 | 385 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 392 | 386 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 393 | 387 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 516 | 510 | printf("%08x %02x FLASH DATA W %08x\n",offset,data,m_flash_addr << 16); |
| 517 | 511 | } |
| 518 | 512 | |
| 519 | ||
| 513 | ||
| 520 | 514 | { |
| 521 | funkball_state *state = space->machine().driver_data<funkball_state>(); | |
| 522 | 515 | |
| 523 | 516 | if (offset == 0) |
| 524 | 517 | { |
| 525 | 518 | return 0xffffff; |
| 526 | 519 | } |
| 527 | return | |
| 520 | return | |
| 528 | 521 | } |
| 529 | 522 | |
| 530 | ||
| 523 | ||
| 531 | 524 | { |
| 532 | funkball_state *state = space->machine().driver_data<funkball_state>(); | |
| 533 | 525 | |
| 534 | 526 | //mame_printf_debug("biu_ctrl_w %08X, %08X, %08X\n", data, offset, mem_mask); |
| 535 | COMBINE_DATA( | |
| 527 | COMBINE_DATA( | |
| 536 | 528 | |
| 537 | 529 | if (offset == 0x0c/4) // BC_XMAP_3 register |
| 538 | 530 | { |
| r14896 | r14897 | |
| 542 | 534 | for(i=0;i<8;i++) |
| 543 | 535 | { |
| 544 | 536 | if (data & 0x1 << i*4) // enable RAM access to region 0xe0000 - 0xfffff |
| 545 | memory_set_bankptr( | |
| 537 | memory_set_bankptr( | |
| 546 | 538 | else // disable RAM access (reads go to BIOS ROM) |
| 547 | memory_set_bankptr( | |
| 539 | memory_set_bankptr( | |
| 548 | 540 | } |
| 549 | 541 | } |
| 550 | 542 | } |
| 551 | 543 | |
| 552 | ||
| 544 | ||
| 553 | 545 | { |
| 554 | funkball_state *state = space->machine().driver_data<funkball_state>(); | |
| 555 | 546 | |
| 556 | if( | |
| 547 | if( | |
| 557 | 548 | { |
| 558 | | |
| 549 | | |
| 559 | 550 | } |
| 560 | 551 | } |
| 561 | 552 | |
| r14896 | r14897 | |
| 581 | 572 | AM_RANGE(0x000f4000, 0x000f7fff) AM_ROMBANK("bios_bank2") |
| 582 | 573 | AM_RANGE(0x000f8000, 0x000fbfff) AM_ROMBANK("bios_bank3") |
| 583 | 574 | AM_RANGE(0x000fc000, 0x000fffff) AM_ROMBANK("bios_bank4") |
| 584 | AM_RANGE(0x000e0000, 0x000fffff) AM_WRITE8 | |
| 575 | AM_RANGE(0x000e0000, 0x000fffff) AM_WRITE8 | |
| 585 | 576 | AM_RANGE(0x00100000, 0x07ffffff) AM_RAM |
| 586 | 577 | // AM_RANGE(0x08000000, 0x0fffffff) AM_NOP |
| 587 | AM_RANGE(0x40008000, 0x400080ff) AM_READWRITE_LEGACY(biu_ctrl_r, biu_ctrl_w) | |
| 588 | AM_RANGE(0x40010e00, 0x40010eff) AM_RAM AM_BASE(m_unk_ram) | |
| 578 | AM_RANGE(0x40008000, 0x400080ff) AM_READWRITE(biu_ctrl_r, biu_ctrl_w) | |
| 579 | AM_RANGE(0x40010e00, 0x40010eff) AM_RAM AM_SHARE("unk_ram") | |
| 589 | 580 | AM_RANGE(0xff000000, 0xffffdfff) AM_DEVREADWRITE_LEGACY("voodoo_0", voodoo_r, voodoo_w) |
| 590 | 581 | AM_RANGE(0xfffe0000, 0xffffffff) AM_ROM AM_REGION("bios", 0) /* System BIOS */ |
| 591 | 582 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 596 | 587 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 597 | 588 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 598 | 589 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) /* todo: nvram (CMOS Setup Save)*/ |
| 599 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 590 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 600 | 591 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 601 | 592 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 602 | 593 | AM_RANGE(0x00e8, 0x00ef) AM_NOP |
| r14896 | r14897 | |
| 1120 | 1111 | kbdc8042_init(machine, &at8042); |
| 1121 | 1112 | |
| 1122 | 1113 | /* defaults, otherwise it won't boot */ |
| 1123 | state->m_unk_ram[0x010/4] = 0x2f8d85ff; | |
| 1124 | state->m_unk_ram[0x018/4] = 0x000018c5; | |
| 1114 | state->m_unk_ram.target()[0x010/4] = 0x2f8d85ff; | |
| 1115 | state->m_unk_ram.target()[0x018/4] = 0x000018c5; | |
| 1125 | 1116 | } |
| 1126 | 1117 | |
| 1127 | 1118 | static MACHINE_RESET( funkball ) |
| r14896 | r14897 | |
|---|---|---|
| 218 | 218 | { |
| 219 | 219 | public: |
| 220 | 220 | tmspoker_state(const machine_config &mconfig, device_type type, const char *tag) |
| 221 | : driver_device(mconfig, type, tag) { } | |
| 221 | : driver_device(mconfig, type, tag) , | |
| 222 | m_videoram(*this, "videoram"){ } | |
| 222 | 223 | |
| 223 | UINT8 | |
| 224 | required_shared_ptr<UINT8> | |
| 224 | 225 | tilemap_t *m_bg_tilemap; |
| 225 | 226 | DECLARE_WRITE8_MEMBER(tmspoker_videoram_w); |
| 226 | 227 | //DECLARE_WRITE8_MEMBER(debug_w); |
| r14896 | r14897 | |
| 234 | 235 | |
| 235 | 236 | WRITE8_MEMBER(tmspoker_state::tmspoker_videoram_w) |
| 236 | 237 | { |
| 237 | m_videoram[offset] = data; | |
| 238 | m_videoram.target()[offset] = data; | |
| 238 | 239 | m_bg_tilemap->mark_tile_dirty(offset); |
| 239 | 240 | } |
| 240 | 241 | |
| r14896 | r14897 | |
| 248 | 249 | ---- ---- seems unused. |
| 249 | 250 | */ |
| 250 | 251 | tmspoker_state *state = machine.driver_data<tmspoker_state>(); |
| 251 | int code = state->m_videoram[tile_index]; | |
| 252 | int code = state->m_videoram.target()[tile_index]; | |
| 252 | 253 | |
| 253 | 254 | SET_TILE_INFO( 0 /* bank */, code, 0 /* color */, 0); |
| 254 | 255 | } |
| r14896 | r14897 | |
| 316 | 317 | AM_RANGE(0x0000, 0x0fff) AM_ROMBANK("bank1") |
| 317 | 318 | AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 318 | 319 | AM_RANGE(0x2801, 0x2801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 319 | AM_RANGE(0x3000, 0x33ff) AM_WRITE(tmspoker_videoram_w) AM_ | |
| 320 | AM_RANGE(0x3000, 0x33ff) AM_WRITE(tmspoker_videoram_w) AM_ | |
| 320 | 321 | AM_RANGE(0x3800, 0x3fff) AM_RAM //NVRAM? |
| 321 | 322 | AM_RANGE(0x2000, 0x20ff) AM_RAM //color RAM? |
| 322 | 323 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 275 | 275 | |
| 276 | 276 | WRITE32_MEMBER(darkhors_state::paletteram32_xBBBBBGGGGGRRRRR_dword_w) |
| 277 | 277 | { |
| 278 | if (ACCESSING_BITS_16_31) paletteram16_xBBBBBGGGGGRRRRR_word_w(space, offset*2, data >> 16, mem_mask >> 16); | |
| 279 | if (ACCESSING_BITS_0_15) paletteram16_xBBBBBGGGGGRRRRR_word_w(space, offset*2+1, data, mem_mask); | |
| 278 | if (ACCESSING_BITS_16_31) paletteram_xBBBBBGGGGGRRRRR_word_w(space, offset*2, data >> 16, mem_mask >> 16); | |
| 279 | if (ACCESSING_BITS_0_15) paletteram_xBBBBBGGGGGRRRRR_word_w(space, offset*2+1, data, mem_mask); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | WRITE32_MEMBER(darkhors_state::darkhors_input_sel_w) |
| r14896 | r14897 | |
| 746 | 746 | //AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(cmd1_r) |
| 747 | 747 | //AM_RANGE(0xc1, 0xc1) AM_READ_LEGACY(cmd2_r) |
| 748 | 748 | //AM_RANGE(0xc2, 0xc2) AM_READ_LEGACY(cmd_stat8_r) |
| 749 | AM_RANGE(0xe1, 0xe1) AM_WRITE_LEGACY(st0016_rom_bank_w) | |
| 750 | AM_RANGE(0xe7, 0xe7) AM_WRITE_LEGACY(st0016_rom_bank_w) | |
| 749 | AM_RANGE(0xe1, 0xe1) AM_WRITE(st0016_rom_bank_w) | |
| 750 | AM_RANGE(0xe7, 0xe7) AM_WRITE(st0016_rom_bank_w) | |
| 751 | 751 | //AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(st0016_dma_r) |
| 752 | 752 | ADDRESS_MAP_END |
| 753 | 753 |
| r14896 | r14897 | |
|---|---|---|
| 435 | 435 | |
| 436 | 436 | case 1: // c0f9: RST75 trigger (written by NMI handler) |
| 437 | 437 | // Note: solder pad CP3 on the pcb would allow to disable this |
| 438 | generic_pulse_irq_line(m_audio_cpu, I8085_RST75_LINE, 1); | |
| 438 | generic_pulse_irq_line(m_audio_cpu->execute(), I8085_RST75_LINE, 1); | |
| 439 | 439 | break; |
| 440 | 440 | |
| 441 | 441 | case 2: // c0fa: INTR trigger (written by NMI handler) |
| r14896 | r14897 | |
| 466 | 466 | |
| 467 | 467 | case 7: // c0ff: sound command latch clear |
| 468 | 468 | // Note: solder pad CP1 on the pcb would allow to disable this |
| 469 | soundlatch_clear_w(space, 0, 0); | |
| 469 | soundlatch_clear_byte_w(space, 0, 0); | |
| 470 | 470 | break; |
| 471 | 471 | } |
| 472 | 472 | } |
| r14896 | r14897 | |
| 750 | 750 | |
| 751 | 751 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, equites_state ) |
| 752 | 752 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 753 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) | |
| 753 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) | |
| 754 | 754 | AM_RANGE(0xc080, 0xc08d) AM_DEVWRITE_LEGACY("msm", msm5232_w) |
| 755 | 755 | AM_RANGE(0xc0a0, 0xc0a1) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w) |
| 756 | 756 | AM_RANGE(0xc0b0, 0xc0b0) AM_WRITENOP // n.c. |
| r14896 | r14897 | |
| 1224 | 1224 | { |
| 1225 | 1225 | equites_state *state = machine.driver_data<equites_state>(); |
| 1226 | 1226 | |
| 1227 | flip_screen_set( | |
| 1227 | state->flip_screen_set( | |
| 1228 | 1228 | |
| 1229 | 1229 | state->m_fg_char_bank = 0; |
| 1230 | 1230 | state->m_bgcolor = 0; |
| r14896 | r14897 | |
|---|---|---|
| 107 | 107 | { |
| 108 | 108 | public: |
| 109 | 109 | mirax_state(const machine_config &mconfig, device_type type, const char *tag) |
| 110 | : driver_device(mconfig, type, tag) { } | |
| 110 | : driver_device(mconfig, type, tag) , | |
| 111 | m_videoram(*this, "videoram"), | |
| 112 | m_spriteram(*this, "spriteram"), | |
| 113 | m_colorram(*this, "colorram"){ } | |
| 111 | 114 | |
| 112 | UINT8 *m_spriteram; | |
| 115 | required_shared_ptr<UINT8> m_videoram; | |
| 116 | required_shared_ptr<UINT8> m_spriteram; | |
| 117 | required_shared_ptr<UINT8> m_colorram; | |
| 113 | 118 | UINT8 m_nAyCtrl; |
| 114 | 119 | UINT8 m_nmi_mask; |
| 115 | UINT8 *m_videoram; | |
| 116 | UINT8 *m_colorram; | |
| 117 | 120 | UINT8 m_flipscreen_x; |
| 118 | 121 | UINT8 m_flipscreen_y; |
| 119 | 122 | DECLARE_WRITE8_MEMBER(audio_w); |
| r14896 | r14897 | |
| 164 | 167 | { |
| 165 | 168 | for (x=0;x<32;x++) |
| 166 | 169 | { |
| 167 | int tile = state->m_videoram[32*y+x]; | |
| 168 | int color = (state->m_colorram[x*2]<<8) | (state->m_colorram[(x*2)+1]); | |
| 170 | int tile = state->m_videoram.target()[32*y+x]; | |
| 171 | int color = (state->m_colorram.target()[x*2]<<8) | (state->m_colorram.target()[(x*2)+1]); | |
| 169 | 172 | int x_scroll = (color & 0xff00)>>8; |
| 170 | 173 | tile |= ((color & 0xe0)<<3); |
| 171 | 174 | |
| r14896 | r14897 | |
| 186 | 189 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 187 | 190 | { |
| 188 | 191 | mirax_state *state = machine.driver_data<mirax_state>(); |
| 189 | UINT8 *spriteram = state->m_spriteram; | |
| 192 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 190 | 193 | int count; |
| 191 | 194 | |
| 192 | 195 | for(count=0;count<0x200;count+=4) |
| r14896 | r14897 | |
| 248 | 251 | |
| 249 | 252 | WRITE8_MEMBER(mirax_state::mirax_sound_cmd_w) |
| 250 | 253 | { |
| 251 | soundlatch_w(space, 0, data & 0xff); | |
| 254 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 252 | 255 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 253 | 256 | } |
| 254 | 257 | |
| r14896 | r14897 | |
| 276 | 279 | static ADDRESS_MAP_START( mirax_main_map, AS_PROGRAM, 8, mirax_state ) |
| 277 | 280 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 278 | 281 | AM_RANGE(0xc800, 0xd7ff) AM_RAM |
| 279 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE(m_videoram) | |
| 280 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_BASE(m_spriteram) | |
| 281 | AM_RANGE(0xea00, 0xea3f) AM_RAM AM_BASE(m_colorram) //per-column color + bank bits for the videoram | |
| 282 | AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE("videoram") | |
| 283 | AM_RANGE(0xe800, 0xe9ff) AM_RAM AM_SHARE("spriteram") | |
| 284 | AM_RANGE(0xea00, 0xea3f) AM_RAM AM_SHARE("colorram") //per-column color + bank bits for the videoram | |
| 282 | 285 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("P1") |
| 283 | 286 | AM_RANGE(0xf100, 0xf100) AM_READ_PORT("P2") |
| 284 | 287 | AM_RANGE(0xf200, 0xf200) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
| 295 | 298 | static ADDRESS_MAP_START( mirax_sound_map, AS_PROGRAM, 8, mirax_state ) |
| 296 | 299 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 297 | 300 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| 298 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 301 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 299 | 302 | |
| 300 | 303 | AM_RANGE(0xe000, 0xe000) AM_WRITENOP |
| 301 | 304 | AM_RANGE(0xe001, 0xe001) AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 27 | 27 | { |
| 28 | 28 | public: |
| 29 | 29 | cardline_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | : driver_device(mconfig, type, tag) { } | |
| 30 | : driver_device(mconfig, type, tag) , | |
| 31 | m_videoram(*this, "videoram"), | |
| 32 | m_colorram(*this, "colorram"){ } | |
| 31 | 33 | |
| 32 | 34 | int m_video; |
| 33 | UINT8 *m_videoram; | |
| 34 | UINT8 *m_colorram; | |
| 35 | required_shared_ptr<UINT8> m_videoram; | |
| 36 | required_shared_ptr<UINT8> m_colorram; | |
| 35 | 37 | int m_var; |
| 36 | 38 | DECLARE_WRITE8_MEMBER(vram_w); |
| 37 | 39 | DECLARE_WRITE8_MEMBER(attr_w); |
| r14896 | r14897 | |
| 43 | 45 | |
| 44 | 46 | |
| 45 | 47 | #define DRAW_TILE(machine, offset, transparency) drawgfx_transpen(bitmap, cliprect, (machine).gfx[0],\ |
| 46 | (state->m_videoram[index+offset] | (state->m_colorram[index+offset]<<8))&0x3fff,\ | |
| 47 | (state->m_colorram[index+offset]&0x80)>>7,\ | |
| 48 | (state->m_videoram.target()[index+offset] | (state->m_colorram.target()[index+offset]<<8))&0x3fff,\ | |
| 49 | (state->m_colorram.target()[index+offset]&0x80)>>7,\ | |
| 48 | 50 | 0,0,\ |
| 49 | 51 | x<<3, y<<3,\ |
| 50 | 52 | transparency?transparency:(UINT32)-1); |
| r14896 | r14897 | |
| 78 | 80 | WRITE8_MEMBER(cardline_state::vram_w) |
| 79 | 81 | { |
| 80 | 82 | offset+=0x1000*((m_video&2)>>1); |
| 81 | m_videoram[offset]=data; | |
| 83 | m_videoram.target()[offset]=data; | |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | WRITE8_MEMBER(cardline_state::attr_w) |
| 85 | 87 | { |
| 86 | 88 | offset+=0x1000*((m_video&2)>>1); |
| 87 | m_colorram[offset]=data; | |
| 89 | m_colorram.target()[offset]=data; | |
| 88 | 90 | } |
| 89 | 91 | |
| 90 | 92 | WRITE8_MEMBER(cardline_state::video_w) |
| r14896 | r14897 | |
| 129 | 131 | AM_RANGE(0x2840, 0x2840) AM_NOP |
| 130 | 132 | AM_RANGE(0x2880, 0x2880) AM_NOP |
| 131 | 133 | AM_RANGE(0x3003, 0x3003) AM_NOP |
| 132 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(vram_w) AM_BASE(m_videoram) | |
| 133 | AM_RANGE(0xe000, 0xffff) AM_WRITE(attr_w) AM_BASE(m_colorram) | |
| 134 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(vram_w) AM_SHARE("videoram") | |
| 135 | AM_RANGE(0xe000, 0xffff) AM_WRITE(attr_w) AM_SHARE("colorram") | |
| 134 | 136 | /* Ports */ |
| 135 | 137 | AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READWRITE(unk_r, video_w) |
| 136 | 138 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 134 | 134 | WRITE16_MEMBER(gradius3_state::sound_command_w) |
| 135 | 135 | { |
| 136 | 136 | if (ACCESSING_BITS_8_15) |
| 137 | soundlatch_w(space, 0, (data >> 8) & 0xff); | |
| 137 | soundlatch_byte_w(space, 0, (data >> 8) & 0xff); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | WRITE16_MEMBER(gradius3_state::sound_irq_w) |
| r14896 | r14897 | |
| 157 | 157 | static ADDRESS_MAP_START( gradius3_map, AS_PROGRAM, 16, gradius3_state ) |
| 158 | 158 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 159 | 159 | AM_RANGE(0x040000, 0x043fff) AM_RAM |
| 160 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(paletteram | |
| 160 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(paletteram | |
| 161 | 161 | AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(cpuA_ctrl_w) /* halt cpu B, irq enable, priority, coin counters, other? */ |
| 162 | 162 | AM_RANGE(0x0c8000, 0x0c8001) AM_READ_PORT("SYSTEM") |
| 163 | 163 | AM_RANGE(0x0c8002, 0x0c8003) AM_READ_PORT("P1") |
| r14896 | r14897 | |
| 191 | 191 | static ADDRESS_MAP_START( gradius3_s_map, AS_PROGRAM, 8, gradius3_state ) |
| 192 | 192 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 193 | 193 | AM_RANGE(0xf000, 0xf000) AM_DEVWRITE_LEGACY("k007232", sound_bank_w) /* 007232 bankswitch */ |
| 194 | AM_RANGE(0xf010, 0xf010) AM_READ(soundlatch_r) | |
| 194 | AM_RANGE(0xf010, 0xf010) AM_READ(soundlatch_byte_r) | |
| 195 | 195 | AM_RANGE(0xf020, 0xf02d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) |
| 196 | 196 | AM_RANGE(0xf030, 0xf031) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 197 | 197 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 326 | 326 | |
| 327 | 327 | WRITE8_MEMBER(omegrace_state::omegrace_soundlatch_w) |
| 328 | 328 | { |
| 329 | soundlatch_w (space, offset, data); | |
| 329 | soundlatch_byte_w (space, offset, data); | |
| 330 | 330 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 331 | 331 | } |
| 332 | 332 | |
| r14896 | r14897 | |
| 378 | 378 | |
| 379 | 379 | static ADDRESS_MAP_START( sound_port, AS_IO, 8, omegrace_state ) |
| 380 | 380 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 381 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) /* likely ay8910 input port, not direct */ | |
| 381 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) /* likely ay8910 input port, not direct */ | |
| 382 | 382 | AM_RANGE(0x00, 0x01) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w) |
| 383 | 383 | AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w) |
| 384 | 384 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 162 | 162 | |
| 163 | 163 | WRITE16_MEMBER(mystwarr_state::sound_cmd1_w) |
| 164 | 164 | { |
| 165 | soundlatch_w(space, 0, data&0xff); | |
| 165 | soundlatch_byte_w(space, 0, data&0xff); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | WRITE16_MEMBER(mystwarr_state::sound_cmd1_msb_w) |
| 169 | 169 | { |
| 170 | soundlatch_w(space, 0, data>>8); | |
| 170 | soundlatch_byte_w(space, 0, data>>8); | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | WRITE16_MEMBER(mystwarr_state::sound_cmd2_w) |
| 174 | 174 | { |
| 175 | soundlatch2_w(space, 0, data&0xff); | |
| 175 | soundlatch2_byte_w(space, 0, data&0xff); | |
| 176 | 176 | return; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | WRITE16_MEMBER(mystwarr_state::sound_cmd2_msb_w) |
| 180 | 180 | { |
| 181 | soundlatch2_w(space, 0, data>>8); | |
| 181 | soundlatch2_byte_w(space, 0, data>>8); | |
| 182 | 182 | return; |
| 183 | 183 | } |
| 184 | 184 | |
| r14896 | r14897 | |
| 189 | 189 | |
| 190 | 190 | READ16_MEMBER(mystwarr_state::sound_status_r) |
| 191 | 191 | { |
| 192 | int latch = soundlatch3_r(space,0); | |
| 192 | int latch = soundlatch3_byte_r(space,0); | |
| 193 | 193 | |
| 194 | 194 | if ((latch & 0xf) == 0xe) latch |= 1; |
| 195 | 195 | |
| r14896 | r14897 | |
| 198 | 198 | |
| 199 | 199 | READ16_MEMBER(mystwarr_state::sound_status_msb_r) |
| 200 | 200 | { |
| 201 | int latch = soundlatch3_r(space,0); | |
| 201 | int latch = soundlatch3_byte_r(space,0); | |
| 202 | 202 | |
| 203 | 203 | if ((latch & 0xf) == 0xe) latch |= 1; |
| 204 | 204 | |
| r14896 | r14897 | |
| 274 | 274 | AM_RANGE(0x600000, 0x601fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) |
| 275 | 275 | AM_RANGE(0x602000, 0x603fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM mirror read(essential) |
| 276 | 276 | AM_RANGE(0x680000, 0x683fff) AM_READ_LEGACY(K056832_mw_rom_word_r) |
| 277 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 277 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram | |
| 278 | 278 | #if MW_DEBUG |
| 279 | 279 | AM_RANGE(0x480000, 0x4800ff) AM_READ_LEGACY(K055555_word_r) |
| 280 | 280 | AM_RANGE(0x482010, 0x48201f) AM_READ_LEGACY(K053247_reg_word_r) |
| r14896 | r14897 | |
| 315 | 315 | AM_RANGE(0x302000, 0x303fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM mirror read/write (essential) |
| 316 | 316 | AM_RANGE(0x310000, 0x311fff) AM_READ_LEGACY(K056832_mw_rom_word_r) |
| 317 | 317 | AM_RANGE(0x320000, 0x321fff) AM_DEVREAD("k053250_1", k053250_t, rom_r) |
| 318 | AM_RANGE(0x330000, 0x331fff) AM_RAM_WRITE(paletteram | |
| 318 | AM_RANGE(0x330000, 0x331fff) AM_RAM_WRITE(paletteram | |
| 319 | 319 | #if MW_DEBUG |
| 320 | 320 | AM_RANGE(0x240000, 0x240007) AM_READ_LEGACY(K053246_reg_word_r) |
| 321 | 321 | AM_RANGE(0x244010, 0x24401f) AM_READ_LEGACY(K053247_reg_word_r) |
| r14896 | r14897 | |
| 358 | 358 | AM_RANGE(0x302000, 0x303fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM mirror read(essential) |
| 359 | 359 | AM_RANGE(0x304000, 0x3041ff) AM_RAM |
| 360 | 360 | AM_RANGE(0x310000, 0x311fff) AM_READ_LEGACY(K056832_mw_rom_word_r) |
| 361 | AM_RANGE(0x330000, 0x331fff) AM_RAM_WRITE(paletteram | |
| 361 | AM_RANGE(0x330000, 0x331fff) AM_RAM_WRITE(paletteram | |
| 362 | 362 | #if MW_DEBUG |
| 363 | 363 | AM_RANGE(0x240000, 0x240007) AM_READ_LEGACY(K053246_reg_word_r) |
| 364 | 364 | AM_RANGE(0x244010, 0x24401f) AM_READ_LEGACY(K053247_reg_word_r) |
| r14896 | r14897 | |
| 445 | 445 | AM_RANGE(0x41c000, 0x41c01f) AM_DEVREADWRITE8_LEGACY("k053252",k053252_r,k053252_w,0x00ff) // CCU |
| 446 | 446 | AM_RANGE(0x41e000, 0x41e007) AM_WRITE_LEGACY(K056832_b_word_w) // VSCCS |
| 447 | 447 | AM_RANGE(0x480000, 0x483fff) AM_READWRITE(K053247_martchmp_word_r,K053247_martchmp_word_w) AM_BASE(m_spriteram) // sprite RAM |
| 448 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 448 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram | |
| 449 | 449 | AM_RANGE(0x680000, 0x681fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM |
| 450 | 450 | AM_RANGE(0x682000, 0x683fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM mirror read/write (essential) |
| 451 | 451 | AM_RANGE(0x700000, 0x703fff) AM_READ_LEGACY(K056832_mw_rom_word_r) // tile ROM readback |
| r14896 | r14897 | |
| 466 | 466 | AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(K053247_scattered_word_r,K053247_scattered_word_w) AM_BASE(m_spriteram) |
| 467 | 467 | AM_RANGE(0x410000, 0x411fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM |
| 468 | 468 | AM_RANGE(0x412000, 0x413fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM mirror read/write (essential) |
| 469 | AM_RANGE(0x420000, 0x421fff) AM_RAM_WRITE(paletteram | |
| 469 | AM_RANGE(0x420000, 0x421fff) AM_RAM_WRITE(paletteram | |
| 470 | 470 | AM_RANGE(0x430000, 0x430007) AM_WRITE_LEGACY(K053246_word_w) |
| 471 | 471 | AM_RANGE(0x440000, 0x443fff) AM_READ_LEGACY(K056832_mw_rom_word_r) |
| 472 | 472 | AM_RANGE(0x450000, 0x45000f) AM_READ_LEGACY(K055673_rom_word_r) |
| r14896 | r14897 | |
| 513 | 513 | AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(K053247_scattered_word_r,K053247_scattered_word_w) AM_BASE(m_spriteram) |
| 514 | 514 | AM_RANGE(0x410000, 0x411fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM |
| 515 | 515 | AM_RANGE(0x412000, 0x413fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM mirror read / write (essential) |
| 516 | AM_RANGE(0x420000, 0x421fff) AM_RAM_WRITE(paletteram | |
| 516 | AM_RANGE(0x420000, 0x421fff) AM_RAM_WRITE(paletteram | |
| 517 | 517 | AM_RANGE(0x430000, 0x430007) AM_WRITE_LEGACY(K053246_word_w) |
| 518 | 518 | AM_RANGE(0x440000, 0x441fff) AM_READ_LEGACY(K056832_mw_rom_word_r) |
| 519 | 519 | AM_RANGE(0x450000, 0x45000f) AM_READ_LEGACY(K055673_rom_word_r) |
| r14896 | r14897 | |
| 583 | 583 | AM_RANGE(0xe230, 0xe3ff) AM_RAM |
| 584 | 584 | AM_RANGE(0xe400, 0xe62f) AM_DEVREADWRITE("konami2", k054539_device, read, write) |
| 585 | 585 | AM_RANGE(0xe630, 0xe7ff) AM_RAM |
| 586 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_w) | |
| 587 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_r) | |
| 588 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_r) | |
| 586 | AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch3_byte_w) | |
| 587 | AM_RANGE(0xf002, 0xf002) AM_READ(soundlatch_byte_r) | |
| 588 | AM_RANGE(0xf003, 0xf003) AM_READ(soundlatch2_byte_r) | |
| 589 | 589 | AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w) |
| 590 | 590 | AM_RANGE(0xfff0, 0xfff3) AM_WRITENOP // unknown write |
| 591 | 591 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | : driver_device(mconfig, type, tag), |
| 53 | 53 | m_ldv1000(*this, "ld_ldv1000"), |
| 54 | 54 | m_pr7820(*this, "ld_pr7820"), |
| 55 | m_22vp932(*this, "ld_22vp932") { } | |
| 55 | m_22vp932(*this, "ld_22vp932") , | |
| 56 | m_videoram(*this, "videoram"){ } | |
| 56 | 57 | |
| 57 | 58 | void laserdisc_data_w(UINT8 data) |
| 58 | 59 | { |
| r14896 | r14897 | |
| 93 | 94 | return CLEAR_LINE; |
| 94 | 95 | } |
| 95 | 96 | |
| 96 | UINT8 *m_videoram; | |
| 97 | 97 | optional_device<pioneer_ldv1000_device> m_ldv1000; |
| 98 | 98 | optional_device<pioneer_pr7820_device> m_pr7820; |
| 99 | 99 | optional_device<phillips_22vp932_device> m_22vp932; |
| 100 | required_shared_ptr<UINT8> m_videoram; | |
| 100 | 101 | UINT8 m_last_misc; |
| 101 | 102 | UINT8 m_laserdisc_data; |
| 102 | 103 | DECLARE_WRITE8_MEMBER(misc_w); |
| r14896 | r14897 | |
| 224 | 225 | static SCREEN_UPDATE_IND16( dleuro ) |
| 225 | 226 | { |
| 226 | 227 | dlair_state *state = screen.machine().driver_data<dlair_state>(); |
| 227 | UINT8 *videoram = state->m_videoram; | |
| 228 | UINT8 *videoram = state->m_videoram.target(); | |
| 228 | 229 | int x, y; |
| 229 | 230 | |
| 230 | 231 | /* redraw the overlay */ |
| r14896 | r14897 | |
| 423 | 424 | static ADDRESS_MAP_START( dleuro_map, AS_PROGRAM, 8, dlair_state ) |
| 424 | 425 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 425 | 426 | AM_RANGE(0xa000, 0xa7ff) AM_MIRROR(0x1800) AM_RAM |
| 426 | AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x1800) AM_RAM AM_ | |
| 427 | AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x1800) AM_RAM AM_ | |
| 427 | 428 | AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1f47) // WT LED 1 |
| 428 | 429 | AM_RANGE(0xe008, 0xe008) AM_MIRROR(0x1f47) // WT LED 2 |
| 429 | 430 | AM_RANGE(0xe010, 0xe010) AM_MIRROR(0x1f47) AM_WRITE(led_den1_w) // WT EXT LED 1 |
| r14896 | r14897 | |
|---|---|---|
| 106 | 106 | { |
| 107 | 107 | public: |
| 108 | 108 | jollyjgr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 109 | : driver_device(mconfig, type, tag) { } | |
| 109 | : driver_device(mconfig, type, tag) , | |
| 110 | m_videoram(*this, "videoram"), | |
| 111 | m_colorram(*this, "colorram"), | |
| 112 | m_spriteram(*this, "spriteram"), | |
| 113 | m_bitmap(*this, "bitmap"), | |
| 114 | m_bulletram(*this, "bulletram"){ } | |
| 110 | 115 | |
| 111 | 116 | /* memory pointers */ |
| 112 | UINT8 * m_videoram; | |
| 113 | UINT8 * m_colorram; | |
| 114 | UINT8 * m_spriteram; | |
| 115 | UINT8 * m_bulletram; | |
| 116 | UINT8 * m_bitmap; | |
| 117 | required_shared_ptr<UINT8> m_videoram; | |
| 118 | required_shared_ptr<UINT8> m_colorram; | |
| 119 | required_shared_ptr<UINT8> m_spriteram; | |
| 120 | required_shared_ptr<UINT8> m_bitmap; | |
| 121 | required_shared_ptr<UINT8> m_bulletram; | |
| 117 | 122 | |
| 118 | 123 | /* video-related */ |
| 119 | 124 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 140 | 145 | |
| 141 | 146 | WRITE8_MEMBER(jollyjgr_state::jollyjgr_videoram_w) |
| 142 | 147 | { |
| 143 | m_videoram[offset] = data; | |
| 148 | m_videoram.target()[offset] = data; | |
| 144 | 149 | m_bg_tilemap->mark_tile_dirty(offset); |
| 145 | 150 | } |
| 146 | 151 | |
| r14896 | r14897 | |
| 160 | 165 | m_bg_tilemap->set_scrolly(offset >> 1, data); |
| 161 | 166 | } |
| 162 | 167 | |
| 163 | m_colorram[offset] = data; | |
| 168 | m_colorram.target()[offset] = data; | |
| 164 | 169 | } |
| 165 | 170 | |
| 166 | 171 | WRITE8_MEMBER(jollyjgr_state::jollyjgr_misc_w) |
| r14896 | r14897 | |
| 204 | 209 | AM_RANGE(0x8ffc, 0x8ffc) AM_WRITE(jollyjgr_misc_w) |
| 205 | 210 | AM_RANGE(0x8ffd, 0x8ffd) AM_WRITE(jollyjgr_coin_lookout_w) |
| 206 | 211 | AM_RANGE(0x8fff, 0x8fff) AM_READ_PORT("DSW2") |
| 207 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(jollyjgr_videoram_w) AM_BASE(m_videoram) | |
| 208 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(jollyjgr_attrram_w) AM_BASE(m_colorram) | |
| 209 | AM_RANGE(0x9840, 0x987f) AM_RAM AM_BASE(m_spriteram) | |
| 212 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(jollyjgr_videoram_w) AM_SHARE("videoram") | |
| 213 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(jollyjgr_attrram_w) AM_SHARE("colorram") | |
| 214 | AM_RANGE(0x9840, 0x987f) AM_RAM AM_SHARE("spriteram") | |
| 210 | 215 | AM_RANGE(0x9880, 0x9bff) AM_RAM |
| 211 | AM_RANGE(0xa000, 0xffff) AM_RAM AM_ | |
| 216 | AM_RANGE(0xa000, 0xffff) AM_RAM AM_ | |
| 212 | 217 | ADDRESS_MAP_END |
| 213 | 218 | |
| 214 | 219 | static ADDRESS_MAP_START( fspider_map, AS_PROGRAM, 8, jollyjgr_state ) |
| r14896 | r14897 | |
| 221 | 226 | AM_RANGE(0x8ffc, 0x8ffc) AM_WRITE(jollyjgr_misc_w) |
| 222 | 227 | AM_RANGE(0x8ffd, 0x8ffd) AM_WRITE(jollyjgr_coin_lookout_w) |
| 223 | 228 | AM_RANGE(0x8fff, 0x8fff) AM_READ_PORT("DSW2") |
| 224 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(jollyjgr_videoram_w) AM_BASE(m_videoram) | |
| 225 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(jollyjgr_attrram_w) AM_BASE(m_colorram) | |
| 226 | AM_RANGE(0x9840, 0x987f) AM_RAM AM_BASE(m_spriteram) | |
| 229 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(jollyjgr_videoram_w) AM_SHARE("videoram") | |
| 230 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(jollyjgr_attrram_w) AM_SHARE("colorram") | |
| 231 | AM_RANGE(0x9840, 0x987f) AM_RAM AM_SHARE("spriteram") | |
| 227 | 232 | AM_RANGE(0x9880, 0x989f) AM_RAM // ? |
| 228 | AM_RANGE(0x98a0, 0x98af) AM_RAM AM_ | |
| 233 | AM_RANGE(0x98a0, 0x98af) AM_RAM AM_ | |
| 229 | 234 | AM_RANGE(0x98b0, 0x9bff) AM_RAM // ? |
| 230 | AM_RANGE(0xa000, 0xffff) AM_RAM AM_ | |
| 235 | AM_RANGE(0xa000, 0xffff) AM_RAM AM_ | |
| 231 | 236 | ADDRESS_MAP_END |
| 232 | 237 | |
| 233 | 238 | |
| r14896 | r14897 | |
| 432 | 437 | static TILE_GET_INFO( get_bg_tile_info ) |
| 433 | 438 | { |
| 434 | 439 | jollyjgr_state *state = machine.driver_data<jollyjgr_state>(); |
| 435 | int color = state->m_colorram[((tile_index & 0x1f) << 1) | 1] & 7; | |
| 440 | int color = state->m_colorram.target()[((tile_index & 0x1f) << 1) | 1] & 7; | |
| 436 | 441 | int region = (state->m_tilemap_bank & 0x20) ? 2 : 0; |
| 437 | SET_TILE_INFO(region, state->m_videoram[tile_index], color, 0); | |
| 442 | SET_TILE_INFO(region, state->m_videoram.target()[tile_index], color, 0); | |
| 438 | 443 | } |
| 439 | 444 | |
| 440 | 445 | static VIDEO_START( jollyjgr ) |
| r14896 | r14897 | |
| 460 | 465 | { |
| 461 | 466 | for(i = 0; i < 8; i++) |
| 462 | 467 | { |
| 463 | bit0 = (state->m_bitmap[count] >> i) & 1; | |
| 464 | bit1 = (state->m_bitmap[count + 0x2000] >> i) & 1; | |
| 465 | bit2 = (state->m_bitmap[count + 0x4000] >> i) & 1; | |
| 468 | bit0 = (state->m_bitmap.target()[count] >> i) & 1; | |
| 469 | bit1 = (state->m_bitmap.target()[count + 0x2000] >> i) & 1; | |
| 470 | bit2 = (state->m_bitmap.target()[count + 0x4000] >> i) & 1; | |
| 466 | 471 | color = bit0 | (bit1 << 1) | (bit2 << 2); |
| 467 | 472 | |
| 468 | 473 | if(color) |
| r14896 | r14897 | |
| 486 | 491 | static SCREEN_UPDATE_IND16( jollyjgr ) |
| 487 | 492 | { |
| 488 | 493 | jollyjgr_state *state = screen.machine().driver_data<jollyjgr_state>(); |
| 489 | UINT8 *spriteram = state->m_spriteram; | |
| 494 | UINT8 *spriteram = state->m_spriteram.target(); | |
| 490 | 495 | int offs; |
| 491 | 496 | |
| 492 | 497 | bitmap.fill(32, cliprect); |
| r14896 | r14897 | |
| 551 | 556 | Assume bullets to look the same as on Galaxian hw, |
| 552 | 557 | that is, simply 4 pixels. Colours are unknown. */ |
| 553 | 558 | for (int offs=0;offs<0x10;offs+=2) { |
| 554 | UINT8 sy=~state->m_bulletram[offs]; | |
| 555 | UINT8 sx=~state->m_bulletram[offs|1]; | |
| 559 | UINT8 sy=~state->m_bulletram.target()[offs]; | |
| 560 | UINT8 sx=~state->m_bulletram.target()[offs|1]; | |
| 556 | 561 | UINT16 bc=(offs<4)? |
| 557 | 562 | 32+7: // player, white |
| 558 | 563 | 32+3; // enemy, yellow |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | ||
| 49 | ||
| 50 | 50 | { |
| 51 | atarigen_scanline_int_ack_w(space, offset, data, mem_mask); | |
| 52 | atarigen_video_int_ack_w(space, offset, data, mem_mask); | |
| 51 | atarigen_scanline_int_ack_w(&space, offset, data, mem_mask); | |
| 52 | atarigen_video_int_ack_w(&space, offset, data, mem_mask); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| r14896 | r14897 | |
| 91 | 91 | AM_RANGE(0x260002, 0x260003) AM_READ_PORT("P2") |
| 92 | 92 | AM_RANGE(0x270000, 0x270001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 93 | 93 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 94 | AM_RANGE(0x360000, 0x360001) AM_WRITE | |
| 94 | AM_RANGE(0x360000, 0x360001) AM_WRITE | |
| 95 | 95 | AM_RANGE(0x3e0000, 0x3e07ff) AM_RAM_WRITE_LEGACY(atarigen_expanded_666_paletteram_w) AM_SHARE("paletteram") |
| 96 | 96 | AM_RANGE(0x3f0000, 0x3f0f7f) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_BASE(m_playfield) |
| 97 | 97 | AM_RANGE(0x3f0f80, 0x3f0fff) AM_READWRITE_LEGACY(atarimo_0_slipram_r, atarimo_0_slipram_w) |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | AM_RANGE(0x100018, 0x100019) AM_WRITE(quizpani_tilesbank_w) |
| 63 | 63 | AM_RANGE(0x104000, 0x104001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 64 | 64 | AM_RANGE(0x104020, 0x104027) AM_DEVWRITE_LEGACY("nmk112", nmk112_okibank_lsb_w) |
| 65 | AM_RANGE(0x108000, 0x1083ff) AM_RAM_WRITE(paletteram | |
| 65 | AM_RANGE(0x108000, 0x1083ff) AM_RAM_WRITE(paletteram | |
| 66 | 66 | AM_RANGE(0x108400, 0x1085ff) AM_WRITENOP |
| 67 | 67 | AM_RANGE(0x10c000, 0x10c007) AM_RAM AM_BASE(m_scrollreg) |
| 68 | 68 | AM_RANGE(0x10c008, 0x10c403) AM_WRITENOP |
| r14896 | r14897 | |
|---|---|---|
| 216 | 216 | { |
| 217 | 217 | public: |
| 218 | 218 | ssfindo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 219 | : driver_device(mconfig, type, tag) { } | |
| 219 | : driver_device(mconfig, type, tag) , | |
| 220 | m_vram(*this, "vram"){ } | |
| 220 | 221 | |
| 221 | 222 | UINT32 m_PS7500_IO[MAXIO]; |
| 222 | 223 | UINT32 m_PS7500_FIFO[256]; |
| 223 | UINT32 | |
| 224 | required_shared_ptr<UINT32> | |
| 224 | 225 | UINT32 m_flashAdr; |
| 225 | 226 | UINT32 m_flashOffset; |
| 226 | 227 | UINT32 m_adrLatch; |
| r14896 | r14897 | |
| 261 | 262 | for(y=0;y<256;y++) |
| 262 | 263 | for(x=0;x<320;x+=4) |
| 263 | 264 | { |
| 264 | bitmap.pix16(y, x+0) = state->m_vram[s]&0xff; | |
| 265 | bitmap.pix16(y, x+1) = (state->m_vram[s]>>8)&0xff; | |
| 266 | bitmap.pix16(y, x+2) = (state->m_vram[s]>>16)&0xff; | |
| 267 | bitmap.pix16(y, x+3) = (state->m_vram[s]>>24)&0xff; | |
| 265 | bitmap.pix16(y, x+0) = state->m_vram.target()[s]&0xff; | |
| 266 | bitmap.pix16(y, x+1) = (state->m_vram.target()[s]>>8)&0xff; | |
| 267 | bitmap.pix16(y, x+2) = (state->m_vram.target()[s]>>16)&0xff; | |
| 268 | bitmap.pix16(y, x+3) = (state->m_vram.target()[s]>>24)&0xff; | |
| 268 | 269 | s++; |
| 269 | 270 | } |
| 270 | 271 | } |
| r14896 | r14897 | |
| 565 | 566 | AM_RANGE(0x0324f000, 0x0324f003) AM_READ(SIMPLEIO_r) |
| 566 | 567 | AM_RANGE(0x03245000, 0x03245003) AM_WRITENOP /* sound ? */ |
| 567 | 568 | AM_RANGE(0x03400000, 0x03400003) AM_WRITE(FIFO_w) |
| 568 | AM_RANGE(0x10000000, 0x11ffffff) AM_RAM AM_ | |
| 569 | AM_RANGE(0x10000000, 0x11ffffff) AM_RAM AM_ | |
| 569 | 570 | ADDRESS_MAP_END |
| 570 | 571 | |
| 571 | 572 | static ADDRESS_MAP_START( ppcar_map, AS_PROGRAM, 32, ssfindo_state ) |
| r14896 | r14897 | |
| 580 | 581 | AM_RANGE(0x033c0000, 0x033c0003) AM_READ(io_r) AM_WRITE(io_w) |
| 581 | 582 | AM_RANGE(0x03400000, 0x03400003) AM_WRITE(FIFO_w) |
| 582 | 583 | AM_RANGE(0x08000000, 0x08ffffff) AM_RAM |
| 583 | AM_RANGE(0x10000000, 0x10ffffff) AM_RAM AM_ | |
| 584 | AM_RANGE(0x10000000, 0x10ffffff) AM_RAM AM_ | |
| 584 | 585 | ADDRESS_MAP_END |
| 585 | 586 | |
| 586 | 587 | READ32_MEMBER(ssfindo_state::tetfight_unk_r) |
| r14896 | r14897 | |
| 602 | 603 | AM_RANGE(0x03240004, 0x03240007) AM_READ_PORT("IN0") |
| 603 | 604 | AM_RANGE(0x03240008, 0x0324000b) AM_READ_PORT("DSW2") |
| 604 | 605 | AM_RANGE(0x03240020, 0x03240023) AM_READWRITE(tetfight_unk_r, tetfight_unk_w) |
| 605 | AM_RANGE(0x10000000, 0x14ffffff) AM_RAM AM_ | |
| 606 | AM_RANGE(0x10000000, 0x14ffffff) AM_RAM AM_ | |
| 606 | 607 | ADDRESS_MAP_END |
| 607 | 608 | |
| 608 | 609 | static MACHINE_RESET( ssfindo ) |
| r14896 | r14897 | |
|---|---|---|
| 180 | 180 | public: |
| 181 | 181 | peplus_state(const machine_config &mconfig, device_type type, const char *tag) |
| 182 | 182 | : driver_device(mconfig, type, tag), |
| 183 | m_cmos_ram(*this, "cmos") { } | |
| 183 | m_cmos_ram(*this, "cmos") , | |
| 184 | m_program_ram(*this, "prograram"), | |
| 185 | m_s3000_ram(*this, "s3000_ram"), | |
| 186 | m_s5000_ram(*this, "s5000_ram"), | |
| 187 | m_videoram(*this, "videoram"), | |
| 188 | m_s7000_ram(*this, "s7000_ram"), | |
| 189 | m_sb000_ram(*this, "sb000_ram"), | |
| 190 | m_sd000_ram(*this, "sd000_ram"), | |
| 191 | m_sf000_ram(*this, "sf000_ram"), | |
| 192 | m_io_port(*this, "io_port"){ } | |
| 184 | 193 | |
| 185 | UINT8 *m_videoram; | |
| 186 | 194 | required_shared_ptr<UINT8> m_cmos_ram; |
| 195 | required_shared_ptr<UINT8> m_program_ram; | |
| 196 | required_shared_ptr<UINT8> m_s3000_ram; | |
| 197 | required_shared_ptr<UINT8> m_s5000_ram; | |
| 198 | required_shared_ptr<UINT8> m_videoram; | |
| 199 | required_shared_ptr<UINT8> m_s7000_ram; | |
| 200 | required_shared_ptr<UINT8> m_sb000_ram; | |
| 201 | required_shared_ptr<UINT8> m_sd000_ram; | |
| 202 | required_shared_ptr<UINT8> m_sf000_ram; | |
| 203 | required_shared_ptr<UINT8> m_io_port; | |
| 187 | 204 | UINT16 m_autohold_addr; |
| 188 | 205 | tilemap_t *m_bg_tilemap; |
| 189 | 206 | UINT8 m_wingboard; |
| 190 | 207 | UINT8 m_jumper_e16_e17; |
| 191 | UINT8 *m_program_ram; | |
| 192 | UINT8 *m_s3000_ram; | |
| 193 | UINT8 *m_s5000_ram; | |
| 194 | UINT8 *m_s7000_ram; | |
| 195 | UINT8 *m_sb000_ram; | |
| 196 | UINT8 *m_sd000_ram; | |
| 197 | UINT8 *m_sf000_ram; | |
| 198 | 208 | UINT16 m_vid_address; |
| 199 | 209 | UINT8 *m_palette_ram; |
| 200 | 210 | UINT8 *m_palette_ram2; |
| 201 | UINT8 *m_io_port; | |
| 202 | 211 | UINT64 m_last_cycles; |
| 203 | 212 | UINT8 m_coin_state; |
| 204 | 213 | UINT64 m_last_door; |
| r14896 | r14897 | |
| 362 | 371 | |
| 363 | 372 | WRITE8_MEMBER(peplus_state::peplus_crtc_display_w) |
| 364 | 373 | { |
| 365 | UINT8 *videoram = m_videoram; | |
| 374 | UINT8 *videoram = m_videoram.target(); | |
| 366 | 375 | videoram[m_vid_address] = data; |
| 367 | m_palette_ram[m_vid_address] = m_io_port[1]; | |
| 368 | m_palette_ram2[m_vid_address] = m_io_port[3]; | |
| 376 | m_palette_ram[m_vid_address] = m_io_port.target()[1]; | |
| 377 | m_palette_ram2[m_vid_address] = m_io_port.target()[3]; | |
| 369 | 378 | |
| 370 | 379 | m_bg_tilemap->mark_tile_dirty(m_vid_address); |
| 371 | 380 | |
| r14896 | r14897 | |
| 375 | 384 | |
| 376 | 385 | WRITE8_MEMBER(peplus_state::peplus_io_w) |
| 377 | 386 | { |
| 378 | m_io_port[offset] = data; | |
| 387 | m_io_port.target()[offset] = data; | |
| 379 | 388 | } |
| 380 | 389 | |
| 381 | 390 | WRITE8_MEMBER(peplus_state::peplus_duart_w) |
| r14896 | r14897 | |
| 394 | 403 | peplus_load_superdata(machine(), bank_name); |
| 395 | 404 | } |
| 396 | 405 | |
| 397 | m_cmos_ram[offset] = data; | |
| 406 | m_cmos_ram.target()[offset] = data; | |
| 398 | 407 | } |
| 399 | 408 | |
| 400 | 409 | WRITE8_MEMBER(peplus_state::peplus_s3000_w) |
| 401 | 410 | { |
| 402 | m_s3000_ram[offset] = data; | |
| 411 | m_s3000_ram.target()[offset] = data; | |
| 403 | 412 | } |
| 404 | 413 | |
| 405 | 414 | WRITE8_MEMBER(peplus_state::peplus_s5000_w) |
| 406 | 415 | { |
| 407 | m_s5000_ram[offset] = data; | |
| 416 | m_s5000_ram.target()[offset] = data; | |
| 408 | 417 | } |
| 409 | 418 | |
| 410 | 419 | WRITE8_MEMBER(peplus_state::peplus_s7000_w) |
| 411 | 420 | { |
| 412 | m_s7000_ram[offset] = data; | |
| 421 | m_s7000_ram.target()[offset] = data; | |
| 413 | 422 | } |
| 414 | 423 | |
| 415 | 424 | WRITE8_MEMBER(peplus_state::peplus_sb000_w) |
| 416 | 425 | { |
| 417 | m_sb000_ram[offset] = data; | |
| 426 | m_sb000_ram.target()[offset] = data; | |
| 418 | 427 | } |
| 419 | 428 | |
| 420 | 429 | WRITE8_MEMBER(peplus_state::peplus_sd000_w) |
| 421 | 430 | { |
| 422 | m_sd000_ram[offset] = data; | |
| 431 | m_sd000_ram.target()[offset] = data; | |
| 423 | 432 | } |
| 424 | 433 | |
| 425 | 434 | WRITE8_MEMBER(peplus_state::peplus_sf000_w) |
| 426 | 435 | { |
| 427 | m_sf000_ram[offset] = data; | |
| 436 | m_sf000_ram.target()[offset] = data; | |
| 428 | 437 | } |
| 429 | 438 | |
| 430 | 439 | WRITE8_MEMBER(peplus_state::peplus_output_bank_a_w) |
| r14896 | r14897 | |
| 482 | 491 | |
| 483 | 492 | READ8_MEMBER(peplus_state::peplus_io_r) |
| 484 | 493 | { |
| 485 | return m_io_port[offset]; | |
| 494 | return m_io_port.target()[offset]; | |
| 486 | 495 | } |
| 487 | 496 | |
| 488 | 497 | READ8_MEMBER(peplus_state::peplus_duart_r) |
| r14896 | r14897 | |
| 493 | 502 | |
| 494 | 503 | READ8_MEMBER(peplus_state::peplus_cmos_r) |
| 495 | 504 | { |
| 496 | return m_cmos_ram[offset]; | |
| 505 | return m_cmos_ram.target()[offset]; | |
| 497 | 506 | } |
| 498 | 507 | |
| 499 | 508 | READ8_MEMBER(peplus_state::peplus_s3000_r) |
| 500 | 509 | { |
| 501 | return m_s3000_ram[offset]; | |
| 510 | return m_s3000_ram.target()[offset]; | |
| 502 | 511 | } |
| 503 | 512 | |
| 504 | 513 | READ8_MEMBER(peplus_state::peplus_s5000_r) |
| 505 | 514 | { |
| 506 | return m_s5000_ram[offset]; | |
| 515 | return m_s5000_ram.target()[offset]; | |
| 507 | 516 | } |
| 508 | 517 | |
| 509 | 518 | READ8_MEMBER(peplus_state::peplus_s7000_r) |
| 510 | 519 | { |
| 511 | return m_s7000_ram[offset]; | |
| 520 | return m_s7000_ram.target()[offset]; | |
| 512 | 521 | } |
| 513 | 522 | |
| 514 | 523 | READ8_MEMBER(peplus_state::peplus_sb000_r) |
| 515 | 524 | { |
| 516 | return m_sb000_ram[offset]; | |
| 525 | return m_sb000_ram.target()[offset]; | |
| 517 | 526 | } |
| 518 | 527 | |
| 519 | 528 | READ8_MEMBER(peplus_state::peplus_sd000_r) |
| 520 | 529 | { |
| 521 | return m_sd000_ram[offset]; | |
| 530 | return m_sd000_ram.target()[offset]; | |
| 522 | 531 | } |
| 523 | 532 | |
| 524 | 533 | READ8_MEMBER(peplus_state::peplus_sf000_r) |
| 525 | 534 | { |
| 526 | return m_sf000_ram[offset]; | |
| 535 | return m_sf000_ram.target()[offset]; | |
| 527 | 536 | } |
| 528 | 537 | |
| 529 | 538 | /* Last Color in Every Palette is bgcolor */ |
| r14896 | r14897 | |
| 653 | 662 | static TILE_GET_INFO( get_bg_tile_info ) |
| 654 | 663 | { |
| 655 | 664 | peplus_state *state = machine.driver_data<peplus_state>(); |
| 656 | UINT8 *videoram = state->m_videoram; | |
| 665 | UINT8 *videoram = state->m_videoram.target(); | |
| 657 | 666 | int pr = state->m_palette_ram[tile_index]; |
| 658 | 667 | int pr2 = state->m_palette_ram2[tile_index]; |
| 659 | 668 | int vr = videoram[tile_index]; |
| r14896 | r14897 | |
| 740 | 749 | *************************/ |
| 741 | 750 | |
| 742 | 751 | static ADDRESS_MAP_START( peplus_map, AS_PROGRAM, 8, peplus_state ) |
| 743 | AM_RANGE(0x0000, 0xffff) AM_ROM AM_ | |
| 752 | AM_RANGE(0x0000, 0xffff) AM_ROM AM_ | |
| 744 | 753 | ADDRESS_MAP_END |
| 745 | 754 | |
| 746 | 755 | static ADDRESS_MAP_START( peplus_iomap, AS_IO, 8, peplus_state ) |
| r14896 | r14897 | |
| 754 | 763 | AM_RANGE(0x2083, 0x2083) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(peplus_crtc_display_w) |
| 755 | 764 | |
| 756 | 765 | // Superboard Data |
| 757 | AM_RANGE(0x3000, 0x3fff) AM_READWRITE(peplus_s3000_r, peplus_s3000_w) AM_ | |
| 766 | AM_RANGE(0x3000, 0x3fff) AM_READWRITE(peplus_s3000_r, peplus_s3000_w) AM_ | |
| 758 | 767 | |
| 759 | 768 | // Sound and Dipswitches |
| 760 | 769 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 761 | 770 | AM_RANGE(0x4004, 0x4004) AM_READ_PORT("SW1")/* likely ay8910 input port, not direct */ AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| 762 | 771 | |
| 763 | 772 | // Superboard Data |
| 764 | AM_RANGE(0x5000, 0x5fff) AM_READWRITE(peplus_s5000_r, peplus_s5000_w) AM_ | |
| 773 | AM_RANGE(0x5000, 0x5fff) AM_READWRITE(peplus_s5000_r, peplus_s5000_w) AM_ | |
| 765 | 774 | |
| 766 | 775 | // Background Color Latch |
| 767 | 776 | AM_RANGE(0x6000, 0x6000) AM_READ(peplus_bgcolor_r) AM_WRITE(peplus_bgcolor_w) |
| 768 | 777 | |
| 769 | 778 | // Bogus Location for Video RAM |
| 770 | AM_RANGE(0x06001, 0x06400) AM_RAM AM_ | |
| 779 | AM_RANGE(0x06001, 0x06400) AM_RAM AM_ | |
| 771 | 780 | |
| 772 | 781 | // Superboard Data |
| 773 | AM_RANGE(0x7000, 0x7fff) AM_READWRITE(peplus_s7000_r, peplus_s7000_w) AM_ | |
| 782 | AM_RANGE(0x7000, 0x7fff) AM_READWRITE(peplus_s7000_r, peplus_s7000_w) AM_ | |
| 774 | 783 | |
| 775 | 784 | // Input Bank A, Output Bank C |
| 776 | 785 | AM_RANGE(0x8000, 0x8000) AM_DEVREAD_LEGACY("i2cmem",peplus_input_bank_a_r) AM_WRITE(peplus_output_bank_c_w) |
| r14896 | r14897 | |
| 782 | 791 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") AM_WRITE(peplus_output_bank_b_w) |
| 783 | 792 | |
| 784 | 793 | // Superboard Data |
| 785 | AM_RANGE(0xb000, 0xbfff) AM_READWRITE(peplus_sb000_r, peplus_sb000_w) AM_ | |
| 794 | AM_RANGE(0xb000, 0xbfff) AM_READWRITE(peplus_sb000_r, peplus_sb000_w) AM_ | |
| 786 | 795 | |
| 787 | 796 | // Output Bank A |
| 788 | 797 | AM_RANGE(0xc000, 0xc000) AM_READ(peplus_watchdog_r) AM_WRITE(peplus_output_bank_a_w) |
| 789 | 798 | |
| 790 | 799 | // Superboard Data |
| 791 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(peplus_sd000_r, peplus_sd000_w) AM_ | |
| 800 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(peplus_sd000_r, peplus_sd000_w) AM_ | |
| 792 | 801 | |
| 793 | 802 | // DUART |
| 794 | 803 | AM_RANGE(0xe000, 0xe00f) AM_READWRITE(peplus_duart_r, peplus_duart_w) |
| 795 | 804 | |
| 796 | 805 | // Superboard Data |
| 797 | AM_RANGE(0xf000, 0xffff) AM_READWRITE(peplus_sf000_r, peplus_sf000_w) AM_ | |
| 806 | AM_RANGE(0xf000, 0xffff) AM_READWRITE(peplus_sf000_r, peplus_sf000_w) AM_ | |
| 798 | 807 | |
| 799 | 808 | /* Ports start here */ |
| 800 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READ(peplus_io_r) AM_WRITE(peplus_io_w) AM_ | |
| 809 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READ(peplus_io_r) AM_WRITE(peplus_io_w) AM_ | |
| 801 | 810 | ADDRESS_MAP_END |
| 802 | 811 | |
| 803 | 812 | |
| r14896 | r14897 | |
| 1010 | 1019 | peplus_state *state = machine.driver_data<peplus_state>(); |
| 1011 | 1020 | |
| 1012 | 1021 | // pepp0158 |
| 1013 | state->m_program_ram[0xa19f] = 0x22; // RET - Disable Memory Test | |
| 1014 | state->m_program_ram[0xddea] = 0x22; // RET - Disable Program Checksum | |
| 1022 | state->m_program_ram.target()[0xa19f] = 0x22; // RET - Disable Memory Test | |
| 1023 | state->m_program_ram.target()[0xddea] = 0x22; // RET - Disable Program Checksum | |
| 1015 | 1024 | state->m_autohold_addr = 0x5ffe; // AutoHold Address |
| 1016 | 1025 | |
| 1017 | 1026 | // pepp0188 |
| 1018 | state->m_program_ram[0x9a8d] = 0x22; // RET - Disable Memory Test | |
| 1019 | state->m_program_ram[0xf429] = 0x22; // RET - Disable Program Checksum | |
| 1027 | state->m_program_ram.target()[0x9a8d] = 0x22; // RET - Disable Memory Test | |
| 1028 | state->m_program_ram.target()[0xf429] = 0x22; // RET - Disable Program Checksum | |
| 1020 | 1029 | state->m_autohold_addr = 0x742f; // AutoHold Address |
| 1021 | 1030 | |
| 1022 | 1031 | // pepp0516 |
| 1023 | state->m_program_ram[0x9a24] = 0x22; // RET - Disable Memory Test | |
| 1024 | state->m_program_ram[0xd61d] = 0x22; // RET - Disable Program Checksum | |
| 1032 | state->m_program_ram.target()[0x9a24] = 0x22; // RET - Disable Memory Test | |
| 1033 | state->m_program_ram.target()[0xd61d] = 0x22; // RET - Disable Program Checksum | |
| 1025 | 1034 | state->m_autohold_addr = 0x5e7e; // AutoHold Address |
| 1026 | 1035 | |
| 1027 | 1036 | if (state->m_autohold_addr) |
| 1028 | state->m_program_ram[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01; | |
| 1037 | state->m_program_ram.target()[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01; | |
| 1029 | 1038 | #endif |
| 1030 | 1039 | } |
| 1031 | 1040 |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | public: |
| 62 | 62 | ddayjlc_state(const machine_config &mconfig, device_type type, const char *tag) |
| 63 | : driver_device(mconfig, type, tag) { } | |
| 63 | : driver_device(mconfig, type, tag) , | |
| 64 | m_mainram(*this, "mainram"), | |
| 65 | m_spriteram(*this, "spriteram"), | |
| 66 | m_videoram(*this, "videoram"), | |
| 67 | m_bgram(*this, "bgram"){ } | |
| 64 | 68 | |
| 65 | 69 | /* memory pointers */ |
| 66 | UINT8 * m_bgram; | |
| 67 | UINT8 * m_mainram; | |
| 68 | UINT8 * m_videoram; | |
| 69 | UINT8 * m_spriteram; | |
| 70 | required_shared_ptr<UINT8> m_mainram; | |
| 71 | required_shared_ptr<UINT8> m_spriteram; | |
| 72 | required_shared_ptr<UINT8> m_videoram; | |
| 73 | required_shared_ptr<UINT8> m_bgram; | |
| 70 | 74 | |
| 71 | 75 | /* video-related */ |
| 72 | 76 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 162 | 166 | if (!offset) |
| 163 | 167 | m_bg_tilemap->set_scrollx(0, data + 8); |
| 164 | 168 | |
| 165 | m_bgram[offset] = data; | |
| 169 | m_bgram.target()[offset] = data; | |
| 166 | 170 | m_bg_tilemap->mark_tile_dirty(offset & 0x3ff); |
| 167 | 171 | } |
| 168 | 172 | |
| 169 | 173 | WRITE8_MEMBER(ddayjlc_state::ddayjlc_videoram_w) |
| 170 | 174 | { |
| 171 | m_videoram[offset] = data; | |
| 175 | m_videoram.target()[offset] = data; | |
| 172 | 176 | } |
| 173 | 177 | |
| 174 | 178 | |
| r14896 | r14897 | |
| 205 | 209 | WRITE8_MEMBER(ddayjlc_state::sound_w) |
| 206 | 210 | { |
| 207 | 211 | |
| 208 | soundlatch_w(space, offset, data); | |
| 212 | soundlatch_byte_w(space, offset, data); | |
| 209 | 213 | device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); |
| 210 | 214 | } |
| 211 | 215 | |
| r14896 | r14897 | |
| 242 | 246 | |
| 243 | 247 | static ADDRESS_MAP_START( main_cpu, AS_PROGRAM, 8, ddayjlc_state ) |
| 244 | 248 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 245 | AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(m_mainram) | |
| 246 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_BASE(m_spriteram) | |
| 247 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(ddayjlc_videoram_w) AM_BASE(m_videoram) | |
| 248 | AM_RANGE(0x9800, 0x9fff) AM_RAM_WRITE(ddayjlc_bgram_w) AM_BASE(m_bgram) /* 9800-981f - videoregs */ | |
| 249 | AM_RANGE(0x8000, 0x8fff) AM_RAM AM_SHARE("mainram") | |
| 250 | AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("spriteram") | |
| 251 | AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(ddayjlc_videoram_w) AM_SHARE("videoram") | |
| 252 | AM_RANGE(0x9800, 0x9fff) AM_RAM_WRITE(ddayjlc_bgram_w) AM_SHARE("bgram") /* 9800-981f - videoregs */ | |
| 249 | 253 | AM_RANGE(0xa000, 0xdfff) AM_ROMBANK("bank1") AM_WRITENOP |
| 250 | 254 | AM_RANGE(0xe000, 0xe003) AM_WRITE(i8257_CH0_w) |
| 251 | 255 | AM_RANGE(0xe008, 0xe008) AM_WRITENOP |
| r14896 | r14897 | |
| 367 | 371 | static TILE_GET_INFO( get_tile_info_bg ) |
| 368 | 372 | { |
| 369 | 373 | ddayjlc_state *state = machine.driver_data<ddayjlc_state>(); |
| 370 | int code = state->m_bgram[tile_index] + ((state->m_bgram[tile_index + 0x400] & 0x08) << 5); | |
| 371 | int color = (state->m_bgram[tile_index + 0x400] & 0x7); | |
| 372 | color |= (state->m_bgram[tile_index + 0x400] & 0x40) >> 3; | |
| 374 | int code = state->m_bgram.target()[tile_index] + ((state->m_bgram.target()[tile_index + 0x400] & 0x08) << 5); | |
| 375 | int color = (state->m_bgram.target()[tile_index + 0x400] & 0x7); | |
| 376 | color |= (state->m_bgram.target()[tile_index + 0x400] & 0x40) >> 3; | |
| 373 | 377 | |
| 374 | 378 | SET_TILE_INFO(2, code, color, 0); |
| 375 | 379 | } |
| r14896 | r14897 | |
| 388 | 392 | |
| 389 | 393 | for (i = 0; i < 0x400; i += 4) |
| 390 | 394 | { |
| 391 | UINT8 flags = state->m_spriteram[i + 2]; | |
| 392 | UINT8 y = 256 - state->m_spriteram[i + 0] - 8; | |
| 393 | UINT16 code = state->m_spriteram[i + 1]; | |
| 394 | UINT8 x = state->m_spriteram[i + 3] - 16; | |
| 395 | UINT8 flags = state->m_spriteram.target()[i + 2]; | |
| 396 | UINT8 y = 256 - state->m_spriteram.target()[i + 0] - 8; | |
| 397 | UINT16 code = state->m_spriteram.target()[i + 1]; | |
| 398 | UINT8 x = state->m_spriteram.target()[i + 3] - 16; | |
| 395 | 399 | UINT8 xflip = flags & 0x80; |
| 396 | 400 | UINT8 yflip = (code & 0x80); |
| 397 | 401 | UINT8 color = flags & 0xf; |
| r14896 | r14897 | |
| 407 | 411 | for (y = 0; y < 32; y++) |
| 408 | 412 | for (x = 0; x < 32; x++) |
| 409 | 413 | { |
| 410 | c = state->m_videoram[y * 32 + x]; | |
| 414 | c = state->m_videoram.target()[y * 32 + x]; | |
| 411 | 415 | if (x > 1 && x < 30) |
| 412 | 416 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], c + state->m_char_bank * 0x100, 2, 0, 0, x*8, y*8, 0); |
| 413 | 417 | else |
| r14896 | r14897 | |
| 421 | 425 | { |
| 422 | 426 | AY8910_LEGACY_OUTPUT, |
| 423 | 427 | AY8910_DEFAULT_LOADS, |
| 424 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_r), | |
| 428 | DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_r), | |
| 425 | 429 | DEVCB_NULL, |
| 426 | 430 | DEVCB_NULL, |
| 427 | 431 | DEVCB_NULL |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | 21 | dorachan_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | : driver_device(mconfig, type, tag) { } | |
| 22 | : driver_device(mconfig, type, tag) , | |
| 23 | m_videoram(*this, "videoram"){ } | |
| 23 | 24 | |
| 24 | 25 | /* memory pointers */ |
| 25 | UINT8 * m_videoram; | |
| 26 | size_t m_videoram_size; | |
| 26 | required_shared_ptr<UINT8> m_videoram; | |
| 27 | 27 | |
| 28 | 28 | /* video-related */ |
| 29 | 29 | UINT8 m_flip_screen; |
| r14896 | r14897 | |
| 90 | 90 | |
| 91 | 91 | color_map_base = screen.machine().region("proms")->base(); |
| 92 | 92 | |
| 93 | for (offs = 0; offs < state->m_videoram | |
| 93 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 94 | 94 | { |
| 95 | 95 | int i; |
| 96 | 96 | UINT8 fore_color; |
| r14896 | r14897 | |
| 101 | 101 | /* the need for +1 is extremely unusual, but definetely correct */ |
| 102 | 102 | offs_t color_address = ((((offs << 2) & 0x03e0) | (offs >> 8)) + 1) & 0x03ff; |
| 103 | 103 | |
| 104 | UINT8 data = state->m_videoram[offs]; | |
| 104 | UINT8 data = state->m_videoram.target()[offs]; | |
| 105 | 105 | |
| 106 | 106 | if (state->m_flip_screen) |
| 107 | 107 | fore_color = (color_map_base[color_address] >> 3) & 0x07; |
| r14896 | r14897 | |
| 151 | 151 | AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_READ_PORT("SYSTEM") |
| 152 | 152 | AM_RANGE(0x2c00, 0x2c00) AM_MIRROR(0x03ff) AM_READ_PORT("JOY") |
| 153 | 153 | AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_READ_PORT("V128") |
| 154 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 154 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_ | |
| 155 | 155 | AM_RANGE(0x6000, 0x77ff) AM_ROM |
| 156 | 156 | ADDRESS_MAP_END |
| 157 | 157 |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | * |
| 69 | 69 | *************************************/ |
| 70 | 70 | |
| 71 | ||
| 71 | ||
| 72 | 72 | { |
| 73 | thunderj_state *state = space->machine().driver_data<thunderj_state>(); | |
| 74 | int result = input_port_read(space->machine(), "260012"); | |
| 73 | int result = input_port_read(machine(), "260012"); | |
| 75 | 74 | |
| 76 | if (state->m_sound_to_cpu_ready) result ^= 0x0004; | |
| 77 | if (state->m_cpu_to_sound_ready) result ^= 0x0008; | |
| 75 | if (m_sound_to_cpu_ready) result ^= 0x0004; | |
| 76 | if (m_cpu_to_sound_ready) result ^= 0x0008; | |
| 78 | 77 | result ^= 0x0010; |
| 79 | 78 | |
| 80 | 79 | return result; |
| 81 | 80 | } |
| 82 | 81 | |
| 83 | 82 | |
| 84 | ||
| 83 | ||
| 85 | 84 | { |
| 86 | thunderj_state *state = space->machine().driver_data<thunderj_state>(); | |
| 87 | 85 | |
| 88 | 86 | /* reset extra CPU */ |
| 89 | 87 | if (ACCESSING_BITS_0_7) |
| 90 | 88 | { |
| 91 | 89 | /* 0 means hold CPU 2's reset low */ |
| 92 | 90 | if (data & 1) |
| 93 | cputag_set_input_line( | |
| 91 | cputag_set_input_line( | |
| 94 | 92 | else |
| 95 | cputag_set_input_line( | |
| 93 | cputag_set_input_line( | |
| 96 | 94 | |
| 97 | 95 | /* bits 2-5 are the alpha bank */ |
| 98 | if ( | |
| 96 | if ( | |
| 99 | 97 | { |
| 100 | space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos()); | |
| 101 | state->m_alpha_tilemap->mark_all_dirty(); | |
| 102 | state->m_alpha_tile_bank = (data >> 2) & 7; | |
| 98 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
| 99 | m_alpha_tilemap->mark_all_dirty(); | |
| 100 | m_alpha_tile_bank = (data >> 2) & 7; | |
| 103 | 101 | } |
| 104 | 102 | } |
| 105 | 103 | } |
| r14896 | r14897 | |
| 112 | 110 | * |
| 113 | 111 | *************************************/ |
| 114 | 112 | |
| 115 | ||
| 113 | ||
| 116 | 114 | { |
| 117 | 115 | /* Sigh. CPU #1 reads the video controller register twice per frame, once at |
| 118 | 116 | the beginning of interrupt and once near the end. It stores these values in a |
| 119 | 117 | table starting at $163484. CPU #2 periodically looks at this table to make |
| 120 | 118 | sure that it is getting interrupts at the appropriate times, and that the |
| 121 | VBLANK bit is set appropriately. Unfortunately, due to all the device_yield(&space | |
| 119 | VBLANK bit is set appropriately. Unfortunately, due to all the device_yield(&space. | |
| 122 | 120 | calls we make to synchronize the two CPUs, we occasionally get out of time |
| 123 | 121 | and generate the interrupt outside of the tight tolerances CPU #2 expects. |
| 124 | 122 | |
| r14896 | r14897 | |
| 130 | 128 | /* Use these lines to detect when things go south: */ |
| 131 | 129 | |
| 132 | 130 | #if 0 |
| 133 | if ( | |
| 131 | if ( | |
| 134 | 132 | mame_printf_debug("You're screwed!"); |
| 135 | 133 | #endif |
| 136 | 134 | |
| 137 | return atarivc_r(* | |
| 135 | return atarivc_r(* | |
| 138 | 136 | } |
| 139 | 137 | |
| 140 | 138 | |
| 141 | ||
| 139 | ||
| 142 | 140 | { |
| 143 | atarivc_w(* | |
| 141 | atarivc_w(* | |
| 144 | 142 | } |
| 145 | 143 | |
| 146 | 144 | |
| r14896 | r14897 | |
| 158 | 156 | AM_RANGE(0x1f0000, 0x1fffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 159 | 157 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 160 | 158 | AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010") |
| 161 | AM_RANGE(0x260012, 0x260013) AM_READ | |
| 159 | AM_RANGE(0x260012, 0x260013) AM_READ | |
| 162 | 160 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) |
| 163 | 161 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 164 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 162 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 165 | 163 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 166 | 164 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) |
| 167 | 165 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 168 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 166 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 169 | 167 | AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_WRITE_LEGACY(atarigen_playfield2_latched_msb_w) AM_BASE(m_playfield2) |
| 170 | 168 | AM_RANGE(0x3f2000, 0x3f3fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_latched_lsb_w) AM_BASE(m_playfield) |
| 171 | 169 | AM_RANGE(0x3f4000, 0x3f5fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_dual_upper_w) AM_BASE(m_playfield_upper) |
| r14896 | r14897 | |
| 190 | 188 | AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE("share1") |
| 191 | 189 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 192 | 190 | AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010") |
| 193 | AM_RANGE(0x260012, 0x260013) AM_READ | |
| 191 | AM_RANGE(0x260012, 0x260013) AM_READ | |
| 194 | 192 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) |
| 195 | 193 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 196 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 194 | AM_RANGE(0x360010, 0x360011) AM_WRITE | |
| 197 | 195 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) |
| 198 | 196 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) |
| 199 | 197 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | if (m_videobank & 0x01) |
| 47 | 47 | { |
| 48 | 48 | if (m_videobank & 0x04) |
| 49 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset + 0x0800, data); | |
| 49 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset + 0x0800, data); | |
| 50 | 50 | else |
| 51 | paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data); | |
| 51 | paletteram_xBBBBBGGGGGRRRRR_byte_be_w(space, offset, data); | |
| 52 | 52 | } |
| 53 | 53 | else |
| 54 | 54 | m_ram[offset] = data; |
| r14896 | r14897 | |
|---|---|---|
| 337 | 337 | * |
| 338 | 338 | *************************************/ |
| 339 | 339 | |
| 340 | GAME( 1982, quantum, 0, quantum, quantum, 0, ROT270, "Atari", "Quantum (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 341 | GAME( 1982, quantum1, quantum, quantum, quantum, 0, ROT270, "Atari", "Quantum (rev 1)", GAME_SUPPORTS_SAVE ) | |
| 342 | GAME( 1982, quantump, quantum, quantum, quantum, 0, ROT270, "Atari", "Quantum (prototype)", GAME_SUPPORTS_SAVE ) | |
| 340 | GAME( 1982, quantum, 0, quantum, quantum, 0, ROT270, "General Computer Corporation (Atari license)", "Quantum (rev 2)", GAME_SUPPORTS_SAVE ) | |
| 341 | GAME( 1982, quantum1, quantum, quantum, quantum, 0, ROT270, "General Computer Corporation (Atari license)", "Quantum (rev 1)", GAME_SUPPORTS_SAVE ) | |
| 342 | GAME( 1982, quantump, quantum, quantum, quantum, 0, ROT270, "General Computer Corporation (Atari license)", "Quantum (prototype)", GAME_SUPPORTS_SAVE ) |
| r14896 | r14897 | |
|---|---|---|
| 110 | 110 | 9000 uPD7759 |
| 111 | 111 | b000 uPD7759 |
| 112 | 112 | c000 uPD7759 |
| 113 | d000 soundlatch_r | |
| 113 | d000 soundlatch_byte_r | |
| 114 | 114 | e000-e001 YM2203 |
| 115 | 115 | |
| 116 | 116 | |
| r14896 | r14897 | |
| 150 | 150 | |
| 151 | 151 | WRITE8_MEMBER(combatsc_state::combatscb_sh_irqtrigger_w) |
| 152 | 152 | { |
| 153 | soundlatch_w(space, offset, data); | |
| 153 | soundlatch_byte_w(space, offset, data); | |
| 154 | 154 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 155 | 155 | } |
| 156 | 156 | |
| r14896 | r14897 | |
| 389 | 389 | AM_RANGE(0x0408, 0x0408) AM_WRITE(combatsc_coin_counter_w) /* coin counters */ |
| 390 | 390 | AM_RANGE(0x040c, 0x040c) AM_WRITE(combatsc_vreg_w) |
| 391 | 391 | AM_RANGE(0x0410, 0x0410) AM_WRITE(combatsc_bankselect_w) |
| 392 | AM_RANGE(0x0414, 0x0414) AM_WRITE(soundlatch_w) | |
| 392 | AM_RANGE(0x0414, 0x0414) AM_WRITE(soundlatch_byte_w) | |
| 393 | 393 | AM_RANGE(0x0418, 0x0418) AM_WRITE(combatsc_sh_irqtrigger_w) |
| 394 | 394 | AM_RANGE(0x041c, 0x041c) AM_WRITE(watchdog_reset_w) /* watchdog reset? */ |
| 395 | 395 | |
| r14896 | r14897 | |
| 419 | 419 | AM_RANGE(0xb000, 0xb000) AM_DEVREAD_LEGACY("upd", combatsc_busy_r) /* upd7759 busy? */ |
| 420 | 420 | AM_RANGE(0xc000, 0xc000) AM_DEVWRITE_LEGACY("upd", combatsc_voice_reset_w) /* upd7759 reset? */ |
| 421 | 421 | |
| 422 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r) /* soundlatch_r? */ | |
| 422 | AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r? */ | |
| 423 | 423 | AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE_LEGACY("ymsnd", combatsc_ym2203_r, ym2203_w) /* YM 2203 intercepted */ |
| 424 | 424 | ADDRESS_MAP_END |
| 425 | 425 | |
| r14896 | r14897 | |
| 440 | 440 | AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) /* YM 2203 */ |
| 441 | 441 | AM_RANGE(0x9008, 0x9009) AM_DEVREAD_LEGACY("ymsnd", ym2203_r) /* ??? */ |
| 442 | 442 | AM_RANGE(0x9800, 0x9800) AM_DEVWRITE_LEGACY("msm5205",combatscb_dac_w) |
| 443 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) /* soundlatch_r? */ | |
| 443 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r? */ | |
| 444 | 444 | ADDRESS_MAP_END |
| 445 | 445 | |
| 446 | 446 | /************************************* |
| r14896 | r14897 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | WRITE8_MEMBER(rockrage_state::rockrage_sh_irqtrigger_w) |
| 80 | 80 | { |
| 81 | soundlatch_w(space, offset, data); | |
| 81 | soundlatch_byte_w(space, offset, data); | |
| 82 | 82 | device_set_input_line(m_audiocpu, M6809_IRQ_LINE, HOLD_LINE); |
| 83 | 83 | } |
| 84 | 84 | |
| r14896 | r14897 | |
| 118 | 118 | AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w) /* VLM5030 */ |
| 119 | 119 | AM_RANGE(0x3000, 0x3000) AM_DEVREAD_LEGACY("vlm", rockrage_VLM5030_busy_r) /* VLM5030 */ |
| 120 | 120 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("vlm", rockrage_speech_w) /* VLM5030 */ |
| 121 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 121 | AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 122 | 122 | AM_RANGE(0x6000, 0x6001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) /* YM 2151 */ |
| 123 | 123 | AM_RANGE(0x7000, 0x77ff) AM_RAM /* RAM */ |
| 124 | 124 | AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */ |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | public: |
| 94 | 94 | quizpun2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 95 | : driver_device(mconfig, type, tag) { } | |
| 95 | : driver_device(mconfig, type, tag) , | |
| 96 | m_fg_ram(*this, "fg_ram"), | |
| 97 | m_bg_ram(*this, "bg_ram"){ } | |
| 96 | 98 | |
| 97 | 99 | struct prot_t m_prot; |
| 98 | UINT8 *m_bg_ram; | |
| 99 | UINT8 *m_fg_ram; | |
| 100 | required_shared_ptr<UINT8> m_fg_ram; | |
| 101 | required_shared_ptr<UINT8> m_bg_ram; | |
| 100 | 102 | tilemap_t *m_bg_tmap; |
| 101 | 103 | tilemap_t *m_fg_tmap; |
| 102 | 104 | DECLARE_WRITE8_MEMBER(bg_ram_w); |
| r14896 | r14897 | |
| 118 | 120 | static TILE_GET_INFO( get_bg_tile_info ) |
| 119 | 121 | { |
| 120 | 122 | quizpun2_state *state = machine.driver_data<quizpun2_state>(); |
| 121 | UINT16 code = state->m_bg_ram[ tile_index * 2 ] + state->m_bg_ram[ tile_index * 2 + 1 ] * 256; | |
| 123 | UINT16 code = state->m_bg_ram.target()[ tile_index * 2 ] + state->m_bg_ram.target()[ tile_index * 2 + 1 ] * 256; | |
| 122 | 124 | SET_TILE_INFO(0, code, 0, 0); |
| 123 | 125 | } |
| 124 | 126 | |
| 125 | 127 | static TILE_GET_INFO( get_fg_tile_info ) |
| 126 | 128 | { |
| 127 | 129 | quizpun2_state *state = machine.driver_data<quizpun2_state>(); |
| 128 | UINT16 code = state->m_fg_ram[ tile_index * 4 ] + state->m_fg_ram[ tile_index * 4 + 1 ] * 256; | |
| 129 | UINT8 color = state->m_fg_ram[ tile_index * 4 + 2 ]; | |
| 130 | UINT16 code = state->m_fg_ram.target()[ tile_index * 4 ] + state->m_fg_ram.target()[ tile_index * 4 + 1 ] * 256; | |
| 131 | UINT8 color = state->m_fg_ram.target()[ tile_index * 4 + 2 ]; | |
| 130 | 132 | SET_TILE_INFO(1, code, color & 0x0f, 0); |
| 131 | 133 | } |
| 132 | 134 | |
| 133 | 135 | WRITE8_MEMBER(quizpun2_state::bg_ram_w) |
| 134 | 136 | { |
| 135 | m_bg_ram[offset] = data; | |
| 137 | m_bg_ram.target()[offset] = data; | |
| 136 | 138 | m_bg_tmap->mark_tile_dirty(offset/2); |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | 141 | WRITE8_MEMBER(quizpun2_state::fg_ram_w) |
| 140 | 142 | { |
| 141 | m_fg_ram[offset] = data; | |
| 143 | m_fg_ram.target()[offset] = data; | |
| 142 | 144 | m_fg_tmap->mark_tile_dirty(offset/4); |
| 143 | 145 | } |
| 144 | 146 | |
| r14896 | r14897 | |
| 352 | 354 | |
| 353 | 355 | WRITE8_MEMBER(quizpun2_state::quizpun2_soundlatch_w) |
| 354 | 356 | { |
| 355 | soundlatch_w(space, 0, data); | |
| 357 | soundlatch_byte_w(space, 0, data); | |
| 356 | 358 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 357 | 359 | } |
| 358 | 360 | |
| r14896 | r14897 | |
| 364 | 366 | AM_RANGE( 0xc000, 0xc7ff ) AM_RAM_WRITE(bg_ram_w ) AM_BASE(m_bg_ram ) // 4 * 400 |
| 365 | 367 | AM_RANGE( 0xc800, 0xcfff ) AM_RAM // |
| 366 | 368 | |
| 367 | AM_RANGE( 0xd000, 0xd3ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_SHARE("paletteram") | |
| 369 | AM_RANGE( 0xd000, 0xd3ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w ) AM_SHARE("paletteram") | |
| 368 | 370 | AM_RANGE( 0xe000, 0xffff ) AM_RAM |
| 369 | 371 | ADDRESS_MAP_END |
| 370 | 372 | |
| r14896 | r14897 | |
| 393 | 395 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 394 | 396 | AM_RANGE( 0x00, 0x00 ) AM_WRITENOP // IRQ end |
| 395 | 397 | AM_RANGE( 0x20, 0x20 ) AM_WRITENOP // NMI end |
| 396 | AM_RANGE( 0x40, 0x40 ) AM_READ(soundlatch_r ) | |
| 398 | AM_RANGE( 0x40, 0x40 ) AM_READ(soundlatch_byte_r ) | |
| 397 | 399 | AM_RANGE( 0x60, 0x61 ) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w ) |
| 398 | 400 | ADDRESS_MAP_END |
| 399 | 401 |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | public: |
| 51 | 51 | egghunt_state(const machine_config &mconfig, device_type type, const char *tag) |
| 52 | : driver_device(mconfig, type, tag) { } | |
| 52 | : driver_device(mconfig, type, tag) , | |
| 53 | m_atram(*this, "atram"){ } | |
| 53 | 54 | |
| 54 | 55 | /* video-related */ |
| 55 | 56 | tilemap_t *m_bg_tilemap; |
| r14896 | r14897 | |
| 63 | 64 | device_t *m_audiocpu; |
| 64 | 65 | |
| 65 | 66 | /* memory */ |
| 66 | UINT8 | |
| 67 | required_shared_ptr<UINT8> | |
| 67 | 68 | UINT8 m_bgram[0x1000]; |
| 68 | 69 | UINT8 m_spram[0x1000]; |
| 69 | 70 | DECLARE_READ8_MEMBER(egghunt_bgram_r); |
| r14896 | r14897 | |
| 118 | 119 | { |
| 119 | 120 | egghunt_state *state = machine.driver_data<egghunt_state>(); |
| 120 | 121 | int code = ((state->m_bgram[tile_index * 2 + 1] << 8) | state->m_bgram[tile_index * 2]) & 0x3fff; |
| 121 | int colour = state->m_atram[tile_index] & 0x3f; | |
| 122 | int colour = state->m_atram.target()[tile_index] & 0x3f; | |
| 122 | 123 | |
| 123 | 124 | if(code & 0x2000) |
| 124 | 125 | { |
| r14896 | r14897 | |
| 160 | 161 | |
| 161 | 162 | WRITE8_MEMBER(egghunt_state::egghunt_atram_w) |
| 162 | 163 | { |
| 163 | m_atram[offset] = data; | |
| 164 | m_atram.target()[offset] = data; | |
| 164 | 165 | m_bg_tilemap->mark_tile_dirty(offset); |
| 165 | 166 | } |
| 166 | 167 | |
| r14896 | r14897 | |
| 199 | 200 | |
| 200 | 201 | WRITE8_MEMBER(egghunt_state::egghunt_soundlatch_w) |
| 201 | 202 | { |
| 202 | soundlatch_w(space, 0, data); | |
| 203 | soundlatch_byte_w(space, 0, data); | |
| 203 | 204 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 204 | 205 | } |
| 205 | 206 | |
| r14896 | r14897 | |
| 219 | 220 | |
| 220 | 221 | static ADDRESS_MAP_START( egghunt_map, AS_PROGRAM, 8, egghunt_state ) |
| 221 | 222 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 222 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_le_w) AM_SHARE("paletteram") | |
| 223 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(egghunt_atram_w) AM_BASE(m_atram) | |
| 223 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_byte_le_w) AM_SHARE("paletteram") | |
| 224 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(egghunt_atram_w) AM_SHARE("atram") | |
| 224 | 225 | AM_RANGE(0xd000, 0xdfff) AM_READWRITE(egghunt_bgram_r, egghunt_bgram_w) |
| 225 | 226 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 226 | 227 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 239 | 240 | |
| 240 | 241 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, egghunt_state ) |
| 241 | 242 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 242 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 243 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 243 | 244 | AM_RANGE(0xe001, 0xe001) AM_DEVREADWRITE_LEGACY("oki", egghunt_okibanking_r, egghunt_okibanking_w) |
| 244 | 245 | AM_RANGE(0xe004, 0xe004) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 245 | 246 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | public: |
| 34 | 34 | splus_state(const machine_config &mconfig, device_type type, const char *tag) |
| 35 | 35 | : driver_device(mconfig, type, tag), |
| 36 | m_cmosl_ram(*this, "cmosl"), m_cmosh_ram(*this, "cmosh") | |
| 36 | m_cmosl_ram(*this, "cmosl"), | |
| 37 | m_cmosh_ram(*this, "cmosh"), | |
| 38 | m_program_ram(*this, "program_ram"), | |
| 39 | m_reel_ram(*this, "reel_ram"), | |
| 40 | m_io_port(*this, "io_port") | |
| 37 | 41 | { |
| 38 | 42 | m_sda_dir = 0; |
| 39 | 43 | m_coin_state = 0; |
| r14896 | r14897 | |
| 58 | 62 | required_shared_ptr<UINT8> m_cmosh_ram; |
| 59 | 63 | |
| 60 | 64 | // Program and Reel Data |
| 61 | UINT8 *m_program_ram; | |
| 62 | UINT8 *m_reel_ram; | |
| 65 | required_shared_ptr<UINT8> m_program_ram; | |
| 66 | required_shared_ptr<UINT8> m_reel_ram; | |
| 63 | 67 | |
| 64 | 68 | // IO Ports |
| 65 | UINT8 | |
| 69 | required_shared_ptr<UINT8> | |
| 66 | 70 | |
| 67 | 71 | // EEPROM States |
| 68 | 72 | int m_sda_dir; |
| r14896 | r14897 | |
| 179 | 183 | #endif |
| 180 | 184 | } |
| 181 | 185 | |
| 182 | m_io_port[offset] = data; | |
| 186 | m_io_port.target()[offset] = data; | |
| 183 | 187 | } |
| 184 | 188 | |
| 185 | 189 | WRITE8_MEMBER(splus_state::splus_load_pulse_w) |
| 186 | 190 | { |
| 187 | 191 | |
| 188 | 192 | // UINT8 out = 0; |
| 189 | // out = ((~m_io_port[1] & 0xf0)>>4); // Output Bank | |
| 193 | // out = ((~m_io_port.target()[1] & 0xf0)>>4); // Output Bank | |
| 190 | 194 | } |
| 191 | 195 | |
| 192 | 196 | WRITE8_MEMBER(splus_state::splus_serial_w) |
| 193 | 197 | { |
| 194 | 198 | |
| 195 | 199 | UINT8 out = 0; |
| 196 | out = ((~m_io_port[1] & 0xe0)>>5); // Output Bank | |
| 200 | out = ((~m_io_port.target()[1] & 0xe0)>>5); // Output Bank | |
| 197 | 201 | |
| 198 | 202 | switch (out) |
| 199 | 203 | { |
| r14896 | r14897 | |
| 342 | 346 | seg = ((~data & 0xf0)>>4); // Segment Number |
| 343 | 347 | val = (~data & 0x0f); // Digit Value |
| 344 | 348 | |
| 345 | // Need to add ~m_io_port[1]-1 to seg value | |
| 346 | if (seg < 0x0a && (m_io_port[1] & 0xe0) == 0xe0) | |
| 349 | // Need to add ~m_io_port.target()[1]-1 to seg value | |
| 350 | if (seg < 0x0a && (m_io_port.target()[1] & 0xe0) == 0xe0) | |
| 347 | 351 | output_set_digit_value(seg, ls48_map[val]); |
| 348 | 352 | } |
| 349 | 353 | |
| r14896 | r14897 | |
| 374 | 378 | |
| 375 | 379 | UINT8 in = 0x00; |
| 376 | 380 | UINT8 val = 0x00; |
| 377 | in = ((~m_io_port[1] & 0xe0)>>5); // Input Bank | |
| 381 | in = ((~m_io_port.target()[1] & 0xe0)>>5); // Input Bank | |
| 378 | 382 | |
| 379 | 383 | switch (in) |
| 380 | 384 | { |
| r14896 | r14897 | |
| 508 | 512 | |
| 509 | 513 | READ8_MEMBER(splus_state::splus_m_reel_ram_r) |
| 510 | 514 | { |
| 511 | return m_reel_ram[offset]; | |
| 515 | return m_reel_ram.target()[offset]; | |
| 512 | 516 | } |
| 513 | 517 | |
| 514 | 518 | READ8_MEMBER(splus_state::splus_io_r) |
| 515 | 519 | { |
| 516 | 520 | |
| 517 | 521 | if (offset == 3) |
| 518 | return m_io_port[offset] & 0xf3; // Ignore Int0 and Int1, or machine will loop forever waiting | |
| 522 | return m_io_port.target()[offset] & 0xf3; // Ignore Int0 and Int1, or machine will loop forever waiting | |
| 519 | 523 | else |
| 520 | return m_io_port[offset]; | |
| 524 | return m_io_port.target()[offset]; | |
| 521 | 525 | } |
| 522 | 526 | |
| 523 | 527 | READ8_MEMBER(splus_state::splus_duart_r) |
| r14896 | r14897 | |
| 586 | 590 | *************************/ |
| 587 | 591 | |
| 588 | 592 | static ADDRESS_MAP_START( splus_map, AS_PROGRAM, 8, splus_state ) |
| 589 | AM_RANGE(0x0000, 0xffff) AM_ROM AM_ | |
| 593 | AM_RANGE(0x0000, 0xffff) AM_ROM AM_ | |
| 590 | 594 | ADDRESS_MAP_END |
| 591 | 595 | |
| 592 | 596 | static ADDRESS_MAP_START( splus_iomap, AS_IO, 8, splus_state ) |
| r14896 | r14897 | |
| 616 | 620 | AM_RANGE(0x7000, 0x7fff) AM_RAM AM_SHARE("cmosh") |
| 617 | 621 | |
| 618 | 622 | // SSxxxx Reel Chip |
| 619 | AM_RANGE(0x8000, 0x9fff) AM_READ(splus_m_reel_ram_r) AM_ | |
| 623 | AM_RANGE(0x8000, 0x9fff) AM_READ(splus_m_reel_ram_r) AM_ | |
| 620 | 624 | |
| 621 | 625 | // Ports start here |
| 622 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READ(splus_io_r) AM_WRITE(splus_io_w) AM_ | |
| 626 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READ(splus_io_r) AM_WRITE(splus_io_w) AM_ | |
| 623 | 627 | ADDRESS_MAP_END |
| 624 | 628 | |
| 625 | 629 | /************************* |
| r14896 | r14897 | |
|---|---|---|
| 53 | 53 | AM_RANGE(0x0ec000, 0x0effff) AM_RAM_WRITE(bsb_videoram_w) AM_BASE(m_videoram) |
| 54 | 54 | |
| 55 | 55 | AM_RANGE(0x0f0000, 0x0f7fff) AM_RAM |
| 56 | AM_RANGE(0x0f8000, 0x0f87ff) AM_RAM_WRITE(paletteram | |
| 56 | AM_RANGE(0x0f8000, 0x0f87ff) AM_RAM_WRITE(paletteram | |
| 57 | 57 | AM_RANGE(0x0f8800, 0x0fffff) AM_RAM |
| 58 | 58 | |
| 59 | 59 | AM_RANGE(0x1f0000, 0x1f7fff) AM_RAM |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | m_interrupt_mask = data & 7; |
| 141 | 141 | |
| 142 | 142 | /* bit 3 = flip screen */ |
| 143 | flip_screen_set( | |
| 143 | flip_screen_set( | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | WRITE8_MEMBER(gberet_state::gberet_sound_w) |
| r14896 | r14897 | |
| 192 | 192 | |
| 193 | 193 | WRITE8_MEMBER(gberet_state::gberetb_flipscreen_w) |
| 194 | 194 | { |
| 195 | flip_screen_set( | |
| 195 | flip_screen_set( | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | READ8_MEMBER(gberet_state::gberetb_irq_ack_r) |
| r14896 | r14897 | |
|---|---|---|
| 222 | 222 | { |
| 223 | 223 | |
| 224 | 224 | m_latch2_full = 0; |
| 225 | return soundlatch2_r(space,0); | |
| 225 | return soundlatch2_byte_r(space,0); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | WRITE16_MEMBER(sandscrp_state::sandscrp_soundlatch_word_w) |
| r14896 | r14897 | |
| 231 | 231 | if (ACCESSING_BITS_0_7) |
| 232 | 232 | { |
| 233 | 233 | m_latch1_full = 1; |
| 234 | soundlatch_w(space, 0, data & 0xff); | |
| 234 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 235 | 235 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 236 | 236 | device_spin_until_time(&space.device(), attotime::from_usec(100)); // Allow the other cpu to reply |
| 237 | 237 | } |
| r14896 | r14897 | |
| 249 | 249 | AM_RANGE(0x402000, 0x402fff) AM_RAM AM_BASE(m_vscroll[1]) // |
| 250 | 250 | AM_RANGE(0x403000, 0x403fff) AM_RAM AM_BASE(m_vscroll[0]) // |
| 251 | 251 | AM_RANGE(0x500000, 0x501fff) AM_DEVREADWRITE_LEGACY("pandora", pandora_spriteram_LSB_r, pandora_spriteram_LSB_w ) // sprites |
| 252 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(paletteram | |
| 252 | AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(paletteram | |
| 253 | 253 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE(sandscrp_coin_counter_w) // Coin Counters (Lockout unused) |
| 254 | 254 | AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1") |
| 255 | 255 | AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 291 | 291 | { |
| 292 | 292 | |
| 293 | 293 | m_latch1_full = 0; |
| 294 | return soundlatch_r(space,0); | |
| 294 | return soundlatch_byte_r(space,0); | |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | WRITE8_MEMBER(sandscrp_state::sandscrp_soundlatch_w) |
| 298 | 298 | { |
| 299 | 299 | |
| 300 | 300 | m_latch2_full = 1; |
| 301 | soundlatch2_w(space,0,data); | |
| 301 | soundlatch2_byte_w(space,0,data); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | static ADDRESS_MAP_START( sandscrp_soundmem, AS_PROGRAM, 8, sandscrp_state ) |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | public: |
| 50 | 50 | gpworld_state(const machine_config &mconfig, device_type type, const char *tag) |
| 51 | 51 | : driver_device(mconfig, type, tag), |
| 52 | m_laserdisc(*this, "laserdisc") { } | |
| 52 | m_laserdisc(*this, "laserdisc") , | |
| 53 | m_sprite_RAM(*this, "sprite_RAM"), | |
| 54 | m_palette_RAM(*this, "palette_RAM"), | |
| 55 | m_tile_RAM(*this, "tile_RAM"){ } | |
| 53 | 56 | |
| 54 | 57 | UINT8 m_nmi_enable; |
| 55 | 58 | UINT8 m_start_lamp; |
| 56 | 59 | UINT8 m_ldp_read_latch; |
| 57 | 60 | UINT8 m_ldp_write_latch; |
| 58 | 61 | UINT8 m_brake_gas; |
| 59 | UINT8* m_tile_RAM; | |
| 60 | UINT8* m_sprite_RAM; | |
| 61 | UINT8* m_palette_RAM; | |
| 62 | 62 | required_device<pioneer_ldv1000_device> m_laserdisc; |
| 63 | required_shared_ptr<UINT8> m_sprite_RAM; | |
| 64 | required_shared_ptr<UINT8> m_palette_RAM; | |
| 65 | required_shared_ptr<UINT8> m_tile_RAM; | |
| 63 | 66 | DECLARE_READ8_MEMBER(ldp_read); |
| 64 | 67 | DECLARE_READ8_MEMBER(pedal_in); |
| 65 | 68 | DECLARE_WRITE8_MEMBER(ldp_write); |
| r14896 | r14897 | |
| 89 | 92 | { |
| 90 | 93 | int current_screen_character = (characterY*64) + characterX; |
| 91 | 94 | |
| 92 | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_RAM[current_screen_character], | |
| 95 | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_RAM.target()[current_screen_character], | |
| 93 | 96 | characterY, 0, 0, characterX*8, characterY*8, 0); |
| 94 | 97 | } |
| 95 | 98 | } |
| r14896 | r14897 | |
| 118 | 121 | const int SPR_SKIP_HI = 5; |
| 119 | 122 | const int SPR_GFXOFS_LO = 6; |
| 120 | 123 | const int SPR_GFXOFS_HI = 7; |
| 121 | int flip = flip_screen | |
| 124 | int flip = state->flip_screen | |
| 122 | 125 | |
| 123 | 126 | int i; |
| 124 | 127 | |
| r14896 | r14897 | |
| 275 | 278 | /* This is all just a (bad) guess */ |
| 276 | 279 | int pal_index, r, g, b, a; |
| 277 | 280 | |
| 278 | m_palette_RAM[offset] = data; | |
| 281 | m_palette_RAM.target()[offset] = data; | |
| 279 | 282 | |
| 280 | 283 | /* "Round down" to the nearest palette entry */ |
| 281 | 284 | pal_index = offset & 0xffe; |
| 282 | 285 | |
| 283 | g = (m_palette_RAM[pal_index] & 0xf0) << 0; | |
| 284 | b = (m_palette_RAM[pal_index] & 0x0f) << 4; | |
| 285 | r = (m_palette_RAM[pal_index+1] & 0x0f) << 4; | |
| 286 | a = (m_palette_RAM[pal_index+1] & 0x80) ? 0 : 255; /* guess */ | |
| 286 | g = (m_palette_RAM.target()[pal_index] & 0xf0) << 0; | |
| 287 | b = (m_palette_RAM.target()[pal_index] & 0x0f) << 4; | |
| 288 | r = (m_palette_RAM.target()[pal_index+1] & 0x0f) << 4; | |
| 289 | a = (m_palette_RAM.target()[pal_index+1] & 0x80) ? 0 : 255; /* guess */ | |
| 287 | 290 | |
| 288 | 291 | /* logerror("PAL WRITE index : %x rgb : %d %d %d (real %x) at %x\n", pal_index, r,g,b, data, offset); */ |
| 289 | 292 | |
| r14896 | r14897 | |
| 293 | 296 | /* PROGRAM MAP */ |
| 294 | 297 | static ADDRESS_MAP_START( mainmem, AS_PROGRAM, 8, gpworld_state ) |
| 295 | 298 | AM_RANGE(0x0000,0xbfff) AM_ROM |
| 296 | AM_RANGE(0xc000,0xc7ff) AM_RAM AM_BASE(m_sprite_RAM) | |
| 297 | AM_RANGE(0xc800,0xcfff) AM_WRITE(palette_write) AM_BASE(m_palette_RAM) /* The memory test reads at 0xc800 */ | |
| 298 | AM_RANGE(0xd000,0xd7ff) AM_RAM AM_BASE(m_tile_RAM) | |
| 299 | AM_RANGE(0xc000,0xc7ff) AM_RAM AM_SHARE("sprite_RAM") | |
| 300 | AM_RANGE(0xc800,0xcfff) AM_WRITE(palette_write) AM_SHARE("palette_RAM") /* The memory test reads at 0xc800 */ | |
| 301 | AM_RANGE(0xd000,0xd7ff) AM_RAM AM_SHARE("tile_RAM") | |
| 299 | 302 | AM_RANGE(0xd800,0xd800) AM_READWRITE(ldp_read,ldp_write) |
| 300 | 303 | /* AM_RANGE(0xd801,0xd801) AM_READ_LEGACY(???) */ |
| 301 | 304 | AM_RANGE(0xda00,0xda00) AM_READ_PORT("INWHEEL") //8255 here.... |
| r14896 | r14897 | |
|---|---|---|
| 289 | 289 | READ8_MEMBER(homedata_state::mrokumei_sound_io_r) |
| 290 | 290 | { |
| 291 | 291 | if (m_sndbank & 4) |
| 292 | return(soundlatch_r(space, 0)); | |
| 292 | return(soundlatch_byte_r(space, 0)); | |
| 293 | 293 | else |
| 294 | 294 | return machine().region("audiocpu")->base()[0x10000 + offset + (m_sndbank & 1) * 0x10000]; |
| 295 | 295 | } |
| r14896 | r14897 | |
| 317 | 317 | |
| 318 | 318 | WRITE8_MEMBER(homedata_state::mrokumei_sound_cmd_w) |
| 319 | 319 | { |
| 320 | soundlatch_w(space, offset, data); | |
| 320 | soundlatch_byte_w(space, offset, data); | |
| 321 | 321 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 322 | 322 | } |
| 323 | 323 |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | switch (offset) |
| 56 | 56 | { |
| 57 | 57 | case 1: |
| 58 | soundlatch_w(space, 1, data & 0xff); | |
| 58 | soundlatch_byte_w(space, 1, data & 0xff); | |
| 59 | 59 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE ); |
| 60 | 60 | break; |
| 61 | 61 | |
| r14896 | r14897 | |
| 176 | 176 | AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(mugsmash_videoram1_w) AM_BASE(m_videoram1) |
| 177 | 177 | AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(mugsmash_videoram2_w) AM_BASE(m_videoram2) |
| 178 | 178 | AM_RANGE(0x0c0000, 0x0c0007) AM_WRITE(mugsmash_reg_w) AM_BASE(m_regs1) /* video registers*/ |
| 179 | AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE(paletteram | |
| 179 | AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE(paletteram | |
| 180 | 180 | AM_RANGE(0x140000, 0x140007) AM_WRITE(mugsmash_reg2_w) AM_BASE(m_regs2) /* sound + ? */ |
| 181 | 181 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* main ram? */ |
| 182 | 182 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM |
| r14896 | r14897 | |
| 196 | 196 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 197 | 197 | AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) |
| 198 | 198 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 199 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 199 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 200 | 200 | ADDRESS_MAP_END |
| 201 | 201 | |
| 202 | 202 |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | WRITE8_MEMBER(pcktgal_state::pcktgal_sound_w) |
| 42 | 42 | { |
| 43 | soundlatch_w(space, 0, data); | |
| 43 | soundlatch_byte_w(space, 0, data); | |
| 44 | 44 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 45 | 45 | } |
| 46 | 46 | |
| r14896 | r14897 | |
| 94 | 94 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3812_w) |
| 95 | 95 | AM_RANGE(0x1800, 0x1800) AM_WRITE(pcktgal_adpcm_data_w) /* ADPCM data for the MSM5205 chip */ |
| 96 | 96 | AM_RANGE(0x2000, 0x2000) AM_WRITE(pcktgal_sound_bank_w) |
| 97 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 97 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 98 | 98 | AM_RANGE(0x3400, 0x3400) AM_DEVREAD_LEGACY("msm", pcktgal_adpcm_reset_r) /* ? not sure */ |
| 99 | 99 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank3") |
| 100 | 100 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 101 | 101 | { |
| 102 | 102 | public: |
| 103 | 103 | jokrwild_state(const machine_config &mconfig, device_type type, const char *tag) |
| 104 | : driver_device(mconfig, type, tag) { } | |
| 104 | : driver_device(mconfig, type, tag) , | |
| 105 | m_videoram(*this, "videoram"), | |
| 106 | m_colorram(*this, "colorram"){ } | |
| 105 | 107 | |
| 106 | UINT8 *m_videoram; | |
| 107 | UINT8 *m_colorram; | |
| 108 | required_shared_ptr<UINT8> m_videoram; | |
| 109 | required_shared_ptr<UINT8> m_colorram; | |
| 108 | 110 | tilemap_t *m_bg_tilemap; |
| 109 | 111 | DECLARE_WRITE8_MEMBER(jokrwild_videoram_w); |
| 110 | 112 | DECLARE_WRITE8_MEMBER(jokrwild_colorram_w); |
| r14896 | r14897 | |
| 119 | 121 | |
| 120 | 122 | WRITE8_MEMBER(jokrwild_state::jokrwild_videoram_w) |
| 121 | 123 | { |
| 122 | m_videoram[offset] = data; | |
| 124 | m_videoram.target()[offset] = data; | |
| 123 | 125 | m_bg_tilemap->mark_tile_dirty(offset); |
| 124 | 126 | } |
| 125 | 127 | |
| 126 | 128 | |
| 127 | 129 | WRITE8_MEMBER(jokrwild_state::jokrwild_colorram_w) |
| 128 | 130 | { |
| 129 | m_colorram[offset] = data; | |
| 131 | m_colorram.target()[offset] = data; | |
| 130 | 132 | m_bg_tilemap->mark_tile_dirty(offset); |
| 131 | 133 | } |
| 132 | 134 | |
| r14896 | r14897 | |
| 139 | 141 | xx-- ---- bank select. |
| 140 | 142 | ---- xxxx color code. |
| 141 | 143 | */ |
| 142 | int attr = state->m_colorram[tile_index]; | |
| 143 | int code = state->m_videoram[tile_index] | ((attr & 0xc0) << 2); | |
| 144 | int attr = state->m_colorram.target()[tile_index]; | |
| 145 | int code = state->m_videoram.target()[tile_index] | ((attr & 0xc0) << 2); | |
| 144 | 146 | int color = (attr & 0x0f); |
| 145 | 147 | |
| 146 | 148 | SET_TILE_INFO( 0, code , color , 0); |
| r14896 | r14897 | |
| 193 | 195 | *************************/ |
| 194 | 196 | |
| 195 | 197 | static ADDRESS_MAP_START( jokrwild_map, AS_PROGRAM, 8, jokrwild_state ) |
| 196 | AM_RANGE(0x0000, 0x03ff) AM_RAM_WRITE(jokrwild_videoram_w) AM_ | |
| 198 | AM_RANGE(0x0000, 0x03ff) AM_RAM_WRITE(jokrwild_videoram_w) AM_ | |
| 197 | 199 | AM_RANGE(0x0400, 0x07ff) AM_RAM //FIXME: backup RAM |
| 198 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(jokrwild_colorram_w) AM_ | |
| 200 | AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(jokrwild_colorram_w) AM_ | |
| 199 | 201 | AM_RANGE(0x2400, 0x27ff) AM_RAM //stack RAM |
| 200 | 202 | AM_RANGE(0x4004, 0x4007) AM_DEVREADWRITE("pia0", pia6821_device, read, write) |
| 201 | 203 | AM_RANGE(0x4008, 0x400b) AM_DEVREADWRITE("pia1", pia6821_device, read, write) //optical sensor is here |
| r14896 | r14897 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | WRITE8_MEMBER(solomon_state::solomon_sh_command_w) |
| 15 | 15 | { |
| 16 | soundlatch_w(space, offset, data); | |
| 16 | soundlatch_byte_w(space, offset, data); | |
| 17 | 17 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 18 | 18 | } |
| 19 | 19 | |
| r14896 | r14897 | |
| 52 | 52 | AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(solomon_colorram2_w) AM_BASE(m_colorram2) |
| 53 | 53 | AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(solomon_videoram2_w) AM_BASE(m_videoram2) |
| 54 | 54 | AM_RANGE(0xe000, 0xe07f) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 55 | AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_SHARE("paletteram") | |
| 55 | AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram") | |
| 56 | 56 | AM_RANGE(0xe600, 0xe600) AM_READ_PORT("P1") |
| 57 | 57 | AM_RANGE(0xe601, 0xe601) AM_READ_PORT("P2") |
| 58 | 58 | AM_RANGE(0xe602, 0xe602) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 69 | 69 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, solomon_state ) |
| 70 | 70 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 71 | 71 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 72 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) | |
| 72 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) | |
| 73 | 73 | AM_RANGE(0xffff, 0xffff) AM_WRITENOP /* watchdog? */ |
| 74 | 74 | ADDRESS_MAP_END |
| 75 | 75 |
| r14896 | r14897 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | |
| 194 | 194 | /*Rom bankswitching*/ |
| 195 | ||
| 195 | ||
| 196 | 196 | { |
| 197 | UINT8 *rom = | |
| 197 | UINT8 *rom = | |
| 198 | 198 | |
| 199 | memory_set_bankptr( | |
| 199 | memory_set_bankptr( | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| r14896 | r14897 | |
| 289 | 289 | msm5205_vclk_w (device,(data>>4)&1); /* bit4 */ |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | ||
| 292 | ||
| 293 | 293 | { |
| 294 | gladiatr_state *state = space->machine().driver_data<gladiatr_state>(); | |
| 295 | state->soundlatch_w(*space,0,data); | |
| 296 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE); | |
| 294 | soundlatch_byte_w(*&space,0,data); | |
| 295 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE); | |
| 297 | 296 | } |
| 298 | 297 | |
| 299 | ||
| 298 | ||
| 300 | 299 | { |
| 301 | gladiatr_state *state = space->machine().driver_data<gladiatr_state>(); | |
| 302 | cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); | |
| 303 | return state->soundlatch_r(*space,0); | |
| 300 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); | |
| 301 | return soundlatch_byte_r(*&space,0); | |
| 304 | 302 | } |
| 305 | 303 | |
| 306 | ||
| 304 | ||
| 307 | 305 | { |
| 308 | flip_screen_set( | |
| 306 | flip_screen_set( | |
| 309 | 307 | } |
| 310 | 308 | |
| 311 | 309 | |
| 312 | 310 | #if 1 |
| 313 | 311 | /* !!!!! patch to IRQ timming for 2nd CPU !!!!! */ |
| 314 | ||
| 312 | ||
| 315 | 313 | { |
| 316 | cputag_set_input_line( | |
| 314 | cputag_set_input_line( | |
| 317 | 315 | } |
| 318 | 316 | #endif |
| 319 | 317 | |
| r14896 | r14897 | |
| 323 | 321 | |
| 324 | 322 | |
| 325 | 323 | |
| 326 | ||
| 324 | ||
| 327 | 325 | { |
| 328 | gladiatr_state *state = space->machine().driver_data<gladiatr_state>(); | |
| 329 | 326 | if(!offset) |
| 330 | 327 | { |
| 331 | state->m_data2=data; | |
| 332 | state->m_flag2=1; | |
| 328 | m_data2=data; | |
| 329 | m_flag2=1; | |
| 333 | 330 | } |
| 334 | 331 | } |
| 335 | 332 | |
| 336 | ||
| 333 | ||
| 337 | 334 | { |
| 338 | gladiatr_state *state = space->machine().driver_data<gladiatr_state>(); | |
| 339 | 335 | if(!offset) |
| 340 | 336 | { |
| 341 | state->m_data1=data; | |
| 342 | state->m_flag1=1; | |
| 337 | m_data1=data; | |
| 338 | m_flag1=1; | |
| 343 | 339 | } |
| 344 | 340 | } |
| 345 | 341 | |
| 346 | ||
| 342 | ||
| 347 | 343 | |
| 348 | ||
| 344 | ||
| 349 | 345 | |
| 350 | ||
| 346 | ||
| 351 | 347 | |
| 352 | ||
| 348 | ||
| 353 | 349 | |
| 354 | ||
| 350 | ||
| 355 | 351 | { |
| 356 | gladiatr_state *state = space->machine().driver_data<gladiatr_state>(); | |
| 357 | 352 | if(!offset) |
| 358 | return | |
| 353 | return | |
| 359 | 354 | else |
| 360 | return | |
| 355 | return | |
| 361 | 356 | } |
| 362 | 357 | |
| 363 | ||
| 358 | ||
| 364 | 359 | { |
| 365 | gladiatr_state *state = space->machine().driver_data<gladiatr_state>(); | |
| 366 | 360 | if(!offset) |
| 367 | return | |
| 361 | return | |
| 368 | 362 | else |
| 369 | return | |
| 363 | return | |
| 370 | 364 | } |
| 371 | 365 | |
| 372 | 366 | static MACHINE_RESET( ppking ) |
| r14896 | r14897 | |
| 397 | 391 | // ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 398 | 392 | AM_RANGE(0xc000, 0xc000) AM_WRITE(gladiatr_spritebuffer_w) |
| 399 | 393 | AM_RANGE(0xc004, 0xc004) AM_NOP // WRITE(ppking_irq_patch_w) |
| 400 | AM_RANGE(0xc09e, 0xc09f) AM_READ | |
| 394 | AM_RANGE(0xc09e, 0xc09f) AM_READ | |
| 401 | 395 | AM_RANGE(0xc0bf, 0xc0bf) AM_NOP |
| 402 | 396 | ADDRESS_MAP_END |
| 403 | 397 | |
| 404 | 398 | static ADDRESS_MAP_START( ppking_cpu2_io, AS_IO, 8, gladiatr_state ) |
| 405 | 399 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 406 | 400 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 407 | AM_RANGE(0x20, 0x21) AM_READ | |
| 401 | AM_RANGE(0x20, 0x21) AM_READ | |
| 408 | 402 | AM_RANGE(0x40, 0x40) AM_READNOP |
| 409 | AM_RANGE(0x60, 0x61) AM_READ_LEGACY(qx2_r) AM_WRITE_LEGACY(qx2_w) | |
| 410 | AM_RANGE(0x80, 0x81) AM_READ_LEGACY(qx3_r) AM_WRITE_LEGACY(qx3_w) | |
| 403 | AM_RANGE(0x60, 0x61) AM_READWRITE(qx2_r,qx2_w) | |
| 404 | AM_RANGE(0x80, 0x81) AM_READWRITE(qx3_r,qx3_w) | |
| 411 | 405 | ADDRESS_MAP_END |
| 412 | 406 | |
| 413 | 407 | |
| r14896 | r14897 | |
| 432 | 426 | |
| 433 | 427 | static ADDRESS_MAP_START( gladiatr_cpu3_map, AS_PROGRAM, 8, gladiatr_state ) |
| 434 | 428 | AM_RANGE(0x1000, 0x1fff) AM_DEVWRITE_LEGACY("msm", glad_adpcm_w) |
| 435 | AM_RANGE(0x2000, 0x2fff) AM_READ | |
| 429 | AM_RANGE(0x2000, 0x2fff) AM_READ | |
| 436 | 430 | AM_RANGE(0x4000, 0xffff) AM_ROMBANK("bank2") |
| 437 | 431 | ADDRESS_MAP_END |
| 438 | 432 | |
| r14896 | r14897 | |
| 441 | 435 | // ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 442 | 436 | AM_RANGE(0xc000, 0xc000) AM_WRITE(gladiatr_spritebuffer_w) |
| 443 | 437 | AM_RANGE(0xc001, 0xc001) AM_WRITE(gladiatr_spritebank_w) |
| 444 | AM_RANGE(0xc002, 0xc002) AM_WRITE_LEGACY(gladiatr_bankswitch_w) | |
| 445 | AM_RANGE(0xc004, 0xc004) AM_WRITE_LEGACY(gladiatr_irq_patch_w) /* !!! patch to 2nd CPU IRQ !!! */ | |
| 446 | AM_RANGE(0xc007, 0xc007) AM_WRITE_LEGACY(gladiatr_flipscreen_w) | |
| 438 | AM_RANGE(0xc002, 0xc002) AM_WRITE(gladiatr_bankswitch_w) | |
| 439 | AM_RANGE(0xc004, 0xc004) AM_WRITE(gladiatr_irq_patch_w) /* !!! patch to 2nd CPU IRQ !!! */ | |
| 440 | AM_RANGE(0xc007, 0xc007) AM_WRITE(gladiatr_flipscreen_w) | |
| 447 | 441 | AM_RANGE(0xc09e, 0xc09f) AM_READWRITE_LEGACY(TAITO8741_0_r, TAITO8741_0_w) |
| 448 | 442 | AM_RANGE(0xc0bf, 0xc0bf) AM_NOP // watchdog_reset_w doesn't work |
| 449 | 443 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 456 | 450 | AM_RANGE(0x60, 0x61) AM_READWRITE_LEGACY(TAITO8741_2_r, TAITO8741_2_w) |
| 457 | 451 | AM_RANGE(0x80, 0x81) AM_READWRITE_LEGACY(TAITO8741_3_r, TAITO8741_3_w) |
| 458 | 452 | AM_RANGE(0xa0, 0xa7) AM_NOP // filters on sound output |
| 459 | AM_RANGE(0xe0, 0xe0) AM_WRITE | |
| 453 | AM_RANGE(0xe0, 0xe0) AM_WRITE | |
| 460 | 454 | ADDRESS_MAP_END |
| 461 | 455 | |
| 462 | 456 | |
| r14896 | r14897 | |
| 998 | 992 | } |
| 999 | 993 | |
| 1000 | 994 | |
| 1001 | ||
| 995 | ||
| 1002 | 996 | { |
| 1003 | gladiatr_state *state = space->machine().driver_data<gladiatr_state>(); | |
| 1004 | if(cpu_get_previouspc(&space->device())==0x8e) | |
| 1005 | state->m_nvram[0x6a3]=1; | |
| 997 | if(cpu_get_previouspc(&space.device())==0x8e) | |
| 998 | m_nvram[0x6a3]=1; | |
| 1006 | 999 | |
| 1007 | return | |
| 1000 | return | |
| 1008 | 1001 | } |
| 1009 | 1002 | |
| 1010 | 1003 | static DRIVER_INIT(ppking) |
| r14896 | r14897 | |
| 1029 | 1022 | rom[i+2*j*0x2000] = rom[i+j*0x2000]; |
| 1030 | 1023 | } |
| 1031 | 1024 | } |
| 1032 | ||
| 1033 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf6a3,0xf6a3,FUNC(f6a3_r) ); | |
| 1025 | gladiatr_state *state = machine.driver_data<gladiatr_state>(); | |
| 1026 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xf6a3,0xf6a3,read8_delegate(FUNC(gladiatr_state::f6a3_r),state)); | |
| 1034 | 1027 | } |
| 1035 | 1028 | |
| 1036 | 1029 |
| r14896 | r14897 | |
|---|---|---|
| 87 | 87 | public: |
| 88 | 88 | imolagp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 89 | 89 | : driver_device(mconfig, type, tag), |
| 90 | m_maincpu(*this,"maincpu") | |
| 91 | { } | |
| 90 | m_maincpu(*this,"maincpu"), | |
| 91 | m_slave_workram(*this, "slave_workram"){ } | |
| 92 | 92 | |
| 93 | UINT8 *m_slave_workram; // used only ifdef HLE_COM | |
| 93 | required_device<cpu_device> m_maincpu; | |
| 94 | required_shared_ptr<UINT8> m_slave_workram; // used only ifdef HLE_COM | |
| 94 | 95 | |
| 95 | 96 | #ifdef HLE_COM |
| 96 | 97 | UINT8 m_mComData[0x100]; |
| r14896 | r14897 | |
| 112 | 113 | /* memory */ |
| 113 | 114 | UINT8 m_videoram[3][0x4000]; |
| 114 | 115 | |
| 115 | required_device<cpu_device> m_maincpu; | |
| 116 | 116 | DECLARE_WRITE8_MEMBER(transmit_data_w); |
| 117 | 117 | DECLARE_READ8_MEMBER(trigger_slave_nmi_r); |
| 118 | 118 | DECLARE_READ8_MEMBER(receive_data_r); |
| r14896 | r14897 | |
| 387 | 387 | AM_RANGE(0x0800, 0x0bff) AM_ROM |
| 388 | 388 | AM_RANGE(0x1000, 0x13ff) AM_ROM |
| 389 | 389 | AM_RANGE(0x1c00, 0x3fff) AM_ROM |
| 390 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_ | |
| 390 | AM_RANGE(0x4000, 0x43ff) AM_RAM AM_ | |
| 391 | 391 | AM_RANGE(0x9fff, 0xa000) AM_READ(receive_data_r) |
| 392 | 392 | AM_RANGE(0xc000, 0xffff) AM_WRITE(screenram_w) |
| 393 | 393 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 496 | 496 | imolagp_state *state = device->machine().driver_data<imolagp_state>(); |
| 497 | 497 | |
| 498 | 498 | #ifdef HLE_COM |
| 499 | memcpy(&state->m_slave_workram[0x80], state->m_mComData, state->m_mComCount); | |
| 499 | memcpy(&state->m_slave_workram.target()[0x80], state->m_mComData, state->m_mComCount); | |
| 500 | 500 | state->m_mComCount = 0; |
| 501 | 501 | #endif |
| 502 | 502 | device_set_input_line(device, 0, HOLD_LINE); |
| r14896 | r14897 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | 21 | poker72_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | : driver_device(mconfig, type, tag) { } | |
| 22 | : driver_device(mconfig, type, tag) , | |
| 23 | m_vram(*this, "vram"), | |
| 24 | m_pal(*this, "pal"){ } | |
| 23 | 25 | |
| 24 | UINT8 *m_vram; | |
| 25 | UINT8 *m_pal; | |
| 26 | required_shared_ptr<UINT8> m_vram; | |
| 27 | required_shared_ptr<UINT8> m_pal; | |
| 26 | 28 | UINT8 m_tile_bank; |
| 27 | 29 | DECLARE_WRITE8_MEMBER(poker72_paletteram_w); |
| 28 | 30 | DECLARE_WRITE8_MEMBER(output_w); |
| r14896 | r14897 | |
| 45 | 47 | { |
| 46 | 48 | for (x=0;x<64;x++) |
| 47 | 49 | { |
| 48 | int tile = ((state->m_vram[count+1] & 0x0f) << 8 ) | (state->m_vram[count+0] & 0xff); //TODO: tile bank | |
| 49 | int fx = (state->m_vram[count+1] & 0x10); | |
| 50 | int fy = (state->m_vram[count+1] & 0x20); | |
| 51 | int color = (state->m_vram[count+1] & 0xc0) >> 6; | |
| 50 | int tile = ((state->m_vram.target()[count+1] & 0x0f) << 8 ) | (state->m_vram.target()[count+0] & 0xff); //TODO: tile bank | |
| 51 | int fx = (state->m_vram.target()[count+1] & 0x10); | |
| 52 | int fy = (state->m_vram.target()[count+1] & 0x20); | |
| 53 | int color = (state->m_vram.target()[count+1] & 0xc0) >> 6; | |
| 52 | 54 | |
| 53 | 55 | tile|= state->m_tile_bank << 12; |
| 54 | 56 | |
| r14896 | r14897 | |
| 64 | 66 | WRITE8_MEMBER(poker72_state::poker72_paletteram_w) |
| 65 | 67 | { |
| 66 | 68 | int r,g,b; |
| 67 | m_pal[offset] = data; | |
| 69 | m_pal.target()[offset] = data; | |
| 68 | 70 | |
| 69 | r = m_pal[(offset & 0x3ff)+0x000] & 0x3f; | |
| 70 | g = m_pal[(offset & 0x3ff)+0x400] & 0x3f; | |
| 71 | b = m_pal[(offset & 0x3ff)+0x800] & 0x3f; | |
| 71 | r = m_pal.target()[(offset & 0x3ff)+0x000] & 0x3f; | |
| 72 | g = m_pal.target()[(offset & 0x3ff)+0x400] & 0x3f; | |
| 73 | b = m_pal.target()[(offset & 0x3ff)+0x800] & 0x3f; | |
| 72 | 74 | |
| 73 | 75 | palette_set_color_rgb( machine(), offset & 0x3ff, pal6bit(r), pal6bit(g), pal6bit(b)); |
| 74 | 76 | } |
| r14896 | r14897 | |
| 96 | 98 | static ADDRESS_MAP_START( poker72_map, AS_PROGRAM, 8, poker72_state ) |
| 97 | 99 | AM_RANGE(0x0000, 0xbfff) AM_ROMBANK("bank1") |
| 98 | 100 | AM_RANGE(0xc000, 0xdfff) AM_RAM //work ram |
| 99 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_BASE(m_vram) | |
| 100 | AM_RANGE(0xf000, 0xfbff) AM_RAM_WRITE(poker72_paletteram_w) AM_BASE(m_pal) | |
| 101 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("vram") | |
| 102 | AM_RANGE(0xf000, 0xfbff) AM_RAM_WRITE(poker72_paletteram_w) AM_SHARE("pal") | |
| 101 | 103 | AM_RANGE(0xfc00, 0xfdff) AM_RAM //??? |
| 102 | 104 | AM_RANGE(0xfe08, 0xfe08) AM_READ_PORT("IN0") |
| 103 | 105 | AM_RANGE(0xfe09, 0xfe09) AM_READ_PORT("IN1") |
| r14896 | r14897 | |
|---|---|---|
| 34 | 34 | machine().tilemap().mark_all_dirty(); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | flip_screen_set( | |
| 37 | flip_screen_set( | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| r14896 | r14897 | |
| 85 | 85 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 86 | 86 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 87 | 87 | AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_BASE(m_ram) |
| 88 | AM_RANGE(0xc800, 0xc800) AM_READNOP AM_WRITE(soundlatch_w) // watchdog? | |
| 88 | AM_RANGE(0xc800, 0xc800) AM_READNOP AM_WRITE(soundlatch_byte_w) // watchdog? | |
| 89 | 89 | AM_RANGE(0xc810, 0xc810) AM_WRITE(goindol_bankswitch_w) |
| 90 | 90 | AM_RANGE(0xc820, 0xc820) AM_READ_PORT("DIAL") |
| 91 | 91 | AM_RANGE(0xc820, 0xd820) AM_WRITEONLY AM_BASE(m_fg_scrolly) |
| r14896 | r14897 | |
| 111 | 111 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 112 | 112 | AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ymsnd", ym2203_w) |
| 113 | 113 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 114 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r) | |
| 114 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) | |
| 115 | 115 | ADDRESS_MAP_END |
| 116 | 116 | |
| 117 | 117 |
| r14896 | r14897 | |
|---|---|---|
| 26 | 26 | { |
| 27 | 27 | public: |
| 28 | 28 | umipoker_state(const machine_config &mconfig, device_type type, const char *tag) |
| 29 | : driver_device(mconfig, type, tag) { } | |
| 29 | : driver_device(mconfig, type, tag) , | |
| 30 | m_vram_0(*this, "vra0"), | |
| 31 | m_vram_1(*this, "vra1"), | |
| 32 | m_vram_2(*this, "vra2"), | |
| 33 | m_vram_3(*this, "vra3"), | |
| 34 | m_z80_wram(*this, "z80_wram"){ } | |
| 30 | 35 | |
| 31 | UINT16 *m_vram_0; | |
| 32 | UINT16 *m_vram_1; | |
| 33 | UINT16 *m_vram_2; | |
| 34 | UINT16 *m_vram_3; | |
| 36 | required_shared_ptr<UINT16> m_vram_0; | |
| 37 | required_shared_ptr<UINT16> m_vram_1; | |
| 38 | required_shared_ptr<UINT16> m_vram_2; | |
| 39 | required_shared_ptr<UINT16> m_vram_3; | |
| 35 | 40 | tilemap_t *m_tilemap_0; |
| 36 | 41 | tilemap_t *m_tilemap_1; |
| 37 | 42 | tilemap_t *m_tilemap_2; |
| 38 | 43 | tilemap_t *m_tilemap_3; |
| 39 | UINT8 | |
| 44 | required_shared_ptr<UINT8> | |
| 40 | 45 | int m_umipoker_scrolly[4]; |
| 41 | 46 | DECLARE_READ8_MEMBER(z80_rom_readback_r); |
| 42 | 47 | DECLARE_READ8_MEMBER(z80_shared_ram_r); |
| r14896 | r14897 | |
| 58 | 63 | static TILE_GET_INFO( get_tile_info_0 ) |
| 59 | 64 | { |
| 60 | 65 | umipoker_state *state = machine.driver_data<umipoker_state>(); |
| 61 | int tile = state->m_vram_0[tile_index*2+0]; | |
| 62 | int color = state->m_vram_0[tile_index*2+1] & 0x3f; | |
| 66 | int tile = state->m_vram_0.target()[tile_index*2+0]; | |
| 67 | int color = state->m_vram_0.target()[tile_index*2+1] & 0x3f; | |
| 63 | 68 | |
| 64 | 69 | SET_TILE_INFO( |
| 65 | 70 | 0, |
| r14896 | r14897 | |
| 71 | 76 | static TILE_GET_INFO( get_tile_info_1 ) |
| 72 | 77 | { |
| 73 | 78 | umipoker_state *state = machine.driver_data<umipoker_state>(); |
| 74 | int tile = state->m_vram_1[tile_index*2+0]; | |
| 75 | int color = state->m_vram_1[tile_index*2+1] & 0x3f; | |
| 79 | int tile = state->m_vram_1.target()[tile_index*2+0]; | |
| 80 | int color = state->m_vram_1.target()[tile_index*2+1] & 0x3f; | |
| 76 | 81 | |
| 77 | 82 | SET_TILE_INFO( |
| 78 | 83 | 0, |
| r14896 | r14897 | |
| 84 | 89 | static TILE_GET_INFO( get_tile_info_2 ) |
| 85 | 90 | { |
| 86 | 91 | umipoker_state *state = machine.driver_data<umipoker_state>(); |
| 87 | int tile = state->m_vram_2[tile_index*2+0]; | |
| 88 | int color = state->m_vram_2[tile_index*2+1] & 0x3f; | |
| 92 | int tile = state->m_vram_2.target()[tile_index*2+0]; | |
| 93 | int color = state->m_vram_2.target()[tile_index*2+1] & 0x3f; | |
| 89 | 94 | |
| 90 | 95 | SET_TILE_INFO( |
| 91 | 96 | 0, |
| r14896 | r14897 | |
| 97 | 102 | static TILE_GET_INFO( get_tile_info_3 ) |
| 98 | 103 | { |
| 99 | 104 | umipoker_state *state = machine.driver_data<umipoker_state>(); |
| 100 | int tile = state->m_vram_3[tile_index*2+0]; | |
| 101 | int color = state->m_vram_3[tile_index*2+1] & 0x3f; | |
| 105 | int tile = state->m_vram_3.target()[tile_index*2+0]; | |
| 106 | int color = state->m_vram_3.target()[tile_index*2+1] & 0x3f; | |
| 102 | 107 | |
| 103 | 108 | SET_TILE_INFO( |
| 104 | 109 | 0, |
| r14896 | r14897 | |
| 154 | 159 | |
| 155 | 160 | machine().scheduler().synchronize(); // force resync |
| 156 | 161 | |
| 157 | return m_z80_wram[offset]; | |
| 162 | return m_z80_wram.target()[offset]; | |
| 158 | 163 | } |
| 159 | 164 | |
| 160 | 165 | WRITE8_MEMBER(umipoker_state::z80_shared_ram_w) |
| r14896 | r14897 | |
| 162 | 167 | |
| 163 | 168 | machine().scheduler().synchronize(); // force resync |
| 164 | 169 | |
| 165 | m_z80_wram[offset] = data; | |
| 170 | m_z80_wram.target()[offset] = data; | |
| 166 | 171 | } |
| 167 | 172 | |
| 168 | 173 | WRITE16_MEMBER(umipoker_state::umipoker_irq_ack_w) |
| r14896 | r14897 | |
| 182 | 187 | WRITE16_MEMBER(umipoker_state::umipoker_vram_0_w) |
| 183 | 188 | { |
| 184 | 189 | |
| 185 | COMBINE_DATA(&m_vram_0[offset]); | |
| 190 | COMBINE_DATA(&m_vram_0.target()[offset]); | |
| 186 | 191 | m_tilemap_0->mark_tile_dirty(offset >> 1); |
| 187 | 192 | } |
| 188 | 193 | |
| 189 | 194 | WRITE16_MEMBER(umipoker_state::umipoker_vram_1_w) |
| 190 | 195 | { |
| 191 | 196 | |
| 192 | COMBINE_DATA(&m_vram_1[offset]); | |
| 197 | COMBINE_DATA(&m_vram_1.target()[offset]); | |
| 193 | 198 | m_tilemap_1->mark_tile_dirty(offset >> 1); |
| 194 | 199 | } |
| 195 | 200 | |
| r14896 | r14897 | |
| 197 | 202 | WRITE16_MEMBER(umipoker_state::umipoker_vram_2_w) |
| 198 | 203 | { |
| 199 | 204 | |
| 200 | COMBINE_DATA(&m_vram_2[offset]); | |
| 205 | COMBINE_DATA(&m_vram_2.target()[offset]); | |
| 201 | 206 | m_tilemap_2->mark_tile_dirty(offset >> 1); |
| 202 | 207 | } |
| 203 | 208 | |
| 204 | 209 | WRITE16_MEMBER(umipoker_state::umipoker_vram_3_w) |
| 205 | 210 | { |
| 206 | 211 | |
| 207 | COMBINE_DATA(&m_vram_3[offset]); | |
| 212 | COMBINE_DATA(&m_vram_3.target()[offset]); | |
| 208 | 213 | m_tilemap_3->mark_tile_dirty(offset >> 1); |
| 209 | 214 | } |
| 210 | 215 | |
| r14896 | r14897 | |
| 305 | 310 | ADDRESS_MAP_UNMAP_LOW |
| 306 | 311 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 307 | 312 | AM_RANGE(0x400000, 0x403fff) AM_RAM AM_SHARE("nvram") |
| 308 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") // Palette | |
| 309 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(umipoker_vram_0_w) AM_BASE(m_vram_0) | |
| 310 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(umipoker_vram_1_w) AM_BASE(m_vram_1) | |
| 311 | AM_RANGE(0x804000, 0x805fff) AM_RAM_WRITE(umipoker_vram_2_w) AM_BASE(m_vram_2) | |
| 312 | AM_RANGE(0x806000, 0x807fff) AM_RAM_WRITE(umipoker_vram_3_w) AM_BASE(m_vram_3) | |
| 313 | AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") // Palette | |
| 314 | AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(umipoker_vram_0_w) AM_SHARE("vra0") | |
| 315 | AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(umipoker_vram_1_w) AM_SHARE("vra1") | |
| 316 | AM_RANGE(0x804000, 0x805fff) AM_RAM_WRITE(umipoker_vram_2_w) AM_SHARE("vra2") | |
| 317 | AM_RANGE(0x806000, 0x807fff) AM_RAM_WRITE(umipoker_vram_3_w) AM_SHARE("vra3") | |
| 313 | 318 | AM_RANGE(0xc00000, 0xc0ffff) AM_READ8(z80_rom_readback_r,0x00ff) |
| 314 | 319 | AM_RANGE(0xc1f000, 0xc1ffff) AM_READWRITE8(z80_shared_ram_r,z80_shared_ram_w,0x00ff) |
| 315 | 320 | AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("IN0") |
| r14896 | r14897 | |
| 329 | 334 | |
| 330 | 335 | static ADDRESS_MAP_START( umipoker_audio_map, AS_PROGRAM, 8, umipoker_state ) |
| 331 | 336 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 332 | AM_RANGE(0xf800, 0xffff) AM_READWRITE(z80_shared_ram_r,z80_shared_ram_w) AM_ | |
| 337 | AM_RANGE(0xf800, 0xffff) AM_READWRITE(z80_shared_ram_r,z80_shared_ram_w) AM_ | |
| 333 | 338 | ADDRESS_MAP_END |
| 334 | 339 | |
| 335 | 340 | static ADDRESS_MAP_START( umipoker_audio_io_map, AS_IO, 8, umipoker_state ) |
| r14896 | r14897 | |
|---|---|---|
| 164 | 164 | AM_RANGE(0xc0a0, 0xc0a0) AM_READ_PORT("P1") |
| 165 | 165 | AM_RANGE(0xc0c0, 0xc0c0) AM_READ_PORT("P2") |
| 166 | 166 | AM_RANGE(0xc0e0, 0xc0e0) AM_READ_PORT("DSW1") |
| 167 | AM_RANGE(0xc100, 0xc100) AM_READ_PORT("DSW3") AM_WRITE(soundlatch_w) | |
| 167 | AM_RANGE(0xc100, 0xc100) AM_READ_PORT("DSW3") AM_WRITE(soundlatch_byte_w) | |
| 168 | 168 | AM_RANGE(0xc180, 0xc180) AM_WRITE(master_nmi_mask_w) |
| 169 | 169 | AM_RANGE(0xc185, 0xc185) AM_WRITEONLY AM_BASE(m_flipscreen) |
| 170 | 170 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 182 | 182 | static ADDRESS_MAP_START( audio_cpu1_map, AS_PROGRAM, 8, gyruss_state ) |
| 183 | 183 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 184 | 184 | AM_RANGE(0x6000, 0x63ff) AM_RAM |
| 185 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_r) | |
| 185 | AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r) | |
| 186 | 186 | ADDRESS_MAP_END |
| 187 | 187 | |
| 188 | 188 | static ADDRESS_MAP_START( audio_cpu1_io_map, AS_IO, 8, gyruss_state ) |
| r14896 | r14897 | |
| 203 | 203 | AM_RANGE(0x11, 0x11) AM_DEVREAD_LEGACY("ay5", ay8910_r) |
| 204 | 204 | AM_RANGE(0x12, 0x12) AM_DEVWRITE_LEGACY("ay5", ay8910_data_w) |
| 205 | 205 | AM_RANGE(0x14, 0x14) AM_WRITE(gyruss_i8039_irq_w) |
| 206 | AM_RANGE(0x18, 0x18) AM_WRITE(soundlatch2_w) | |
| 206 | AM_RANGE(0x18, 0x18) AM_WRITE(soundlatch2_byte_w) | |
| 207 | 207 | ADDRESS_MAP_END |
| 208 | 208 | |
| 209 | 209 | static ADDRESS_MAP_START( audio_cpu2_map, AS_PROGRAM, 8, gyruss_state ) |
| r14896 | r14897 | |
| 211 | 211 | ADDRESS_MAP_END |
| 212 | 212 | |
| 213 | 213 | static ADDRESS_MAP_START( audio_cpu2_io_map, AS_IO, 8, gyruss_state ) |
| 214 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_r) | |
| 214 | AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_byte_r) | |
| 215 | 215 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("discrete", gyruss_dac_w) |
| 216 | 216 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(gyruss_irq_clear_w) |
| 217 | 217 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 81 | 81 | { |
| 82 | 82 | public: |
| 83 | 83 | gamecstl_state(const machine_config &mconfig, device_type type, const char *tag) |
| 84 | : driver_device(mconfig, type, tag) { } | |
| 84 | : driver_device(mconfig, type, tag) , | |
| 85 | m_cga_ram(*this, "cga_ram"){ } | |
| 85 | 86 | |
| 86 | UINT32 | |
| 87 | required_shared_ptr<UINT32> | |
| 87 | 88 | UINT32 *m_bios_ram; |
| 88 | 89 | UINT8 m_mxtc_config_reg[256]; |
| 89 | 90 | UINT8 m_piix4_config_reg[4][256]; |
| r14896 | r14897 | |
| 96 | 97 | device_t *m_pic8259_2; |
| 97 | 98 | device_t *m_dma8237_1; |
| 98 | 99 | device_t *m_dma8237_2; |
| 100 | DECLARE_WRITE32_MEMBER(pnp_config_w); | |
| 101 | DECLARE_WRITE32_MEMBER(pnp_data_w); | |
| 102 | DECLARE_WRITE32_MEMBER(bios_ram_w); | |
| 103 | DECLARE_READ8_MEMBER(at_page8_r); | |
| 104 | DECLARE_WRITE8_MEMBER(at_page8_w); | |
| 105 | DECLARE_READ8_MEMBER(pc_dma_read_byte); | |
| 106 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); | |
| 99 | 107 | }; |
| 100 | 108 | |
| 101 | 109 | |
| r14896 | r14897 | |
| 144 | 152 | gamecstl_state *state = screen.machine().driver_data<gamecstl_state>(); |
| 145 | 153 | int i, j; |
| 146 | 154 | const gfx_element *gfx = screen.machine().gfx[0]; |
| 147 | UINT32 *cga = state->m_cga_ram; | |
| 155 | UINT32 *cga = state->m_cga_ram.target(); | |
| 148 | 156 | int index = 0; |
| 149 | 157 | |
| 150 | 158 | bitmap.fill(0, cliprect); |
| r14896 | r14897 | |
| 333 | 341 | } |
| 334 | 342 | |
| 335 | 343 | // ISA Plug-n-Play |
| 336 | ||
| 344 | ||
| 337 | 345 | { |
| 338 | 346 | if (ACCESSING_BITS_8_15) |
| 339 | 347 | { |
| r14896 | r14897 | |
| 341 | 349 | } |
| 342 | 350 | } |
| 343 | 351 | |
| 344 | ||
| 352 | ||
| 345 | 353 | { |
| 346 | 354 | if (ACCESSING_BITS_8_15) |
| 347 | 355 | { |
| r14896 | r14897 | |
| 374 | 382 | |
| 375 | 383 | |
| 376 | 384 | |
| 377 | ||
| 385 | ||
| 378 | 386 | { |
| 379 | gamecstl_state *state = space->machine().driver_data<gamecstl_state>(); | |
| 380 | if (state->m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled | |
| 387 | if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled | |
| 381 | 388 | { |
| 382 | COMBINE_DATA( | |
| 389 | COMBINE_DATA( | |
| 383 | 390 | } |
| 384 | 391 | } |
| 385 | 392 | |
| r14896 | r14897 | |
| 392 | 399 | |
| 393 | 400 | |
| 394 | 401 | |
| 395 | ||
| 402 | ||
| 396 | 403 | { |
| 397 | gamecstl_state *state = space->machine().driver_data<gamecstl_state>(); | |
| 398 | UINT8 data = state->m_at_pages[offset % 0x10]; | |
| 404 | UINT8 data = m_at_pages[offset % 0x10]; | |
| 399 | 405 | |
| 400 | 406 | switch(offset % 8) |
| 401 | 407 | { |
| 402 | 408 | case 1: |
| 403 | data = | |
| 409 | data = | |
| 404 | 410 | break; |
| 405 | 411 | case 2: |
| 406 | data = | |
| 412 | data = | |
| 407 | 413 | break; |
| 408 | 414 | case 3: |
| 409 | data = | |
| 415 | data = | |
| 410 | 416 | break; |
| 411 | 417 | case 7: |
| 412 | data = | |
| 418 | data = | |
| 413 | 419 | break; |
| 414 | 420 | } |
| 415 | 421 | return data; |
| 416 | 422 | } |
| 417 | 423 | |
| 418 | 424 | |
| 419 | ||
| 425 | ||
| 420 | 426 | { |
| 421 | gamecstl_state *state = space->machine().driver_data<gamecstl_state>(); | |
| 422 | state->m_at_pages[offset % 0x10] = data; | |
| 427 | m_at_pages[offset % 0x10] = data; | |
| 423 | 428 | |
| 424 | 429 | switch(offset % 8) |
| 425 | 430 | { |
| 426 | 431 | case 1: |
| 427 | | |
| 432 | | |
| 428 | 433 | break; |
| 429 | 434 | case 2: |
| 430 | | |
| 435 | | |
| 431 | 436 | break; |
| 432 | 437 | case 3: |
| 433 | | |
| 438 | | |
| 434 | 439 | break; |
| 435 | 440 | case 7: |
| 436 | | |
| 441 | | |
| 437 | 442 | break; |
| 438 | 443 | } |
| 439 | 444 | } |
| r14896 | r14897 | |
| 448 | 453 | } |
| 449 | 454 | |
| 450 | 455 | |
| 451 | ||
| 456 | ||
| 452 | 457 | { |
| 453 | gamecstl_state *state = space->machine().driver_data<gamecstl_state>(); | |
| 454 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 458 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 455 | 459 | & 0xFF0000; |
| 456 | 460 | |
| 457 | return space | |
| 461 | return space. | |
| 458 | 462 | } |
| 459 | 463 | |
| 460 | 464 | |
| 461 | ||
| 465 | ||
| 462 | 466 | { |
| 463 | gamecstl_state *state = space->machine().driver_data<gamecstl_state>(); | |
| 464 | offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16) | |
| 467 | offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) | |
| 465 | 468 | & 0xFF0000; |
| 466 | 469 | |
| 467 | space | |
| 470 | space. | |
| 468 | 471 | } |
| 469 | 472 | |
| 470 | 473 | static void set_dma_channel(device_t *device, int channel, int state) |
| r14896 | r14897 | |
| 482 | 485 | { |
| 483 | 486 | DEVCB_LINE(pc_dma_hrq_changed), |
| 484 | 487 | DEVCB_NULL, |
| 485 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 486 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 488 | DEVCB_DRIVER_MEMBER(gamecstl_state, pc_dma_read_byte), | |
| 489 | DEVCB_DRIVER_MEMBER(gamecstl_state, pc_dma_write_byte), | |
| 487 | 490 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 488 | 491 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, |
| 489 | 492 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } |
| r14896 | r14897 | |
| 500 | 503 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL } |
| 501 | 504 | }; |
| 502 | 505 | |
| 503 | static READ32_HANDLER(at_page32_r) | |
| 504 | { | |
| 505 | return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask); | |
| 506 | } | |
| 507 | 506 | |
| 508 | 507 | |
| 509 | static WRITE32_HANDLER(at_page32_w) | |
| 510 | { | |
| 511 | write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask); | |
| 512 | } | |
| 513 | ||
| 514 | ||
| 515 | 508 | /*****************************************************************************/ |
| 516 | 509 | |
| 517 | 510 | static ADDRESS_MAP_START( gamecstl_map, AS_PROGRAM, 32, gamecstl_state ) |
| 518 | 511 | AM_RANGE(0x00000000, 0x0009ffff) AM_RAM |
| 519 | 512 | AM_RANGE(0x000a0000, 0x000affff) AM_RAM |
| 520 | AM_RANGE(0x000b0000, 0x000b7fff) AM_RAM AM_ | |
| 513 | AM_RANGE(0x000b0000, 0x000b7fff) AM_RAM AM_ | |
| 521 | 514 | AM_RANGE(0x000e0000, 0x000effff) AM_RAM |
| 522 | 515 | AM_RANGE(0x000f0000, 0x000fffff) AM_ROMBANK("bank1") |
| 523 | AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE | |
| 516 | AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE | |
| 524 | 517 | AM_RANGE(0x00100000, 0x01ffffff) AM_RAM |
| 525 | 518 | AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("bios", 0) /* System BIOS */ |
| 526 | 519 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 531 | 524 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 532 | 525 | AM_RANGE(0x0060, 0x006f) AM_READWRITE_LEGACY(kbdc8042_32le_r, kbdc8042_32le_w) |
| 533 | 526 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("rtc", mc146818_device, read, write, 0xffffffff) |
| 534 | AM_RANGE(0x0080, 0x009f) AM_READWRITE | |
| 527 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8 | |
| 535 | 528 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8_LEGACY("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) |
| 536 | 529 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE_LEGACY("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w) |
| 537 | 530 | AM_RANGE(0x00e8, 0x00eb) AM_NOP |
| r14896 | r14897 | |
| 539 | 532 | AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE_LEGACY("ide", ide_r, ide_w) |
| 540 | 533 | AM_RANGE(0x0300, 0x03af) AM_NOP |
| 541 | 534 | AM_RANGE(0x03b0, 0x03df) AM_NOP |
| 542 | AM_RANGE(0x0278, 0x027b) AM_WRITE | |
| 535 | AM_RANGE(0x0278, 0x027b) AM_WRITE | |
| 543 | 536 | AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE_LEGACY("ide", fdc_r, fdc_w) |
| 544 | AM_RANGE(0x0a78, 0x0a7b) AM_WRITE | |
| 537 | AM_RANGE(0x0a78, 0x0a7b) AM_WRITE | |
| 545 | 538 | AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE_LEGACY("pcibus", pci_32le_r, pci_32le_w) |
| 546 | 539 | ADDRESS_MAP_END |
| 547 | 540 |
| r14896 | r14897 | |
|---|---|---|
| 258 | 258 | AM_RANGE(0xe000, 0xe3ff) AM_RAM |
| 259 | 259 | AM_RANGE(0xe400, 0xe400) AM_MIRROR(0x03ff) AM_READ_PORT("DSW0") |
| 260 | 260 | AM_RANGE(0xe800, 0xe80a) AM_MIRROR(0x03f0) AM_WRITE(kangaroo_video_control_w) AM_BASE(m_video_control) |
| 261 | AM_RANGE(0xec00, 0xec00) AM_MIRROR(0x00ff) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w) | |
| 261 | AM_RANGE(0xec00, 0xec00) AM_MIRROR(0x00ff) AM_READ_PORT("IN0") AM_WRITE(soundlatch_byte_w) | |
| 262 | 262 | AM_RANGE(0xed00, 0xed00) AM_MIRROR(0x00ff) AM_READ_PORT("IN1") AM_WRITE(kangaroo_coin_counter_w) |
| 263 | 263 | AM_RANGE(0xee00, 0xee00) AM_MIRROR(0x00ff) AM_READ_PORT("IN2") |
| 264 | 264 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 274 | 274 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, kangaroo_state ) |
| 275 | 275 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 276 | 276 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM |
| 277 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_r) | |
| 277 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_byte_r) | |
| 278 | 278 | AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| 279 | 279 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 280 | 280 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 284 | 284 | static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, kangaroo_state ) |
| 285 | 285 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 286 | 286 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM |
| 287 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_r) | |
| 287 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_byte_r) | |
| 288 | 288 | AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w) |
| 289 | 289 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w) |
| 290 | 290 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | public: |
| 38 | 38 | wldarrow_state(const machine_config &mconfig, device_type type, const char *tag) |
| 39 | : driver_device(mconfig, type, tag) { } | |
| 39 | : driver_device(mconfig, type, tag) , | |
| 40 | m_videoram_0(*this, "videoram_0"), | |
| 41 | m_videoram_1(*this, "videora1"), | |
| 42 | m_videoram_2(*this, "videora2"){ } | |
| 40 | 43 | |
| 41 | UINT8 *m_videoram_0; | |
| 42 | UINT8 *m_videoram_1; | |
| 43 | UINT8 *m_videoram_2; | |
| 44 | size_t m_videoram_size; | |
| 44 | required_shared_ptr<UINT8> m_videoram_0; | |
| 45 | required_shared_ptr<UINT8> m_videoram_1; | |
| 46 | required_shared_ptr<UINT8> m_videoram_2; | |
| 45 | 47 | DECLARE_WRITE8_MEMBER(lights_1_w); |
| 46 | 48 | DECLARE_WRITE8_MEMBER(lights_2_w); |
| 47 | 49 | DECLARE_WRITE8_MEMBER(counter_w); |
| r14896 | r14897 | |
| 76 | 78 | |
| 77 | 79 | get_pens(pens); |
| 78 | 80 | |
| 79 | for (offs = 0; offs < state->m_videoram_ | |
| 81 | for (offs = 0; offs < state->m_videoram_0.bytes(); offs++) | |
| 80 | 82 | { |
| 81 | 83 | int i; |
| 82 | 84 | |
| 83 | 85 | UINT8 y = offs >> 5; |
| 84 | 86 | UINT8 x = offs << 3; |
| 85 | 87 | |
| 86 | UINT8 data0 = state->m_videoram_0[offs]; | |
| 87 | UINT8 data1 = state->m_videoram_1[offs]; | |
| 88 | UINT8 data2 = state->m_videoram_2[offs]; | |
| 88 | UINT8 data0 = state->m_videoram_0.target()[offs]; | |
| 89 | UINT8 data1 = state->m_videoram_1.target()[offs]; | |
| 90 | UINT8 data2 = state->m_videoram_2.target()[offs]; | |
| 89 | 91 | |
| 90 | 92 | /* weird equations, but it matches every flyer screenshot - |
| 91 | 93 | perhaphs they used a look-up PROM? */ |
| r14896 | r14897 | |
| 184 | 186 | static ADDRESS_MAP_START( wldarrow_map, AS_PROGRAM, 8, wldarrow_state ) |
| 185 | 187 | AM_RANGE(0x0000, 0x37ff) AM_ROM |
| 186 | 188 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("IN0") |
| 187 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(m_videoram_0) AM_SIZE(m_videoram_size) | |
| 188 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE(m_videoram_1) | |
| 189 | AM_RANGE(0x8000, 0x9fff) AM_RAM AM_BASE(m_videoram_2) | |
| 189 | AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("videora0") | |
| 190 | AM_RANGE(0x6000, 0x7fff) AM_RAM AM_SHARE("videora1") | |
| 191 | AM_RANGE(0x8000, 0x9fff) AM_RAM AM_SHARE("videora2") | |
| 190 | 192 | AM_RANGE(0xcd00, 0xcdff) AM_RAM AM_SHARE("nvram") |
| 191 | 193 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("BITSW") AM_DEVWRITE_LEGACY("dac", wldarrow_dac_1_w) |
| 192 | 194 | AM_RANGE(0xf004, 0xf004) AM_READ_PORT("IN1") AM_WRITE(lights_1_w) |
| r14896 | r14897 | |
|---|---|---|
| 130 | 130 | AM_RANGE(0xc0000, 0xc0001) AM_WRITE(track_reset_w) |
| 131 | 131 | AM_RANGE(0xc0040, 0xc0041) AM_WRITENOP /* ??? */ |
| 132 | 132 | AM_RANGE(0xc0080, 0xc0081) AM_WRITE(cabal_flipscreen_w) |
| 133 | AM_RANGE(0xe0000, 0xe07ff) AM_RAM_WRITE(paletteram | |
| 133 | AM_RANGE(0xe0000, 0xe07ff) AM_RAM_WRITE(paletteram | |
| 134 | 134 | AM_RANGE(0xe8008, 0xe8009) AM_WRITE(cabal_sound_irq_trigger_word_w) // fix coin insertion |
| 135 | 135 | AM_RANGE(0xe8000, 0xe800d) AM_READWRITE_LEGACY(seibu_main_word_r, seibu_main_word_w) |
| 136 | 136 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 148 | 148 | AM_RANGE(0xa0010, 0xa0011) AM_READ_PORT("INPUTS") |
| 149 | 149 | AM_RANGE(0xc0040, 0xc0041) AM_WRITENOP /* ??? */ |
| 150 | 150 | AM_RANGE(0xc0080, 0xc0081) AM_WRITE(cabal_flipscreen_w) |
| 151 | AM_RANGE(0xe0000, 0xe07ff) AM_RAM_WRITE(paletteram | |
| 151 | AM_RANGE(0xe0000, 0xe07ff) AM_RAM_WRITE(paletteram | |
| 152 | 152 | AM_RANGE(0xe8000, 0xe8003) AM_WRITE(cabalbl_sndcmd_w) |
| 153 | 153 | AM_RANGE(0xe8004, 0xe8005) AM_READ(soundlatch2_word_r) |
| 154 | 154 | AM_RANGE(0xe8008, 0xe8009) AM_WRITE(cabalbl_sound_irq_trigger_word_w) |
| r14896 | r14897 | |
| 199 | 199 | static ADDRESS_MAP_START( cabalbl_sound_map, AS_PROGRAM, 8, cabal_state ) |
| 200 | 200 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 201 | 201 | AM_RANGE(0x2000, 0x2fff) AM_RAM |
| 202 | AM_RANGE(0x4000, 0x4000) AM_WRITE(soundlatch3_w) | |
| 203 | AM_RANGE(0x4002, 0x4002) AM_WRITE(soundlatch4_w) | |
| 202 | AM_RANGE(0x4000, 0x4000) AM_WRITE(soundlatch3_byte_w) | |
| 203 | AM_RANGE(0x4002, 0x4002) AM_WRITE(soundlatch4_byte_w) | |
| 204 | 204 | AM_RANGE(0x4004, 0x4004) AM_WRITE(cabalbl_coin_w) |
| 205 | 205 | AM_RANGE(0x4006, 0x4006) AM_READ_PORT("COIN") |
| 206 | 206 | AM_RANGE(0x4008, 0x4008) AM_READ(cabalbl_snd2_r) |
| 207 | 207 | AM_RANGE(0x400a, 0x400a) AM_READ(cabalbl_snd1_r) |
| 208 | AM_RANGE(0x400c, 0x400c) AM_WRITE(soundlatch2_w) | |
| 208 | AM_RANGE(0x400c, 0x400c) AM_WRITE(soundlatch2_byte_w) | |
| 209 | 209 | AM_RANGE(0x400e, 0x400f) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 210 | 210 | AM_RANGE(0x6000, 0x6000) AM_WRITENOP /* ??? */ |
| 211 | 211 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
| 228 | 228 | |
| 229 | 229 | static ADDRESS_MAP_START( cabalbl_talk1_portmap, AS_IO, 8, cabal_state ) |
| 230 | 230 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 231 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch3_r) | |
| 231 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch3_byte_r) | |
| 232 | 232 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("msm1", cabalbl_adpcm_w) |
| 233 | 233 | ADDRESS_MAP_END |
| 234 | 234 | |
| r14896 | r14897 | |
| 238 | 238 | |
| 239 | 239 | static ADDRESS_MAP_START( cabalbl_talk2_portmap, AS_IO, 8, cabal_state ) |
| 240 | 240 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 241 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch4_r) | |
| 241 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch4_byte_r) | |
| 242 | 242 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("msm2", cabalbl_adpcm_w) |
| 243 | 243 | ADDRESS_MAP_END |
| 244 | 244 |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | public: |
| 51 | 51 | hotblock_state(const machine_config &mconfig, device_type type, const char *tag) |
| 52 | : driver_device(mconfig, type, tag) { } | |
| 52 | : driver_device(mconfig, type, tag) , | |
| 53 | m_vram(*this, "vram"){ } | |
| 53 | 54 | |
| 54 | 55 | /* memory pointers */ |
| 55 | UINT8 | |
| 56 | required_shared_ptr<UINT8> | |
| 56 | 57 | |
| 57 | 58 | /* misc */ |
| 58 | 59 | int m_port0; |
| r14896 | r14897 | |
| 78 | 79 | } |
| 79 | 80 | else // port 0 = 88 c8 |
| 80 | 81 | { |
| 81 | return m_vram[offset]; | |
| 82 | return m_vram.target()[offset]; | |
| 82 | 83 | } |
| 83 | 84 | } |
| 84 | 85 | |
| r14896 | r14897 | |
| 116 | 117 | } |
| 117 | 118 | else // port 0 = 88 c8 |
| 118 | 119 | { |
| 119 | m_vram[offset] = data; | |
| 120 | m_vram.target()[offset] = data; | |
| 120 | 121 | } |
| 121 | 122 | } |
| 122 | 123 | |
| 123 | 124 | static ADDRESS_MAP_START( hotblock_map, AS_PROGRAM, 8, hotblock_state ) |
| 124 | 125 | AM_RANGE(0x00000, 0x0ffff) AM_RAM |
| 125 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(hotblock_video_read, hotblock_video_write) AM_ | |
| 126 | AM_RANGE(0x10000, 0x1ffff) AM_READWRITE(hotblock_video_read, hotblock_video_write) AM_ | |
| 126 | 127 | AM_RANGE(0x20000, 0xfffff) AM_ROM |
| 127 | 128 | ADDRESS_MAP_END |
| 128 | 129 | |
| r14896 | r14897 | |
| 162 | 163 | for(x = 0; x < xxx; x++) |
| 163 | 164 | { |
| 164 | 165 | if (state->m_port0 & 0x40) |
| 165 | bitmap.pix16(y, x) = state->m_vram[count]; | |
| 166 | bitmap.pix16(y, x) = state->m_vram.target()[count]; | |
| 166 | 167 | count++; |
| 167 | 168 | } |
| 168 | 169 | } |
| r14896 | r14897 | |
|---|---|---|
| 169 | 169 | if (select & 1) |
| 170 | 170 | { |
| 171 | 171 | space->install_read_bank(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, "bank4" ); |
| 172 | space->install_write_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, write8_delegate(FUNC(vendetta_state::paletteram_xBBBBBGGGGGRRRRR_be_w), state) ); | |
| 172 | space->install_write_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, write8_delegate(FUNC(vendetta_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state) ); | |
| 173 | 173 | space->install_legacy_readwrite_handler(*state->m_k053246, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k053247_r), FUNC(k053247_w) ); |
| 174 | 174 | memory_set_bankptr(machine, "bank4", state->m_generic_paletteram_8); |
| 175 | 175 | } |
| r14896 | r14897 | |
|---|---|---|
| 1030 | 1030 | if (state->m_soundcpu != NULL) |
| 1031 | 1031 | { |
| 1032 | 1032 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 1033 | state->soundlatch_w(*space, 0, data & 0xff); | |
| 1033 | state->soundlatch_byte_w(*space, 0, data & 0xff); | |
| 1034 | 1034 | device_set_input_line(state->m_soundcpu, 0, HOLD_LINE); |
| 1035 | 1035 | } |
| 1036 | 1036 | } |
| r14896 | r14897 | |
| 1854 | 1854 | ADDRESS_MAP_UNMAP_HIGH |
| 1855 | 1855 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1856 | 1856 | AM_RANGE(0x8000, 0xdfff) AM_ROMBANK("bank1") |
| 1857 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r) | |
| 1857 | AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) | |
| 1858 | 1858 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 1859 | 1859 | ADDRESS_MAP_END |
| 1860 | 1860 | |
| r14896 | r14897 | |
| 1864 | 1864 | AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 1865 | 1865 | AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_DEVWRITE_LEGACY("upd", upd7759_control_w) |
| 1866 | 1866 | AM_RANGE(0x80, 0x80) AM_MIRROR(0x3f) AM_DEVREADWRITE_LEGACY("upd", upd7759_status_r, upd7759_port_w) |
| 1867 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_READ(soundlatch_r) | |
| 1867 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_READ(soundlatch_byte_r) | |
| 1868 | 1868 | ADDRESS_MAP_END |
| 1869 | 1869 | |
| 1870 | 1870 |
| r14896 | r14897 | |
|---|---|---|
| 89 | 89 | AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(thoop2_vram_w) AM_BASE(m_videoram) /* Video RAM */ |
| 90 | 90 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_BASE(m_vregs) /* Video Registers */ |
| 91 | 91 | AM_RANGE(0x10800c, 0x10800d) AM_WRITE(watchdog_reset16_w) /* INT 6 ACK/Watchdog timer */ |
| 92 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 92 | AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram | |
| 93 | 93 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 94 | 94 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2") |
| 95 | 95 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1") |
| r14896 | r14897 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | AM_RANGE(0x300000, 0x30000f) AM_RAM // ?? |
| 153 | 153 | |
| 154 | AM_RANGE(0x330000, 0x330bff) AM_RAM_WRITE(paletteram | |
| 154 | AM_RANGE(0x330000, 0x330bff) AM_RAM_WRITE(paletteram | |
| 155 | 155 | ADDRESS_MAP_END |
| 156 | 156 | |
| 157 | 157 |
| r14896 | r14897 | |
|---|---|---|
| 120 | 120 | AM_RANGE(0xa800, 0xafff) AM_RAM |
| 121 | 121 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(m_spriteram) |
| 122 | 122 | AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(m_spriteram2) |
| 123 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_w) | |
| 123 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_byte_w) | |
| 124 | 124 | AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w) |
| 125 | 125 | AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_nmi_enable_w) |
| 126 | 126 | AM_RANGE(0xc302, 0xc302) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_flipscreen_w) |
| r14896 | r14897 | |
| 144 | 144 | AM_RANGE(0xa800, 0xafff) AM_RAM |
| 145 | 145 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(m_spriteram) |
| 146 | 146 | AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(m_spriteram2) |
| 147 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_w) | |
| 147 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_byte_w) | |
| 148 | 148 | AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w) |
| 149 | 149 | AM_RANGE(0xc302, 0xc302) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_flipscreen_w) |
| 150 | 150 | AM_RANGE(0xc304, 0xc304) AM_MIRROR(0x0cf1) AM_WRITE_LEGACY(timeplt_sh_irqtrigger_w) |
| r14896 | r14897 | |
| 166 | 166 | AM_RANGE(0xa800, 0xafff) AM_RAM |
| 167 | 167 | AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(m_spriteram) |
| 168 | 168 | AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(m_spriteram2) |
| 169 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_w) | |
| 169 | AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_byte_w) | |
| 170 | 170 | AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w) |
| 171 | 171 | AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_nmi_enable_w) |
| 172 | 172 | AM_RANGE(0xc302, 0xc302) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_flipscreen_w) |
| r14896 | r14897 | |
|---|---|---|
| 65 | 65 | * |
| 66 | 66 | *************************************/ |
| 67 | 67 | |
| 68 | ||
| 68 | ||
| 69 | 69 | { |
| 70 | atarigx2_state *state = space->machine().driver_data<atarigx2_state>(); | |
| 71 | int temp = input_port_read(space->machine(), "SERVICE"); | |
| 72 | if (state->m_cpu_to_sound_ready) temp ^= 0x0020; | |
| 73 | if (state->m_sound_to_cpu_ready) temp ^= 0x0010; | |
| 70 | int temp = input_port_read(machine(), "SERVICE"); | |
| 71 | if (m_cpu_to_sound_ready) temp ^= 0x0020; | |
| 72 | if (m_sound_to_cpu_ready) temp ^= 0x0010; | |
| 74 | 73 | temp ^= 0x0008; /* A2D.EOC always high for now */ |
| 75 | 74 | return (temp << 16) | temp; |
| 76 | 75 | } |
| 77 | 76 | |
| 78 | 77 | |
| 79 | ||
| 78 | ||
| 80 | 79 | { |
| 81 | int temp = input_port_read( | |
| 80 | int temp = input_port_read( | |
| 82 | 81 | return (temp << 16) | temp; |
| 83 | 82 | } |
| 84 | 83 | |
| 85 | 84 | |
| 86 | 85 | |
| 87 | ||
| 86 | ||
| 88 | 87 | { |
| 89 | 88 | /* otherwise, assume it's hydra */ |
| 90 | 89 | switch (offset) |
| 91 | 90 | { |
| 92 | 91 | case 0: |
| 93 | return (input_port_read( | |
| 92 | return (input_port_read( | |
| 94 | 93 | case 1: |
| 95 | return (input_port_read( | |
| 94 | return (input_port_read( | |
| 96 | 95 | } |
| 97 | 96 | |
| 98 | 97 | return 0; |
| 99 | 98 | } |
| 100 | 99 | |
| 101 | 100 | |
| 102 | ||
| 101 | ||
| 103 | 102 | { |
| 104 | 103 | /* |
| 105 | 104 | D13 = 68.DISA |
| r14896 | r14897 | |
| 117 | 116 | /* upper byte */ |
| 118 | 117 | if (ACCESSING_BITS_24_31) |
| 119 | 118 | { |
| 120 | atarigx2_state *state = space->machine().driver_data<atarigx2_state>(); | |
| 121 | 119 | |
| 122 | 120 | /* bits 13-11 are the MO control bits */ |
| 123 | atarirle_control_w( | |
| 121 | atarirle_control_w( | |
| 124 | 122 | } |
| 125 | 123 | |
| 126 | 124 | /* lower byte */ |
| 127 | 125 | if (ACCESSING_BITS_16_23) |
| 128 | cputag_set_input_line( | |
| 126 | cputag_set_input_line( | |
| 129 | 127 | } |
| 130 | 128 | |
| 131 | 129 | |
| 132 | ||
| 130 | ||
| 133 | 131 | { |
| 134 | atarigx2_state *state = space->machine().driver_data<atarigx2_state>(); | |
| 135 | COMBINE_DATA(state->m_mo_command); | |
| 132 | COMBINE_DATA(m_mo_command); | |
| 136 | 133 | if (ACCESSING_BITS_0_15) |
| 137 | atarirle_command_w( | |
| 134 | atarirle_command_w( | |
| 138 | 135 | } |
| 139 | 136 | |
| 140 | 137 | |
| r14896 | r14897 | |
| 146 | 143 | *************************************/ |
| 147 | 144 | |
| 148 | 145 | |
| 149 | ||
| 146 | ||
| 150 | 147 | { |
| 151 | atarigx2_state *state = space->machine().driver_data<atarigx2_state>(); | |
| 152 | 148 | { |
| 153 | int pc = cpu_get_previouspc(&space | |
| 149 | int pc = cpu_get_previouspc(&space. | |
| 154 | 150 | // if (pc == 0x11cbe || pc == 0x11c30) |
| 155 | // logerror("%06X:Protection W@%04X = %04X (result to %06X)\n", pc, offset, data, cpu_get_reg(&space | |
| 151 | // logerror("%06X:Protection W@%04X = %04X (result to %06X)\n", pc, offset, data, cpu_get_reg(&space. | |
| 156 | 152 | // else |
| 157 | 153 | if (ACCESSING_BITS_16_31) |
| 158 | 154 | logerror("%06X:Protection W@%04X = %04X\n", pc, offset * 4, data >> 16); |
| r14896 | r14897 | |
| 160 | 156 | logerror("%06X:Protection W@%04X = %04X\n", pc, offset * 4 + 2, data); |
| 161 | 157 | } |
| 162 | 158 | |
| 163 | COMBINE_DATA(& | |
| 159 | COMBINE_DATA(& | |
| 164 | 160 | |
| 165 | 161 | if (ACCESSING_BITS_16_31) |
| 166 | 162 | { |
| 167 | state->m_last_write = state->m_protection_base[offset] >> 16; | |
| 168 | state->m_last_write_offset = offset*2; | |
| 163 | m_last_write = m_protection_base[offset] >> 16; | |
| 164 | m_last_write_offset = offset*2; | |
| 169 | 165 | } |
| 170 | 166 | if (ACCESSING_BITS_0_15) |
| 171 | 167 | { |
| 172 | state->m_last_write = state->m_protection_base[offset] & 0xffff; | |
| 173 | state->m_last_write_offset = offset*2+1; | |
| 168 | m_last_write = m_protection_base[offset] & 0xffff; | |
| 169 | m_last_write_offset = offset*2+1; | |
| 174 | 170 | } |
| 175 | 171 | } |
| 176 | 172 | |
| 177 | ||
| 173 | ||
| 178 | 174 | { |
| 179 | 175 | static const UINT32 lookup_table[][2] = |
| 180 | 176 | { |
| r14896 | r14897 | |
| 1105 | 1101 | { 0xffffffff, 0xffff } |
| 1106 | 1102 | }; |
| 1107 | 1103 | |
| 1108 | atarigx2_state *state = space->machine().driver_data<atarigx2_state>(); | |
| 1109 | UINT32 result = state->m_protection_base[offset]; | |
| 1104 | UINT32 result = m_protection_base[offset]; | |
| 1110 | 1105 | |
| 1111 | 1106 | if (offset == 0x300) |
| 1112 | 1107 | result |= 0x80000000; |
| 1113 | 1108 | if (offset == 0x3f0) |
| 1114 | 1109 | { |
| 1115 | UINT32 tag = ( | |
| 1110 | UINT32 tag = ( | |
| 1116 | 1111 | int i = 0; |
| 1117 | 1112 | |
| 1118 | 1113 | while (lookup_table[i][0] != 0xffffffff) |
| r14896 | r14897 | |
| 1127 | 1122 | |
| 1128 | 1123 | if (lookup_table[i][0] == 0xffffffff) |
| 1129 | 1124 | { |
| 1130 | if (state->m_last_write_offset*2 >= 0x700 && state->m_last_write_offset*2 < 0x720) | |
| 1131 | result = space->machine().rand() << 16; | |
| 1125 | if (m_last_write_offset*2 >= 0x700 && m_last_write_offset*2 < 0x720) | |
| 1126 | result = machine().rand() << 16; | |
| 1132 | 1127 | else |
| 1133 | 1128 | result = 0xffff << 16; |
| 1134 | logerror("%06X:Unhandled protection R@%04X = %04X\n", cpu_get_previouspc(&space | |
| 1129 | logerror("%06X:Unhandled protection R@%04X = %04X\n", cpu_get_previouspc(&space. | |
| 1135 | 1130 | } |
| 1136 | 1131 | } |
| 1137 | 1132 | |
| 1138 | 1133 | if (ACCESSING_BITS_16_31) |
| 1139 | logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(&space | |
| 1134 | logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(&space. | |
| 1140 | 1135 | else |
| 1141 | logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(&space | |
| 1136 | logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(&space. | |
| 1142 | 1137 | return result; |
| 1143 | 1138 | } |
| 1144 | 1139 | |
| r14896 | r14897 | |
| 1153 | 1148 | ADDRESS_MAP_UNMAP_HIGH |
| 1154 | 1149 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1155 | 1150 | AM_RANGE(0xc80000, 0xc80fff) AM_RAM |
| 1156 | AM_RANGE(0xca0000, 0xca0fff) AM_READWRITE_LEGACY(atarigx2_protection_r, atarigx2_protection_w) AM_BASE(m_protection_base) | |
| 1157 | AM_RANGE(0xd00000, 0xd1ffff) AM_READ_LEGACY(a2d_data_r) | |
| 1151 | AM_RANGE(0xca0000, 0xca0fff) AM_READWRITE(atarigx2_protection_r, atarigx2_protection_w) AM_BASE(m_protection_base) | |
| 1152 | AM_RANGE(0xd00000, 0xd1ffff) AM_READ(a2d_data_r) | |
| 1158 | 1153 | AM_RANGE(0xd20000, 0xd20fff) AM_READWRITE_LEGACY(atarigen_eeprom_upper32_r, atarigen_eeprom32_w) AM_SHARE("eeprom") |
| 1159 | 1154 | AM_RANGE(0xd40000, 0xd40fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram32_w) AM_SHARE("paletteram") |
| 1160 | 1155 | AM_RANGE(0xd72000, 0xd75fff) AM_WRITE_LEGACY(atarigen_playfield32_w) AM_BASE(m_playfield32) |
| 1161 | 1156 | AM_RANGE(0xd76000, 0xd76fff) AM_WRITE_LEGACY(atarigen_alpha32_w) AM_BASE(m_alpha32) |
| 1162 | 1157 | AM_RANGE(0xd78000, 0xd78fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram32_r, atarirle_spriteram32_w) |
| 1163 | AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE | |
| 1158 | AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE | |
| 1164 | 1159 | AM_RANGE(0xd70000, 0xd7ffff) AM_RAM |
| 1165 | 1160 | AM_RANGE(0xd80000, 0xd9ffff) AM_WRITE_LEGACY(atarigen_eeprom_enable32_w) |
| 1166 | 1161 | AM_RANGE(0xe06000, 0xe06003) AM_WRITE_LEGACY(atarigen_sound_upper32_w) |
| 1167 | AM_RANGE(0xe08000, 0xe08003) AM_WRITE | |
| 1162 | AM_RANGE(0xe08000, 0xe08003) AM_WRITE | |
| 1168 | 1163 | AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE_LEGACY(atarigen_video_int_ack32_w) |
| 1169 | 1164 | AM_RANGE(0xe0e000, 0xe0e003) AM_WRITENOP//watchdog_reset_w }, |
| 1170 | 1165 | AM_RANGE(0xe80000, 0xe80003) AM_READ_PORT("P1_P2") |
| 1171 | AM_RANGE(0xe82000, 0xe82003) AM_READ_LEGACY(special_port2_r) | |
| 1172 | AM_RANGE(0xe82004, 0xe82007) AM_READ_LEGACY(special_port3_r) | |
| 1166 | AM_RANGE(0xe82000, 0xe82003) AM_READ(special_port2_r) | |
| 1167 | AM_RANGE(0xe82004, 0xe82007) AM_READ(special_port3_r) | |
| 1173 | 1168 | AM_RANGE(0xe86000, 0xe86003) AM_READ_LEGACY(atarigen_sound_upper32_r) |
| 1174 | 1169 | AM_RANGE(0xff8000, 0xffffff) AM_RAM |
| 1175 | 1170 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 2232 | 2227 | */ |
| 2233 | 2228 | } |
| 2234 | 2229 | |
| 2235 | ||
| 2230 | ||
| 2236 | 2231 | { |
| 2237 | 2232 | return 0; |
| 2238 | 2233 | } |
| r14896 | r14897 | |
| 2245 | 2240 | |
| 2246 | 2241 | state->m_playfield_base = 0x000; |
| 2247 | 2242 | |
| 2248 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2243 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 2249 | 2244 | } |
| 2250 | 2245 | |
| 2251 | 2246 |
| r14896 | r14897 | |
|---|---|---|
| 230 | 230 | { |
| 231 | 231 | public: |
| 232 | 232 | nwktr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 233 | : driver_device(mconfig, type, tag) { } | |
| 233 | : driver_device(mconfig, type, tag) , | |
| 234 | m_work_ram(*this, "work_ram"){ } | |
| 234 | 235 | |
| 235 | 236 | UINT8 m_led_reg0; |
| 236 | 237 | UINT8 m_led_reg1; |
| 237 | UINT32 | |
| 238 | required_shared_ptr<UINT32> | |
| 238 | 239 | int m_fpga_uploaded; |
| 239 | 240 | int m_lanc2_ram_r; |
| 240 | 241 | int m_lanc2_ram_w; |
| r14896 | r14897 | |
| 466 | 467 | { |
| 467 | 468 | if (mame_stricmp(machine().system().name, "thrilld") == 0) |
| 468 | 469 | { |
| 469 | m_work_ram[(0x3ffed0/4) + 0] = 0x472a3731; | |
| 470 | m_work_ram[(0x3ffed0/4) + 1] = 0x33202020; | |
| 471 | m_work_ram[(0x3ffed0/4) + 2] = 0x2d2d2a2a; | |
| 472 | m_work_ram[(0x3ffed0/4) + 3] = 0x2a207878; | |
| 470 | m_work_ram.target()[(0x3ffed0/4) + 0] = 0x472a3731; | |
| 471 | m_work_ram.target()[(0x3ffed0/4) + 1] = 0x33202020; | |
| 472 | m_work_ram.target()[(0x3ffed0/4) + 2] = 0x2d2d2a2a; | |
| 473 | m_work_ram.target()[(0x3ffed0/4) + 3] = 0x2a207878; | |
| 473 | 474 | |
| 474 | m_work_ram[(0x3fff40/4) + 0] = 0x47433731; | |
| 475 | m_work_ram[(0x3fff40/4) + 1] = 0x33000000; | |
| 476 | m_work_ram[(0x3fff40/4) + 2] = 0x19994a41; | |
| 477 | m_work_ram[(0x3fff40/4) + 3] = 0x4100a9b1; | |
| 475 | m_work_ram.target()[(0x3fff40/4) + 0] = 0x47433731; | |
| 476 | m_work_ram.target()[(0x3fff40/4) + 1] = 0x33000000; | |
| 477 | m_work_ram.target()[(0x3fff40/4) + 2] = 0x19994a41; | |
| 478 | m_work_ram.target()[(0x3fff40/4) + 3] = 0x4100a9b1; | |
| 478 | 479 | } |
| 479 | 480 | } |
| 480 | 481 | |
| r14896 | r14897 | |
| 490 | 491 | ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS); |
| 491 | 492 | |
| 492 | 493 | /* configure fast RAM regions for DRC */ |
| 493 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->m_work_ram); | |
| 494 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->m_work_ram.target()); | |
| 494 | 495 | } |
| 495 | 496 | |
| 496 | 497 | static ADDRESS_MAP_START( nwktr_map, AS_PROGRAM, 32, nwktr_state ) |
| 497 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 498 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_ | |
| 498 | 499 | AM_RANGE(0x74000000, 0x740000ff) AM_DEVREADWRITE_LEGACY("k001604", k001604_reg_r, k001604_reg_w) |
| 499 | 500 | AM_RANGE(0x74010000, 0x74017fff) AM_RAM_WRITE(paletteram32_w) AM_SHARE("paletteram") |
| 500 | 501 | AM_RANGE(0x74020000, 0x7403ffff) AM_DEVREADWRITE_LEGACY("k001604", k001604_tile_r, k001604_tile_w) |
| r14896 | r14897 | |
|---|---|---|
| 63 | 63 | AM_RANGE(0x2000, 0x2000) AM_WRITE(circus_clown_x_w) |
| 64 | 64 | AM_RANGE(0x3000, 0x3000) AM_WRITE(circus_clown_y_w) |
| 65 | 65 | AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(circus_videoram_w) AM_BASE(m_videoram) |
| 66 | AM_RANGE(0x8000, 0x8000) AM_RAM_WRITE | |
| 66 | AM_RANGE(0x8000, 0x8000) AM_RAM_WRITE | |
| 67 | 67 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("INPUTS") |
| 68 | 68 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("DSW") |
| 69 | 69 | AM_RANGE(0xd000, 0xd000) AM_READ(circus_paddle_r) |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | if (ACCESSING_BITS_0_7) |
| 84 | 84 | { |
| 85 | 85 | m_pending_command = 1; |
| 86 | soundlatch_w(space, offset, data & 0xff); | |
| 86 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 87 | 87 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 88 | 88 | } |
| 89 | 89 | } |
| r14896 | r14897 | |
| 93 | 93 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM AM_BASE(m_spriteram) // sprite ram |
| 94 | 94 | AM_RANGE(0xc00000, 0xc0ffff) AM_RAM AM_BASE(m_spriteram2) // sprite tile lookup ram |
| 95 | 95 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM // main ram |
| 96 | AM_RANGE(0xffc000, 0xffcfff) AM_RAM_WRITE(paletteram | |
| 96 | AM_RANGE(0xffc000, 0xffcfff) AM_RAM_WRITE(paletteram | |
| 97 | 97 | AM_RANGE(0xffe000, 0xffe3ff) AM_RAM AM_BASE(m_scrollram) // rowscroll / rowselect / scroll ram |
| 98 | 98 | AM_RANGE(0xffff80, 0xffff81) AM_READ_PORT("P1") |
| 99 | 99 | AM_RANGE(0xffff82, 0xffff83) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 139 | 139 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 140 | 140 | AM_RANGE(0x04, 0x04) AM_WRITE(taotaido_sh_bankswitch_w) |
| 141 | 141 | AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w) |
| 142 | AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_r) | |
| 142 | AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r) | |
| 143 | 143 | ADDRESS_MAP_END |
| 144 | 144 | |
| 145 | 145 |
| r14896 | r14897 | |
|---|---|---|
| 46 | 46 | * |
| 47 | 47 | *************************************/ |
| 48 | 48 | |
| 49 | ||
| 49 | ||
| 50 | 50 | { |
| 51 | return atarivc_r(* | |
| 51 | return atarivc_r(* | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| 55 | ||
| 55 | ||
| 56 | 56 | { |
| 57 | atarivc_w(* | |
| 57 | atarivc_w(* | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| r14896 | r14897 | |
| 93 | 93 | * |
| 94 | 94 | *************************************/ |
| 95 | 95 | |
| 96 | ||
| 96 | ||
| 97 | 97 | { |
| 98 | relief_state *state = space->machine().driver_data<relief_state>(); | |
| 99 | int result = input_port_read(space->machine(), "260010"); | |
| 100 | if (state->m_cpu_to_sound_ready) result ^= 0x0020; | |
| 101 | if (!(result & 0x0080) || atarigen_get_hblank(*space->machine().primary_screen)) result ^= 0x0001; | |
| 98 | int result = input_port_read(machine(), "260010"); | |
| 99 | if (m_cpu_to_sound_ready) result ^= 0x0020; | |
| 100 | if (!(result & 0x0080) || atarigen_get_hblank(*machine().primary_screen)) result ^= 0x0001; | |
| 102 | 101 | return result; |
| 103 | 102 | } |
| 104 | 103 | |
| r14896 | r14897 | |
| 110 | 109 | * |
| 111 | 110 | *************************************/ |
| 112 | 111 | |
| 113 | ||
| 112 | ||
| 114 | 113 | { |
| 115 | relief_state *state = space->machine().driver_data<relief_state>(); | |
| 116 | 114 | if (ACCESSING_BITS_0_7) |
| 117 | 115 | { |
| 118 | state->m_ym2413_volume = (data >> 1) & 15; | |
| 119 | atarigen_set_ym2413_vol(space->machine(), (state->m_ym2413_volume * state->m_overall_volume * 100) / (127 * 15)); | |
| 120 | state->m_adpcm_bank_base = (0x040000 * ((data >> 6) & 3)) | (state->m_adpcm_bank_base & 0x100000); | |
| 116 | m_ym2413_volume = (data >> 1) & 15; | |
| 117 | atarigen_set_ym2413_vol(machine(), (m_ym2413_volume * m_overall_volume * 100) / (127 * 15)); | |
| 118 | m_adpcm_bank_base = (0x040000 * ((data >> 6) & 3)) | (m_adpcm_bank_base & 0x100000); | |
| 121 | 119 | } |
| 122 | 120 | if (ACCESSING_BITS_8_15) |
| 123 | | |
| 121 | | |
| 124 | 122 | |
| 125 | okim6295_device *oki = space->machine().device<okim6295_device>("oki"); | |
| 126 | oki->set_bank_base(state->m_adpcm_bank_base); | |
| 123 | okim6295_device *oki = machine().device<okim6295_device>("oki"); | |
| 124 | oki->set_bank_base(m_adpcm_bank_base); | |
| 127 | 125 | } |
| 128 | 126 | |
| 129 | 127 | |
| 130 | ||
| 128 | ||
| 131 | 129 | { |
| 132 | relief_state *state = space->machine().driver_data<relief_state>(); | |
| 133 | 130 | if (ACCESSING_BITS_0_7) |
| 134 | 131 | { |
| 135 | state->m_overall_volume = data & 127; | |
| 136 | atarigen_set_ym2413_vol(space->machine(), (state->m_ym2413_volume * state->m_overall_volume * 100) / (127 * 15)); | |
| 137 | atarigen_set_oki6295_vol(space->machine(), state->m_overall_volume * 100 / 127); | |
| 132 | m_overall_volume = data & 127; | |
| 133 | atarigen_set_ym2413_vol(machine(), (m_ym2413_volume * m_overall_volume * 100) / (127 * 15)); | |
| 134 | atarigen_set_oki6295_vol(machine(), m_overall_volume * 100 / 127); | |
| 138 | 135 | } |
| 139 | 136 | } |
| 140 | 137 | |
| r14896 | r14897 | |
| 152 | 149 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 153 | 150 | AM_RANGE(0x140000, 0x140003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 154 | 151 | AM_RANGE(0x140010, 0x140011) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 155 | AM_RANGE(0x140020, 0x140021) AM_WRITE_LEGACY(audio_volume_w) | |
| 156 | AM_RANGE(0x140030, 0x140031) AM_WRITE_LEGACY(audio_control_w) | |
| 152 | AM_RANGE(0x140020, 0x140021) AM_WRITE(audio_volume_w) | |
| 153 | AM_RANGE(0x140030, 0x140031) AM_WRITE(audio_control_w) | |
| 157 | 154 | AM_RANGE(0x180000, 0x180fff) AM_READWRITE_LEGACY(atarigen_eeprom_upper_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 158 | 155 | AM_RANGE(0x1c0030, 0x1c0031) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 159 | 156 | AM_RANGE(0x260000, 0x260001) AM_READ_PORT("260000") |
| 160 | 157 | AM_RANGE(0x260002, 0x260003) AM_READ_PORT("260002") |
| 161 | AM_RANGE(0x260010, 0x260011) AM_READ | |
| 158 | AM_RANGE(0x260010, 0x260011) AM_READ | |
| 162 | 159 | AM_RANGE(0x260012, 0x260013) AM_READ_PORT("260012") |
| 163 | 160 | AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w) |
| 164 | 161 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 165 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 162 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE | |
| 166 | 163 | AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_WRITE_LEGACY(atarigen_playfield2_latched_msb_w) AM_BASE(m_playfield2) |
| 167 | 164 | AM_RANGE(0x3f2000, 0x3f3fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_latched_lsb_w) AM_BASE(m_playfield) |
| 168 | 165 | AM_RANGE(0x3f4000, 0x3f5fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_dual_upper_w) AM_BASE(m_playfield_upper) |
| r14896 | r14897 | |
|---|---|---|
| 264 | 264 | AM_RANGE(0xa007, 0xa007) AM_WRITE(champbas_mcu_switch_w) // MCU not present/not used in champbas |
| 265 | 265 | |
| 266 | 266 | AM_RANGE(0xa060, 0xa06f) AM_RAM AM_BASE(m_spriteram_2) |
| 267 | AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_w) | |
| 267 | AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_byte_w) | |
| 268 | 268 | /* AM_RANGE(0xa0a0, 0xa0a0) ???? */ |
| 269 | 269 | AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(champbas_watchdog_reset_w) |
| 270 | 270 | |
| r14896 | r14897 | |
| 293 | 293 | AM_RANGE(0xa007, 0xa007) AM_WRITENOP /* MCU is not used, but some leftover code still writes here */ |
| 294 | 294 | |
| 295 | 295 | AM_RANGE(0xa040, 0xa06f) AM_WRITEONLY AM_BASE(m_spriteram) /* Sprite Pos */ |
| 296 | AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_w) | |
| 296 | AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_byte_w) | |
| 297 | 297 | AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(watchdog_reset_w) |
| 298 | 298 | ADDRESS_MAP_END |
| 299 | 299 | |
| r14896 | r14897 | |
| 318 | 318 | AM_RANGE(0xa007, 0xa007) AM_WRITENOP /* This is also MCU control, but i dont need it */ |
| 319 | 319 | |
| 320 | 320 | AM_RANGE(0xa040, 0xa06f) AM_WRITEONLY AM_BASE(m_spriteram) /* Sprite pos */ |
| 321 | AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_w) | |
| 321 | AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_byte_w) | |
| 322 | 322 | AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(watchdog_reset_w) |
| 323 | 323 | ADDRESS_MAP_END |
| 324 | 324 | |
| r14896 | r14897 | |
| 326 | 326 | |
| 327 | 327 | static ADDRESS_MAP_START( champbas_sub_map, AS_PROGRAM, 8, champbas_state ) |
| 328 | 328 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 329 | AM_RANGE(0x6000, 0x7fff) AM_READ(soundlatch_r) | |
| 329 | AM_RANGE(0x6000, 0x7fff) AM_READ(soundlatch_byte_r) | |
| 330 | 330 | AM_RANGE(0x8000, 0x9fff) AM_WRITENOP // 4-bit return code to main CPU (not used) |
| 331 | AM_RANGE(0xa000, 0xbfff) AM_WRITE(soundlatch_clear_w) | |
| 331 | AM_RANGE(0xa000, 0xbfff) AM_WRITE(soundlatch_clear_byte_w) | |
| 332 | 332 | AM_RANGE(0xc000, 0xdfff) AM_DEVWRITE_LEGACY("dac", champbas_dac_w) |
| 333 | 333 | AM_RANGE(0xe000, 0xe3ff) AM_MIRROR(0x1c00) AM_RAM |
| 334 | 334 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 339 | 339 | AM_RANGE(0xa000, 0xa7ff) AM_RAM |
| 340 | 340 | AM_RANGE(0xc008, 0xc008) AM_DEVWRITE_LEGACY("dac1", champbas_dac_w) |
| 341 | 341 | AM_RANGE(0xc009, 0xc009) AM_DEVWRITE_LEGACY("dac2", champbas_dac_w) |
| 342 | AM_RANGE(0xc00c, 0xc00c) AM_WRITE(soundlatch_clear_w) | |
| 343 | AM_RANGE(0xc00d, 0xc00d) AM_READ(soundlatch_r) | |
| 342 | AM_RANGE(0xc00c, 0xc00c) AM_WRITE(soundlatch_clear_byte_w) | |
| 343 | AM_RANGE(0xc00d, 0xc00d) AM_READ(soundlatch_byte_r) | |
| 344 | 344 | // AM_RANGE(0xc00f, 0xc00f) AM_WRITENOP /* ??? */ |
| 345 | 345 | ADDRESS_MAP_END |
| 346 | 346 |
| r14896 | r14897 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | WRITE8_MEMBER(ssozumo_state::ssozumo_sh_command_w) |
| 18 | 18 | { |
| 19 | soundlatch_w(space, 0, data); | |
| 19 | soundlatch_byte_w(space, 0, data); | |
| 20 | 20 | cputag_set_input_line(machine(), "audiocpu", M6502_IRQ_LINE, HOLD_LINE); |
| 21 | 21 | } |
| 22 | 22 | |
| r14896 | r14897 | |
| 53 | 53 | AM_RANGE(0x2002, 0x2003) AM_DEVWRITE_LEGACY("ay2", ay8910_data_address_w) |
| 54 | 54 | AM_RANGE(0x2004, 0x2004) AM_DEVWRITE_LEGACY("dac", dac_signed_w) |
| 55 | 55 | AM_RANGE(0x2005, 0x2005) AM_WRITE(sound_nmi_mask_w) |
| 56 | AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_r) | |
| 56 | AM_RANGE(0x2007, 0x2007) AM_READ(soundlatch_byte_r) | |
| 57 | 57 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 58 | 58 | ADDRESS_MAP_END |
| 59 | 59 |
| r14896 | r14897 | |
|---|---|---|
| 92 | 92 | WRITE16_MEMBER(m107_state::m107_soundlatch_w) |
| 93 | 93 | { |
| 94 | 94 | cputag_set_input_line(machine(), "soundcpu", NEC_INPUT_LINE_INTP1, ASSERT_LINE); |
| 95 | soundlatch_w(space, 0, data & 0xff); | |
| 96 | // logerror("soundlatch_w %02x\n",data); | |
| 95 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 96 | // logerror("soundlatch_byte_w %02x\n",data); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | READ16_MEMBER(m107_state::m107_sound_status_r) |
| r14896 | r14897 | |
| 104 | 104 | READ16_MEMBER(m107_state::m107_soundlatch_r) |
| 105 | 105 | { |
| 106 | 106 | cputag_set_input_line(machine(), "soundcpu", NEC_INPUT_LINE_INTP1, CLEAR_LINE); |
| 107 | return soundlatch_r(space, offset) | 0xff00; | |
| 107 | return soundlatch_byte_r(space, offset) | 0xff00; | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE16_MEMBER(m107_state::m107_sound_irq_ack_w) |
| r14896 | r14897 | |
| 131 | 131 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m107_vram_w) AM_BASE(m_vram_data) |
| 132 | 132 | AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ |
| 133 | 133 | AM_RANGE(0xf8000, 0xf8fff) AM_RAM AM_BASE(m_spriteram) |
| 134 | AM_RANGE(0xf9000, 0xf9fff) AM_RAM_WRITE(paletteram | |
| 134 | AM_RANGE(0xf9000, 0xf9fff) AM_RAM_WRITE(paletteram | |
| 135 | 135 | AM_RANGE(0xffff0, 0xfffff) AM_ROM AM_REGION("maincpu", 0x7fff0) |
| 136 | 136 | ADDRESS_MAP_END |
| 137 | 137 |
| r14896 | r14897 | |
|---|---|---|
| 104 | 104 | WRITE16_MEMBER(twin16_state::sound_command_w) |
| 105 | 105 | { |
| 106 | 106 | COMBINE_DATA(&m_sound_command); |
| 107 | soundlatch_w(space, 0, m_sound_command&0xff ); | |
| 107 | soundlatch_byte_w(space, 0, m_sound_command&0xff ); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE16_MEMBER(twin16_state::twin16_CPUA_register_w) |
| r14896 | r14897 | |
| 224 | 224 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 225 | 225 | AM_RANGE(0x8000, 0x8fff) AM_RAM |
| 226 | 226 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("upd", twin16_upd_reset_w) |
| 227 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 227 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 228 | 228 | AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE_LEGACY("konami", k007232_r, k007232_w) |
| 229 | 229 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 230 | 230 | AM_RANGE(0xd000, 0xd000) AM_DEVWRITE_LEGACY("upd", upd7759_port_w) |
| r14896 | r14897 | |
|---|---|---|
| 180 | 180 | AM_RANGE(0x080006, 0x080007) AM_READ_PORT("DSW") |
| 181 | 181 | AM_RANGE(0x080008, 0x080009) AM_READ(soundlatch2_word_r) /* from sound cpu */ |
| 182 | 182 | AM_RANGE(0x084000, 0x0843ff) AM_RAM_WRITE(megasys1_vregs_A_w) AM_BASE(m_vregs) |
| 183 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 183 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 184 | 184 | AM_RANGE(0x08e000, 0x08ffff) AM_RAM AM_BASE(m_objectram) |
| 185 | 185 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(megasys1_scrollram_0_w) AM_BASE(m_scrollram[0]) |
| 186 | 186 | AM_RANGE(0x094000, 0x097fff) AM_RAM_WRITE(megasys1_scrollram_1_w) AM_BASE(m_scrollram[1]) |
| r14896 | r14897 | |
| 257 | 257 | ADDRESS_MAP_GLOBAL_MASK(0xfffff) |
| 258 | 258 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 259 | 259 | AM_RANGE(0x044000, 0x0443ff) AM_RAM_WRITE(megasys1_vregs_A_w) AM_BASE(m_vregs) |
| 260 | AM_RANGE(0x048000, 0x0487ff) AM_RAM_WRITE(paletteram | |
| 260 | AM_RANGE(0x048000, 0x0487ff) AM_RAM_WRITE(paletteram | |
| 261 | 261 | AM_RANGE(0x04e000, 0x04ffff) AM_RAM AM_BASE(m_objectram) |
| 262 | 262 | AM_RANGE(0x050000, 0x053fff) AM_RAM_WRITE(megasys1_scrollram_0_w) AM_BASE(m_scrollram[0]) |
| 263 | 263 | AM_RANGE(0x054000, 0x057fff) AM_RAM_WRITE(megasys1_scrollram_1_w) AM_BASE(m_scrollram[1]) |
| r14896 | r14897 | |
| 284 | 284 | AM_RANGE(0x0e0000, 0x0e3fff) AM_RAM_WRITE(megasys1_scrollram_0_w) AM_BASE(m_scrollram[0]) |
| 285 | 285 | AM_RANGE(0x0e8000, 0x0ebfff) AM_RAM_WRITE(megasys1_scrollram_1_w) AM_BASE(m_scrollram[1]) |
| 286 | 286 | AM_RANGE(0x0f0000, 0x0f3fff) AM_RAM_WRITE(megasys1_scrollram_2_w) AM_BASE(m_scrollram[2]) |
| 287 | AM_RANGE(0x0f8000, 0x0f87ff) AM_RAM_WRITE(paletteram | |
| 287 | AM_RANGE(0x0f8000, 0x0f87ff) AM_RAM_WRITE(paletteram | |
| 288 | 288 | AM_RANGE(0x0d8000, 0x0d8001) AM_READWRITE(ip_select_r,ip_select_w) |
| 289 | 289 | AM_RANGE(0x1c0000, 0x1cffff) AM_MIRROR(0x30000) AM_RAM AM_BASE(m_ram) //0x1f****, Cybattler reads attract mode inputs at 0x1d**** |
| 290 | 290 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 305 | 305 | AM_RANGE(0x0ca000, 0x0cbfff) AM_RAM AM_BASE(m_objectram) |
| 306 | 306 | AM_RANGE(0x0d0000, 0x0d3fff) AM_RAM_WRITE(megasys1_scrollram_1_w) AM_BASE(m_scrollram[1]) |
| 307 | 307 | AM_RANGE(0x0d4000, 0x0d7fff) AM_RAM_WRITE(megasys1_scrollram_2_w) AM_BASE(m_scrollram[2]) |
| 308 | AM_RANGE(0x0d8000, 0x0d87ff) AM_MIRROR(0x3000) AM_RAM_WRITE(paletteram | |
| 308 | AM_RANGE(0x0d8000, 0x0d87ff) AM_MIRROR(0x3000) AM_RAM_WRITE(paletteram | |
| 309 | 309 | AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("DSW") |
| 310 | 310 | AM_RANGE(0x0e8000, 0x0ebfff) AM_RAM_WRITE(megasys1_scrollram_0_w) AM_BASE(m_scrollram[0]) |
| 311 | 311 | AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("SYSTEM") |
| r14896 | r14897 | |
| 433 | 433 | static ADDRESS_MAP_START( z80_sound_map, AS_PROGRAM, 8, megasys1_state ) |
| 434 | 434 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 435 | 435 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 436 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) | |
| 436 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) | |
| 437 | 437 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ?? */ |
| 438 | 438 | ADDRESS_MAP_END |
| 439 | 439 | |
| r14896 | r14897 | |
| 3811 | 3811 | //device_t *oki1 = machine.device("oki1"); |
| 3812 | 3812 | megasys1_state *state = machine.driver_data<megasys1_state>(); |
| 3813 | 3813 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::edfbl_input_r),state)); |
| 3814 | //machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki1, 0xe000e, 0xe000f, FUNC(soundlatch_w)); | |
| 3814 | //machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki1, 0xe000e, 0xe000f, FUNC(soundlatch_byte_w)); | |
| 3815 | 3815 | } |
| 3816 | 3816 | |
| 3817 | 3817 | static DRIVER_INIT( hayaosi1 ) |
| r14896 | r14897 | |
|---|---|---|
| 165 | 165 | if (ACCESSING_BITS_0_7) |
| 166 | 166 | { |
| 167 | 167 | m_pending_command = 1; |
| 168 | soundlatch_w(space, offset, data & 0xff); | |
| 168 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 169 | 169 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 170 | 170 | } |
| 171 | 171 | } |
| r14896 | r14897 | |
| 193 | 193 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM |
| 194 | 194 | AM_RANGE(0xffc000, 0xffc001) AM_WRITE(crshrace_roz_bank_w) |
| 195 | 195 | AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(crshrace_videoram2_w) AM_BASE(m_videoram2) |
| 196 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 196 | AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram | |
| 197 | 197 | AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("P1") AM_WRITE(crshrace_gfxctrl_w) |
| 198 | 198 | AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("P2") |
| 199 | 199 | AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW0") |
| r14896 | r14897 | |
| 214 | 214 | static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, crshrace_state ) |
| 215 | 215 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 216 | 216 | AM_RANGE(0x00, 0x00) AM_WRITE(crshrace_sh_bankswitch_w) |
| 217 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) AM_WRITE(pending_command_clear_w) | |
| 217 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) AM_WRITE(pending_command_clear_w) | |
| 218 | 218 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r, ym2610_w) |
| 219 | 219 | ADDRESS_MAP_END |
| 220 | 220 |
| r14896 | r14897 | |
|---|---|---|
| 274 | 274 | |
| 275 | 275 | memory_set_bank(machine(), "bank2", data & 0x07); |
| 276 | 276 | |
| 277 | flip_screen_set( | |
| 277 | flip_screen_set( | |
| 278 | 278 | |
| 279 | 279 | // used at the end of levels, after defeating the boss, to leave trails |
| 280 | 280 | pandora_set_clear_bitmap(m_pandora, data & 0x20); |
| r14896 | r14897 | |
| 295 | 295 | READ8_MEMBER(airbustr_state::soundcommand_r) |
| 296 | 296 | { |
| 297 | 297 | m_soundlatch_status = 0; // soundlatch has been read |
| 298 | return soundlatch_r(space, 0); | |
| 298 | return soundlatch_byte_r(space, 0); | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | READ8_MEMBER(airbustr_state::soundcommand2_r) |
| 302 | 302 | { |
| 303 | 303 | m_soundlatch2_status = 0; // soundlatch2 has been read |
| 304 | return soundlatch2_r(space, 0); | |
| 304 | return soundlatch2_byte_r(space, 0); | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | WRITE8_MEMBER(airbustr_state::soundcommand_w) |
| 308 | 308 | { |
| 309 | soundlatch_w(space, 0, data); | |
| 309 | soundlatch_byte_w(space, 0, data); | |
| 310 | 310 | m_soundlatch_status = 1; // soundlatch has been written |
| 311 | 311 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | WRITE8_MEMBER(airbustr_state::soundcommand2_w) |
| 315 | 315 | { |
| 316 | soundlatch2_w(space, 0, data); | |
| 316 | soundlatch2_byte_w(space, 0, data); | |
| 317 | 317 | m_soundlatch2_status = 1; // soundlatch2 has been written |
| 318 | 318 | } |
| 319 | 319 |
| r14896 | r14897 | |
|---|---|---|
| 5930 | 5930 | GAME( 1981, abscam, puckman, piranha, mspacman, eyes, ROT90, "GL (US Billiards license)", "Abscam", GAME_SUPPORTS_SAVE ) |
| 5931 | 5931 | GAME( 1981, nmouse, 0 , nmouse , nmouse, eyes, ROT90, "Amenip (Palcom Queen River)", "Naughty Mouse (set 1)", GAME_SUPPORTS_SAVE ) |
| 5932 | 5932 | GAME( 1981, nmouseb, nmouse , nmouse , nmouse, eyes, ROT90, "Amenip Nova Games Ltd.", "Naughty Mouse (set 2)", GAME_SUPPORTS_SAVE ) |
| 5933 | GAME( 1981, mspacman, 0, mspacman, mspacman, mspacman, ROT90, "Midway", "Ms. Pac-Man", GAME_SUPPORTS_SAVE ) | |
| 5934 | GAME( 1981, mspacmnf, mspacman, mspacman, mspacman, mspacman, ROT90, "Midway", "Ms. Pac-Man (with speedup hack)", GAME_SUPPORTS_SAVE ) | |
| 5933 | GAME( 1981, mspacman, 0, mspacman, mspacman, mspacman, ROT90, "Midway / General Computer Corporation", "Ms. Pac-Man", GAME_SUPPORTS_SAVE ) | |
| 5934 | GAME( 1981, mspacmnf, mspacman, mspacman, mspacman, mspacman, ROT90, "Midway / General Computer Corporation", "Ms. Pac-Man (with speedup hack)", GAME_SUPPORTS_SAVE ) | |
| 5935 | 5935 | GAME( 1981, mspacmat, mspacman, mspacman, mspacman, mspacman, ROT90, "hack", "Ms. Pac Attack", GAME_SUPPORTS_SAVE ) |
| 5936 | 5936 | GAME( 1981, woodpeck, 0, woodpek, woodpek, woodpek, ROT90, "Amenip (Palcom Queen River)", "Woodpecker (set 1)", GAME_SUPPORTS_SAVE ) |
| 5937 | 5937 | GAME( 1981, woodpeca, woodpeck, woodpek, woodpek, woodpek, ROT90, "Amenip", "Woodpecker (set 2)", GAME_SUPPORTS_SAVE ) |
| r14896 | r14897 | |
|---|---|---|
| 85 | 85 | public: |
| 86 | 86 | igs011_state(const machine_config &mconfig, device_type type, const char *tag) |
| 87 | 87 | : driver_device(mconfig, type, tag), |
| 88 | m_maincpu(*this, "maincpu") | |
| 89 | { } | |
| 88 | m_maincpu(*this, "maincpu"), | |
| 89 | m_priority_ram(*this, "priority_ram"), | |
| 90 | m_vbowl_trackball(*this, "vbowl_trackball"){ } | |
| 90 | 91 | |
| 92 | required_device<cpu_device> m_maincpu; | |
| 93 | required_shared_ptr<UINT16> m_priority_ram; | |
| 94 | required_shared_ptr<UINT16> m_vbowl_trackball; | |
| 91 | 95 | UINT8 *m_layer[8]; |
| 92 | 96 | UINT16 m_priority; |
| 93 | UINT16 *m_priority_ram; | |
| 94 | 97 | UINT8 m_lhb2_pen_hi; |
| 95 | 98 | UINT16 m_igs_dips_sel; |
| 96 | 99 | UINT16 m_igs_input_sel; |
| r14896 | r14897 | |
| 104 | 107 | UINT8 m_igs012_prot_mode; |
| 105 | 108 | UINT16 m_igs003_reg[2]; |
| 106 | 109 | UINT16 m_lhb_irq_enable; |
| 107 | UINT16 *m_vbowl_trackball; | |
| 108 | 110 | blitter_t m_blitter; |
| 109 | 111 | |
| 110 | required_device<cpu_device> m_maincpu; | |
| 111 | 112 | DECLARE_WRITE16_MEMBER(igs011_priority_w); |
| 112 | 113 | DECLARE_READ16_MEMBER(igs011_layers_r); |
| 113 | 114 | DECLARE_WRITE16_MEMBER(igs011_layers_w); |
| r14896 | r14897 | |
| 248 | 249 | } |
| 249 | 250 | #endif |
| 250 | 251 | |
| 251 | pri_ram = &state->m_priority_ram[(state->m_priority & 7) * 512/2]; | |
| 252 | pri_ram = &state->m_priority_ram.target()[(state->m_priority & 7) * 512/2]; | |
| 252 | 253 | |
| 253 | 254 | for (y = cliprect.min_y; y <= cliprect.max_y; y++) |
| 254 | 255 | { |
| r14896 | r14897 | |
| 2343 | 2344 | AM_RANGE( 0x204000, 0x204003 ) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff ) |
| 2344 | 2345 | AM_RANGE( 0x208000, 0x208003 ) AM_WRITE(lhb2_igs003_w ) |
| 2345 | 2346 | AM_RANGE( 0x208002, 0x208003 ) AM_READ(lhb2_igs003_r ) |
| 2346 | AM_RANGE( 0x20c000, 0x20cfff ) AM_RAM AM_ | |
| 2347 | AM_RANGE( 0x20c000, 0x20cfff ) AM_RAM AM_ | |
| 2347 | 2348 | AM_RANGE( 0x210000, 0x211fff ) AM_RAM_WRITE(igs011_palette ) AM_SHARE("paletteram") |
| 2348 | 2349 | AM_RANGE( 0x214000, 0x214001 ) AM_READ_PORT( "COIN" ) |
| 2349 | 2350 | AM_RANGE( 0x300000, 0x3fffff ) AM_READWRITE(igs011_layers_r, igs011_layers_w ) |
| r14896 | r14897 | |
| 2406 | 2407 | if (vblank_on) |
| 2407 | 2408 | { |
| 2408 | 2409 | igs011_state *state = screen.machine().driver_data<igs011_state>(); |
| 2409 | state->m_vbowl_trackball[0] = state->m_vbowl_trackball[1]; | |
| 2410 | state->m_vbowl_trackball[1] = (input_port_read(screen.machine(), "AN1") << 8) | input_port_read(screen.machine(), "AN0"); | |
| 2410 | state->m_vbowl_trackball.target()[0] = state->m_vbowl_trackball.target()[1]; | |
| 2411 | state->m_vbowl_trackball.target()[1] = (input_port_read(screen.machine(), "AN1") << 8) | input_port_read(screen.machine(), "AN0"); | |
| 2411 | 2412 | } |
| 2412 | 2413 | } |
| 2413 | 2414 |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | device_set_input_line(m_subcpu, INPUT_LINE_NMI, ASSERT_LINE); // SNMI |
| 104 | 104 | else |
| 105 | 105 | { |
| 106 | soundlatch_w(space, 0, data); | |
| 106 | soundlatch_byte_w(space, 0, data); | |
| 107 | 107 | device_set_input_line(m_audiocpu, DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ |
| 108 | 108 | } |
| 109 | 109 | break; |
| r14896 | r14897 | |
| 178 | 178 | AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 179 | 179 | AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 180 | 180 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| 181 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 181 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 182 | 182 | AM_RANGE(0xd000, 0xd000) AM_WRITE(bwp3_nmimask_w) |
| 183 | 183 | AM_RANGE(0xe000, 0xffff) AM_ROM AM_BASE_SIZE(m_bwp3_rombase, m_bwp3_romsize) |
| 184 | 184 | ADDRESS_MAP_END |
| r14896 | r14897 | |
|---|---|---|
| 74 | 74 | { |
| 75 | 75 | public: |
| 76 | 76 | srmp6_state(const machine_config &mconfig, device_type type, const char *tag) |
| 77 | : driver_device(mconfig, type, tag) { } | |
| 77 | : driver_device(mconfig, type, tag) , | |
| 78 | m_sprram(*this, "sprram"), | |
| 79 | m_chrram(*this, "chrram"), | |
| 80 | m_dmaram(*this, "dmaram"), | |
| 81 | m_video_regs(*this, "video_regs"){ } | |
| 78 | 82 | |
| 79 | 83 | UINT16* m_tileram; |
| 80 | UINT16* m_dmaram; | |
| 81 | UINT16* m_chrram; | |
| 84 | required_shared_ptr<UINT16> m_sprram; | |
| 85 | required_shared_ptr<UINT16> m_chrram; | |
| 86 | required_shared_ptr<UINT16> m_dmaram; | |
| 87 | required_shared_ptr<UINT16> m_video_regs; | |
| 82 | 88 | |
| 83 | UINT16 *m_sprram; | |
| 84 | 89 | UINT16 *m_sprram_old; |
| 85 | 90 | |
| 86 | 91 | int m_brightness; |
| 87 | 92 | UINT16 m_input_select; |
| 88 | UINT16 *m_video_regs; | |
| 89 | 93 | |
| 90 | 94 | unsigned short m_lastb; |
| 91 | 95 | unsigned short m_lastb2; |
| r14896 | r14897 | |
| 153 | 157 | srmp6_state *state = machine.driver_data<srmp6_state>(); |
| 154 | 158 | |
| 155 | 159 | state->m_tileram = auto_alloc_array_clear(machine, UINT16, 0x100000*16/2); |
| 156 | state->m_dmaram = auto_alloc_array(machine, UINT16, 0x100/2); | |
| 160 | //state->m_dmaram = auto_alloc_array(machine, UINT16, 0x100/2); | |
| 157 | 161 | state->m_sprram_old = auto_alloc_array_clear(machine, UINT16, 0x80000/2); |
| 158 | 162 | |
| 159 | 163 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| r14896 | r14897 | |
| 359 | 363 | logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", cpu_get_previouspc(&space.device()), offset*2, data, mem_mask); |
| 360 | 364 | break; |
| 361 | 365 | } |
| 362 | COMBINE_DATA(&m_video_regs[offset]); | |
| 366 | COMBINE_DATA(&m_video_regs.target()[offset]); | |
| 363 | 367 | } |
| 364 | 368 | |
| 365 | 369 | READ16_MEMBER(srmp6_state::video_regs_r) |
| 366 | 370 | { |
| 367 | 371 | |
| 368 | 372 | logerror("video_regs_r (PC=%06X): %04x\n", cpu_get_previouspc(&space.device()), offset*2); |
| 369 | return m_video_regs[offset]; | |
| 373 | return m_video_regs.target()[offset]; | |
| 370 | 374 | } |
| 371 | 375 | |
| 372 | 376 | |
| r14896 | r14897 | |
| 409 | 413 | |
| 410 | 414 | WRITE16_MEMBER(srmp6_state::srmp6_dma_w) |
| 411 | 415 | { |
| 412 | UINT16* dmaram = m_dmaram; | |
| 416 | UINT16* dmaram = m_dmaram.target(); | |
| 413 | 417 | |
| 414 | 418 | COMBINE_DATA(&dmaram[offset]); |
| 415 | 419 | if (offset==13 && dmaram[offset]==0x40) |
| r14896 | r14897 | |
| 483 | 487 | READ16_MEMBER(srmp6_state::tileram_r) |
| 484 | 488 | { |
| 485 | 489 | |
| 486 | return m_chrram[offset]; | |
| 490 | return m_chrram.target()[offset]; | |
| 487 | 491 | } |
| 488 | 492 | |
| 489 | 493 | WRITE16_MEMBER(srmp6_state::tileram_w) |
| 490 | 494 | { |
| 491 | 495 | |
| 492 | 496 | //UINT16 tmp; |
| 493 | COMBINE_DATA(&m_chrram[offset]); | |
| 497 | COMBINE_DATA(&m_chrram.target()[offset]); | |
| 494 | 498 | |
| 495 | 499 | /* are the DMA registers enabled some other way, or always mapped here, over RAM? */ |
| 496 | 500 | if (offset >= 0xfff00/2 && offset <= 0xfff1a/2 ) |
| r14896 | r14897 | |
| 505 | 509 | INT8 r, g, b; |
| 506 | 510 | int brg = m_brightness - 0x60; |
| 507 | 511 | |
| 508 | paletteram | |
| 512 | paletteram | |
| 509 | 513 | |
| 510 | 514 | if(brg) |
| 511 | 515 | { |
| r14896 | r14897 | |
| 551 | 555 | AM_RANGE(0x4d0000, 0x4d0001) AM_READ(srmp6_irq_ack_r) |
| 552 | 556 | |
| 553 | 557 | // OBJ RAM: checked [$400000-$47dfff] |
| 554 | AM_RANGE(0x400000, 0x47ffff) AM_RAM AM_ | |
| 558 | AM_RANGE(0x400000, 0x47ffff) AM_RAM AM_ | |
| 555 | 559 | |
| 556 | 560 | // CHR RAM: checked [$500000-$5fffff] |
| 557 | AM_RANGE(0x500000, 0x5fffff) AM_READWRITE(tileram_r,tileram_w) AM_BASE(m_chrram) | |
| 558 | //AM_RANGE(0x5fff00, 0x5fffff) AM_WRITE_LEGACY(dma_w) AM_BASE(m_dmaram) | |
| 561 | AM_RANGE(0x500000, 0x5fffff) AM_READWRITE(tileram_r,tileram_w) AM_SHARE("chrram") | |
| 562 | //AM_RANGE(0x5fff00, 0x5fffff) AM_WRITE_LEGACY(dma_w) AM_SHARE("dmaram") | |
| 559 | 563 | |
| 560 | AM_RANGE(0x4c0000, 0x4c006f) AM_READWRITE(video_regs_r, video_regs_w) AM_ | |
| 564 | AM_RANGE(0x4c0000, 0x4c006f) AM_READWRITE(video_regs_r, video_regs_w) AM_ | |
| 561 | 565 | AM_RANGE(0x4e0000, 0x4e00ff) AM_DEVREADWRITE_LEGACY("nile", nile_snd_r, nile_snd_w) |
| 562 | 566 | AM_RANGE(0x4e0100, 0x4e0101) AM_DEVREADWRITE_LEGACY("nile", nile_sndctrl_r, nile_sndctrl_w) |
| 563 | 567 | //AM_RANGE(0x4e0110, 0x4e0111) AM_NOP // ? accessed once ($268dc, written $b.w) |
| r14896 | r14897 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | if (ACCESSING_BITS_0_7) |
| 46 | 46 | { |
| 47 | soundlatch_w(space, offset, data & 0xff); | |
| 47 | soundlatch_byte_w(space, offset, data & 0xff); | |
| 48 | 48 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 49 | 49 | } |
| 50 | 50 | } |
| r14896 | r14897 | |
| 191 | 191 | static ADDRESS_MAP_START( sf_map, AS_PROGRAM, 16, sf_state ) |
| 192 | 192 | AM_RANGE(0x000000, 0x04ffff) AM_ROM |
| 193 | 193 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(sf_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 194 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 194 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 195 | 195 | AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("COINS") |
| 196 | 196 | AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("IN0") |
| 197 | 197 | AM_RANGE(0xc00004, 0xc00005) AM_READ(button1_r) |
| r14896 | r14897 | |
| 213 | 213 | static ADDRESS_MAP_START( sfus_map, AS_PROGRAM, 16, sf_state ) |
| 214 | 214 | AM_RANGE(0x000000, 0x04ffff) AM_ROM |
| 215 | 215 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(sf_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 216 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 216 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 217 | 217 | AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("IN0") |
| 218 | 218 | AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("IN1") |
| 219 | 219 | AM_RANGE(0xc00004, 0xc00005) AM_READ(dummy_r) |
| r14896 | r14897 | |
| 235 | 235 | static ADDRESS_MAP_START( sfjp_map, AS_PROGRAM, 16, sf_state ) |
| 236 | 236 | AM_RANGE(0x000000, 0x04ffff) AM_ROM |
| 237 | 237 | AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(sf_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 238 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 238 | AM_RANGE(0xb00000, 0xb007ff) AM_RAM_WRITE(paletteram | |
| 239 | 239 | AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("COINS") |
| 240 | 240 | AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("P1") |
| 241 | 241 | AM_RANGE(0xc00004, 0xc00005) AM_READ_PORT("P2") |
| r14896 | r14897 | |
| 257 | 257 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, sf_state ) |
| 258 | 258 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 259 | 259 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 260 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r) | |
| 260 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) | |
| 261 | 261 | AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r,ym2151_w) |
| 262 | 262 | ADDRESS_MAP_END |
| 263 | 263 | |
| r14896 | r14897 | |
| 272 | 272 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 273 | 273 | AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("msm1", msm5205_w) |
| 274 | 274 | AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("msm2", msm5205_w) |
| 275 | AM_RANGE(0x01, 0x01) AM_READ(soundlatch_r) | |
| 275 | AM_RANGE(0x01, 0x01) AM_READ(soundlatch_byte_r) | |
| 276 | 276 | AM_RANGE(0x02, 0x02) AM_WRITE(sound2_bank_w) |
| 277 | 277 | ADDRESS_MAP_END |
| 278 | 278 |
| r14896 | r14897 | |
|---|---|---|
| 204 | 204 | { |
| 205 | 205 | public: |
| 206 | 206 | konamim2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 207 | : driver_device(mconfig, type, tag) { } | |
| 207 | : driver_device(mconfig, type, tag) , | |
| 208 | m_main_ram(*this, "main_ram"){ } | |
| 208 | 209 | |
| 209 | UINT64 | |
| 210 | required_shared_ptr<UINT64> | |
| 210 | 211 | UINT32 m_vdl0_address; |
| 211 | 212 | UINT32 m_vdl1_address; |
| 212 | 213 | UINT32 m_irq_enable; |
| r14896 | r14897 | |
| 261 | 262 | UINT32 fb_start = 0xffffffff; |
| 262 | 263 | if (state->m_vdl0_address != 0) |
| 263 | 264 | { |
| 264 | fb_start = *(UINT32*)&state->m_main_ram[(state->m_vdl0_address - 0x40000000) / 8] - 0x40000000; | |
| 265 | fb_start = *(UINT32*)&state->m_main_ram.target()[(state->m_vdl0_address - 0x40000000) / 8] - 0x40000000; | |
| 265 | 266 | } |
| 266 | 267 | |
| 267 | 268 | if (fb_start <= 0x800000) |
| 268 | 269 | { |
| 269 | UINT16 *frame = (UINT16*)&state->m_main_ram[fb_start/8]; | |
| 270 | UINT16 *frame = (UINT16*)&state->m_main_ram.target()[fb_start/8]; | |
| 270 | 271 | for (j=0; j < 384; j++) |
| 271 | 272 | { |
| 272 | 273 | UINT16 *fb = &frame[(j*512)]; |
| r14896 | r14897 | |
| 1134 | 1135 | AM_RANGE(0x10000000, 0x10000007) AM_READ(cpu_r) |
| 1135 | 1136 | AM_RANGE(0x10000008, 0x10001007) AM_NOP // ??? |
| 1136 | 1137 | AM_RANGE(0x20000000, 0x201fffff) AM_ROM AM_SHARE("share2") |
| 1137 | AM_RANGE(0x40000000, 0x407fffff) AM_RAM AM_SHARE("share3") AM_ | |
| 1138 | AM_RANGE(0x40000000, 0x407fffff) AM_RAM AM_SHARE("share3") AM_ | |
| 1138 | 1139 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("boot", 0) AM_SHARE("share2") |
| 1139 | 1140 | ADDRESS_MAP_END |
| 1140 | 1141 |
| r14896 | r14897 | |
|---|---|---|
| 12 | 12 | { |
| 13 | 13 | public: |
| 14 | 14 | cball_state(const machine_config &mconfig, device_type type, const char *tag) |
| 15 | : driver_device(mconfig, type, tag) { } | |
| 15 | : driver_device(mconfig, type, tag) , | |
| 16 | m_video_ram(*this, "video_ram"){ } | |
| 16 | 17 | |
| 17 | 18 | /* memory pointers */ |
| 18 | UINT8 | |
| 19 | required_shared_ptr<UINT8> | |
| 19 | 20 | |
| 20 | 21 | /* video-related */ |
| 21 | 22 | tilemap_t* m_bg_tilemap; |
| r14896 | r14897 | |
| 31 | 32 | static TILE_GET_INFO( get_tile_info ) |
| 32 | 33 | { |
| 33 | 34 | cball_state *state = machine.driver_data<cball_state>(); |
| 34 | UINT8 code = state->m_video_ram[tile_index]; | |
| 35 | UINT8 code = state->m_video_ram.target()[tile_index]; | |
| 35 | 36 | |
| 36 | 37 | SET_TILE_INFO(0, code, code >> 7, 0); |
| 37 | 38 | } |
| r14896 | r14897 | |
| 40 | 41 | WRITE8_MEMBER(cball_state::cball_vram_w) |
| 41 | 42 | { |
| 42 | 43 | |
| 43 | m_video_ram[offset] = data; | |
| 44 | m_video_ram.target()[offset] = data; | |
| 44 | 45 | m_bg_tilemap->mark_tile_dirty(offset); |
| 45 | 46 | } |
| 46 | 47 | |
| r14896 | r14897 | |
| 61 | 62 | |
| 62 | 63 | /* draw sprite */ |
| 63 | 64 | drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], |
| 64 | state->m_video_ram[0x399] >> 4, | |
| 65 | state->m_video_ram.target()[0x399] >> 4, | |
| 65 | 66 | 0, |
| 66 | 67 | 0, 0, |
| 67 | 240 - state->m_video_ram[0x390], | |
| 68 | 240 - state->m_video_ram[0x398], 0); | |
| 68 | 240 - state->m_video_ram.target()[0x390], | |
| 69 | 240 - state->m_video_ram.target()[0x398], 0); | |
| 69 | 70 | return 0; |
| 70 | 71 | } |
| 71 | 72 | |
| r14896 | r14897 | |
| 112 | 113 | READ8_MEMBER(cball_state::cball_wram_r) |
| 113 | 114 | { |
| 114 | 115 | |
| 115 | return m_video_ram[0x380 + offset]; | |
| 116 | return m_video_ram.target()[0x380 + offset]; | |
| 116 | 117 | } |
| 117 | 118 | |
| 118 | 119 | |
| 119 | 120 | WRITE8_MEMBER(cball_state::cball_wram_w) |
| 120 | 121 | { |
| 121 | 122 | |
| 122 | m_video_ram[0x380 + offset] = data; | |
| 123 | m_video_ram.target()[0x380 + offset] = data; | |
| 123 | 124 | } |
| 124 | 125 | |
| 125 | 126 | |
| r14896 | r14897 | |
| 138 | 139 | AM_RANGE(0x2800, 0x2800) AM_READ_PORT("2800") |
| 139 | 140 | |
| 140 | 141 | AM_RANGE(0x0000, 0x03ff) AM_WRITE(cball_wram_w) AM_MASK(0x7f) |
| 141 | AM_RANGE(0x0400, 0x07ff) AM_WRITE(cball_vram_w) AM_ | |
| 142 | AM_RANGE(0x0400, 0x07ff) AM_WRITE(cball_vram_w) AM_ | |
| 142 | 143 | AM_RANGE(0x1800, 0x1800) AM_NOP /* watchdog? */ |
| 143 | 144 | AM_RANGE(0x1810, 0x1811) AM_NOP |
| 144 | 145 | AM_RANGE(0x1820, 0x1821) AM_NOP |
| r14896 | r14897 | |
|---|---|---|
| 1245 | 1245 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) |
| 1246 | 1246 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) |
| 1247 | 1247 | PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1248 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) | |
| 1248 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) | |
| 1249 | 1249 | |
| 1250 | 1250 | PORT_START("IN1") |
| 1251 | 1251 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| r14896 | r14897 | |
| 1526 | 1526 | |
| 1527 | 1527 | /* pia */ |
| 1528 | 1528 | MCFG_PIA6821_MODIFY("pia_0", lottofun_pia_0_intf) |
| 1529 | MCFG_TICKET_DISPENSER_ADD("ticket", 70, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 1529 | MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(70), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH) | |
| 1530 | 1530 | MACHINE_CONFIG_END |
| 1531 | 1531 | |
| 1532 | 1532 |
| r14896 | r14897 | |
|---|---|---|
| 461 | 461 | |
| 462 | 462 | if ((data&1)==0) device_set_input_line(m_maincpu, M6809_IRQ_LINE, CLEAR_LINE); |
| 463 | 463 | if (data & 2) m_nmi_enable =1; else m_nmi_enable = 0; |
| 464 | flip_screen_set( | |
| 464 | flip_screen_set( | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | WRITE8_MEMBER(dec8_state::csilver_control_w) |
| r14896 | r14897 | |
| 478 | 478 | |
| 479 | 479 | WRITE8_MEMBER(dec8_state::dec8_sound_w) |
| 480 | 480 | { |
| 481 | soundlatch_w(space, 0, data); | |
| 481 | soundlatch_byte_w(space, 0, data); | |
| 482 | 482 | device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); |
| 483 | 483 | } |
| 484 | 484 | |
| r14896 | r14897 | |
| 576 | 576 | |
| 577 | 577 | /******************************************************************************/ |
| 578 | 578 | |
| 579 | WRITE8_MEMBER(dec8_state::flip_screen_w){ flip_screen_set( | |
| 579 | WRITE8_MEMBER(dec8_state::flip_screen_w){ flip_screen_set( | |
| 580 | 580 | |
| 581 | 581 | /******************************************************************************/ |
| 582 | 582 | |
| 583 | 583 | |
| 584 | 584 | static ADDRESS_MAP_START( lastmisn_map, AS_PROGRAM, 8, dec8_state ) |
| 585 | 585 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 586 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3") AM_SHARE("paletteram") | |
| 587 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4") AM_SHARE("paletteram2") | |
| 586 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram") | |
| 587 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2") | |
| 588 | 588 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 589 | 589 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 590 | 590 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 609 | 609 | |
| 610 | 610 | static ADDRESS_MAP_START( lastmisn_sub_map, AS_PROGRAM, 8, dec8_state ) |
| 611 | 611 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 612 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3") | |
| 613 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4") | |
| 612 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") | |
| 613 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") | |
| 614 | 614 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 615 | 615 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 616 | 616 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 629 | 629 | |
| 630 | 630 | static ADDRESS_MAP_START( shackled_map, AS_PROGRAM, 8, dec8_state ) |
| 631 | 631 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 632 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3") AM_SHARE("paletteram") | |
| 633 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4") AM_SHARE("paletteram2") | |
| 632 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram") | |
| 633 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2") | |
| 634 | 634 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 635 | 635 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 636 | 636 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 653 | 653 | |
| 654 | 654 | static ADDRESS_MAP_START( shackled_sub_map, AS_PROGRAM, 8, dec8_state ) |
| 655 | 655 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 656 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3") | |
| 657 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4") | |
| 656 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") | |
| 657 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") | |
| 658 | 658 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 659 | 659 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 660 | 660 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 680 | 680 | AM_RANGE(0x0000, 0x17ff) AM_RAM |
| 681 | 681 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(dec8_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 682 | 682 | AM_RANGE(0x2000, 0x27ff) AM_READWRITE(dec8_bg_data_r, dec8_bg_data_w) AM_BASE(m_bg_data) |
| 683 | AM_RANGE(0x2800, 0x2bff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 684 | AM_RANGE(0x2c00, 0x2fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 683 | AM_RANGE(0x2800, 0x2bff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 684 | AM_RANGE(0x2c00, 0x2fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 685 | 685 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") /* Sprites */ |
| 686 | 686 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("DSW0") /* Dip 1 */ |
| 687 | 687 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("DSW1") /* Dip 2 */ |
| r14896 | r14897 | |
| 703 | 703 | AM_RANGE(0x0000, 0x17ff) AM_RAM |
| 704 | 704 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(dec8_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 705 | 705 | AM_RANGE(0x2000, 0x27ff) AM_READWRITE(dec8_bg_data_r, dec8_bg_data_w) AM_BASE(m_bg_data) |
| 706 | AM_RANGE(0x2800, 0x2bff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 707 | AM_RANGE(0x2c00, 0x2fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 706 | AM_RANGE(0x2800, 0x2bff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 707 | AM_RANGE(0x2c00, 0x2fff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 708 | 708 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") /* Sprites */ |
| 709 | 709 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("DSW0") /* Dip 1 */ |
| 710 | 710 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("DSW1") /* Dip 2 */ |
| r14896 | r14897 | |
| 747 | 747 | |
| 748 | 748 | static ADDRESS_MAP_START( csilver_map, AS_PROGRAM, 8, dec8_state ) |
| 749 | 749 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 750 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3") AM_SHARE("paletteram") | |
| 751 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4") AM_SHARE("paletteram2") | |
| 750 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram") | |
| 751 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2") | |
| 752 | 752 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN1") |
| 753 | 753 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN0") |
| 754 | 754 | AM_RANGE(0x1803, 0x1803) AM_READ_PORT("IN2") |
| r14896 | r14897 | |
| 772 | 772 | |
| 773 | 773 | static ADDRESS_MAP_START( csilver_sub_map, AS_PROGRAM, 8, dec8_state ) |
| 774 | 774 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 775 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3") | |
| 776 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4") | |
| 775 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") | |
| 776 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") | |
| 777 | 777 | AM_RANGE(0x1803, 0x1803) AM_READ_PORT("IN2") |
| 778 | 778 | AM_RANGE(0x1804, 0x1804) AM_READ_PORT("DSW1") |
| 779 | 779 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
| r14896 | r14897 | |
| 793 | 793 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(dec8_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 794 | 794 | AM_RANGE(0x2800, 0x2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w) |
| 795 | 795 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") /* Sprites */ |
| 796 | AM_RANGE(0x3800, 0x3bff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_SHARE("paletteram") | |
| 796 | AM_RANGE(0x3800, 0x3bff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("paletteram") | |
| 797 | 797 | AM_RANGE(0x3c00, 0x3c00) AM_READ_PORT("IN0") |
| 798 | 798 | AM_RANGE(0x3c01, 0x3c01) AM_READ_PORT("IN1") |
| 799 | 799 | AM_RANGE(0x3c02, 0x3c02) AM_READ_PORT("IN2") /* VBL & coins */ |
| r14896 | r14897 | |
| 831 | 831 | AM_RANGE(0x1805, 0x1806) AM_WRITE(srdarwin_control_w) /* Scroll & Bank */ |
| 832 | 832 | AM_RANGE(0x2000, 0x2000) AM_READWRITE(i8751_h_r, dec8_sound_w) /* Sound */ |
| 833 | 833 | AM_RANGE(0x2001, 0x2001) AM_READWRITE(i8751_l_r, flip_screen_w) /* Flipscreen */ |
| 834 | AM_RANGE(0x2800, 0x288f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("paletteram") | |
| 835 | AM_RANGE(0x3000, 0x308f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("paletteram2") | |
| 834 | AM_RANGE(0x2800, 0x288f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") | |
| 835 | AM_RANGE(0x3000, 0x308f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 836 | 836 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("DSW0") /* Dip 1 */ |
| 837 | 837 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("IN0") /* Player 1 */ |
| 838 | 838 | AM_RANGE(0x3802, 0x3802) AM_READ_PORT("IN1") /* Player 2 (cocktail) + VBL */ |
| r14896 | r14897 | |
| 848 | 848 | AM_RANGE(0x1800, 0x1fff) AM_RAM |
| 849 | 849 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(dec8_videoram_w) AM_BASE_SIZE(m_videoram, m_videoram_size) |
| 850 | 850 | AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("spriteram") |
| 851 | AM_RANGE(0x3000, 0x31ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_SHARE("paletteram") | |
| 851 | AM_RANGE(0x3000, 0x31ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("paletteram") | |
| 852 | 852 | AM_RANGE(0x3200, 0x37ff) AM_WRITEONLY /* Unused */ |
| 853 | 853 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("IN0") /* Player 1 */ |
| 854 | 854 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("IN1") /* Player 2 */ |
| r14896 | r14897 | |
| 873 | 873 | AM_RANGE(0x0000, 0x05ff) AM_RAM |
| 874 | 874 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 875 | 875 | AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ym2", ym3812_w) |
| 876 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 876 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 877 | 877 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 878 | 878 | ADDRESS_MAP_END |
| 879 | 879 | |
| r14896 | r14897 | |
| 882 | 882 | AM_RANGE(0x0000, 0x05ff) AM_RAM |
| 883 | 883 | AM_RANGE(0x2000, 0x2001) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 884 | 884 | AM_RANGE(0x4000, 0x4001) AM_DEVWRITE_LEGACY("ym2", ym3526_w) |
| 885 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r) | |
| 885 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) | |
| 886 | 886 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 887 | 887 | ADDRESS_MAP_END |
| 888 | 888 | |
| r14896 | r14897 | |
| 891 | 891 | AM_RANGE(0x0000, 0x05ff) AM_RAM |
| 892 | 892 | AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ym1", ym2203_w) |
| 893 | 893 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3526_w) |
| 894 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 894 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 895 | 895 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 896 | 896 | ADDRESS_MAP_END |
| 897 | 897 | |
| r14896 | r14897 | |
| 902 | 902 | AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3526_w) |
| 903 | 903 | AM_RANGE(0x1800, 0x1800) AM_WRITE(csilver_adpcm_data_w) /* ADPCM data for the MSM5205 chip */ |
| 904 | 904 | AM_RANGE(0x2000, 0x2000) AM_WRITE(csilver_sound_bank_w) |
| 905 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r) | |
| 905 | AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r) | |
| 906 | 906 | AM_RANGE(0x3400, 0x3400) AM_DEVREAD_LEGACY("msm", csilver_adpcm_reset_r) /* ? not sure */ |
| 907 | 907 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank3") |
| 908 | 908 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 34 | 34 | { |
| 35 | 35 | public: |
| 36 | 36 | slotcarn_state(const machine_config &mconfig, device_type type, const char *tag) |
| 37 | : driver_device(mconfig, type, tag) { } | |
| 37 | : driver_device(mconfig, type, tag) , | |
| 38 | m_backup_ram(*this, "backup_ram"), | |
| 39 | m_ram_attr(*this, "raattr"), | |
| 40 | m_ram_video(*this, "ravideo"){ } | |
| 38 | 41 | |
| 39 | 42 | pen_t m_pens[NUM_PENS]; |
| 40 | UINT8 *m_ram_attr; | |
| 41 | UINT8 *m_ram_video; | |
| 43 | required_shared_ptr<UINT8> m_backup_ram; | |
| 44 | required_shared_ptr<UINT8> m_ram_attr; | |
| 45 | required_shared_ptr<UINT8> m_ram_video; | |
| 42 | 46 | UINT8 *m_ram_palette; |
| 43 | UINT8 *m_backup_ram; | |
| 44 | 47 | DECLARE_READ8_MEMBER(palette_r); |
| 45 | 48 | DECLARE_WRITE8_MEMBER(palette_w); |
| 46 | 49 | }; |
| r14896 | r14897 | |
| 60 | 63 | { |
| 61 | 64 | int co; |
| 62 | 65 | |
| 63 | co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 66 | co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 64 | 67 | return m_ram_palette[co]; |
| 65 | 68 | } |
| 66 | 69 | |
| r14896 | r14897 | |
| 71 | 74 | machine().primary_screen->update_now(); |
| 72 | 75 | data &= 0x0f; |
| 73 | 76 | |
| 74 | co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 77 | co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07); | |
| 75 | 78 | m_ram_palette[co] = data; |
| 76 | 79 | |
| 77 | 80 | } |
| r14896 | r14897 | |
| 117 | 120 | for (cx = 0; cx < x_count; cx++) |
| 118 | 121 | { |
| 119 | 122 | int i; |
| 120 | int attr = state->m_ram_attr[ma & 0x7ff]; | |
| 123 | int attr = state->m_ram_attr.target()[ma & 0x7ff]; | |
| 121 | 124 | int region = (attr & 0x40) >> 6; |
| 122 | int addr = ((state->m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f); | |
| 125 | int addr = ((state->m_ram_video.target()[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f); | |
| 123 | 126 | int colour = (attr & 0x7f) << 3; |
| 124 | 127 | UINT8 *data; |
| 125 | 128 | |
| r14896 | r14897 | |
| 181 | 184 | |
| 182 | 185 | static ADDRESS_MAP_START( slotcarn_map, AS_PROGRAM, 8, slotcarn_state ) |
| 183 | 186 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 184 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_ | |
| 187 | AM_RANGE(0x6000, 0x67ff) AM_RAM AM_ | |
| 185 | 188 | AM_RANGE(0x6800, 0x6fff) AM_RAM // spielbud |
| 186 | 189 | AM_RANGE(0x7000, 0xafff) AM_ROM // spielbud |
| 187 | 190 | |
| r14896 | r14897 | |
| 201 | 204 | AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 202 | 205 | AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("crtc", mc6845_device, register_w) |
| 203 | 206 | |
| 204 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(m_ram_attr) | |
| 205 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(m_ram_video) | |
| 207 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("raattr") | |
| 208 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("ravideo") | |
| 206 | 209 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w) |
| 207 | 210 | ADDRESS_MAP_END |
| 208 | 211 |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | WRITE8_MEMBER(tbowl_state::tbowl_sound_command_w) |
| 71 | 71 | { |
| 72 | soundlatch_w(space, offset, data); | |
| 72 | soundlatch_byte_w(space, offset, data); | |
| 73 | 73 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 74 | 74 | } |
| 75 | 75 | |
| r14896 | r14897 | |
| 131 | 131 | AM_RANGE(0xc000, 0xdfff) AM_READONLY |
| 132 | 132 | AM_RANGE(0xc000, 0xd7ff) AM_WRITEONLY |
| 133 | 133 | AM_RANGE(0xd800, 0xdfff) AM_WRITEONLY AM_BASE(m_spriteram) |
| 134 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_SHARE("paletteram") // 2x palettes, one for each monitor? | |
| 134 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_byte_be_w) AM_SHARE("paletteram") // 2x palettes, one for each monitor? | |
| 135 | 135 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK("bank2") |
| 136 | 136 | AM_RANGE(0xf800, 0xfbff) AM_READWRITE(shared_r, shared_w) |
| 137 | 137 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(tbowlc_bankswitch_w) |
| r14896 | r14897 | |
| 192 | 192 | AM_RANGE(0xe004, 0xe005) AM_WRITE(tbowl_adpcm_vol_w) |
| 193 | 193 | AM_RANGE(0xe006, 0xe006) AM_WRITENOP |
| 194 | 194 | AM_RANGE(0xe007, 0xe007) AM_WRITENOP /* NMI acknowledge */ |
| 195 | AM_RANGE(0xe010, 0xe010) AM_READ(soundlatch_r) | |
| 195 | AM_RANGE(0xe010, 0xe010) AM_READ(soundlatch_byte_r) | |
| 196 | 196 | ADDRESS_MAP_END |
| 197 | 197 | |
| 198 | 198 | /*** Input Ports |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | 0x01 = Y Scroll MSB |
| 36 | 36 | */ |
| 37 | 37 | |
| 38 | flip_screen_set( | |
| 38 | flip_screen_set( | |
| 39 | 39 | |
| 40 | 40 | /* |
| 41 | 41 | I think that the NMI is an inhibitor. It is constantly set |
| r14896 | r14897 | |
|---|---|---|
| 97 | 97 | * |
| 98 | 98 | *************************************/ |
| 99 | 99 | |
| 100 | ||
| 100 | ||
| 101 | 101 | { |
| 102 | int temp = input_port_read( | |
| 102 | int temp = input_port_read( | |
| 103 | 103 | temp ^= 0x0001; /* /A2DRDY always high for now */ |
| 104 | 104 | temp ^= 0x0008; /* A2D.EOC always high for now */ |
| 105 | 105 | return (temp << 16) | temp; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | ||
| 109 | ||
| 110 | 110 | { |
| 111 | atarigt_state *state = space->machine().driver_data<atarigt_state>(); | |
| 112 | int temp = input_port_read(space->machine(), "COIN"); | |
| 113 | if (state->m_video_int_state) temp ^= 0x0001; | |
| 114 | if (state->m_scanline_int_state) temp ^= 0x0002; | |
| 111 | int temp = input_port_read(machine(), "COIN"); | |
| 112 | if (m_video_int_state) temp ^= 0x0001; | |
| 113 | if (m_scanline_int_state) temp ^= 0x0002; | |
| 115 | 114 | return (temp << 16) | temp; |
| 116 | 115 | } |
| 117 | 116 | |
| r14896 | r14897 | |
| 149 | 148 | #endif |
| 150 | 149 | |
| 151 | 150 | |
| 152 | ||
| 151 | ||
| 153 | 152 | { |
| 154 | 153 | #if (HACK_TMEK_CONTROLS) |
| 155 | 154 | int pots[4]; |
| 156 | 155 | compute_fake_pots(pots); |
| 157 | 156 | return (pots[0] << 24) | (pots[3] << 8); |
| 158 | 157 | #else |
| 159 | return (input_port_read( | |
| 158 | return (input_port_read( | |
| 160 | 159 | #endif |
| 161 | 160 | } |
| 162 | 161 | |
| 163 | 162 | |
| 164 | ||
| 163 | ||
| 165 | 164 | { |
| 166 | 165 | #if (HACK_TMEK_CONTROLS) |
| 167 | 166 | int pots[4]; |
| 168 | 167 | compute_fake_pots(pots); |
| 169 | 168 | return (pots[2] << 24) | (pots[1] << 8); |
| 170 | 169 | #else |
| 171 | return (input_port_read( | |
| 170 | return (input_port_read( | |
| 172 | 171 | #endif |
| 173 | 172 | } |
| 174 | 173 | |
| r14896 | r14897 | |
| 180 | 179 | * |
| 181 | 180 | *************************************/ |
| 182 | 181 | |
| 183 | ||
| 182 | ||
| 184 | 183 | { |
| 185 | 184 | /* |
| 186 | 185 | D13 = 68.DISA |
| r14896 | r14897 | |
| 196 | 195 | /* upper byte */ |
| 197 | 196 | if (ACCESSING_BITS_24_31) |
| 198 | 197 | { |
| 199 | atarigt_state *state = space->machine().driver_data<atarigt_state>(); | |
| 200 | 198 | |
| 201 | 199 | /* bits 13-11 are the MO control bits */ |
| 202 | atarirle_control_w( | |
| 200 | atarirle_control_w( | |
| 203 | 201 | } |
| 204 | 202 | |
| 205 | 203 | if (ACCESSING_BITS_16_23) |
| 206 | 204 | { |
| 207 | //cage_reset_w(space, data & 0x00100000); | |
| 208 | coin_counter_w(space->machine(), 0, data & 0x00080000); | |
| 209 | coin_counter_w(space->machine(), 1, data & 0x00010000); | |
| 205 | //cage_reset_w(&space, data & 0x00100000); | |
| 206 | coin_counter_w(machine(), 0, data & 0x00080000); | |
| 207 | coin_counter_w(machine(), 1, data & 0x00010000); | |
| 210 | 208 | } |
| 211 | 209 | } |
| 212 | 210 | |
| 213 | 211 | |
| 214 | ||
| 212 | ||
| 215 | 213 | { |
| 216 | atarigt_state *state = space->machine().driver_data<atarigt_state>(); | |
| 217 | COMBINE_DATA(state->m_mo_command); | |
| 214 | COMBINE_DATA(m_mo_command); | |
| 218 | 215 | if (ACCESSING_BITS_0_15) |
| 219 | atarirle_command_w( | |
| 216 | atarirle_command_w( | |
| 220 | 217 | } |
| 221 | 218 | |
| 222 | 219 | |
| 223 | ||
| 220 | ||
| 224 | 221 | { |
| 225 | 222 | // logerror("LED = %08X & %08X\n", data, mem_mask); |
| 226 | 223 | } |
| r14896 | r14897 | |
| 233 | 230 | * |
| 234 | 231 | *************************************/ |
| 235 | 232 | |
| 236 | ||
| 233 | ||
| 237 | 234 | { |
| 238 | 235 | UINT32 result = 0; |
| 239 | 236 | |
| 240 | 237 | if (ACCESSING_BITS_0_15) |
| 241 | result |= cage_control_r( | |
| 238 | result |= cage_control_r( | |
| 242 | 239 | if (ACCESSING_BITS_16_31) |
| 243 | result |= cage_main_r(space) << 16; | |
| 240 | result |= cage_main_r(&space) << 16; | |
| 244 | 241 | return result; |
| 245 | 242 | } |
| 246 | 243 | |
| 247 | 244 | |
| 248 | ||
| 245 | ||
| 249 | 246 | { |
| 250 | 247 | if (ACCESSING_BITS_0_15) |
| 251 | cage_control_w( | |
| 248 | cage_control_w( | |
| 252 | 249 | if (ACCESSING_BITS_16_31) |
| 253 | cage_main_w(space, data >> 16); | |
| 250 | cage_main_w(&space, data >> 16); | |
| 254 | 251 | } |
| 255 | 252 | |
| 256 | 253 | |
| r14896 | r14897 | |
| 552 | 549 | * |
| 553 | 550 | *************************************/ |
| 554 | 551 | |
| 555 | ||
| 552 | ||
| 556 | 553 | { |
| 557 | atarigt_state *state = space->machine().driver_data<atarigt_state>(); | |
| 558 | 554 | offs_t address = 0xd80000 + offset * 4; |
| 559 | 555 | UINT32 result32 = 0; |
| 560 | 556 | UINT16 result; |
| 561 | 557 | |
| 562 | 558 | if (ACCESSING_BITS_16_31) |
| 563 | 559 | { |
| 564 | result = atarigt_colorram_r(state, address); | |
| 565 | (*state->m_protection_r)(space, address, &result); | |
| 560 | result = atarigt_colorram_r(address); | |
| 561 | (*m_protection_r)(&space, address, &result); | |
| 566 | 562 | result32 |= result << 16; |
| 567 | 563 | } |
| 568 | 564 | if (ACCESSING_BITS_0_15) |
| 569 | 565 | { |
| 570 | result = atarigt_colorram_r(state, address + 2); | |
| 571 | (*state->m_protection_r)(space, address + 2, &result); | |
| 566 | result = atarigt_colorram_r(address + 2); | |
| 567 | (*m_protection_r)(&space, address + 2, &result); | |
| 572 | 568 | result32 |= result; |
| 573 | 569 | } |
| 574 | 570 | |
| r14896 | r14897 | |
| 576 | 572 | } |
| 577 | 573 | |
| 578 | 574 | |
| 579 | ||
| 575 | ||
| 580 | 576 | { |
| 581 | atarigt_state *state = space->machine().driver_data<atarigt_state>(); | |
| 582 | 577 | offs_t address = 0xd80000 + offset * 4; |
| 583 | 578 | |
| 584 | 579 | if (ACCESSING_BITS_16_31) |
| 585 | 580 | { |
| 586 | if (!state->m_ignore_writes) | |
| 587 | atarigt_colorram_w(state, address, data >> 16, mem_mask >> 16); | |
| 588 | (*state->m_protection_w)(space, address, data >> 16); | |
| 581 | if (!m_ignore_writes) | |
| 582 | atarigt_colorram_w(address, data >> 16, mem_mask >> 16); | |
| 583 | (*m_protection_w)(&space, address, data >> 16); | |
| 589 | 584 | } |
| 590 | 585 | if (ACCESSING_BITS_0_15) |
| 591 | 586 | { |
| 592 | if (!state->m_ignore_writes) | |
| 593 | atarigt_colorram_w(state, address + 2, data, mem_mask); | |
| 594 | (*state->m_protection_w)(space, address + 2, data); | |
| 587 | if (!m_ignore_writes) | |
| 588 | atarigt_colorram_w(address + 2, data, mem_mask); | |
| 589 | (*m_protection_w)(&space, address + 2, data); | |
| 595 | 590 | } |
| 596 | 591 | } |
| 597 | 592 | |
| r14896 | r14897 | |
| 605 | 600 | |
| 606 | 601 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atarigt_state ) |
| 607 | 602 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 608 | AM_RANGE(0xc00000, 0xc00003) AM_READWRITE_LEGACY(sound_data_r, sound_data_w) | |
| 609 | AM_RANGE(0xd00014, 0xd00017) AM_READ_LEGACY(analog_port0_r) | |
| 610 | AM_RANGE(0xd0001c, 0xd0001f) AM_READ_LEGACY(analog_port1_r) | |
| 603 | AM_RANGE(0xc00000, 0xc00003) AM_READWRITE(sound_data_r, sound_data_w) | |
| 604 | AM_RANGE(0xd00014, 0xd00017) AM_READ(analog_port0_r) | |
| 605 | AM_RANGE(0xd0001c, 0xd0001f) AM_READ(analog_port1_r) | |
| 611 | 606 | AM_RANGE(0xd20000, 0xd20fff) AM_READWRITE_LEGACY(atarigen_eeprom_upper32_r, atarigen_eeprom32_w) AM_SHARE("eeprom") |
| 612 | 607 | AM_RANGE(0xd40000, 0xd4ffff) AM_WRITE_LEGACY(atarigen_eeprom_enable32_w) |
| 613 | 608 | AM_RANGE(0xd72000, 0xd75fff) AM_WRITE_LEGACY(atarigen_playfield32_w) AM_BASE(m_playfield32) |
| 614 | 609 | AM_RANGE(0xd76000, 0xd76fff) AM_WRITE_LEGACY(atarigen_alpha32_w) AM_BASE(m_alpha32) |
| 615 | 610 | AM_RANGE(0xd78000, 0xd78fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram32_r, atarirle_spriteram32_w) |
| 616 | AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE | |
| 611 | AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE | |
| 617 | 612 | AM_RANGE(0xd70000, 0xd7ffff) AM_RAM |
| 618 | AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE_LEGACY(colorram_protection_r, colorram_protection_w) AM_BASE(m_colorram) | |
| 619 | AM_RANGE(0xe04000, 0xe04003) AM_WRITE_LEGACY(led_w) | |
| 620 | AM_RANGE(0xe08000, 0xe08003) AM_WRITE_LEGACY(latch_w) | |
| 613 | AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE(colorram_protection_r, colorram_protection_w) AM_BASE(m_colorram) | |
| 614 | AM_RANGE(0xe04000, 0xe04003) AM_WRITE(led_w) | |
| 615 | AM_RANGE(0xe08000, 0xe08003) AM_WRITE(latch_w) | |
| 621 | 616 | AM_RANGE(0xe0a000, 0xe0a003) AM_WRITE_LEGACY(atarigen_scanline_int_ack32_w) |
| 622 | 617 | AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE_LEGACY(atarigen_video_int_ack32_w) |
| 623 | 618 | AM_RANGE(0xe0e000, 0xe0e003) AM_WRITENOP//watchdog_reset_w }, |
| 624 | 619 | AM_RANGE(0xe80000, 0xe80003) AM_READ_PORT("P1_P2") |
| 625 | AM_RANGE(0xe82000, 0xe82003) AM_READ_LEGACY(special_port2_r) | |
| 626 | AM_RANGE(0xe82004, 0xe82007) AM_READ_LEGACY(special_port3_r) | |
| 620 | AM_RANGE(0xe82000, 0xe82003) AM_READ(special_port2_r) | |
| 621 | AM_RANGE(0xe82004, 0xe82007) AM_READ(special_port3_r) | |
| 627 | 622 | AM_RANGE(0xf80000, 0xffffff) AM_RAM |
| 628 | 623 | ADDRESS_MAP_END |
| 629 | 624 | |
| r14896 | r14897 | |
| 1247 | 1242 | * |
| 1248 | 1243 | *************************************/ |
| 1249 | 1244 | |
| 1250 | ||
| 1245 | ||
| 1251 | 1246 | { |
| 1252 | offs_t pc = cpu_get_pc(&space | |
| 1247 | offs_t pc = cpu_get_pc(&space. | |
| 1253 | 1248 | |
| 1254 | 1249 | /* protected version */ |
| 1255 | 1250 | if (pc == 0x2EB3C || pc == 0x2EB48) |
| 1256 | 1251 | { |
| 1257 | logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(&space | |
| 1252 | logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(&space. | |
| 1258 | 1253 | /* skip these writes to make more stuff visible */ |
| 1259 | 1254 | return; |
| 1260 | 1255 | } |
| 1261 | 1256 | |
| 1262 | 1257 | /* unprotected version */ |
| 1263 | 1258 | if (pc == 0x25834 || pc == 0x25860) |
| 1264 | logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(&space | |
| 1259 | logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(&space. | |
| 1265 | 1260 | |
| 1266 | atarigen_playfield32_w(space, offset, data, mem_mask); | |
| 1261 | atarigen_playfield32_w(&space, offset, data, mem_mask); | |
| 1267 | 1262 | } |
| 1268 | 1263 | |
| 1269 | 1264 | static DRIVER_INIT( tmek ) |
| r14896 | r14897 | |
| 1281 | 1276 | state->m_protection_w = tmek_protection_w; |
| 1282 | 1277 | |
| 1283 | 1278 | /* temp hack */ |
| 1284 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1279 | machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ | |
| 1285 | 1280 | } |
| 1286 | 1281 | |
| 1287 | 1282 |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | WRITE8_MEMBER(crimfght_state::crimfght_sh_irqtrigger_w) |
| 34 | 34 | { |
| 35 | soundlatch_w(space, offset, data); | |
| 35 | soundlatch_byte_w(space, offset, data); | |
| 36 | 36 | device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); |
| 37 | 37 | } |
| 38 | 38 | |
| r14896 | r14897 | |
| 99 | 99 | AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM 821l01.h4 */ |
| 100 | 100 | AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */ |
| 101 | 101 | AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */ |
| 102 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 102 | AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 103 | 103 | AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE_LEGACY("k007232", k007232_r, k007232_w) /* 007232 registers */ |
| 104 | 104 | ADDRESS_MAP_END |
| 105 | 105 | |
| r14896 | r14897 | |
| 407 | 407 | if (lines & 0x20) |
| 408 | 408 | { |
| 409 | 409 | device->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank3"); |
| 410 | device->memory().space(AS_PROGRAM)->install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(crimfght_state::paletteram_xBBBBBGGGGGRRRRR_be_w), state)); | |
| 410 | device->memory().space(AS_PROGRAM)->install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(crimfght_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state)); | |
| 411 | 411 | memory_set_bankptr(device->machine(), "bank3", state->m_generic_paletteram_8); |
| 412 | 412 | } |
| 413 | 413 | else |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | AM_RANGE(0xa0c0, 0xa0c0) AM_MIRROR(0x5e1f) AM_READ_PORT("IN2") |
| 62 | 62 | AM_RANGE(0xa0e0, 0xa0e0) AM_MIRROR(0x5e1f) AM_READ_PORT("DSW0") |
| 63 | 63 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x5e7f) AM_WRITE(watchdog_reset_w) |
| 64 | AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x5e7f) AM_WRITE(soundlatch_w) | |
| 64 | AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x5e7f) AM_WRITE(soundlatch_byte_w) | |
| 65 | 65 | AM_RANGE(0xa180, 0xa180) AM_MIRROR(0x5e78) AM_WRITE(irq_enable_w) |
| 66 | 66 | AM_RANGE(0xa181, 0xa181) AM_MIRROR(0x5e78) AM_WRITE_LEGACY(timeplt_sh_irqtrigger_w) |
| 67 | 67 | AM_RANGE(0xa183, 0xa183) AM_MIRROR(0x5e78) AM_WRITENOP // ??? |
| r14896 | r14897 | |
|---|---|---|
| 93 | 93 | AM_RANGE(0x0300, 0x030f) AM_DEVREADWRITE_LEGACY("k053244", k053244_r, k053244_w) |
| 94 | 94 | AM_RANGE(0x0800, 0x0fff) AM_READ(rollerg_k051316_r) AM_DEVWRITE_LEGACY("k051316", k051316_w) |
| 95 | 95 | AM_RANGE(0x1000, 0x17ff) AM_DEVREADWRITE_LEGACY("k053244", k053245_r, k053245_w) |
| 96 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_SHARE("paletteram") | |
| 96 | AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_be_w) AM_SHARE("paletteram") | |
| 97 | 97 | AM_RANGE(0x2000, 0x3aff) AM_RAM |
| 98 | 98 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 99 | 99 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r14896 | r14897 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | public: |
| 77 | 77 | hvyunit_state(const machine_config &mconfig, device_type type, const char *tag) |
| 78 | : driver_device(mconfig, type, tag) { } | |
| 78 | : driver_device(mconfig, type, tag) , | |
| 79 | m_videoram(*this, "videoram"), | |
| 80 | m_colorram(*this, "colorram"){ } | |
| 79 | 81 | |
| 80 | 82 | /* Video */ |
| 81 | UINT8 *m_videoram; | |
| 82 | UINT8 *m_colorram; | |
| 83 | required_shared_ptr<UINT8> m_videoram; | |
| 84 | required_shared_ptr<UINT8> m_colorram; | |
| 83 | 85 | tilemap_t *m_bg_tilemap; |
| 84 | 86 | UINT16 m_scrollx; |
| 85 | 87 | UINT16 m_scrolly; |
| r14896 | r14897 | |
| 162 | 164 | { |
| 163 | 165 | hvyunit_state *state = machine.driver_data<hvyunit_state>(); |
| 164 | 166 | |
| 165 | int attr = state->m_colorram[tile_index]; | |
| 166 | int code = state->m_videoram[tile_index] + ((attr & 0x0f) << 8); | |
| 167 | int attr = state->m_colorram.target()[tile_index]; | |
| 168 | int code = state->m_videoram.target()[tile_index] + ((attr & 0x0f) << 8); | |
| 167 | 169 | int color = (attr >> 4); |
| 168 | 170 | |
| 169 | 171 | SET_TILE_INFO(1, code, color, 0); |
| r14896 | r14897 | |
| 252 | 254 | WRITE8_MEMBER(hvyunit_state::trigger_nmi_on_sound_cpu2) |
| 253 | 255 | { |
| 254 | 256 | |
| 255 | soundlatch_w(space, 0, data); | |
| 257 | soundlatch_byte_w(space, 0, data); | |
| 256 | 258 | device_set_input_line(m_sound_cpu, INPUT_LINE_NMI, PULSE_LINE); |
| 257 | 259 | } |
| 258 | 260 | |
| 259 | 261 | WRITE8_MEMBER(hvyunit_state::hu_videoram_w) |
| 260 | 262 | { |
| 261 | 263 | |
| 262 | m_videoram[offset] = data; | |
| 264 | m_videoram.target()[offset] = data; | |
| 263 | 265 | m_bg_tilemap->mark_tile_dirty(offset); |
| 264 | 266 | } |
| 265 | 267 | |
| 266 | 268 | WRITE8_MEMBER(hvyunit_state::hu_colorram_w) |
| 267 | 269 | { |
| 268 | 270 | |
| 269 | m_colorram[offset] = data; | |
| 271 | m_colorram.target()[offset] = data; | |
| 270 | 272 | m_bg_tilemap->mark_tile_dirty(offset); |
| 271 | 273 | } |
| 272 | 274 | |
| r14896 | r14897 | |
| 431 | 433 | static ADDRESS_MAP_START( slave_memory, AS_PROGRAM, 8, hvyunit_state ) |
| 432 | 434 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 433 | 435 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") |
| 434 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(hu_videoram_w) AM_BASE(m_videoram) | |
| 435 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(hu_colorram_w) AM_BASE(m_colorram) | |
| 436 | AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_split2_w) AM_SHARE("paletteram2") | |
| 437 | AM_RANGE(0xd800, 0xd9ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_split1_w) AM_SHARE("paletteram") | |
| 436 | AM_RANGE(0xc000, 0xc3ff) AM_RAM_WRITE(hu_videoram_w) AM_SHARE("videoram") | |
| 437 | AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(hu_colorram_w) AM_SHARE("colorram") | |
| 438 | AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_split_hi_w) AM_SHARE("paletteram2") | |
| 439 | AM_RANGE(0xd800, 0xd9ff) AM_RAM_WRITE(paletteram_xxxxRRRRGGGGBBBB_byte_split_lo_w) AM_SHARE("paletteram") | |
| 438 | 440 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 439 | 441 | AM_RANGE(0xe000, 0xffff) AM_RAM AM_SHARE("share1") |
| 440 | 442 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 464 | 466 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 465 | 467 | AM_RANGE(0x00, 0x00) AM_WRITE(sound_bankswitch_w) |
| 466 | 468 | AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w) |
| 467 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r) | |
| 469 | AM_RANGE(0x04, 0x04) AM_READ(soundlatch_byte_r) | |
| 468 | 470 | ADDRESS_MAP_END |
| 469 | 471 | |
| 470 | 472 |
| r14896 | r14897 | |
|---|---|---|
| 172 | 172 | // AM_RANGE(0x500800, 0x50080f) AM_WRITENOP |
| 173 | 173 | AM_RANGE(0x600000, 0x600001) AM_WRITE(pirates_out_w) |
| 174 | 174 | AM_RANGE(0x700000, 0x700001) AM_WRITEONLY AM_BASE(m_scroll) // scroll reg |
| 175 | AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(paletteram | |
| 175 | AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(paletteram | |
| 176 | 176 | AM_RANGE(0x900000, 0x90017f) AM_RAM // more of tilemaps ? |
| 177 | 177 | AM_RANGE(0x900180, 0x90137f) AM_RAM_WRITE(pirates_tx_tileram_w) AM_BASE(m_tx_tileram) |
| 178 | 178 | AM_RANGE(0x901380, 0x902a7f) AM_RAM_WRITE(pirates_fg_tileram_w) AM_BASE(m_fg_tileram) |
| r14896 | r14897 | |
|---|---|---|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tankbatt_state ) |
| 158 | AM_RANGE(0x0000, 0x000f) AM_RAM AM_BASE(m_bulletsram | |
| 158 | AM_RANGE(0x0000, 0x000f) AM_RAM AM_BASE_SIZE(m_bulletsram, | |
| 159 | 159 | AM_RANGE(0x0010, 0x01ff) AM_RAM |
| 160 | 160 | AM_RANGE(0x0200, 0x07ff) AM_RAM |
| 161 | 161 | AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(tankbatt_videoram_w) AM_BASE(m_videoram) |
| r14896 | r14897 | |
|---|---|---|
| 106 | 106 | AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(wrally_vram_w) AM_BASE(m_videoram) /* encrypted Video RAM */ |
| 107 | 107 | AM_RANGE(0x108000, 0x108007) AM_RAM AM_BASE(m_vregs) /* Video Registers */ |
| 108 | 108 | AM_RANGE(0x10800c, 0x10800d) AM_WRITENOP /* CLR INT Video */ |
| 109 | AM_RANGE(0x200000, 0x203fff) AM_RAM_WRITE(paletteram | |
| 109 | AM_RANGE(0x200000, 0x203fff) AM_RAM_WRITE(paletteram | |
| 110 | 110 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(m_spriteram) /* Sprite RAM */ |
| 111 | 111 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW") |
| 112 | 112 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2") |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | public: |
| 104 | 104 | royalmah_state(const machine_config &mconfig, device_type type, const char *tag) |
| 105 | 105 | : driver_device(mconfig, type, tag), |
| 106 | m_maincpu(*this,"maincpu") | |
| 107 | { } | |
| 106 | m_maincpu(*this,"maincpu"), | |
| 107 | m_videoram(*this, "videoram"){ } | |
| 108 | 108 | |
| 109 | UINT8 *m_videoram; | |
| 109 | required_device<cpu_device> m_maincpu; | |
| 110 | required_shared_ptr<UINT8> m_videoram; | |
| 110 | 111 | UINT8 m_input_port_select; |
| 111 | 112 | UINT8 m_dsw_select; |
| 112 | 113 | UINT8 m_rombank; |
| r14896 | r14897 | |
| 122 | 123 | UINT8 m_jansou_colortable[16]; |
| 123 | 124 | UINT8 m_mjifb_rom_enable; |
| 124 | 125 | |
| 125 | required_device<cpu_device> m_maincpu; | |
| 126 | 126 | DECLARE_WRITE8_MEMBER(royalmah_palbank_w); |
| 127 | 127 | DECLARE_WRITE8_MEMBER(mjderngr_coin_w); |
| 128 | 128 | DECLARE_WRITE8_MEMBER(mjderngr_palbank_w); |
| r14896 | r14897 | |
| 278 | 278 | static SCREEN_UPDATE_IND16( royalmah ) |
| 279 | 279 | { |
| 280 | 280 | royalmah_state *state = screen.machine().driver_data<royalmah_state>(); |
| 281 | UINT8 *videoram = state->m_videoram; | |
| 281 | UINT8 *videoram = state->m_videoram.target(); | |
| 282 | 282 | |
| 283 | 283 | offs_t offs; |
| 284 | 284 | |
| r14896 | r14897 | |
| 409 | 409 | |
| 410 | 410 | WRITE8_MEMBER(royalmah_state::mjapinky_palbank_w) |
| 411 | 411 | { |
| 412 | flip_screen_set( | |
| 412 | flip_screen_set( | |
| 413 | 413 | m_palette_base = (data >> 3) & 0x01; |
| 414 | 414 | coin_counter_w(machine(), 0,data & 2); // in |
| 415 | 415 | coin_counter_w(machine(), 1,data & 1); // out |
| r14896 | r14897 | |
| 518 | 518 | AM_RANGE( 0x0000, 0x6fff ) AM_ROM AM_WRITE(royalmah_rom_w ) |
| 519 | 519 | AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram") |
| 520 | 520 | AM_RANGE( 0x8000, 0xffff ) AM_ROMBANK( "bank1" ) // banked ROMs not present in royalmah |
| 521 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 521 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 522 | 522 | ADDRESS_MAP_END |
| 523 | 523 | |
| 524 | 524 | |
| r14896 | r14897 | |
| 528 | 528 | AM_RANGE( 0x7800, 0x7fff ) AM_RAM |
| 529 | 529 | AM_RANGE( 0x8000, 0x8000 ) AM_READ(mjapinky_dsw_r ) |
| 530 | 530 | AM_RANGE( 0x8000, 0xffff ) AM_ROMBANK( "bank1" ) |
| 531 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 531 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 532 | 532 | ADDRESS_MAP_END |
| 533 | 533 | |
| 534 | 534 | |
| r14896 | r14897 | |
| 660 | 660 | static ADDRESS_MAP_START( janoh_map, AS_PROGRAM, 8, royalmah_state ) |
| 661 | 661 | AM_RANGE( 0x0000, 0x6fff ) AM_ROM AM_WRITE(royalmah_rom_w ) |
| 662 | 662 | AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram") |
| 663 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 663 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 664 | 664 | ADDRESS_MAP_END |
| 665 | 665 | |
| 666 | 666 | |
| r14896 | r14897 | |
| 757 | 757 | |
| 758 | 758 | WRITE8_MEMBER(royalmah_state::jansou_sound_w) |
| 759 | 759 | { |
| 760 | soundlatch_w(space, 0, data); | |
| 760 | soundlatch_byte_w(space, 0, data); | |
| 761 | 761 | cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 762 | 762 | } |
| 763 | 763 | |
| r14896 | r14897 | |
| 778 | 778 | AM_RANGE( 0x6800, 0x6800 ) AM_WRITE(jansou_sound_w) |
| 779 | 779 | |
| 780 | 780 | AM_RANGE( 0x7000, 0x77ff ) AM_RAM AM_SHARE("nvram") |
| 781 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 781 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 782 | 782 | ADDRESS_MAP_END |
| 783 | 783 | |
| 784 | 784 | static ADDRESS_MAP_START( jansou_sub_map, AS_PROGRAM, 8, royalmah_state ) |
| r14896 | r14897 | |
| 788 | 788 | |
| 789 | 789 | static ADDRESS_MAP_START( jansou_sub_iomap, AS_IO, 8, royalmah_state ) |
| 790 | 790 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 791 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r) AM_DEVWRITE_LEGACY("dac", dac_w ) | |
| 791 | AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_DEVWRITE_LEGACY("dac", dac_w ) | |
| 792 | 792 | ADDRESS_MAP_END |
| 793 | 793 | |
| 794 | 794 | |
| r14896 | r14897 | |
| 801 | 801 | AM_RANGE( 0x6000, 0x6fff ) AM_RAMBANK("bank3") AM_SHARE("nvram") // nvram |
| 802 | 802 | AM_RANGE( 0x7000, 0x7fff ) AM_RAMBANK("bank2") // banked nvram |
| 803 | 803 | AM_RANGE( 0x8000, 0xffff ) AM_ROMBANK("bank1") |
| 804 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 804 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 805 | 805 | ADDRESS_MAP_END |
| 806 | 806 | |
| 807 | 807 | WRITE8_MEMBER(royalmah_state::janptr96_dswsel_w) |
| r14896 | r14897 | |
| 845 | 845 | |
| 846 | 846 | WRITE8_MEMBER(royalmah_state::janptr96_coin_counter_w) |
| 847 | 847 | { |
| 848 | flip_screen_set( | |
| 848 | flip_screen_set( | |
| 849 | 849 | coin_counter_w(machine(), 0,data & 2); // in |
| 850 | 850 | coin_counter_w(machine(), 1,data & 1); // out |
| 851 | 851 | } |
| r14896 | r14897 | |
| 872 | 872 | |
| 873 | 873 | WRITE8_MEMBER(royalmah_state::mjifb_coin_counter_w) |
| 874 | 874 | { |
| 875 | flip_screen_set( | |
| 875 | flip_screen_set( | |
| 876 | 876 | coin_counter_w(machine(), 0,data & 2); // in |
| 877 | 877 | coin_counter_w(machine(), 1,data & 1); // out |
| 878 | 878 | } |
| r14896 | r14897 | |
| 898 | 898 | |
| 899 | 899 | WRITE8_MEMBER(royalmah_state::mjifb_rom_io_w) |
| 900 | 900 | { |
| 901 | UINT8 *videoram = m_videoram; | |
| 901 | UINT8 *videoram = m_videoram.target(); | |
| 902 | 902 | if (m_mjifb_rom_enable) |
| 903 | 903 | { |
| 904 | 904 | videoram[offset] = data; |
| r14896 | r14897 | |
| 926 | 926 | |
| 927 | 927 | WRITE8_MEMBER(royalmah_state::mjifb_videoram_w) |
| 928 | 928 | { |
| 929 | UINT8 *videoram = m_videoram; | |
| 929 | UINT8 *videoram = m_videoram.target(); | |
| 930 | 930 | videoram[offset + 0x4000] = data; |
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | static ADDRESS_MAP_START( mjifb_map, AS_PROGRAM, 8, royalmah_state ) |
| 934 | 934 | AM_RANGE( 0x0000, 0x6fff ) AM_ROM |
| 935 | 935 | AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram") |
| 936 | AM_RANGE( 0x8000, 0xbfff ) AM_READWRITE(mjifb_rom_io_r, mjifb_rom_io_w) AM_ | |
| 936 | AM_RANGE( 0x8000, 0xbfff ) AM_READWRITE(mjifb_rom_io_r, mjifb_rom_io_w) AM_ | |
| 937 | 937 | AM_RANGE( 0xc000, 0xffff ) AM_ROM AM_WRITE(mjifb_videoram_w) |
| 938 | 938 | // AM_RANGE( 0xc000, 0xffff ) AM_ROM AM_WRITEONLY This should, but doesn't work |
| 939 | 939 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 1007 | 1007 | |
| 1008 | 1008 | WRITE8_MEMBER(royalmah_state::mjdejavu_rom_io_w) |
| 1009 | 1009 | { |
| 1010 | UINT8 *videoram = m_videoram; | |
| 1010 | UINT8 *videoram = m_videoram.target(); | |
| 1011 | 1011 | if (m_mjifb_rom_enable) |
| 1012 | 1012 | { |
| 1013 | 1013 | videoram[offset] = data; |
| r14896 | r14897 | |
| 1033 | 1033 | static ADDRESS_MAP_START( mjdejavu_map, AS_PROGRAM, 8, royalmah_state ) |
| 1034 | 1034 | AM_RANGE( 0x0000, 0x6fff ) AM_ROM |
| 1035 | 1035 | AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram") |
| 1036 | AM_RANGE( 0x8000, 0xbfff ) AM_READWRITE(mjdejavu_rom_io_r, mjdejavu_rom_io_w) AM_ | |
| 1036 | AM_RANGE( 0x8000, 0xbfff ) AM_READWRITE(mjdejavu_rom_io_r, mjdejavu_rom_io_w) AM_ | |
| 1037 | 1037 | AM_RANGE( 0xc000, 0xffff ) AM_ROM AM_WRITE(mjifb_videoram_w) |
| 1038 | 1038 | ADDRESS_MAP_END |
| 1039 | 1039 | |
| r14896 | r14897 | |
| 1076 | 1076 | AM_RANGE( 0x6ff3, 0x6ff3 ) AM_WRITE(mjtensin_6ff3_w ) |
| 1077 | 1077 | AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram") |
| 1078 | 1078 | AM_RANGE( 0x8000, 0xffff ) AM_ROMBANK( "bank1" ) |
| 1079 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 1079 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 1080 | 1080 | ADDRESS_MAP_END |
| 1081 | 1081 | |
| 1082 | 1082 | static ADDRESS_MAP_START( mjtensin_iomap, AS_IO, 8, royalmah_state ) |
| r14896 | r14897 | |
| 1147 | 1147 | AM_RANGE( 0x7fe4, 0x7fe4 ) AM_READ(cafetime_7fe4_r ) |
| 1148 | 1148 | AM_RANGE( 0x7ff0, 0x7fff ) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 1149 | 1149 | AM_RANGE( 0x8000, 0xffff ) AM_ROMBANK( "bank1" ) |
| 1150 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 1150 | AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_ | |
| 1151 | 1151 | ADDRESS_MAP_END |
| 1152 | 1152 | |
| 1153 | 1153 | |
| r14896 | r14897 | |
| 1194 | 1194 | |
| 1195 | 1195 | WRITE8_MEMBER(royalmah_state::mjvegasa_rom_io_w) |
| 1196 | 1196 | { |
| 1197 | UINT8 *videoram = m_videoram; | |
| 1197 | UINT8 *videoram = m_videoram.target(); | |
| 1198 | 1198 | if ((m_rombank & 0x70) != 0x70) |
| 1199 | 1199 | { |
| 1200 | 1200 | videoram[offset] = data; |
| r14896 | r14897 | |
| 1216 | 1216 | |
| 1217 | 1217 | WRITE8_MEMBER(royalmah_state::mjvegasa_coin_counter_w) |
| 1218 | 1218 | { |
| 1219 | flip_screen_set( | |
| 1219 | flip_screen_set( | |
| 1220 | 1220 | coin_counter_w(machine(), 0,data & 2); // in |
| 1221 | 1221 | coin_counter_w(machine(), 1,data & 1); // out |
| 1222 | 1222 | } |
| r14896 | r14897 | |
| 1237 | 1237 | |
| 1238 | 1238 | AM_RANGE( 0x00000, 0x05fff ) AM_ROM |
| 1239 | 1239 | AM_RANGE( 0x06000, 0x07fff ) AM_RAM AM_SHARE("nvram") |
| 1240 | AM_RANGE( 0x08000, 0x0ffff ) AM_READWRITE(mjvegasa_rom_io_r, mjvegasa_rom_io_w) AM_ | |
| 1240 | AM_RANGE( 0x08000, 0x0ffff ) AM_READWRITE(mjvegasa_rom_io_r, mjvegasa_rom_io_w) AM_ | |
| 1241 | 1241 | |
| 1242 | 1242 | AM_RANGE( 0x10001, 0x10001 ) AM_DEVREAD_LEGACY("aysnd", ay8910_r ) |
| 1243 | 1243 | AM_RANGE( 0x10002, 0x10003 ) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_address_w ) |
| r14896 | r14897 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | if(ACCESSING_BITS_0_7) |
| 44 | 44 | { |
| 45 | soundlatch_w(space, 0, data & 0xff); | |
| 45 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| r14896 | r14897 | |
| 58 | 58 | AM_RANGE(0x10000e, 0x10000f) AM_WRITENOP |
| 59 | 59 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(crospang_fg_videoram_w) AM_BASE(m_fg_videoram) |
| 60 | 60 | AM_RANGE(0x122000, 0x1227ff) AM_RAM_WRITE(crospang_bg_videoram_w) AM_BASE(m_bg_videoram) |
| 61 | AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(paletteram | |
| 61 | AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(paletteram | |
| 62 | 62 | AM_RANGE(0x210000, 0x2107ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 63 | 63 | AM_RANGE(0x270000, 0x270001) AM_WRITE(crospang_soundlatch_w) |
| 64 | 64 | AM_RANGE(0x280000, 0x280001) AM_READ_PORT("P1_P2") |
| r14896 | r14897 | |
| 78 | 78 | |
| 79 | 79 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(crospang_fg_videoram_w) AM_BASE(m_fg_videoram) |
| 80 | 80 | AM_RANGE(0x122000, 0x1227ff) AM_RAM_WRITE(crospang_bg_videoram_w) AM_BASE(m_bg_videoram) |
| 81 | AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(paletteram | |
| 81 | AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(paletteram | |
| 82 | 82 | AM_RANGE(0x210000, 0x2107ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size) |
| 83 | 83 | AM_RANGE(0x270000, 0x270001) AM_WRITE(crospang_soundlatch_w) |
| 84 | 84 | AM_RANGE(0x270004, 0x270005) AM_WRITENOP |
| r14896 | r14897 | |
| 100 | 100 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 101 | 101 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r, ym3812_w) |
| 102 | 102 | AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 103 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r) | |
| 103 | AM_RANGE(0x06, 0x06) AM_READ(soundlatch_byte_r) | |
| 104 | 104 | ADDRESS_MAP_END |
| 105 | 105 | |
| 106 | 106 |
| r14896 | r14897 | |
|---|---|---|
| 29 | 29 | AM_RANGE(0x0000, 0x01c0) AM_READWRITE(ajax_ls138_f10_r, ajax_ls138_f10_w) /* bankswitch + sound command + FIRQ command */ |
| 30 | 30 | AM_RANGE(0x0800, 0x0807) AM_DEVREADWRITE_LEGACY("k051960", k051937_r, k051937_w) /* sprite control registers */ |
| 31 | 31 | AM_RANGE(0x0c00, 0x0fff) AM_DEVREADWRITE_LEGACY("k051960", k051960_r, k051960_w) /* sprite RAM 2128SL at J7 */ |
| 32 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_SHARE("paletteram")/* palette */ | |
| 32 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_be_w) AM_SHARE("paletteram")/* palette */ | |
| 33 | 33 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("share1") /* shared RAM with the 6809 */ |
| 34 | 34 | AM_RANGE(0x4000, 0x5fff) AM_RAM /* RAM 6264L at K10 */ |
| 35 | 35 | AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank2") /* banked ROM */ |
| r14896 | r14897 | |
| 56 | 56 | AM_RANGE(0xb80c, 0xb80c) AM_DEVWRITE_LEGACY("k007232_2", k007232_extvol_w) /* extra volume, goes to the 007232 w/ A11 */ |
| 57 | 57 | /* selecting a different latch for the external port */ |
| 58 | 58 | AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) /* YM2151 */ |
| 59 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r) /* soundlatch_r */ | |
| 59 | AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */ | |
| 60 | 60 | ADDRESS_MAP_END |
| 61 | 61 | |
| 62 | 62 |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | public: |
| 22 | 22 | rotaryf_state(const machine_config &mconfig, device_type type, const char *tag) |
| 23 | 23 | : driver_device(mconfig, type, tag), |
| 24 | m_maincpu(*this,"maincpu") | |
| 25 | { } | |
| 24 | m_maincpu(*this,"maincpu"), | |
| 25 | m_videoram(*this, "videoram"){ } | |
| 26 | 26 | |
| 27 | UINT8 *m_videoram; | |
| 28 | size_t m_videoram_size; | |
| 29 | ||
| 30 | 27 | required_device<cpu_device> m_maincpu; |
| 28 | required_shared_ptr<UINT8> m_videoram; | |
| 31 | 29 | }; |
| 32 | 30 | |
| 33 | 31 | |
| r14896 | r14897 | |
| 68 | 66 | rotaryf_state *state = screen.machine().driver_data<rotaryf_state>(); |
| 69 | 67 | offs_t offs; |
| 70 | 68 | |
| 71 | for (offs = 0; offs < state->m_videoram | |
| 69 | for (offs = 0; offs < state->m_videoram.bytes(); offs++) | |
| 72 | 70 | { |
| 73 | 71 | int i; |
| 74 | 72 | |
| 75 | 73 | UINT8 x = offs << 3; |
| 76 | 74 | int y = offs >> 5; |
| 77 | UINT8 data = state->m_videoram[offs]; | |
| 75 | UINT8 data = state->m_videoram.target()[offs]; | |
| 78 | 76 | |
| 79 | 77 | for (i = 0; i < 8; i++) |
| 80 | 78 | { |
| r14896 | r14897 | |
| 96 | 94 | // AM_RANGE(0x6ffd, 0x6ffd) AM_READ_LEGACY(random_r) ?? |
| 97 | 95 | // AM_RANGE(0x6fff, 0x6fff) AM_READ_LEGACY(random_r) ?? |
| 98 | 96 | AM_RANGE(0x7000, 0x73ff) AM_RAM // clears to 1ff ? |
| 99 | AM_RANGE(0x8000, 0x9fff) AM_MIRROR(0x4000) AM_RAM AM_ | |
| 97 | AM_RANGE(0x8000, 0x9fff) AM_MIRROR(0x4000) AM_RAM AM_ | |
| 100 | 98 | AM_RANGE(0xa000, 0xa1ff) AM_RAM |
| 101 | 99 | ADDRESS_MAP_END |
| 102 | 100 |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | WRITE8_MEMBER(funybubl_state::funybubl_soundcommand_w) |
| 69 | 69 | { |
| 70 | soundlatch_w(space, 0, data); | |
| 70 | soundlatch_byte_w(space, 0, data); | |
| 71 | 71 | device_set_input_line(m_audiocpu, 0, HOLD_LINE); |
| 72 | 72 | } |
| 73 | 73 | |
| r14896 | r14897 | |
| 104 | 104 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 105 | 105 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("oki", funybubl_oki_bank_sw) |
| 106 | 106 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 107 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 107 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 108 | 108 | ADDRESS_MAP_END |
| 109 | 109 | |
| 110 | 110 |
| r14896 | r14897 | |
|---|---|---|
| 67 | 67 | static ADDRESS_MAP_START( shisen_sound_io_map, AS_IO, 8, shisen_state ) |
| 68 | 68 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 69 | 69 | AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) |
| 70 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r) | |
| 70 | AM_RANGE(0x80, 0x80) AM_READ(soundlatch_byte_r) | |
| 71 | 71 | AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("m72", shisen_sample_addr_w) |
| 72 | 72 | AM_RANGE(0x82, 0x82) AM_DEVWRITE_LEGACY("m72", m72_sample_w) |
| 73 | 73 | AM_RANGE(0x83, 0x83) AM_DEVWRITE_LEGACY("m72", m72_sound_irq_ack_w) |
| r14896 | r14897 | |
|---|---|---|
| 205 | 205 | { |
| 206 | 206 | if (ACCESSING_BITS_0_7) |
| 207 | 207 | { |
| 208 | soundlatch_w(space, 0, data & 0xff); | |
| 208 | soundlatch_byte_w(space, 0, data & 0xff); | |
| 209 | 209 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 210 | 210 | } |
| 211 | 211 | } |
| r14896 | r14897 | |
| 270 | 270 | WRITE16_MEMBER(nmk16_state::macross2_sound_command_w) |
| 271 | 271 | { |
| 272 | 272 | if (ACCESSING_BITS_0_7) |
| 273 | soundlatch_w(space,0,data & 0xff); | |
| 273 | soundlatch_byte_w(space,0,data & 0xff); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | WRITE8_MEMBER(nmk16_state::macross2_sound_bank_w) |
| r14896 | r14897 | |
| 302 | 302 | { |
| 303 | 303 | if (ACCESSING_BITS_0_7) |
| 304 | 304 | { |
| 305 | soundlatch_w(space, 0, data&0xff); | |
| 305 | soundlatch_byte_w(space, 0, data&0xff); | |
| 306 | 306 | cputag_set_input_line(machine(), "audiocpu", 0, HOLD_LINE); |
| 307 | 307 | } |
| 308 | 308 | } |
| r14896 | r14897 | |
| 319 | 319 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
| 320 | 320 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 321 | 321 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 322 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 322 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 323 | 323 | AM_RANGE(0x08c000, 0x08c007) AM_WRITE(vandyke_scroll_w) |
| 324 | 324 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 325 | 325 | AM_RANGE(0x094000, 0x097fff) AM_RAM /* what is this? */ |
| r14896 | r14897 | |
| 338 | 338 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 339 | 339 | AM_RANGE(0x080010, 0x08001d) AM_WRITE(vandykeb_scroll_w) /* 10, 12, 1a, 1c */ |
| 340 | 340 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 341 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 341 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 342 | 342 | AM_RANGE(0x08c000, 0x08c007) AM_WRITENOP /* just in case... */ |
| 343 | 343 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 344 | 344 | AM_RANGE(0x094000, 0x097fff) AM_RAM /* what is this? */ |
| r14896 | r14897 | |
| 356 | 356 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 357 | 357 | AM_RANGE(0x08001c, 0x08001d) AM_WRITENOP /* See notes at the top of the driver */ |
| 358 | 358 | AM_RANGE(0x08001e, 0x08001f) AM_READWRITE(soundlatch2_word_r,soundlatch_word_w) |
| 359 | AM_RANGE(0x088000, 0x0883ff) AM_RAM_WRITE(paletteram | |
| 359 | AM_RANGE(0x088000, 0x0883ff) AM_RAM_WRITE(paletteram | |
| 360 | 360 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 361 | 361 | AM_RANGE(0x09c000, 0x09cfff) AM_RAM_WRITE(manybloc_scroll_w) AM_BASE(m_gunnail_scrollram) |
| 362 | 362 | AM_RANGE(0x09d000, 0x09d7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) |
| r14896 | r14897 | |
| 375 | 375 | // AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 376 | 376 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(soundlatch_word_w) |
| 377 | 377 | AM_RANGE(0x080202, 0x080203) AM_READ_PORT("IN2") |
| 378 | AM_RANGE(0x088000, 0x0883ff) AM_RAM_WRITE(paletteram | |
| 378 | AM_RANGE(0x088000, 0x0883ff) AM_RAM_WRITE(paletteram | |
| 379 | 379 | // AM_RANGE(0x08c000, 0x08c007) AM_WRITE(nmk_scroll_w) |
| 380 | 380 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 381 | 381 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM /* Unused txvideoram area? */ |
| r14896 | r14897 | |
| 386 | 386 | static ADDRESS_MAP_START( tharrier_sound_map, AS_PROGRAM, 8, nmk16_state ) |
| 387 | 387 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 388 | 388 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 389 | AM_RANGE(0xf000, 0xf000) AM_READWRITE(soundlatch_r,soundlatch2_w) | |
| 389 | AM_RANGE(0xf000, 0xf000) AM_READWRITE(soundlatch_byte_r,soundlatch2_byte_w) | |
| 390 | 390 | AM_RANGE(0xf400, 0xf400) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 391 | 391 | AM_RANGE(0xf500, 0xf500) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 392 | 392 | AM_RANGE(0xf600, 0xf600) AM_WRITE(tharrier_oki6295_bankswitch_0_w) |
| r14896 | r14897 | |
| 410 | 410 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 411 | 411 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP // frame number? |
| 412 | 412 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 413 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 413 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 414 | 414 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
| 415 | 415 | AM_RANGE(0x08c002, 0x08c087) AM_WRITENOP // ?? |
| 416 | 416 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| r14896 | r14897 | |
| 427 | 427 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 428 | 428 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP // frame number? |
| 429 | 429 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(seibu_main_mustb_w) |
| 430 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 430 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 431 | 431 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
| 432 | 432 | AM_RANGE(0x08c002, 0x08c087) AM_WRITENOP // ?? |
| 433 | 433 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| r14896 | r14897 | |
| 445 | 445 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 446 | 446 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP // frame number? |
| 447 | 447 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(afega_soundlatch_w) |
| 448 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 448 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 449 | 449 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
| 450 | 450 | AM_RANGE(0x08c002, 0x08c087) AM_WRITENOP // ?? |
| 451 | 451 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| r14896 | r14897 | |
| 466 | 466 | AM_RANGE(0xc0016, 0xc0017) AM_WRITENOP |
| 467 | 467 | AM_RANGE(0xc0018, 0xc0019) AM_WRITE(nmk_tilebank_w) |
| 468 | 468 | AM_RANGE(0xc001e, 0xc001f) AM_WRITE_LEGACY(NMK004_w) |
| 469 | AM_RANGE(0xc4000, 0xc45ff) AM_RAM_WRITE(paletteram | |
| 469 | AM_RANGE(0xc4000, 0xc45ff) AM_RAM_WRITE(paletteram | |
| 470 | 470 | AM_RANGE(0xc8000, 0xc8007) AM_RAM_WRITE(nmk_scroll_w) |
| 471 | 471 | AM_RANGE(0xcc000, 0xcffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 472 | 472 | AM_RANGE(0xd4000, 0xd47ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) |
| r14896 | r14897 | |
| 482 | 482 | // AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 483 | 483 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 484 | 484 | AM_RANGE(0x084000, 0x084001) AM_WRITE(bioship_bank_w) |
| 485 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 485 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 486 | 486 | AM_RANGE(0x08c000, 0x08c007) AM_RAM_WRITE(bioshipbg_scroll_w) |
| 487 | 487 | AM_RANGE(0x08c010, 0x08c017) AM_RAM_WRITE(bioship_scroll_w) |
| 488 | 488 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| r14896 | r14897 | |
| 662 | 662 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 663 | 663 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 664 | 664 | /* Video Region */ |
| 665 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 665 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 666 | 666 | AM_RANGE(0x08c000, 0x08c007) AM_WRITE(nmk_scroll_w) |
| 667 | 667 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 668 | 668 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) |
| r14896 | r14897 | |
| 895 | 895 | AM_RANGE(0x0c0018, 0x0c0019) AM_WRITE(nmk_tilebank_w) /* Tile Bank ? */ |
| 896 | 896 | AM_RANGE(0x0c001e, 0x0c001f) AM_WRITE_LEGACY(NMK004_w) |
| 897 | 897 | AM_RANGE(0x0c4000, 0x0c4007) AM_RAM_WRITE(nmk_scroll_w) |
| 898 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_WRITE(paletteram | |
| 898 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_WRITE(paletteram | |
| 899 | 899 | AM_RANGE(0x0cc000, 0x0cffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 900 | 900 | AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) |
| 901 | 901 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 912 | 912 | AM_RANGE(0x0c0018, 0x0c0019) AM_WRITE(nmk_tilebank_w) /* Tile Bank ? */ |
| 913 | 913 | AM_RANGE(0x0c001e, 0x0c001f) AM_WRITE_LEGACY(seibu_main_mustb_w) |
| 914 | 914 | AM_RANGE(0x0c4000, 0x0c4007) AM_RAM_WRITE(nmk_scroll_w) |
| 915 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_WRITE(paletteram | |
| 915 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_WRITE(paletteram | |
| 916 | 916 | AM_RANGE(0x0cc000, 0x0cffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 917 | 917 | AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) |
| 918 | 918 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 928 | 928 | AM_RANGE(0x0c0018, 0x0c0019) AM_WRITE(nmk_tilebank_w) /* Tile Bank ? */ |
| 929 | 929 | AM_RANGE(0x0c001e, 0x0c001f) AM_WRITE(ssmissin_sound_w) |
| 930 | 930 | AM_RANGE(0x0c4000, 0x0c4007) AM_RAM_WRITE(nmk_scroll_w) |
| 931 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_WRITE(paletteram | |
| 931 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_WRITE(paletteram | |
| 932 | 932 | AM_RANGE(0x0cc000, 0x0cffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 933 | 933 | AM_RANGE(0x0d0000, 0x0d07ff) AM_MIRROR(0x1800) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) //mirror for airattck |
| 934 | 934 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 938 | 938 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 939 | 939 | AM_RANGE(0x9000, 0x9000) AM_WRITE(ssmissin_soundbank_w) |
| 940 | 940 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 941 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) | |
| 941 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) | |
| 942 | 942 | ADDRESS_MAP_END |
| 943 | 943 | |
| 944 | 944 | static ADDRESS_MAP_START( strahl_map, AS_PROGRAM, 16, nmk16_state ) |
| r14896 | r14897 | |
| 953 | 953 | AM_RANGE(0x8001e, 0x8001f) AM_WRITE_LEGACY(NMK004_w) |
| 954 | 954 | AM_RANGE(0x84000, 0x84007) AM_RAM_WRITE(nmk_scroll_w) |
| 955 | 955 | AM_RANGE(0x88000, 0x88007) AM_RAM_WRITE(nmk_scroll_2_w) |
| 956 | AM_RANGE(0x8c000, 0x8c7ff) AM_RAM_WRITE(paletteram | |
| 956 | AM_RANGE(0x8c000, 0x8c7ff) AM_RAM_WRITE(paletteram | |
| 957 | 957 | AM_RANGE(0x90000, 0x93fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 958 | 958 | AM_RANGE(0x94000, 0x97fff) AM_RAM_WRITE(nmk_fgvideoram_w) AM_BASE(m_nmk_fgvideoram) |
| 959 | 959 | AM_RANGE(0x9c000, 0x9c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) |
| r14896 | r14897 | |
| 971 | 971 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
| 972 | 972 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 973 | 973 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 974 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 974 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 975 | 975 | AM_RANGE(0x08c000, 0x08c007) AM_RAM_WRITE(nmk_scroll_w) |
| 976 | 976 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| 977 | 977 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(m_nmk_txvideoram) |
| r14896 | r14897 | |
| 989 | 989 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
| 990 | 990 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 991 | 991 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 992 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 992 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 993 | 993 | AM_RANGE(0x08c000, 0x08c1ff) AM_WRITEONLY AM_BASE(m_gunnail_scrollram) |
| 994 | 994 | AM_RANGE(0x08c200, 0x08c3ff) AM_WRITEONLY AM_BASE(m_gunnail_scrollramy) |
| 995 | 995 | AM_RANGE(0x08c400, 0x08c7ff) AM_WRITEONLY // unknown |
| r14896 | r14897 | |
| 1009 | 1009 | AM_RANGE(0x100016, 0x100017) AM_WRITE(macross2_sound_reset_w) /* Z80 reset */ |
| 1010 | 1010 | AM_RANGE(0x100018, 0x100019) AM_WRITE(nmk_tilebank_w) |
| 1011 | 1011 | AM_RANGE(0x10001e, 0x10001f) AM_WRITE(macross2_sound_command_w) /* to Z80 */ |
| 1012 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(paletteram | |
| 1012 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(paletteram | |
| 1013 | 1013 | |
| 1014 | 1014 | AM_RANGE(0x130000, 0x1301ff) AM_RAM AM_BASE(m_gunnail_scrollram) |
| 1015 | 1015 | AM_RANGE(0x130200, 0x1303ff) AM_RAM AM_BASE(m_gunnail_scrollramy) |
| r14896 | r14897 | |
| 1035 | 1035 | AM_RANGE(0x100016, 0x100017) AM_WRITENOP /* IRQ enable or z80 sound reset like in Macross 2? */ |
| 1036 | 1036 | AM_RANGE(0x100018, 0x100019) AM_WRITE(nmk_tilebank_w) |
| 1037 | 1037 | AM_RANGE(0x10001e, 0x10001f) AM_WRITE(macross2_sound_command_w) /* to Z80 */ |
| 1038 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(paletteram | |
| 1038 | AM_RANGE(0x120000, 0x1207ff) AM_RAM_WRITE(paletteram | |
| 1039 | 1039 | |
| 1040 | 1040 | AM_RANGE(0x130000, 0x1301ff) AM_RAM AM_BASE(m_gunnail_scrollram) |
| 1041 | 1041 | AM_RANGE(0x130200, 0x1303ff) AM_RAM AM_BASE(m_gunnail_scrollramy) |
| r14896 | r14897 | |
| 1079 | 1079 | AM_RANGE(0xc810, 0xc817) AM_DEVWRITE_LEGACY("nmk112", nmk112_okibank_w) |
| 1080 | 1080 | // AM_RANGE(0xc810, 0xc817) AM_WRITE(okibank_w) |
| 1081 | 1081 | AM_RANGE(0xd000, 0xd000) AM_WRITE(raphero_sound_rombank_w) |
| 1082 | AM_RANGE(0xd800, 0xd800) AM_READWRITE(soundlatch_r, soundlatch2_w) // main cpu | |
| 1082 | AM_RANGE(0xd800, 0xd800) AM_READWRITE(soundlatch_byte_r, soundlatch2_byte_w) // main cpu | |
| 1083 | 1083 | AM_RANGE(0xe000, 0xffff) AM_RAM |
| 1084 | 1084 | ADDRESS_MAP_END |
| 1085 | 1085 | |
| r14896 | r14897 | |
| 1089 | 1089 | AM_RANGE(0xa000, 0xa000) AM_READNOP /* IRQ ack? watchdog? */ |
| 1090 | 1090 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 1091 | 1091 | AM_RANGE(0xe001, 0xe001) AM_WRITE(macross2_sound_bank_w) |
| 1092 | AM_RANGE(0xf000, 0xf000) AM_READWRITE(soundlatch_r,soundlatch2_w) /* from 68000 */ | |
| 1092 | AM_RANGE(0xf000, 0xf000) AM_READWRITE(soundlatch_byte_r,soundlatch2_byte_w) /* from 68000 */ | |
| 1093 | 1093 | ADDRESS_MAP_END |
| 1094 | 1094 | |
| 1095 | 1095 | static ADDRESS_MAP_START( macross2_sound_io_map, AS_IO, 8, nmk16_state ) |
| r14896 | r14897 | |
| 1110 | 1110 | AM_RANGE(0x084000, 0x084001) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) |
| 1111 | 1111 | AM_RANGE(0x084010, 0x084011) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff) |
| 1112 | 1112 | AM_RANGE(0x084020, 0x08402f) AM_DEVWRITE_LEGACY("nmk112", nmk112_okibank_lsb_w) |
| 1113 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 1113 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram | |
| 1114 | 1114 | AM_RANGE(0x094000, 0x094001) AM_WRITE(nmk_tilebank_w) |
| 1115 | 1115 | AM_RANGE(0x094002, 0x094003) AM_WRITENOP /* IRQ enable? */ |
| 1116 | 1116 | AM_RANGE(0x09c000, 0x09cfff) AM_MIRROR(0x1000) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(m_nmk_bgvideoram0) |
| r14896 | r14897 | |
| 4624 | 4624 | /**/AM_RANGE(0x084000, 0x084003) AM_RAM_WRITE(afega_scroll0_w) // Scroll on redhawkb (mirror or changed?..) |
| 4625 | 4625 | /**/AM_RANGE(0x084004, 0x084007) AM_RAM_WRITE(afega_scroll1_w) // Scroll on redhawkb (mirror or changed?..) |
| 4626 | 4626 | AM_RANGE(0x080020, 0x087fff) AM_WRITEONLY // |
| 4627 | /**/AM_RANGE(0x088000, 0x0885ff) AM_RAM_WRITE(paletteram | |
| 4627 | /**/AM_RANGE(0x088000, 0x0885ff) AM_RAM_WRITE(paletteram | |
| 4628 | 4628 | AM_RANGE(0x088600, 0x08bfff) AM_WRITEONLY // |
| 4629 | 4629 | /**/AM_RANGE(0x08c000, 0x08c003) AM_RAM_WRITE(afega_scroll0_w) AM_BASE(m_afega_scroll_0) // Scroll |
| 4630 | 4630 | /**/AM_RANGE(0x08c004, 0x08c007) AM_RAM_WRITE(afega_scroll1_w) AM_BASE(m_afega_scroll_1) // |
| r14896 | r14897 | |
| 4657 | 4657 | WRITE16_MEMBER(nmk16_state::twinactn_flipscreen_w) |
| 4658 | 4658 | { |
| 4659 | 4659 | if (ACCESSING_BITS_0_7) |
| 4660 | flip_screen_set( | |
| 4660 | flip_screen_set( | |
| 4661 | 4661 | |
| 4662 | 4662 | if (data & (~1)) |
| 4663 | 4663 | logerror("%06x: unknown flip screen bit written %04x\n", cpu_get_pc(&space.device()), data); |
| r14896 | r14897 | |
| 4684 | 4684 | AM_RANGE(0x0004, 0x0004) AM_WRITENOP // bug in sound prg? |
| 4685 | 4685 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 4686 | 4686 | AM_RANGE(0xf000, 0xf7ff) AM_RAM // RAM |
| 4687 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r) // From Main CPU | |
| 4687 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 4688 | 4688 | AM_RANGE(0xf808, 0xf809) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) // YM2151 |
| 4689 | 4689 | AM_RANGE(0xf80a, 0xf80a) AM_DEVREADWRITE("oki1", okim6295_device, read, write) // M6295 |
| 4690 | 4690 | ADDRESS_MAP_END |
| r14896 | r14897 | |
| 4692 | 4692 | static ADDRESS_MAP_START( firehawk_sound_cpu, AS_PROGRAM, 8, nmk16_state ) |
| 4693 | 4693 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 4694 | 4694 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 4695 | AM_RANGE(0xfff0, 0xfff0) AM_READ(soundlatch_r) | |
| 4695 | AM_RANGE(0xfff0, 0xfff0) AM_READ(soundlatch_byte_r) | |
| 4696 | 4696 | AM_RANGE(0xfff2, 0xfff2) AM_DEVWRITE_LEGACY("oki2", spec2k_oki1_banking_w ) |
| 4697 | 4697 | AM_RANGE(0xfff8, 0xfff8) AM_DEVREADWRITE("oki2", okim6295_device, read, write) |
| 4698 | 4698 | AM_RANGE(0xfffa, 0xfffa) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| r14896 | r14897 | |
| 4715 | 4715 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 4716 | 4716 | AM_RANGE(0x9000, 0x9000) AM_DEVWRITE_LEGACY("oki1", twinactn_oki_bank_w) |
| 4717 | 4717 | AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki1", okim6295_device, read, write) |
| 4718 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r) // From Main CPU | |
| 4718 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) // From Main CPU | |
| 4719 | 4719 | ADDRESS_MAP_END |
| 4720 | 4720 | |
| 4721 | 4721 | /*************************************************************************** |
| r14896 | r14897 | |
|---|---|---|
| 156 | 156 | { |
| 157 | 157 | public: |
| 158 | 158 | miniboy7_state(const machine_config &mconfig, device_type type, const char *tag) |
| 159 | : driver_device(mconfig, type, tag) { } | |
| 159 | : driver_device(mconfig, type, tag) , | |
| 160 | m_videoram(*this, "videoram"), | |
| 161 | m_colorram(*this, "colorram"){ } | |
| 160 | 162 | |
| 161 | UINT8 *m_videoram; | |
| 162 | UINT8 *m_colorram; | |
| 163 | required_shared_ptr<UINT8> m_videoram; | |
| 164 | required_shared_ptr<UINT8> m_colorram; | |
| 163 | 165 | tilemap_t *m_bg_tilemap; |
| 164 | 166 | DECLARE_WRITE8_MEMBER(miniboy7_videoram_w); |
| 165 | 167 | DECLARE_WRITE8_MEMBER(miniboy7_colorram_w); |
| r14896 | r14897 | |
| 172 | 174 | |
| 173 | 175 | WRITE8_MEMBER(miniboy7_state::miniboy7_videoram_w) |
| 174 | 176 | { |
| 175 | m_videoram[offset] = data; | |
| 177 | m_videoram.target()[offset] = data; | |
| 176 | 178 | m_bg_tilemap->mark_tile_dirty(offset); |
| 177 | 179 | } |
| 178 | 180 | |
| 179 | 181 | WRITE8_MEMBER(miniboy7_state::miniboy7_colorram_w) |
| 180 | 182 | { |
| 181 | m_colorram[offset] = data; | |
| 183 | m_colorram.target()[offset] = data; | |
| 182 | 184 | m_bg_tilemap->mark_tile_dirty(offset); |
| 183 | 185 | } |
| 184 | 186 | |
| r14896 | r14897 | |
| 191 | 193 | ---- --x- tiles bank. |
| 192 | 194 | xx-- ---x seems unused. */ |
| 193 | 195 | |
| 194 | int attr = state->m_colorram[tile_index]; | |
| 195 | int code = state->m_videoram[tile_index]; | |
| 196 | int attr = state->m_colorram.target()[tile_index]; | |
| 197 | int code = state->m_videoram.target()[tile_index]; | |
| 196 | 198 | int bank = (attr & 0x02) >> 1; /* bit 1 switch the gfx banks */ |
| 197 | 199 | int color = (attr & 0x3c); /* bits 2-3-4-5 for color? */ |
| 198 | 200 | |
| r14896 | r14897 | |
| 268 | 270 | |
| 269 | 271 | static ADDRESS_MAP_START( miniboy7_map, AS_PROGRAM, 8, miniboy7_state ) |
| 270 | 272 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") /* battery backed RAM? */ |
| 271 | AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(miniboy7_videoram_w) AM_BASE(m_videoram) | |
| 272 | AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(miniboy7_colorram_w) AM_BASE(m_colorram) | |
| 273 | AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(miniboy7_videoram_w) AM_SHARE("videoram") | |
| 274 | AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(miniboy7_colorram_w) AM_SHARE("colorram") | |
| 273 | 275 | AM_RANGE(0x1800, 0x25ff) AM_RAM /* looks like videoram */ |
| 274 | 276 | AM_RANGE(0x2600, 0x27ff) AM_RAM |
| 275 | 277 | AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | UINT32 irq_state; |
| 84 | 84 | UINT8 no_interrupt; |
| 85 | 85 | |
| 86 | device_irq_callback irq_callback; | |
| 86 | device_irq_acknowledge_callback irq_callback; | |
| 87 | 87 | legacy_cpu_device *device; |
| 88 | 88 | address_space *program; |
| 89 | 89 | direct_read_data *direct; |
| r14896 | r14897 | |
| 133 | 133 | v30mz_state *cpustate = get_safe_token(device); |
| 134 | 134 | unsigned int i,j,c; |
| 135 | 135 | static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; |
| 136 | device_irq_callback save_irqcallback; | |
| 136 | device_irq_acknowledge_callback save_irqcallback; | |
| 137 | 137 | |
| 138 | 138 | save_irqcallback = cpustate->irq_callback; |
| 139 | 139 | memset( cpustate, 0, sizeof(*cpustate) ); |
| r14896 | r14897 | |
| 933 | 933 | return necv_dasm_one(buffer, pc, oprom, cpustate->config); |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | static void nec_init(legacy_cpu_device *device, device_irq_callback irqcallback, int type) | |
| 936 | static void nec_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int type) | |
| 937 | 937 | { |
| 938 | 938 | v30mz_state *cpustate = get_safe_token(device); |
| 939 | 939 |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | UINT8 cc; /* Condition codes */ |
| 62 | 62 | |
| 63 | 63 | UINT16 pending_interrupts; /* MB */ |
| 64 | device_irq_callback irq_callback; | |
| 64 | device_irq_acknowledge_callback irq_callback; | |
| 65 | 65 | legacy_cpu_device *device; |
| 66 | 66 | address_space *program; |
| 67 | 67 | direct_read_data *direct; |
| r14896 | r14897 | |
| 487 | 487 | { |
| 488 | 488 | m6805_Regs *cpustate = get_safe_token(device); |
| 489 | 489 | |
| 490 | device_irq_callback save_irqcallback = cpustate->irq_callback; | |
| 490 | device_irq_acknowledge_callback save_irqcallback = cpustate->irq_callback; | |
| 491 | 491 | memset(cpustate, 0, sizeof(*cpustate)); |
| 492 | 492 | |
| 493 | 493 | cpustate->iCount=50000; /* Used to be global */ |
| r14896 | r14897 | |
|---|---|---|
| 93 | 93 | UINT8 irq_state[2]; |
| 94 | 94 | |
| 95 | 95 | int extra_cycles; /* cycles used up by interrupts */ |
| 96 | device_irq_callback irq_callback; | |
| 96 | device_irq_acknowledge_callback irq_callback; | |
| 97 | 97 | legacy_cpu_device *device; |
| 98 | 98 | const m6809_config *config; |
| 99 | 99 | int icount; |
| r14896 | r14897 | |
|---|---|---|
| 50 | 50 | UINT8 h8uflag, h8uiflag; |
| 51 | 51 | UINT8 incheckirqs; |
| 52 | 52 | |
| 53 | device_irq_callback irq_cb; | |
| 53 | device_irq_acknowledge_callback irq_cb; | |
| 54 | 54 | legacy_cpu_device *device; |
| 55 | 55 | |
| 56 | 56 | address_space *program; |
| r14896 | r14897 | |
|---|---|---|
| 677 | 677 | const UINT8* cyc_exception; |
| 678 | 678 | |
| 679 | 679 | /* Callbacks to host */ |
| 680 | device_irq_callback int_ack_callback; /* Interrupt Acknowledge */ | |
| 680 | device_irq_acknowledge_callback int_ack_callback; /* Interrupt Acknowledge */ | |
| 681 | 681 | m68k_bkpt_ack_func bkpt_ack_callback; /* Breakpoint Acknowledge */ |
| 682 | 682 | m68k_reset_func reset_instr_callback; /* Called when a RESET instruction is encountered */ |
| 683 | 683 | m68k_cmpild_func cmpild_instr_callback; /* Called when a CMPI.L #v, Dn instruction is encountered */ |
| r14896 | r14897 | |
|---|---|---|
| 2705 | 2705 | |
| 2706 | 2706 | static READ32_HANDLER( m68340_internal_base_r ) |
| 2707 | 2707 | { |
| 2708 | ||
| 2709 | ||
| 2708 | m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device()); | |
| 2710 | 2709 | int pc = cpu_get_pc(&space->device()); |
| 2711 | logerror("%08x m68340_internal_base_r %08x, (%04x)\n", pc, offset*4,mem_mask); | |
| 2712 | return 0x55555555; | |
| 2710 | logerror("%08x m68340_internal_base_r %08x, (%08x)\n", pc, offset*4,mem_mask); | |
| 2711 | return m68k->m68340_base; | |
| 2713 | 2712 | } |
| 2714 | 2713 | |
| 2715 | 2714 | static WRITE32_HANDLER( m68340_internal_base_w ) |
| r14896 | r14897 | |
| 2717 | 2716 | m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device()); |
| 2718 | 2717 | |
| 2719 | 2718 | int pc = cpu_get_pc(&space->device()); |
| 2720 | logerror("%08x m68340_internal_base_w %08x, %0 | |
| 2719 | logerror("%08x m68340_internal_base_w %08x, %08x (%08x)\n", pc, offset*4,data,mem_mask); | |
| 2721 | 2720 | |
| 2722 | 2721 | // other conditions? |
| 2723 | 2722 | if (m68k->dfc==0x7) |
| r14896 | r14897 | |
| 2735 | 2734 | } |
| 2736 | 2735 | |
| 2737 | 2736 | COMBINE_DATA(&m68k->m68340_base); |
| 2738 | logerror("%08x m68340_internal_base_w %08x, %0 | |
| 2737 | logerror("%08x m68340_internal_base_w %08x, %08x (%08x) (m68340_base write)\n", pc, offset*4,data,mem_mask); | |
| 2739 | 2738 | |
| 2740 | 2739 | // map new modules |
| 2741 | 2740 | if (m68k->m68340_base&1) |
| r14896 | r14897 | |
|---|---|---|
| 61 | 61 | UINT8 hblank_stable; |
| 62 | 62 | UINT8 external_host_access; |
| 63 | 63 | UINT8 executing; |
| 64 | device_irq_callback irq_callback; | |
| 64 | device_irq_acknowledge_callback irq_callback; | |
| 65 | 65 | legacy_cpu_device *device; |
| 66 | 66 | address_space *program; |
| 67 | 67 | direct_read_data *direct; |
| r14896 | r14897 | |
| 679 | 679 | const tms34010_config *config = tms->config; |
| 680 | 680 | screen_device *screen = tms->screen; |
| 681 | 681 | UINT16 *shiftreg = tms->shiftreg; |
| 682 | device_irq_callback save_irqcallback = tms->irq_callback; | |
| 682 | device_irq_acknowledge_callback save_irqcallback = tms->irq_callback; | |
| 683 | 683 | emu_timer *save_scantimer = tms->scantimer; |
| 684 | 684 | |
| 685 | 685 | memset(tms, 0, sizeof(*tms)); |
| r14896 | r14897 | |
|---|---|---|
| 803 | 803 | int m_icount; |
| 804 | 804 | |
| 805 | 805 | UINT32 m_iotemp; |
| 806 | device_irq_callback m_irq_callback; | |
| 806 | device_irq_acknowledge_callback m_irq_callback; | |
| 807 | 807 | address_space * m_program; |
| 808 | 808 | direct_read_data * m_direct; |
| 809 | 809 |
| r14896 | r14897 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | UINT16 a11; /* A11 value, either 0x000 or 0x800 */ |
| 151 | 151 | |
| 152 | device_irq_callback irq_callback; | |
| 152 | device_irq_acknowledge_callback irq_callback; | |
| 153 | 153 | legacy_cpu_device *device; |
| 154 | 154 | int icount; |
| 155 | 155 | |
| r14896 | r14897 | |
| 842 | 842 | mcs48_init - generic MCS-48 initialization |
| 843 | 843 | -------------------------------------------------*/ |
| 844 | 844 | |
| 845 | static void mcs48_init(legacy_cpu_device *device, device_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize) | |
| 845 | static void mcs48_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, UINT8 feature_mask, UINT16 romsize) | |
| 846 | 846 | { |
| 847 | 847 | mcs48_state *cpustate = get_safe_token(device); |
| 848 | 848 |
| r14896 | r14897 | |
|---|---|---|
| 944 | 944 | |
| 945 | 945 | /* Set the callback that is called when servicing an interrupt */ |
| 946 | 946 | #ifdef UNUSED_FUNCTION |
| 947 | void m37710_set_irq_callback(device_irq_callback callback) | |
| 947 | void m37710_set_irq_callback(device_irq_acknowledge_callback callback) | |
| 948 | 948 | { |
| 949 | 949 | INT_ACK = callback; |
| 950 | 950 | } |
| r14896 | r14897 | |
|---|---|---|
| 110 | 110 | int ICount; /* cycle count */ |
| 111 | 111 | uint source; /* temp register */ |
| 112 | 112 | uint destination; /* temp register */ |
| 113 | device_irq_callback int_ack; | |
| 113 | device_irq_acknowledge_callback int_ack; | |
| 114 | 114 | legacy_cpu_device *device; |
| 115 | 115 | address_space *program; |
| 116 | 116 | address_space *io; |
| r14896 | r14897 | |
|---|---|---|
| 124 | 124 | UINT16 *internal_ram; |
| 125 | 125 | UINT16 *internal_ram_block0, *internal_ram_block1; |
| 126 | 126 | |
| 127 | device_irq_callback irq_callback; | |
| 127 | device_irq_acknowledge_callback irq_callback; | |
| 128 | 128 | legacy_cpu_device *device; |
| 129 | 129 | address_space *program; |
| 130 | 130 | address_space *data; |
| r14896 | r14897 | |
|---|---|---|
| 138 | 138 | UINT8 dma0_cnt; /* dma0 counter / divide by 20 */ |
| 139 | 139 | UINT8 dma1_cnt; /* dma1 counter / divide by 20 */ |
| 140 | 140 | z80_daisy_chain daisy; |
| 141 | device_irq_callback irq_callback; | |
| 141 | device_irq_acknowledge_callback irq_callback; | |
| 142 | 142 | legacy_cpu_device *device; |
| 143 | 143 | address_space *program; |
| 144 | 144 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 39 | 39 | UINT32 base[4]; |
| 40 | 40 | UINT16 sregs[4]; |
| 41 | 41 | UINT16 flags; |
| 42 | device_irq_callback irq_callback; | |
| 42 | device_irq_acknowledge_callback irq_callback; | |
| 43 | 43 | INT32 AuxVal, OverVal, SignVal, ZeroVal, CarryVal, DirVal; /* 0 or non-0 valued flags */ |
| 44 | 44 | UINT8 ParityVal; |
| 45 | 45 | UINT8 TF, IF; /* 0 or 1 valued flags */ |
| r14896 | r14897 | |
| 232 | 232 | static CPU_RESET( i8086 ) |
| 233 | 233 | { |
| 234 | 234 | i8086_state *cpustate = get_safe_token(device); |
| 235 | device_irq_callback save_irqcallback; | |
| 235 | device_irq_acknowledge_callback save_irqcallback; | |
| 236 | 236 | |
| 237 | 237 | save_irqcallback = cpustate->irq_callback; |
| 238 | 238 | memset(cpustate, 0, sizeof(*cpustate)); |
| r14896 | r14897 | |
|---|---|---|
| 56 | 56 | UINT16 limit; |
| 57 | 57 | UINT8 rights; |
| 58 | 58 | } ldtr, tr; |
| 59 | device_irq_callback irq_callback; | |
| 59 | device_irq_acknowledge_callback irq_callback; | |
| 60 | 60 | legacy_cpu_device *device; |
| 61 | 61 | address_space *program; |
| 62 | 62 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 498 | 498 | const struct opcode_s *op74; |
| 499 | 499 | void (*handle_timers)(upd7810_state *cpustate, int cycles); |
| 500 | 500 | UPD7810_CONFIG config; |
| 501 | device_irq_callback irq_callback; | |
| 501 | device_irq_acknowledge_callback irq_callback; | |
| 502 | 502 | legacy_cpu_device *device; |
| 503 | 503 | address_space *program; |
| 504 | 504 | direct_read_data *direct; |
| r14896 | r14897 | |
| 1780 | 1780 | { |
| 1781 | 1781 | upd7810_state *cpustate = get_safe_token(device); |
| 1782 | 1782 | UPD7810_CONFIG save_config; |
| 1783 | device_irq_callback save_irqcallback; | |
| 1783 | device_irq_acknowledge_callback save_irqcallback; | |
| 1784 | 1784 | |
| 1785 | 1785 | save_config = cpustate->config; |
| 1786 | 1786 | save_irqcallback = cpustate->irq_callback; |
| r14896 | r14897 | |
|---|---|---|
| 83 | 83 | UINT8 YI; |
| 84 | 84 | UINT8 halted; |
| 85 | 85 | UINT8 interrupt_pending; |
| 86 | device_irq_callback irq_callback; | |
| 86 | device_irq_acknowledge_callback irq_callback; | |
| 87 | 87 | legacy_cpu_device *device; |
| 88 | 88 | address_space *program; |
| 89 | 89 | int icount; |
| r14896 | r14897 | |
|---|---|---|
| 90 | 90 | v60_flags flags; |
| 91 | 91 | UINT8 irq_line; |
| 92 | 92 | UINT8 nmi_line; |
| 93 | device_irq_callback irq_cb; | |
| 93 | device_irq_acknowledge_callback irq_cb; | |
| 94 | 94 | legacy_cpu_device * device; |
| 95 | 95 | address_space *program; |
| 96 | 96 | direct_read_data * direct; |
| r14896 | r14897 | |
| 324 | 324 | // Opcode jump table |
| 325 | 325 | #include "optable.c" |
| 326 | 326 | |
| 327 | static void base_init(legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 327 | static void base_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 328 | 328 | { |
| 329 | 329 | v60_state *cpustate = get_safe_token(device); |
| 330 | 330 |
| r14896 | r14897 | |
|---|---|---|
| 86 | 86 | uint line_nmi; /* Status of the NMI line */ |
| 87 | 87 | uint line_rst; /* Status of the RESET line */ |
| 88 | 88 | uint ir; /* Instruction Register */ |
| 89 | device_irq_callback int_ack; | |
| 89 | device_irq_acknowledge_callback int_ack; | |
| 90 | 90 | legacy_cpu_device *device; |
| 91 | 91 | address_space *program; |
| 92 | 92 | uint stopped; /* stopped status */ |
| r14896 | r14897 | |
|---|---|---|
| 131 | 131 | UINT8 irq_state[2]; |
| 132 | 132 | |
| 133 | 133 | int extra_cycles; /* cycles used up by interrupts */ |
| 134 | device_irq_callback irq_callback; | |
| 134 | device_irq_acknowledge_callback irq_callback; | |
| 135 | 135 | legacy_cpu_device *device; |
| 136 | 136 | int icount; |
| 137 | 137 | PAIR ea; /* effective address */ |
| r14896 | r14897 | |
|---|---|---|
| 31 | 31 | PAIR af2,bc2,de2,hl2; |
| 32 | 32 | UINT8 halt, after_EI; |
| 33 | 33 | UINT16 irq_state, irq_mask; |
| 34 | device_irq_callback irq_callback; | |
| 34 | device_irq_acknowledge_callback irq_callback; | |
| 35 | 35 | legacy_cpu_device *device; |
| 36 | 36 | address_space *program; |
| 37 | 37 | address_space *io; |
| r14896 | r14897 | |
|---|---|---|
| 41 | 41 | UINT8 irq_state; |
| 42 | 42 | |
| 43 | 43 | int icount; |
| 44 | device_irq_callback irq_callback; | |
| 44 | device_irq_acknowledge_callback irq_callback; | |
| 45 | 45 | legacy_cpu_device *device; |
| 46 | 46 | address_space *program; |
| 47 | 47 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 22 | 22 | UINT32 ER; |
| 23 | 23 | UINT32 PPC; |
| 24 | 24 | |
| 25 | device_irq_callback irq_callback; | |
| 25 | device_irq_acknowledge_callback irq_callback; | |
| 26 | 26 | legacy_cpu_device *device; |
| 27 | 27 | address_space *program; |
| 28 | 28 | direct_read_data *direct; |
| r14896 | r14897 | |
| 1714 | 1714 | { |
| 1715 | 1715 | se3208_state_t *se3208_state = get_safe_token(device); |
| 1716 | 1716 | |
| 1717 | device_irq_callback save_irqcallback = se3208_state->irq_callback; | |
| 1717 | device_irq_acknowledge_callback save_irqcallback = se3208_state->irq_callback; | |
| 1718 | 1718 | memset(se3208_state,0,sizeof(se3208_state_t)); |
| 1719 | 1719 | se3208_state->irq_callback = save_irqcallback; |
| 1720 | 1720 | se3208_state->device = device; |
| r14896 | r14897 | |
|---|---|---|
| 318 | 318 | |
| 319 | 319 | struct _delay delay; |
| 320 | 320 | |
| 321 | device_irq_callback irq_callback; | |
| 321 | device_irq_acknowledge_callback irq_callback; | |
| 322 | 322 | legacy_cpu_device *device; |
| 323 | 323 | address_space *program; |
| 324 | 324 | direct_read_data *direct; |
| r14896 | r14897 | |
| 1527 | 1527 | ISR &= ~(1 << irqline); |
| 1528 | 1528 | } |
| 1529 | 1529 | |
| 1530 | static void hyperstone_init(legacy_cpu_device *device, device_irq_callback irqcallback, int scale_mask) | |
| 1530 | static void hyperstone_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) | |
| 1531 | 1531 | { |
| 1532 | 1532 | hyperstone_state *cpustate = get_safe_token(device); |
| 1533 | 1533 | |
| r14896 | r14897 | |
| 1550 | 1550 | cpustate->clock_scale_mask = scale_mask; |
| 1551 | 1551 | } |
| 1552 | 1552 | |
| 1553 | static void e116_init(legacy_cpu_device *device, device_irq_callback irqcallback, int scale_mask) | |
| 1553 | static void e116_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) | |
| 1554 | 1554 | { |
| 1555 | 1555 | hyperstone_state *cpustate = get_safe_token(device); |
| 1556 | 1556 | hyperstone_init(device, irqcallback, scale_mask); |
| r14896 | r14897 | |
| 1587 | 1587 | e116_init(device, irqcallback, 0); |
| 1588 | 1588 | } |
| 1589 | 1589 | |
| 1590 | static void e132_init(legacy_cpu_device *device, device_irq_callback irqcallback, int scale_mask) | |
| 1590 | static void e132_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int scale_mask) | |
| 1591 | 1591 | { |
| 1592 | 1592 | hyperstone_state *cpustate = get_safe_token(device); |
| 1593 | 1593 | hyperstone_init(device, irqcallback, scale_mask); |
| r14896 | r14897 | |
| 1641 | 1641 | //TODO: Add different reset initializations for BCR, MCR, FCR, TPR |
| 1642 | 1642 | |
| 1643 | 1643 | emu_timer *save_timer; |
| 1644 | device_irq_callback save_irqcallback; | |
| 1644 | device_irq_acknowledge_callback save_irqcallback; | |
| 1645 | 1645 | UINT32 save_opcodexor; |
| 1646 | 1646 | |
| 1647 | 1647 | save_timer = cpustate->timer; |
| r14896 | r14897 | |
|---|---|---|
| 281 | 281 | UINT8 (*sfr_read)(mcs51_state_t *mcs51_state, size_t offset); |
| 282 | 282 | |
| 283 | 283 | /* Interrupt Callback */ |
| 284 | device_irq_callback irq_callback; | |
| 284 | device_irq_acknowledge_callback irq_callback; | |
| 285 | 285 | legacy_cpu_device *device; |
| 286 | 286 | |
| 287 | 287 | /* Memory spaces */ |
| r14896 | r14897 | |
|---|---|---|
| 268 | 268 | UINT8 opcode; |
| 269 | 269 | |
| 270 | 270 | UINT8 irq_state; |
| 271 | device_irq_callback irq_callback; | |
| 271 | device_irq_acknowledge_callback irq_callback; | |
| 272 | 272 | legacy_cpu_device *device; |
| 273 | 273 | address_space *program; |
| 274 | 274 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 3025 | 3025 | static CPU_RESET( i386 ) |
| 3026 | 3026 | { |
| 3027 | 3027 | i386_state *cpustate = get_safe_token(device); |
| 3028 | device_irq_callback save_irqcallback; | |
| 3028 | device_irq_acknowledge_callback save_irqcallback; | |
| 3029 | 3029 | |
| 3030 | 3030 | save_irqcallback = cpustate->irq_callback; |
| 3031 | 3031 | memset( cpustate, 0, sizeof(*cpustate) ); |
| r14896 | r14897 | |
| 3512 | 3512 | static CPU_RESET( i486 ) |
| 3513 | 3513 | { |
| 3514 | 3514 | i386_state *cpustate = get_safe_token(device); |
| 3515 | device_irq_callback save_irqcallback; | |
| 3515 | device_irq_acknowledge_callback save_irqcallback; | |
| 3516 | 3516 | |
| 3517 | 3517 | save_irqcallback = cpustate->irq_callback; |
| 3518 | 3518 | memset( cpustate, 0, sizeof(*cpustate) ); |
| r14896 | r14897 | |
| 3619 | 3619 | static CPU_RESET( pentium ) |
| 3620 | 3620 | { |
| 3621 | 3621 | i386_state *cpustate = get_safe_token(device); |
| 3622 | device_irq_callback save_irqcallback; | |
| 3622 | device_irq_acknowledge_callback save_irqcallback; | |
| 3623 | 3623 | |
| 3624 | 3624 | save_irqcallback = cpustate->irq_callback; |
| 3625 | 3625 | memset( cpustate, 0, sizeof(*cpustate) ); |
| r14896 | r14897 | |
| 3741 | 3741 | static CPU_RESET( mediagx ) |
| 3742 | 3742 | { |
| 3743 | 3743 | i386_state *cpustate = get_safe_token(device); |
| 3744 | device_irq_callback save_irqcallback; | |
| 3744 | device_irq_acknowledge_callback save_irqcallback; | |
| 3745 | 3745 | |
| 3746 | 3746 | save_irqcallback = cpustate->irq_callback; |
| 3747 | 3747 | memset( cpustate, 0, sizeof(*cpustate) ); |
| r14896 | r14897 | |
|---|---|---|
| 29 | 29 | UINT8 reg[0x80]; |
| 30 | 30 | UINT8 temp1[0x10]; |
| 31 | 31 | UINT8 temp2[0x10]; |
| 32 | device_irq_callback irq_callback; | |
| 32 | device_irq_acknowledge_callback irq_callback; | |
| 33 | 33 | legacy_cpu_device *device; |
| 34 | 34 | address_space *program; |
| 35 | 35 | address_space *io; |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | UINT8 adctl; |
| 63 | 63 | int ad_channel; |
| 64 | 64 | |
| 65 | device_irq_callback irq_callback; | |
| 65 | device_irq_acknowledge_callback irq_callback; | |
| 66 | 66 | UINT8 irq_state[2]; |
| 67 | 67 | legacy_cpu_device *device; |
| 68 | 68 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 71 | 71 | int halted; |
| 72 | 72 | int icount; |
| 73 | 73 | int regbank; |
| 74 | device_irq_callback irqcallback; | |
| 74 | device_irq_acknowledge_callback irqcallback; | |
| 75 | 75 | legacy_cpu_device *device; |
| 76 | 76 | address_space *program; |
| 77 | 77 | }; |
| r14896 | r14897 | |
|---|---|---|
| 178 | 178 | UINT32 ppc; |
| 179 | 179 | UINT32 nextpc; |
| 180 | 180 | |
| 181 | device_irq_callback irq_callback; | |
| 181 | device_irq_acknowledge_callback irq_callback; | |
| 182 | 182 | legacy_cpu_device *device; |
| 183 | 183 | address_space *program; |
| 184 | 184 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 580 | 580 | { 7, 7, 7, 7, 7, 7, 7, 7 }, // 7 |
| 581 | 581 | }; |
| 582 | 582 | |
| 583 | static void rspcom_init(rsp_state *rsp, legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 583 | static void rspcom_init(rsp_state *rsp, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 584 | 584 | { |
| 585 | 585 | int regIdx = 0; |
| 586 | 586 | int accumIdx; |
| r14896 | r14897 | |
|---|---|---|
| 40 | 40 | int icount; |
| 41 | 41 | int pc_pos; // PC possition in ADDR |
| 42 | 42 | |
| 43 | device_irq_callback irq_callback; | |
| 43 | device_irq_acknowledge_callback irq_callback; | |
| 44 | 44 | UINT8 irq_state; |
| 45 | 45 | }; |
| 46 | 46 |
| r14896 | r14897 | |
|---|---|---|
| 98 | 98 | int icount; |
| 99 | 99 | int bankswitch_icount; |
| 100 | 100 | void (*const *table)(jaguar_state *jaguar, UINT16 op); |
| 101 | device_irq_callback irq_callback; | |
| 101 | device_irq_acknowledge_callback irq_callback; | |
| 102 | 102 | jaguar_int_func cpu_interrupt; |
| 103 | 103 | legacy_cpu_device *device; |
| 104 | 104 | address_space *program; |
| r14896 | r14897 | |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | |
| 409 | static void init_common(int isdsp, legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 409 | static void init_common(int isdsp, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 410 | 410 | { |
| 411 | 411 | const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->static_config(); |
| 412 | 412 | jaguar_state *jaguar = get_safe_token(device); |
| r14896 | r14897 | |
|---|---|---|
| 142 | 142 | UINT16 low, high; |
| 143 | 143 | UINT32 mem[8]; |
| 144 | 144 | |
| 145 | device_irq_callback irq_callback; | |
| 145 | device_irq_acknowledge_callback irq_callback; | |
| 146 | 146 | legacy_cpu_device *device; |
| 147 | 147 | address_space *space; |
| 148 | 148 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 68 | 68 | UINT8 irq_state; |
| 69 | 69 | UINT8 so_state; |
| 70 | 70 | |
| 71 | device_irq_callback irq_callback; | |
| 71 | device_irq_acknowledge_callback irq_callback; | |
| 72 | 72 | legacy_cpu_device *device; |
| 73 | 73 | address_space *space; |
| 74 | 74 | direct_read_data *direct; |
| r14896 | r14897 | |
| 130 | 130 | * |
| 131 | 131 | *****************************************************************************/ |
| 132 | 132 | |
| 133 | static void m6502_common_init(legacy_cpu_device *device, device_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type) | |
| 133 | static void m6502_common_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type) | |
| 134 | 134 | { |
| 135 | 135 | m6502_Regs *cpustate = get_safe_token(device); |
| 136 | 136 | const m6502_interface *intf = (const m6502_interface *)device->static_config(); |
| r14896 | r14897 | |
|---|---|---|
| 77 | 77 | UINT8 nmi_state; |
| 78 | 78 | UINT8 irq_state; |
| 79 | 79 | UINT8 so_state; |
| 80 | device_irq_callback irq_callback; | |
| 80 | device_irq_acknowledge_callback irq_callback; | |
| 81 | 81 | legacy_cpu_device *device; |
| 82 | 82 | address_space *space; |
| 83 | 83 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 74 | 74 | UINT8 nmi_state; |
| 75 | 75 | UINT8 irq_state; |
| 76 | 76 | int icount; |
| 77 | device_irq_callback irq_callback; | |
| 77 | device_irq_acknowledge_callback irq_callback; | |
| 78 | 78 | legacy_cpu_device *device; |
| 79 | 79 | address_space *space; |
| 80 | 80 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 182 | 182 | |
| 183 | 183 | UINT8 ietemp; /* import/export temp space */ |
| 184 | 184 | |
| 185 | device_irq_callback irq_callback; | |
| 185 | device_irq_acknowledge_callback irq_callback; | |
| 186 | 186 | legacy_cpu_device *device; |
| 187 | 187 | address_space *program; |
| 188 | 188 | direct_read_data *direct; |
| r14896 | r14897 | |
| 968 | 968 | } |
| 969 | 969 | |
| 970 | 970 | |
| 971 | static void init_808x_common(legacy_cpu_device *device, device_irq_callback irqcallback, int type) | |
| 971 | static void init_808x_common(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int type) | |
| 972 | 972 | { |
| 973 | 973 | i8085_state *cpustate = get_safe_token(device); |
| 974 | 974 |
| r14896 | r14897 | |
|---|---|---|
| 234 | 234 | UINT32 coproRegister[16]; |
| 235 | 235 | UINT8 pendingIrq; |
| 236 | 236 | UINT8 pendingFiq; |
| 237 | device_irq_callback irq_callback; | |
| 237 | device_irq_acknowledge_callback irq_callback; | |
| 238 | 238 | legacy_cpu_device *device; |
| 239 | 239 | address_space *program; |
| 240 | 240 | direct_read_data *direct; |
| r14896 | r14897 | |
| 338 | 338 | { |
| 339 | 339 | ARM_REGS *cpustate = get_safe_token(device); |
| 340 | 340 | |
| 341 | device_irq_callback save_irqcallback = cpustate->irq_callback; | |
| 341 | device_irq_acknowledge_callback save_irqcallback = cpustate->irq_callback; | |
| 342 | 342 | endianness_t save_endian = cpustate->endian; |
| 343 | 343 | |
| 344 | 344 | memset(cpustate, 0, sizeof(ARM_REGS)); |
| r14896 | r14897 | |
|---|---|---|
| 547 | 547 | ppcdrc_init - initialize the processor |
| 548 | 548 | -------------------------------------------------*/ |
| 549 | 549 | |
| 550 | static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 550 | static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 551 | 551 | { |
| 552 | 552 | powerpc_state *ppc; |
| 553 | 553 | drcbe_info beinfo; |
| r14896 | r14897 | |
|---|---|---|
| 302 | 302 | structure based on the configured type |
| 303 | 303 | -------------------------------------------------*/ |
| 304 | 304 | |
| 305 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 305 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 306 | 306 | { |
| 307 | 307 | const powerpc_config *config = (const powerpc_config *)device->static_config(); |
| 308 | 308 |
| r14896 | r14897 | |
|---|---|---|
| 305 | 305 | |
| 306 | 306 | UINT64 tb; /* 56-bit timebase register */ |
| 307 | 307 | |
| 308 | device_irq_callback irq_callback; | |
| 308 | device_irq_acknowledge_callback irq_callback; | |
| 309 | 309 | legacy_cpu_device *device; |
| 310 | 310 | address_space *program; |
| 311 | 311 |
| r14896 | r14897 | |
|---|---|---|
| 551 | 551 | UINT32 mmu603_r[4]; |
| 552 | 552 | |
| 553 | 553 | /* internal stuff */ |
| 554 | device_irq_callback irq_callback; | |
| 554 | device_irq_acknowledge_callback irq_callback; | |
| 555 | 555 | legacy_cpu_device * device; |
| 556 | 556 | address_space *program; |
| 557 | 557 | direct_read_data *direct; |
| r14896 | r14897 | |
| 573 | 573 | FUNCTION PROTOTYPES |
| 574 | 574 | ***************************************************************************/ |
| 575 | 575 | |
| 576 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback); | |
| 576 | void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback); | |
| 577 | 577 | void ppccom_exit(powerpc_state *ppc); |
| 578 | 578 | |
| 579 | 579 | void ppccom_reset(powerpc_state *ppc); |
| r14896 | r14897 | |
|---|---|---|
| 81 | 81 | z8000_reg_file regs;/* registers */ |
| 82 | 82 | int nmi_state; /* NMI line state */ |
| 83 | 83 | int irq_state[2]; /* IRQ line states (NVI, VI) */ |
| 84 | device_irq_callback irq_callback; | |
| 84 | device_irq_acknowledge_callback irq_callback; | |
| 85 | 85 | legacy_cpu_device *device; |
| 86 | 86 | address_space *program; |
| 87 | 87 | direct_read_data *direct; |
| r14896 | r14897 | |
| 393 | 393 | { |
| 394 | 394 | z8000_state *cpustate = get_safe_token(device); |
| 395 | 395 | |
| 396 | device_irq_callback save_irqcallback = cpustate->irq_callback; | |
| 396 | device_irq_acknowledge_callback save_irqcallback = cpustate->irq_callback; | |
| 397 | 397 | memset(cpustate, 0, sizeof(*cpustate)); |
| 398 | 398 | cpustate->irq_callback = save_irqcallback; |
| 399 | 399 | cpustate->device = device; |
| r14896 | r14897 | |
| 415 | 415 | { |
| 416 | 416 | z8000_state *cpustate = get_safe_token(device); |
| 417 | 417 | |
| 418 | device_irq_callback save_irqcallback = cpustate->irq_callback; | |
| 418 | device_irq_acknowledge_callback save_irqcallback = cpustate->irq_callback; | |
| 419 | 419 | memset(cpustate, 0, sizeof(*cpustate)); |
| 420 | 420 | cpustate->irq_callback = save_irqcallback; |
| 421 | 421 | cpustate->device = device; |
| r14896 | r14897 | |
|---|---|---|
| 118 | 118 | UINT32 pcflushes[16]; // pcflush entries |
| 119 | 119 | |
| 120 | 120 | INT8 irq_line_state[17]; |
| 121 | device_irq_callback irq_callback; | |
| 121 | device_irq_acknowledge_callback irq_callback; | |
| 122 | 122 | legacy_cpu_device *device; |
| 123 | 123 | address_space *program; |
| 124 | 124 | direct_read_data *direct; |
| r14896 | r14897 | |
| 207 | 207 | }; |
| 208 | 208 | #endif |
| 209 | 209 | |
| 210 | void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callback irqcallback); | |
| 210 | void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback); | |
| 211 | 211 | void sh2_recalc_irq(sh2_state *sh2); |
| 212 | 212 | void sh2_set_irq_line(sh2_state *sh2, int irqline, int state); |
| 213 | 213 | void sh2_exception(sh2_state *sh2, const char *message, int irqline); |
| r14896 | r14897 | |
|---|---|---|
| 780 | 780 | UINT32 *m; |
| 781 | 781 | |
| 782 | 782 | void (*f)(UINT32 data); |
| 783 | device_irq_callback save_irqcallback; | |
| 783 | device_irq_acknowledge_callback save_irqcallback; | |
| 784 | 784 | |
| 785 | 785 | m = sh2->m; |
| 786 | 786 | tsave = sh2->timer; |
| r14896 | r14897 | |
|---|---|---|
| 929 | 929 | #endif |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 932 | void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 933 | 933 | { |
| 934 | 934 | const sh2_cpu_core *conf = (const sh2_cpu_core *)device->static_config(); |
| 935 | 935 | int i; |
| r14896 | r14897 | |
|---|---|---|
| 2152 | 2152 | int save_is_slave; |
| 2153 | 2153 | |
| 2154 | 2154 | void (*f)(UINT32 data); |
| 2155 | device_irq_callback save_irqcallback; | |
| 2155 | device_irq_acknowledge_callback save_irqcallback; | |
| 2156 | 2156 | |
| 2157 | 2157 | m = sh2->m; |
| 2158 | 2158 | tsave = sh2->timer; |
| r14896 | r14897 | |
|---|---|---|
| 49 | 49 | UINT8 CheckInterrupts; |
| 50 | 50 | int halted; |
| 51 | 51 | int icount; |
| 52 | device_irq_callback irq_callback; | |
| 52 | device_irq_acknowledge_callback irq_callback; | |
| 53 | 53 | legacy_cpu_device *device; |
| 54 | 54 | address_space *program; |
| 55 | 55 | UINT16 oldpc; |
| r14896 | r14897 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | /* IRQ handling */ |
| 75 | 75 | UINT8 pending_interrupt; |
| 76 | device_irq_callback irqcallback; | |
| 76 | device_irq_acknowledge_callback irqcallback; | |
| 77 | 77 | legacy_cpu_device *device; |
| 78 | 78 | address_space *program; |
| 79 | 79 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 2841 | 2841 | int savecpu_clock, savebus_clock, savepm_clock; |
| 2842 | 2842 | |
| 2843 | 2843 | void (*f)(UINT32 data); |
| 2844 | device_irq_callback save_irqcallback; | |
| 2844 | device_irq_acknowledge_callback save_irqcallback; | |
| 2845 | 2845 | |
| 2846 | 2846 | m = sh4->m; |
| 2847 | 2847 | tsaved[0] = sh4->dma_timer[0]; |
| r14896 | r14897 | |
|---|---|---|
| 72 | 72 | int exception_requesting[128]; |
| 73 | 73 | |
| 74 | 74 | INT8 irq_line_state[17]; |
| 75 | device_irq_callback irq_callback; | |
| 75 | device_irq_acknowledge_callback irq_callback; | |
| 76 | 76 | legacy_cpu_device *device; |
| 77 | 77 | address_space *internal; |
| 78 | 78 | address_space *program; |
| r14896 | r14897 | |
|---|---|---|
| 142 | 142 | INT32 treg2; |
| 143 | 143 | } shadow; |
| 144 | 144 | |
| 145 | device_irq_callback irq_callback; | |
| 145 | device_irq_acknowledge_callback irq_callback; | |
| 146 | 146 | legacy_cpu_device *device; |
| 147 | 147 | address_space *program; |
| 148 | 148 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /* Set the callback that is called when servicing an interrupt */ |
| 305 | static void g65816_set_irq_callback(g65816i_cpu_struct *cpustate, device_irq_callback callback) | |
| 305 | static void g65816_set_irq_callback(g65816i_cpu_struct *cpustate, device_irq_acknowledge_callback callback) | |
| 306 | 306 | { |
| 307 | 307 | INT_ACK = callback; |
| 308 | 308 | } |
| r14896 | r14897 | |
|---|---|---|
| 93 | 93 | uint line_nmi; /* Status of the NMI line */ |
| 94 | 94 | uint ir; /* Instruction Register */ |
| 95 | 95 | uint irq_delay; /* delay 1 instruction before checking irq */ |
| 96 | device_irq_callback int_ack; /* Interrupt Acknowledge */ | |
| 96 | device_irq_acknowledge_callback int_ack; /* Interrupt Acknowledge */ | |
| 97 | 97 | legacy_cpu_device *device; |
| 98 | 98 | address_space *program; |
| 99 | 99 | read8_space_func read_vector; /* Read vector override */ |
| r14896 | r14897 | |
|---|---|---|
| 103 | 103 | UINT8 RAMEN, TB, PCK; /* PRC register */ |
| 104 | 104 | UINT32 IDB; |
| 105 | 105 | |
| 106 | device_irq_callback irq_callback; | |
| 106 | device_irq_acknowledge_callback irq_callback; | |
| 107 | 107 | legacy_cpu_device *device; |
| 108 | 108 | address_space *program; |
| 109 | 109 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 315 | 315 | return necv_dasm_one(buffer, pc, oprom, NULL); |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | static void nec_init(legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 318 | static void nec_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 319 | 319 | { |
| 320 | 320 | nec_state_t *nec_state = get_safe_token(device); |
| 321 | 321 |
| r14896 | r14897 | |
|---|---|---|
| 55 | 55 | UINT8 no_interrupt; |
| 56 | 56 | UINT8 halted; |
| 57 | 57 | |
| 58 | device_irq_callback irq_callback; | |
| 58 | device_irq_acknowledge_callback irq_callback; | |
| 59 | 59 | legacy_cpu_device *device; |
| 60 | 60 | address_space *program; |
| 61 | 61 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 403 | 403 | return necv_dasm_one(buffer, pc, oprom, nec_state->config); |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | static void v25_init(legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 406 | static void v25_init(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 407 | 407 | { |
| 408 | 408 | const nec_config *config = device->static_config() ? (const nec_config *)device->static_config() : &default_config; |
| 409 | 409 | v25_state_t *nec_state = get_safe_token(device); |
| r14896 | r14897 | |
|---|---|---|
| 196 | 196 | |
| 197 | 197 | /* internal stuff */ |
| 198 | 198 | mips3_flavor flavor; |
| 199 | device_irq_callback irq_callback; | |
| 199 | device_irq_acknowledge_callback irq_callback; | |
| 200 | 200 | legacy_cpu_device * device; |
| 201 | 201 | address_space *program; |
| 202 | 202 | direct_read_data *direct; |
| r14896 | r14897 | |
| 232 | 232 | FUNCTION PROTOTYPES |
| 233 | 233 | ***************************************************************************/ |
| 234 | 234 | |
| 235 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback); | |
| 235 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback); | |
| 236 | 236 | void mips3com_exit(mips3_state *mips); |
| 237 | 237 | |
| 238 | 238 | void mips3com_reset(mips3_state *mips); |
| r14896 | r14897 | |
|---|---|---|
| 386 | 386 | mips3_init - initialize the processor |
| 387 | 387 | -------------------------------------------------*/ |
| 388 | 388 | |
| 389 | static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 389 | static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 390 | 390 | { |
| 391 | 391 | mips3_state *mips3; |
| 392 | 392 | drc_cache *cache; |
| r14896 | r14897 | |
|---|---|---|
| 137 | 137 | int icount; |
| 138 | 138 | int interrupt_cycles; |
| 139 | 139 | int hasfpu; |
| 140 | device_irq_callback irq_callback; | |
| 140 | device_irq_acknowledge_callback irq_callback; | |
| 141 | 141 | legacy_cpu_device *device; |
| 142 | 142 | address_space *program; |
| 143 | 143 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 69 | 69 | structure based on the configured type |
| 70 | 70 | -------------------------------------------------*/ |
| 71 | 71 | |
| 72 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 72 | void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 73 | 73 | { |
| 74 | 74 | const mips3_config *config = (const mips3_config *)device->static_config(); |
| 75 | 75 | int tlbindex; |
| r14896 | r14897 | |
|---|---|---|
| 72 | 72 | UINT8 irq_state[3]; /* State of the three IRQs */ |
| 73 | 73 | UINT8 rf[0x80]; /* Register file (SJE) */ |
| 74 | 74 | UINT8 pf[0x100]; /* Perpherial file */ |
| 75 | device_irq_callback irq_callback; | |
| 75 | device_irq_acknowledge_callback irq_callback; | |
| 76 | 76 | legacy_cpu_device *device; |
| 77 | 77 | address_space *program; |
| 78 | 78 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 52 | 52 | UINT8 dbus; /* data bus value */ |
| 53 | 53 | UINT16 io; /* last I/O address */ |
| 54 | 54 | UINT16 irq_vector; |
| 55 | device_irq_callback irq_callback; | |
| 55 | device_irq_acknowledge_callback irq_callback; | |
| 56 | 56 | legacy_cpu_device *device; |
| 57 | 57 | address_space *program; |
| 58 | 58 | direct_read_data *direct; |
| r14896 | r14897 | |
| 1545 | 1545 | f8_Regs *cpustate = get_safe_token(device); |
| 1546 | 1546 | UINT8 data; |
| 1547 | 1547 | int i; |
| 1548 | device_irq_callback save_callback; | |
| 1548 | device_irq_acknowledge_callback save_callback; | |
| 1549 | 1549 | |
| 1550 | 1550 | save_callback = cpustate->irq_callback; |
| 1551 | 1551 | memset(cpustate, 0, sizeof(f8_Regs)); |
| r14896 | r14897 | |
|---|---|---|
| 157 | 157 | UINT8 after_ei; /* are we in the EI shadow? */ |
| 158 | 158 | UINT8 after_ldair; /* same, but for LD A,I or LD A,R */ |
| 159 | 159 | UINT32 ea; |
| 160 | device_irq_callback irq_callback; | |
| 160 | device_irq_acknowledge_callback irq_callback; | |
| 161 | 161 | legacy_cpu_device *device; |
| 162 | 162 | address_space *program; |
| 163 | 163 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 435 | 435 | /* interrupt callback */ |
| 436 | 436 | /* note that this callback is used by tms9900_set_irq_line(cpustate) and tms9980a_set_irq_line(cpustate) to |
| 437 | 437 | retreive the value on IC0-IC3 (non-standard behaviour) */ |
| 438 | device_irq_callback irq_callback; | |
| 438 | device_irq_acknowledge_callback irq_callback; | |
| 439 | 439 | legacy_cpu_device *device; |
| 440 | 440 | address_space *program; |
| 441 | 441 | address_space *io; |
| r14896 | r14897 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | int immediate_irq, immediate_vector, immediate_pri; |
| 35 | 35 | |
| 36 | device_irq_callback irq_cb; | |
| 36 | device_irq_acknowledge_callback irq_cb; | |
| 37 | 37 | legacy_cpu_device *device; |
| 38 | 38 | address_space *program; |
| 39 | 39 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 30 | 30 | UINT8 irq_line; |
| 31 | 31 | UINT8 irq_state; |
| 32 | 32 | UINT8 nmi_line; |
| 33 | device_irq_callback irq_callback; | |
| 33 | device_irq_acknowledge_callback irq_callback; | |
| 34 | 34 | legacy_cpu_device *device; |
| 35 | 35 | address_space *program; |
| 36 | 36 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 165 | 165 | int init_load_addr; /* 0=No, 1=Yes, 2=Once for repeat mode */ |
| 166 | 166 | int tms32025_irq_cycles; |
| 167 | 167 | int tms32025_dec_cycles; |
| 168 | device_irq_callback irq_callback; | |
| 168 | device_irq_acknowledge_callback irq_callback; | |
| 169 | 169 | |
| 170 | 170 | PAIR oldacc; |
| 171 | 171 | UINT32 memaccess; |
| r14896 | r14897 | |
|---|---|---|
| 125 | 125 | ; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | static void tx0_init_common(legacy_cpu_device *device, device_irq_callback irqcallback, int is_64kw) | |
| 128 | static void tx0_init_common(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback, int is_64kw) | |
| 129 | 129 | { |
| 130 | 130 | tx0_state *cpustate = get_safe_token(device); |
| 131 | 131 |
| r14896 | r14897 | |
|---|---|---|
| 32 | 32 | UINT8 wait_state; |
| 33 | 33 | UINT8 irq_state; |
| 34 | 34 | int icount; |
| 35 | device_irq_callback irq_callback; | |
| 35 | device_irq_acknowledge_callback irq_callback; | |
| 36 | 36 | legacy_cpu_device * device; |
| 37 | 37 | address_space *program; |
| 38 | 38 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 135 | 135 | { |
| 136 | 136 | arm_state *cpustate = get_safe_token(device); |
| 137 | 137 | |
| 138 | device_irq_callback save_irqcallback = cpustate->irq_callback; | |
| 138 | device_irq_acknowledge_callback save_irqcallback = cpustate->irq_callback; | |
| 139 | 139 | |
| 140 | 140 | memset(cpustate, 0, sizeof(arm_state)); |
| 141 | 141 | cpustate->irq_callback = save_irqcallback; |
| r14896 | r14897 | |
|---|---|---|
| 178 | 178 | UINT8 pendingSwi; \ |
| 179 | 179 | INT32 iCount; \ |
| 180 | 180 | endianness_t endian; \ |
| 181 | device_irq_callback irq_callback; \ | |
| 181 | device_irq_acknowledge_callback irq_callback; \ | |
| 182 | 182 | legacy_cpu_device *device; \ |
| 183 | 183 | address_space *program; \ |
| 184 | 184 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 170 | 170 | { |
| 171 | 171 | h6280_Regs* cpustate = get_safe_token(device); |
| 172 | 172 | |
| 173 | device_irq_callback save_irqcallback; | |
| 173 | device_irq_acknowledge_callback save_irqcallback; | |
| 174 | 174 | int i; |
| 175 | 175 | |
| 176 | 176 | /* wipe out the h6280 structure */ |
| r14896 | r14897 | |
|---|---|---|
| 60 | 60 | UINT8 nmi_state; |
| 61 | 61 | UINT8 irq_state[3]; |
| 62 | 62 | UINT8 irq_pending; |
| 63 | device_irq_callback irq_callback; | |
| 63 | device_irq_acknowledge_callback irq_callback; | |
| 64 | 64 | legacy_cpu_device *device; |
| 65 | 65 | address_space *program; |
| 66 | 66 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 123 | 123 | UINT8 ic_eddge; /* InputCapture eddge , b.0=fall,b.1=raise */ |
| 124 | 124 | int sc1_state; |
| 125 | 125 | |
| 126 | device_irq_callback irq_callback; | |
| 126 | device_irq_acknowledge_callback irq_callback; | |
| 127 | 127 | legacy_cpu_device *device; |
| 128 | 128 | |
| 129 | 129 | /* Memory spaces */ |
| r14896 | r14897 | |
|---|---|---|
| 37 | 37 | UINT8 flags; /* flags */ |
| 38 | 38 | int intr_enabled; |
| 39 | 39 | //int (*reset_callback)(cp1610_state *cpustate); |
| 40 | device_irq_callback irq_callback; | |
| 40 | device_irq_acknowledge_callback irq_callback; | |
| 41 | 41 | UINT16 intr_vector; |
| 42 | 42 | int reset_state; |
| 43 | 43 | int intr_state; |
| r14896 | r14897 | |
|---|---|---|
| 81 | 81 | UINT8 sleeping; /* low-consumption state */ |
| 82 | 82 | int monitor_id; |
| 83 | 83 | int monitor_in; |
| 84 | device_irq_callback irq_callback; | |
| 84 | device_irq_acknowledge_callback irq_callback; | |
| 85 | 85 | legacy_cpu_device *device; |
| 86 | 86 | address_space *program; |
| 87 | 87 | direct_read_data *direct; |
| r14896 | r14897 | |
|---|---|---|
| 56 | 56 | UINT8 cc; |
| 57 | 57 | UINT8 ireg; |
| 58 | 58 | UINT8 irq_state[2]; |
| 59 | device_irq_callback irq_callback; | |
| 59 | device_irq_acknowledge_callback irq_callback; | |
| 60 | 60 | UINT8 int_state; /* SYNC and CWAI flags */ |
| 61 | 61 | UINT8 nmi_state; |
| 62 | 62 | UINT8 nmi_pending; |
| r14896 | r14897 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | /*************************************************************************** |
| 17 | TYPE DEFINITIONS | |
| 18 | ***************************************************************************/ | |
| 19 | ||
| 20 | struct _generic_video_private | |
| 21 | { | |
| 22 | int flip_screen_x; | |
| 23 | int flip_screen_y; | |
| 24 | }; | |
| 25 | ||
| 26 | ||
| 27 | ||
| 28 | /*************************************************************************** | |
| 29 | 17 | COMMON GRAPHICS LAYOUTS |
| 30 | 18 | ***************************************************************************/ |
| 31 | 19 | |
| r14896 | r14897 | |
| 109 | 97 | |
| 110 | 98 | |
| 111 | 99 | /*************************************************************************** |
| 112 | INLINE FUNCTIONS | |
| 113 | ***************************************************************************/ | |
| 114 | ||
| 115 | /*------------------------------------------------- | |
| 116 | set_color_332 - set a 3-3-2 RGB color using | |
| 117 | the 16-bit data provided and the specified | |
| 118 | shift values | |
| 119 | -------------------------------------------------*/ | |
| 120 | ||
| 121 | void driver_device::set_color_332(pen_t color, int rshift, int gshift, int bshift, UINT32 data) | |
| 122 | { | |
| 123 | palette_set_color(machine(), color, pal332(data, rshift, gshift, bshift)); | |
| 124 | } | |
| 125 | ||
| 126 | ||
| 127 | /*------------------------------------------------- | |
| 128 | set_color_444 - set a 4-4-4 RGB color using | |
| 129 | the 16-bit data provided and the specified | |
| 130 | shift values | |
| 131 | -------------------------------------------------*/ | |
| 132 | ||
| 133 | void driver_device::set_color_444(pen_t color, int rshift, int gshift, int bshift, UINT32 data) | |
| 134 | { | |
| 135 | palette_set_color(machine(), color, pal444(data, rshift, gshift, bshift)); | |
| 136 | } | |
| 137 | ||
| 138 | ||
| 139 | /*------------------------------------------------- | |
| 140 | set_color_4444 - set a 4-4-4-4 IRGB color using | |
| 141 | the 16-bit data provided and the specified | |
| 142 | shift values | |
| 143 | -------------------------------------------------*/ | |
| 144 | ||
| 145 | void driver_device::set_color_4444(pen_t color, int ishift, int rshift, int gshift, int bshift, UINT16 data) | |
| 146 | { | |
| 147 | static const UINT8 ztable[16] = | |
| 148 | { 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11 }; | |
| 149 | int i, r, g, b; | |
| 150 | ||
| 151 | i = ztable[(data >> ishift) & 15]; | |
| 152 | r = ((data >> rshift) & 15) * i; | |
| 153 | g = ((data >> gshift) & 15) * i; | |
| 154 | b = ((data >> bshift) & 15) * i; | |
| 155 | ||
| 156 | palette_set_color_rgb(machine(), color, r, g, b); | |
| 157 | } | |
| 158 | ||
| 159 | ||
| 160 | /*------------------------------------------------- | |
| 161 | set_color_555 - set a 5-5-5 RGB color using | |
| 162 | the 16-bit data provided and the specified | |
| 163 | shift values | |
| 164 | -------------------------------------------------*/ | |
| 165 | ||
| 166 | void driver_device::set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT32 data) | |
| 167 | { | |
| 168 | palette_set_color(machine(), color, pal555(data, rshift, gshift, bshift)); | |
| 169 | } | |
| 170 | ||
| 171 | ||
| 172 | /*------------------------------------------------- | |
| 173 | set_color_565 - set a 5-6-5 RGB color using | |
| 174 | the 16-bit data provided and the specified | |
| 175 | shift values | |
| 176 | -------------------------------------------------*/ | |
| 177 | ||
| 178 | void driver_device::set_color_565(pen_t color, int rshift, int gshift, int bshift, UINT32 data) | |
| 179 | { | |
| 180 | palette_set_color(machine(), color, pal565(data, rshift, gshift, bshift)); | |
| 181 | } | |
| 182 | ||
| 183 | ||
| 184 | /*------------------------------------------------- | |
| 185 | set_color_8888 - set a 8-8-8 RGB color using | |
| 186 | the 32-bit data provided and the specified | |
| 187 | shift values | |
| 188 | -------------------------------------------------*/ | |
| 189 | ||
| 190 | void driver_device::set_color_888(pen_t color, int rshift, int gshift, int bshift, UINT32 data) | |
| 191 | { | |
| 192 | palette_set_color(machine(), color, pal888(data, rshift, gshift, bshift)); | |
| 193 | } | |
| 194 | ||
| 195 | ||
| 196 | ||
| 197 | /*************************************************************************** | |
| 198 | INITIALIZATION | |
| 199 | ***************************************************************************/ | |
| 200 | ||
| 201 | /*------------------------------------------------- | |
| 202 | generic_video_init - initialize globals and | |
| 203 | register for save states | |
| 204 | -------------------------------------------------*/ | |
| 205 | ||
| 206 | void generic_video_init(running_machine &machine) | |
| 207 | { | |
| 208 | generic_video_private *state; | |
| 209 | ||
| 210 | state = machine.generic_video_data = auto_alloc_clear(machine, generic_video_private); | |
| 211 | ||
| 212 | machine.save().save_item(NAME(state->flip_screen_x)); | |
| 213 | machine.save().save_item(NAME(state->flip_screen_y)); | |
| 214 | } | |
| 215 | ||
| 216 | ||
| 217 | ||
| 218 | /*************************************************************************** | |
| 219 | GLOBAL VIDEO ATTRIBUTES | |
| 220 | ***************************************************************************/ | |
| 221 | ||
| 222 | /*------------------------------------------------- | |
| 223 | updateflip - handle global flipping | |
| 224 | -------------------------------------------------*/ | |
| 225 | ||
| 226 | static void updateflip(running_machine &machine) | |
| 227 | { | |
| 228 | generic_video_private *state = machine.generic_video_data; | |
| 229 | int width = machine.primary_screen->width(); | |
| 230 | int height = machine.primary_screen->height(); | |
| 231 | attoseconds_t period = machine.primary_screen->frame_period().attoseconds; | |
| 232 | rectangle visarea = machine.primary_screen->visible_area(); | |
| 233 | ||
| 234 | machine.tilemap().set_flip_all((TILEMAP_FLIPX & state->flip_screen_x) | (TILEMAP_FLIPY & state->flip_screen_y)); | |
| 235 | ||
| 236 | if (state->flip_screen_x) | |
| 237 | { | |
| 238 | int temp; | |
| 239 | ||
| 240 | temp = width - visarea.min_x - 1; | |
| 241 | visarea.min_x = width - visarea.max_x - 1; | |
| 242 | visarea.max_x = temp; | |
| 243 | } | |
| 244 | if (state->flip_screen_y) | |
| 245 | { | |
| 246 | int temp; | |
| 247 | ||
| 248 | temp = height - visarea.min_y - 1; | |
| 249 | visarea.min_y = height - visarea.max_y - 1; | |
| 250 | visarea.max_y = temp; | |
| 251 | } | |
| 252 | ||
| 253 | machine.primary_screen->configure(width, height, visarea, period); | |
| 254 | } | |
| 255 | ||
| 256 | ||
| 257 | /*------------------------------------------------- | |
| 258 | flip_screen_set - set global flip | |
| 259 | -------------------------------------------------*/ | |
| 260 | ||
| 261 | void flip_screen_set(running_machine &machine, int on) | |
| 262 | { | |
| 263 | generic_video_private *state = machine.generic_video_data; | |
| 264 | if (on) on = ~0; | |
| 265 | if (state->flip_screen_x != on || state->flip_screen_y != on) | |
| 266 | { | |
| 267 | if (!on) updateflip(machine); // flip visarea back | |
| 268 | state->flip_screen_x = state->flip_screen_y = on; | |
| 269 | updateflip(machine); | |
| 270 | } | |
| 271 | } | |
| 272 | ||
| 273 | ||
| 274 | /*------------------------------------------------- | |
| 275 | flip_screen_set_no_update - set global flip | |
| 276 | do not call update_flip. | |
| 277 | -------------------------------------------------*/ | |
| 278 | ||
| 279 | void flip_screen_set_no_update(running_machine &machine, int on) | |
| 280 | { | |
| 281 | /* flip_screen_y is not updated on purpose | |
| 282 | * this function is for drivers which | |
| 283 | * where writing to flip_screen_x to | |
| 284 | * bypass update_flip | |
| 285 | */ | |
| 286 | generic_video_private *state = machine.generic_video_data; | |
| 287 | if (on) on = ~0; | |
| 288 | state->flip_screen_x = on; | |
| 289 | } | |
| 290 | ||
| 291 | ||
| 292 | /*------------------------------------------------- | |
| 293 | flip_screen_x_set - set global horizontal flip | |
| 294 | -------------------------------------------------*/ | |
| 295 | ||
| 296 | void flip_screen_x_set(running_machine &machine, int on) | |
| 297 | { | |
| 298 | generic_video_private *state = machine.generic_video_data; | |
| 299 | if (on) on = ~0; | |
| 300 | if (state->flip_screen_x != on) | |
| 301 | { | |
| 302 | state->flip_screen_x = on; | |
| 303 | updateflip(machine); | |
| 304 | } | |
| 305 | } | |
| 306 | ||
| 307 | ||
| 308 | /*------------------------------------------------- | |
| 309 | flip_screen_y_set - set global vertical flip | |
| 310 | -------------------------------------------------*/ | |
| 311 | ||
| 312 | void flip_screen_y_set(running_machine &machine, int on) | |
| 313 | { | |
| 314 | generic_video_private *state = machine.generic_video_data; | |
| 315 | if (on) on = ~0; | |
| 316 | if (state->flip_screen_y != on) | |
| 317 | { | |
| 318 | state->flip_screen_y = on; | |
| 319 | updateflip(machine); | |
| 320 | } | |
| 321 | } | |
| 322 | ||
| 323 | ||
| 324 | /*------------------------------------------------- | |
| 325 | flip_screen_get - get global flip | |
| 326 | -------------------------------------------------*/ | |
| 327 | ||
| 328 | int flip_screen_get(running_machine &machine) | |
| 329 | { | |
| 330 | generic_video_private *state = machine.generic_video_data; | |
| 331 | return state->flip_screen_x; | |
| 332 | } | |
| 333 | ||
| 334 | ||
| 335 | /*------------------------------------------------- | |
| 336 | flip_screen_x_get - get global x flip | |
| 337 | -------------------------------------------------*/ | |
| 338 | ||
| 339 | int flip_screen_x_get(running_machine &machine) | |
| 340 | { | |
| 341 | generic_video_private *state = machine.generic_video_data; | |
| 342 | return state->flip_screen_x; | |
| 343 | } | |
| 344 | ||
| 345 | ||
| 346 | /*------------------------------------------------- | |
| 347 | flip_screen_get - get global y flip | |
| 348 | -------------------------------------------------*/ | |
| 349 | ||
| 350 | int flip_screen_y_get(running_machine &machine) | |
| 351 | { | |
| 352 | generic_video_private *state = machine.generic_video_data; | |
| 353 | return state->flip_screen_y; | |
| 354 | } | |
| 355 | ||
| 356 | ||
| 357 | ||
| 358 | /*************************************************************************** | |
| 359 | 100 | COMMON PALETTE INITIALIZATION |
| 360 | 101 | ***************************************************************************/ |
| 361 | 102 | |
| r14896 | r14897 | |
| 490 | 231 | for (i = 0; i < 0x10000; i++) |
| 491 | 232 | palette_set_color(machine, i, MAKE_RGB(pal5bit(i >> 11), pal6bit(i >> 5), pal5bit(i >> 0))); |
| 492 | 233 | } |
| 493 | ||
| 494 | ||
| 495 | ||
| 496 | /*************************************************************************** | |
| 497 | 3-3-2 RGB PALETTE WRITE HANDLERS | |
| 498 | ***************************************************************************/ | |
| 499 | ||
| 500 | /*------------------------------------------------- | |
| 501 | RRR-GGG-BB writes | |
| 502 | -------------------------------------------------*/ | |
| 503 | ||
| 504 | WRITE8_MEMBER( driver_device::paletteram_RRRGGGBB_w ) | |
| 505 | { | |
| 506 | m_generic_paletteram_8[offset] = data; | |
| 507 | palette_set_color_rgb(machine(), offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data >> 0)); | |
| 508 | } | |
| 509 | ||
| 510 | ||
| 511 | /*------------------------------------------------- | |
| 512 | BB-GGG-RR writes | |
| 513 | -------------------------------------------------*/ | |
| 514 | ||
| 515 | WRITE8_MEMBER( driver_device::paletteram_BBGGGRRR_w ) | |
| 516 | { | |
| 517 | m_generic_paletteram_8[offset] = data; | |
| 518 | palette_set_color_rgb(machine(), offset, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); | |
| 519 | } | |
| 520 | ||
| 521 | ||
| 522 | /*------------------------------------------------- | |
| 523 | BB-GG-RR-II writes | |
| 524 | -------------------------------------------------*/ | |
| 525 | ||
| 526 | WRITE8_MEMBER( driver_device::paletteram_BBGGRRII_w ) | |
| 527 | { | |
| 528 | int i = (data >> 0) & 3; | |
| 529 | ||
| 530 | m_generic_paletteram_8[offset] = data; | |
| 531 | palette_set_color_rgb(machine(), offset, pal4bit(((data >> 0) & 0x0c) | i), | |
| 532 | pal4bit(((data >> 2) & 0x0c) | i), | |
| 533 | pal4bit(((data >> 4) & 0x0c) | i)); | |
| 534 | } | |
| 535 | ||
| 536 | /*------------------------------------------------- | |
| 537 | II-BB-GG-RR writes | |
| 538 | -------------------------------------------------*/ | |
| 539 | ||
| 540 | WRITE8_MEMBER( driver_device::paletteram_IIBBGGRR_w ) | |
| 541 | { | |
| 542 | int i = (data >> 6) & 3; | |
| 543 | ||
| 544 | m_generic_paletteram_8[offset] = data; | |
| 545 | palette_set_color_rgb(machine(), offset, pal4bit(((data << 2) & 0x0c) | i), | |
| 546 | pal4bit(((data >> 0) & 0x0c) | i), | |
| 547 | pal4bit(((data >> 2) & 0x0c) | i)); | |
| 548 | } | |
| 549 | ||
| 550 | ||
| 551 | ||
| 552 | /*************************************************************************** | |
| 553 | 4-4-4 RGB PALETTE WRITE HANDLERS | |
| 554 | ***************************************************************************/ | |
| 555 | ||
| 556 | /*------------------------------------------------- | |
| 557 | xxxx-BBBB-GGGG-RRRR writes | |
| 558 | -------------------------------------------------*/ | |
| 559 | ||
| 560 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_le_w ) | |
| 561 | { | |
| 562 | m_generic_paletteram_8[offset] = data; | |
| 563 | set_color_444(offset / 2, 0, 4, 8, paletteram16_le(offset)); | |
| 564 | } | |
| 565 | ||
| 566 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_be_w ) | |
| 567 | { | |
| 568 | m_generic_paletteram_8[offset] = data; | |
| 569 | set_color_444(offset / 2, 0, 4, 8, paletteram16_be(offset)); | |
| 570 | } | |
| 571 | ||
| 572 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_split1_w ) | |
| 573 | { | |
| 574 | m_generic_paletteram_8[offset] = data; | |
| 575 | set_color_444(offset, 0, 4, 8, paletteram16_split(offset)); | |
| 576 | } | |
| 577 | ||
| 578 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_split2_w ) | |
| 579 | { | |
| 580 | m_generic_paletteram2_8[offset] = data; | |
| 581 | set_color_444(offset, 0, 4, 8, paletteram16_split(offset)); | |
| 582 | } | |
| 583 | ||
| 584 | WRITE16_MEMBER( driver_device::paletteram16_xxxxBBBBGGGGRRRR_word_w ) | |
| 585 | { | |
| 586 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 587 | set_color_444(offset, 0, 4, 8, m_generic_paletteram_16[offset]); | |
| 588 | } | |
| 589 | ||
| 590 | ||
| 591 | /*------------------------------------------------- | |
| 592 | xxxx-BBBB-RRRR-GGGG writes | |
| 593 | -------------------------------------------------*/ | |
| 594 | ||
| 595 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_le_w ) | |
| 596 | { | |
| 597 | m_generic_paletteram_8[offset] = data; | |
| 598 | set_color_444(offset / 2, 4, 0, 8, paletteram16_le(offset)); | |
| 599 | } | |
| 600 | ||
| 601 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_be_w ) | |
| 602 | { | |
| 603 | m_generic_paletteram_8[offset] = data; | |
| 604 | set_color_444(offset / 2, 4, 0, 8, paletteram16_be(offset)); | |
| 605 | } | |
| 606 | ||
| 607 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_split1_w ) | |
| 608 | { | |
| 609 | m_generic_paletteram_8[offset] = data; | |
| 610 | set_color_444(offset, 4, 0, 8, paletteram16_split(offset)); | |
| 611 | } | |
| 612 | ||
| 613 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_split2_w ) | |
| 614 | { | |
| 615 | m_generic_paletteram2_8[offset] = data; | |
| 616 | set_color_444(offset, 4, 0, 8, paletteram16_split(offset)); | |
| 617 | } | |
| 618 | ||
| 619 | WRITE16_MEMBER( driver_device::paletteram16_xxxxBBBBRRRRGGGG_word_w ) | |
| 620 | { | |
| 621 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 622 | set_color_444(offset, 4, 0, 8, m_generic_paletteram_16[offset]); | |
| 623 | } | |
| 624 | ||
| 625 | ||
| 626 | /*------------------------------------------------- | |
| 627 | xxxx-RRRR-BBBB-GGGG writes | |
| 628 | -------------------------------------------------*/ | |
| 629 | ||
| 630 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRBBBBGGGG_split1_w ) | |
| 631 | { | |
| 632 | m_generic_paletteram_8[offset] = data; | |
| 633 | set_color_444(offset, 8, 0, 4, paletteram16_split(offset)); | |
| 634 | } | |
| 635 | ||
| 636 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRBBBBGGGG_split2_w ) | |
| 637 | { | |
| 638 | m_generic_paletteram2_8[offset] = data; | |
| 639 | set_color_444(offset, 8, 0, 4, paletteram16_split(offset)); | |
| 640 | } | |
| 641 | ||
| 642 | ||
| 643 | /*------------------------------------------------- | |
| 644 | xxxx-RRRR-GGGG-BBBB writes | |
| 645 | -------------------------------------------------*/ | |
| 646 | ||
| 647 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_le_w ) | |
| 648 | { | |
| 649 | m_generic_paletteram_8[offset] = data; | |
| 650 | set_color_444(offset / 2, 8, 4, 0, paletteram16_le(offset)); | |
| 651 | } | |
| 652 | ||
| 653 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_be_w ) | |
| 654 | { | |
| 655 | m_generic_paletteram_8[offset] = data; | |
| 656 | set_color_444(offset / 2, 8, 4, 0, paletteram16_be(offset)); | |
| 657 | } | |
| 658 | ||
| 659 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_split1_w ) | |
| 660 | { | |
| 661 | m_generic_paletteram_8[offset] = data; | |
| 662 | set_color_444(offset, 8, 4, 0, paletteram16_split(offset)); | |
| 663 | } | |
| 664 | ||
| 665 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_split2_w ) | |
| 666 | { | |
| 667 | m_generic_paletteram2_8[offset] = data; | |
| 668 | set_color_444(offset, 8, 4, 0, paletteram16_split(offset)); | |
| 669 | } | |
| 670 | ||
| 671 | WRITE16_MEMBER( driver_device::paletteram16_xxxxRRRRGGGGBBBB_word_w ) | |
| 672 | { | |
| 673 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 674 | set_color_444(offset, 8, 4, 0, m_generic_paletteram_16[offset]); | |
| 675 | } | |
| 676 | ||
| 677 | ||
| 678 | /*------------------------------------------------- | |
| 679 | RRRR-GGGG-BBBB-xxxx writes | |
| 680 | -------------------------------------------------*/ | |
| 681 | ||
| 682 | WRITE8_MEMBER( driver_device::paletteram_RRRRGGGGBBBBxxxx_be_w ) | |
| 683 | { | |
| 684 | m_generic_paletteram_8[offset] = data; | |
| 685 | set_color_444(offset / 2, 12, 8, 4, paletteram16_be(offset)); | |
| 686 | } | |
| 687 | ||
| 688 | WRITE8_MEMBER( driver_device::paletteram_RRRRGGGGBBBBxxxx_split1_w ) | |
| 689 | { | |
| 690 | m_generic_paletteram_8[offset] = data; | |
| 691 | set_color_444(offset, 12, 8, 4, paletteram16_split(offset)); | |
| 692 | } | |
| 693 | ||
| 694 | WRITE8_MEMBER( driver_device::paletteram_RRRRGGGGBBBBxxxx_split2_w ) | |
| 695 | { | |
| 696 | m_generic_paletteram2_8[offset] = data; | |
| 697 | set_color_444(offset, 12, 8, 4, paletteram16_split(offset)); | |
| 698 | } | |
| 699 | ||
| 700 | WRITE16_MEMBER( driver_device::paletteram16_RRRRGGGGBBBBxxxx_word_w ) | |
| 701 | { | |
| 702 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 703 | set_color_444(offset, 12, 8, 4, m_generic_paletteram_16[offset]); | |
| 704 | } | |
| 705 | ||
| 706 | ||
| 707 | ||
| 708 | /*************************************************************************** | |
| 709 | 5-5-5 RGB PALETTE WRITE HANDLERS | |
| 710 | ***************************************************************************/ | |
| 711 | ||
| 712 | /*------------------------------------------------- | |
| 713 | x-BBBBB-GGGGG-RRRRR writes | |
| 714 | -------------------------------------------------*/ | |
| 715 | ||
| 716 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_le_w ) | |
| 717 | { | |
| 718 | m_generic_paletteram_8[offset] = data; | |
| 719 | set_color_555(offset / 2, 0, 5, 10, paletteram16_le(offset)); | |
| 720 | } | |
| 721 | ||
| 722 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_be_w ) | |
| 723 | { | |
| 724 | m_generic_paletteram_8[offset] = data; | |
| 725 | set_color_555(offset / 2, 0, 5, 10, paletteram16_be(offset)); | |
| 726 | } | |
| 727 | ||
| 728 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_split1_w ) | |
| 729 | { | |
| 730 | m_generic_paletteram_8[offset] = data; | |
| 731 | set_color_555(offset, 0, 5, 10, paletteram16_split(offset)); | |
| 732 | } | |
| 733 | ||
| 734 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_split2_w ) | |
| 735 | { | |
| 736 | m_generic_paletteram2_8[offset] = data; | |
| 737 | set_color_555(offset, 0, 5, 10, paletteram16_split(offset)); | |
| 738 | } | |
| 739 | ||
| 740 | WRITE16_MEMBER( driver_device::paletteram16_xBBBBBGGGGGRRRRR_word_w ) | |
| 741 | { | |
| 742 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 743 | set_color_555(offset, 0, 5, 10, m_generic_paletteram_16[offset]); | |
| 744 | } | |
| 745 | ||
| 746 | ||
| 747 | /*------------------------------------------------- | |
| 748 | x-BBBBB-RRRRR-GGGGG writes | |
| 749 | -------------------------------------------------*/ | |
| 750 | ||
| 751 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBRRRRRGGGGG_split1_w ) | |
| 752 | { | |
| 753 | m_generic_paletteram_8[offset] = data; | |
| 754 | set_color_555(offset, 5, 0, 10, paletteram16_split(offset)); | |
| 755 | } | |
| 756 | ||
| 757 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBRRRRRGGGGG_split2_w ) | |
| 758 | { | |
| 759 | m_generic_paletteram2_8[offset] = data; | |
| 760 | set_color_555(offset, 5, 0, 10, paletteram16_split(offset)); | |
| 761 | } | |
| 762 | ||
| 763 | ||
| 764 | /*------------------------------------------------- | |
| 765 | x-RRRRR-GGGGG-BBBBB writes | |
| 766 | -------------------------------------------------*/ | |
| 767 | ||
| 768 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_le_w ) | |
| 769 | { | |
| 770 | m_generic_paletteram_8[offset] = data; | |
| 771 | set_color_555(offset / 2, 10, 5, 0, paletteram16_le(offset)); | |
| 772 | } | |
| 773 | ||
| 774 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_be_w ) | |
| 775 | { | |
| 776 | m_generic_paletteram_8[offset] = data; | |
| 777 | set_color_555(offset / 2, 10, 5, 0, paletteram16_be(offset)); | |
| 778 | } | |
| 779 | ||
| 780 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_split1_w ) | |
| 781 | { | |
| 782 | m_generic_paletteram_8[offset] = data; | |
| 783 | set_color_555(offset, 10, 5, 0, paletteram16_split(offset)); | |
| 784 | } | |
| 785 | ||
| 786 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_split2_w ) | |
| 787 | { | |
| 788 | m_generic_paletteram2_8[offset] = data; | |
| 789 | set_color_555(offset, 10, 5, 0, paletteram16_split(offset)); | |
| 790 | } | |
| 791 | ||
| 792 | WRITE16_MEMBER( driver_device::paletteram16_xRRRRRGGGGGBBBBB_word_w ) | |
| 793 | { | |
| 794 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 795 | set_color_555(offset, 10, 5, 0, m_generic_paletteram_16[offset]); | |
| 796 | } | |
| 797 | ||
| 798 | ||
| 799 | /*------------------------------------------------- | |
| 800 | x-GGGGG-RRRRR-BBBBB writes | |
| 801 | -------------------------------------------------*/ | |
| 802 | ||
| 803 | WRITE16_MEMBER( driver_device::paletteram16_xGGGGGRRRRRBBBBB_word_w ) | |
| 804 | { | |
| 805 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 806 | set_color_555(offset, 5, 10, 0, m_generic_paletteram_16[offset]); | |
| 807 | } | |
| 808 | ||
| 809 | ||
| 810 | /*------------------------------------------------- | |
| 811 | x-GGGGG-BBBBB-RRRRR writes | |
| 812 | -------------------------------------------------*/ | |
| 813 | ||
| 814 | WRITE16_MEMBER( driver_device::paletteram16_xGGGGGBBBBBRRRRR_word_w ) | |
| 815 | { | |
| 816 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 817 | set_color_555(offset, 0, 10, 5, m_generic_paletteram_16[offset]); | |
| 818 | } | |
| 819 | ||
| 820 | ||
| 821 | /*------------------------------------------------- | |
| 822 | GGGGG-RRRRR-BBBBB-x writes | |
| 823 | -------------------------------------------------*/ | |
| 824 | ||
| 825 | WRITE16_MEMBER( driver_device::paletteram16_GGGGGRRRRRBBBBBx_word_w ) | |
| 826 | { | |
| 827 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 828 | set_color_555(offset, 6, 11, 1, m_generic_paletteram_16[offset]); | |
| 829 | } | |
| 830 | ||
| 831 | /*------------------------------------------------- | |
| 832 | RRRRR-GGGGG-BBBBB-x writes | |
| 833 | -------------------------------------------------*/ | |
| 834 | ||
| 835 | WRITE16_MEMBER( driver_device::paletteram16_RRRRRGGGGGBBBBBx_word_w ) | |
| 836 | { | |
| 837 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 838 | set_color_555(offset, 11, 6, 1, m_generic_paletteram_16[offset]); | |
| 839 | } | |
| 840 | ||
| 841 | ||
| 842 | /*------------------------------------------------- | |
| 843 | RRRR-GGGG-BBBB-RGBx writes | |
| 844 | -------------------------------------------------*/ | |
| 845 | ||
| 846 | WRITE16_MEMBER( driver_device::paletteram16_RRRRGGGGBBBBRGBx_word_w ) | |
| 847 | { | |
| 848 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 849 | data = m_generic_paletteram_16[offset]; | |
| 850 | palette_set_color_rgb(machine(), offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)), | |
| 851 | pal5bit(((data >> 7) & 0x1e) | ((data >> 2) & 0x01)), | |
| 852 | pal5bit(((data >> 3) & 0x1e) | ((data >> 1) & 0x01))); | |
| 853 | } | |
| 854 | ||
| 855 | ||
| 856 | ||
| 857 | /*************************************************************************** | |
| 858 | 4-4-4-4 RGBI PALETTE WRITE HANDLERS | |
| 859 | ***************************************************************************/ | |
| 860 | ||
| 861 | /*------------------------------------------------- | |
| 862 | IIII-RRRR-GGGG-BBBB writes | |
| 863 | -------------------------------------------------*/ | |
| 864 | ||
| 865 | WRITE16_MEMBER( driver_device::paletteram16_IIIIRRRRGGGGBBBB_word_w ) | |
| 866 | { | |
| 867 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 868 | set_color_4444(offset, 12, 8, 4, 0, m_generic_paletteram_16[offset]); | |
| 869 | } | |
| 870 | ||
| 871 | ||
| 872 | /*------------------------------------------------- | |
| 873 | RRRR-GGGG-BBBB-IIII writes | |
| 874 | -------------------------------------------------*/ | |
| 875 | ||
| 876 | WRITE16_MEMBER( driver_device::paletteram16_RRRRGGGGBBBBIIII_word_w ) | |
| 877 | { | |
| 878 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 879 | set_color_4444(offset, 0, 12, 8, 4, m_generic_paletteram_16[offset]); | |
| 880 | } | |
| 881 | ||
| 882 | ||
| 883 | ||
| 884 | /*************************************************************************** | |
| 885 | 8-8-8 RGB PALETTE WRITE HANDLERS | |
| 886 | ***************************************************************************/ | |
| 887 | ||
| 888 | /*------------------------------------------------- | |
| 889 | xxxxxxxx-RRRRRRRR-GGGGGGGG-BBBBBBBB writes | |
| 890 | -------------------------------------------------*/ | |
| 891 | ||
| 892 | WRITE16_MEMBER( driver_device::paletteram16_xrgb_word_be_w ) | |
| 893 | { | |
| 894 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 895 | set_color_888(offset / 2, 16, 8, 0, paletteram32_be(offset)); | |
| 896 | } | |
| 897 | ||
| 898 | ||
| 899 | /*------------------------------------------------- | |
| 900 | xxxxxxxx-BBBBBBBB-GGGGGGGG-RRRRRRRR writes | |
| 901 | -------------------------------------------------*/ | |
| 902 | ||
| 903 | WRITE16_MEMBER( driver_device::paletteram16_xbgr_word_be_w ) | |
| 904 | { | |
| 905 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 906 | set_color_888(offset / 2, 0, 8, 16, paletteram32_be(offset)); | |
| 907 | } |
| r14896 | r14897 | |
|---|---|---|
| 35 | 35 | FUNCTION PROTOTYPES |
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | /* ----- initialization ----- */ | |
| 39 | ||
| 40 | /* set up all the common systems */ | |
| 41 | void generic_video_init(running_machine &machine); | |
| 42 | ||
| 43 | ||
| 44 | ||
| 45 | /* ----- global attributes ----- */ | |
| 46 | ||
| 47 | /* set global attributes */ | |
| 48 | void flip_screen_set(running_machine &machine, int on); | |
| 49 | void flip_screen_set_no_update(running_machine &machine, int on); /* will not call update_flip */ | |
| 50 | void flip_screen_x_set(running_machine &machine, int on); | |
| 51 | void flip_screen_y_set(running_machine &machine, int on); | |
| 52 | int flip_screen_get(running_machine &machine); | |
| 53 | int flip_screen_x_get(running_machine &machine); | |
| 54 | int flip_screen_y_get(running_machine &machine); | |
| 55 | ||
| 56 | //#define flip_screen flip_screen_get(machine) | |
| 57 | ||
| 58 | ||
| 59 | ||
| 60 | 38 | /* ----- generic palette init routines ----- */ |
| 61 | 39 | |
| 62 | 40 | PALETTE_INIT( all_black ); |
| r14896 | r14897 | |
|---|---|---|
| 85 | 85 | // static driver initialization callback |
| 86 | 86 | typedef void (*driver_init_func)(running_machine &machine); |
| 87 | 87 | |
| 88 | /* | |
| 89 | // wrapper template to allow members | |
| 90 | template<class _DriverClass, void (_DriverClass::*_Function)()> | |
| 91 | void driver_init_wrapper(running_machine &machine) | |
| 92 | { | |
| 93 | _DriverClass *object = machine.driver_data<_DriverClass>(); | |
| 94 | (object->*_Function)(); | |
| 95 | } | |
| 96 | */ | |
| 97 | ||
| 98 | 88 | // static POD structure describing each game driver entry |
| 99 | 89 | struct game_driver |
| 100 | 90 | { |
| r14896 | r14897 | |
|---|---|---|
| 140 | 140 | // generic helpers |
| 141 | 141 | #include "devcb.h" |
| 142 | 142 | #include "drivers/xtal.h" |
| 143 | #include "audio/generic.h" | |
| 144 | 143 | #include "machine/generic.h" |
| 145 | 144 | #include "video/generic.h" |
| 146 | 145 |
| r14896 | r14897 | |
|---|---|---|
| 62 | 62 | - calls render_init() [render.c] to initialize the rendering system |
| 63 | 63 | - calls ui_init() [ui.c] to initialize the user interface |
| 64 | 64 | - calls generic_machine_init() [machine/generic.c] to initialize generic machine structures |
| 65 | - calls generic_video_init() [video/generic.c] to initialize generic video structures | |
| 66 | - calls generic_sound_init() [audio/generic.c] to initialize generic sound structures | |
| 67 | 65 | - calls timer_init() [timer.c] to reset the timer system |
| 68 | 66 | - calls osd_init() [osdepend.h] to do platform-specific initialization |
| 69 | 67 | - calls input_port_init() [inptport.c] to set up the input ports |
| r14896 | r14897 | |
| 149 | 147 | ui_input_data(NULL), |
| 150 | 148 | debugcpu_data(NULL), |
| 151 | 149 | generic_machine_data(NULL), |
| 152 | generic_video_data(NULL), | |
| 153 | generic_audio_data(NULL), | |
| 154 | 150 | |
| 155 | 151 | m_config(_config), |
| 156 | 152 | m_system(_config.gamedrv()), |
| r14896 | r14897 | |
| 251 | 247 | palette_init(*this); |
| 252 | 248 | m_render = auto_alloc(*this, render_manager(*this)); |
| 253 | 249 | generic_machine_init(*this); |
| 254 | generic_sound_init(*this); | |
| 255 | generic_video_init(*this); | |
| 256 | 250 | |
| 257 | 251 | // allocate a soft_reset timer |
| 258 | 252 | m_soft_reset_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::soft_reset), this)); |
| r14896 | r14897 | |
|---|---|---|
| 189 | 189 | typedef struct _ui_input_private ui_input_private; |
| 190 | 190 | typedef struct _debugcpu_private debugcpu_private; |
| 191 | 191 | typedef struct _generic_machine_private generic_machine_private; |
| 192 | typedef struct _generic_video_private generic_video_private; | |
| 193 | typedef struct _generic_audio_private generic_audio_private; | |
| 194 | 192 | |
| 195 | 193 | |
| 196 | 194 | // legacy callback functions |
| r14896 | r14897 | |
| 413 | 411 | ui_input_private * ui_input_data; // internal data from uiinput.c |
| 414 | 412 | debugcpu_private * debugcpu_data; // internal data from debugcpu.c |
| 415 | 413 | generic_machine_private *generic_machine_data; // internal data from machine/generic.c |
| 416 | generic_video_private * generic_video_data; // internal data from video/generic.c | |
| 417 | generic_audio_private * generic_audio_data; // internal data from audio/generic.c | |
| 418 | 414 | |
| 419 | 415 | private: |
| 420 | 416 | // internal helpers |
| r14896 | r14897 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | generic.h | |
| 4 | ||
| 5 | Generic simple sound functions. | |
| 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 __SOUND_GENERIC_H__ | |
| 15 | #define __SOUND_GENERIC_H__ | |
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | /*************************************************************************** | |
| 20 | ||
| 21 | Function prototypes | |
| 22 | ||
| 23 | ***************************************************************************/ | |
| 24 | ||
| 25 | int generic_sound_init(running_machine &machine); | |
| 26 | ||
| 27 | /* If you're going to use soundlatchX_clear_w, and the cleared value is | |
| 28 | something other than 0x00, use this function from machine_init. Note | |
| 29 | that this one call effects all 4 latches */ | |
| 30 | void soundlatch_setclearedvalue(running_machine &machine, int value); | |
| 31 | ||
| 32 | ||
| 33 | #endif /* __SOUND_GENERIC_H__ */ |
| r14896 | r14897 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | generic.c | |
| 4 | ||
| 5 | Generic simple sound functions. | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | ||
| 14 | ||
| 15 | ||
| 16 | /*************************************************************************** | |
| 17 | TYPE DEFINITIONS | |
| 18 | ***************************************************************************/ | |
| 19 | ||
| 20 | struct _generic_audio_private | |
| 21 | { | |
| 22 | UINT16 latch_clear_value; | |
| 23 | UINT16 latched_value[4]; | |
| 24 | UINT8 latch_read[4]; | |
| 25 | }; | |
| 26 | ||
| 27 | ||
| 28 | ||
| 29 | /*************************************************************************** | |
| 30 | INITIALIZATION | |
| 31 | ***************************************************************************/ | |
| 32 | ||
| 33 | /*------------------------------------------------- | |
| 34 | generic_sound_init - initialize globals and | |
| 35 | register for save states | |
| 36 | -------------------------------------------------*/ | |
| 37 | ||
| 38 | int generic_sound_init(running_machine &machine) | |
| 39 | { | |
| 40 | generic_audio_private *state; | |
| 41 | ||
| 42 | state = machine.generic_audio_data = auto_alloc_clear(machine, generic_audio_private); | |
| 43 | ||
| 44 | /* register globals with the save state system */ | |
| 45 | state_save_register_global_array(machine, state->latched_value); | |
| 46 | state_save_register_global_array(machine, state->latch_read); | |
| 47 | ||
| 48 | return 0; | |
| 49 | } | |
| 50 | ||
| 51 | ||
| 52 | ||
| 53 | /*************************************************************************** | |
| 54 | ||
| 55 | Many games use a master-slave CPU setup. Typically, the main CPU writes | |
| 56 | a command to some register, and then writes to another register to trigger | |
| 57 | an interrupt on the slave CPU (the interrupt might also be triggered by | |
| 58 | the first write). The slave CPU, notified by the interrupt, goes and reads | |
| 59 | the command. | |
| 60 | ||
| 61 | ***************************************************************************/ | |
| 62 | ||
| 63 | /*------------------------------------------------- | |
| 64 | latch_callback - time-delayed callback to | |
| 65 | set a latch value | |
| 66 | -------------------------------------------------*/ | |
| 67 | ||
| 68 | static TIMER_CALLBACK( latch_callback ) | |
| 69 | { | |
| 70 | generic_audio_private *state = machine.generic_audio_data; | |
| 71 | UINT16 value = param >> 8; | |
| 72 | int which = param & 0xff; | |
| 73 | ||
| 74 | /* if the latch hasn't been read and the value is changed, log a warning */ | |
| 75 | if (!state->latch_read[which] && state->latched_value[which] != value) | |
| 76 | logerror("Warning: sound latch %d written before being read. Previous: %02x, new: %02x\n", which, state->latched_value[which], value); | |
| 77 | ||
| 78 | /* store the new value and mark it not read */ | |
| 79 | state->latched_value[which] = value; | |
| 80 | state->latch_read[which] = 0; | |
| 81 | } | |
| 82 | ||
| 83 | ||
| 84 | /*------------------------------------------------- | |
| 85 | latch_w - handle a write to a given latch | |
| 86 | -------------------------------------------------*/ | |
| 87 | ||
| 88 | INLINE void latch_w(address_space *space, int which, UINT16 value) | |
| 89 | { | |
| 90 | space->machine().scheduler().synchronize(FUNC(latch_callback), which | (value << 8)); | |
| 91 | } | |
| 92 | ||
| 93 | ||
| 94 | /*------------------------------------------------- | |
| 95 | latch_r - handle a read from a given latch | |
| 96 | -------------------------------------------------*/ | |
| 97 | ||
| 98 | INLINE UINT16 latch_r(address_space *space, int which) | |
| 99 | { | |
| 100 | generic_audio_private *state = space->machine().generic_audio_data; | |
| 101 | state->latch_read[which] = 1; | |
| 102 | return state->latched_value[which]; | |
| 103 | } | |
| 104 | ||
| 105 | ||
| 106 | /*------------------------------------------------- | |
| 107 | latch_clear - clear a given latch | |
| 108 | -------------------------------------------------*/ | |
| 109 | ||
| 110 | INLINE void latch_clear(address_space *space, int which) | |
| 111 | { | |
| 112 | generic_audio_private *state = space->machine().generic_audio_data; | |
| 113 | state->latched_value[which] = state->latch_clear_value; | |
| 114 | } | |
| 115 | ||
| 116 | ||
| 117 | /*------------------------------------------------- | |
| 118 | soundlatch_w - global write handlers for | |
| 119 | writing to sound latches | |
| 120 | -------------------------------------------------*/ | |
| 121 | ||
| 122 | WRITE8_MEMBER( driver_device::soundlatch_w ) { latch_w(&space, 0, data); } | |
| 123 | WRITE16_MEMBER( driver_device::soundlatch_word_w ) { latch_w(&space, 0, data); } | |
| 124 | WRITE8_MEMBER( driver_device::soundlatch2_w ) { latch_w(&space, 1, data); } | |
| 125 | WRITE16_MEMBER( driver_device::soundlatch2_word_w ) { latch_w(&space, 1, data); } | |
| 126 | WRITE8_MEMBER( driver_device::soundlatch3_w ) { latch_w(&space, 2, data); } | |
| 127 | WRITE16_MEMBER( driver_device::soundlatch3_word_w ) { latch_w(&space, 2, data); } | |
| 128 | WRITE8_MEMBER( driver_device::soundlatch4_w ) { latch_w(&space, 3, data); } | |
| 129 | WRITE16_MEMBER( driver_device::soundlatch4_word_w ) { latch_w(&space, 3, data); } | |
| 130 | ||
| 131 | ||
| 132 | /*------------------------------------------------- | |
| 133 | soundlatch_r - global read handlers for | |
| 134 | reading from sound latches | |
| 135 | -------------------------------------------------*/ | |
| 136 | ||
| 137 | READ8_MEMBER( driver_device::soundlatch_r ) { return latch_r(&space, 0); } | |
| 138 | READ16_MEMBER( driver_device::soundlatch_word_r ) { return latch_r(&space, 0); } | |
| 139 | READ8_MEMBER( driver_device::soundlatch2_r ) { return latch_r(&space, 1); } | |
| 140 | READ16_MEMBER( driver_device::soundlatch2_word_r ) { return latch_r(&space, 1); } | |
| 141 | READ8_MEMBER( driver_device::soundlatch3_r ) { return latch_r(&space, 2); } | |
| 142 | READ16_MEMBER( driver_device::soundlatch3_word_r ) { return latch_r(&space, 2); } | |
| 143 | READ8_MEMBER( driver_device::soundlatch4_r ) { return latch_r(&space, 3); } | |
| 144 | READ16_MEMBER( driver_device::soundlatch4_word_r ) { return latch_r(&space, 3); } | |
| 145 | ||
| 146 | ||
| 147 | /*------------------------------------------------- | |
| 148 | soundlatch_clear_w - global write handlers | |
| 149 | for clearing sound latches | |
| 150 | -------------------------------------------------*/ | |
| 151 | ||
| 152 | WRITE8_MEMBER( driver_device::soundlatch_clear_w ) { latch_clear(&space, 0); } | |
| 153 | WRITE8_MEMBER( driver_device::soundlatch2_clear_w ) { latch_clear(&space, 1); } | |
| 154 | WRITE8_MEMBER( driver_device::soundlatch3_clear_w ) { latch_clear(&space, 2); } | |
| 155 | WRITE8_MEMBER( driver_device::soundlatch4_clear_w ) { latch_clear(&space, 3); } | |
| 156 | ||
| 157 | ||
| 158 | /*------------------------------------------------- | |
| 159 | soundlatch_setclearedvalue - set the "clear" | |
| 160 | value for all sound latches | |
| 161 | -------------------------------------------------*/ | |
| 162 | ||
| 163 | void soundlatch_setclearedvalue(running_machine &machine, int value) | |
| 164 | { | |
| 165 | generic_audio_private *state = machine.generic_audio_data; | |
| 166 | assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!"); | |
| 167 | state->latch_clear_value = value; | |
| 168 | } |
| r14896 | r14897 | |
|---|---|---|
| 199 | 199 | #define CPU_SET_INFO_CALL(name) CPU_SET_INFO_NAME(name)(device, state, info) |
| 200 | 200 | |
| 201 | 201 | #define CPU_INIT_NAME(name) cpu_init_##name |
| 202 | #define CPU_INIT(name) void CPU_INIT_NAME(name)(legacy_cpu_device *device, device_irq_callback irqcallback) | |
| 202 | #define CPU_INIT(name) void CPU_INIT_NAME(name)(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback) | |
| 203 | 203 | #define CPU_INIT_CALL(name) CPU_INIT_NAME(name)(device, irqcallback) |
| 204 | 204 | |
| 205 | 205 | #define CPU_RESET_NAME(name) cpu_reset_##name |
| r14896 | r14897 | |
| 262 | 262 | |
| 263 | 263 | #define cpu_set_reg(cpu, _reg, val) device_state(cpu)->set_state(_reg, val) |
| 264 | 264 | |
| 265 | #define INTERRUPT_GEN(func) void func(device_t *device) | |
| 266 | ||
| 267 | 265 | // helpers for using machine/cputag instead of cpu objects |
| 268 | 266 | #define cputag_set_input_line(mach, tag, line, state) device_execute((mach).device(tag))->set_input_line(line, state) |
| 269 | 267 | #define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach).device(tag))->set_input_line_and_vector(line, state, vec) |
| r14896 | r14897 | |
| 283 | 281 | // CPU interface functions |
| 284 | 282 | typedef void (*cpu_get_info_func)(legacy_cpu_device *device, UINT32 state, cpuinfo *info); |
| 285 | 283 | typedef void (*cpu_set_info_func)(legacy_cpu_device *device, UINT32 state, cpuinfo *info); |
| 286 | typedef void (*cpu_init_func)(legacy_cpu_device *device, device_irq_callback irqcallback); | |
| 284 | typedef void (*cpu_init_func)(legacy_cpu_device *device, device_irq_acknowledge_callback irqcallback); | |
| 287 | 285 | typedef void (*cpu_reset_func)(legacy_cpu_device *device); |
| 288 | 286 | typedef void (*cpu_exit_func)(legacy_cpu_device *device); |
| 289 | 287 | typedef void (*cpu_execute_func)(legacy_cpu_device *device); |
| r14896 | r14897 | |
|---|---|---|
| 134 | 134 | $(EMUOBJ)/sound/wavwrite.o \ |
| 135 | 135 | |
| 136 | 136 | EMUAUDIOOBJS = \ |
| 137 | $(EMUAUDIO)/generic.o \ | |
| 138 | 137 | |
| 139 | 138 | EMUDRIVEROBJS = \ |
| 140 | 139 | $(EMUDRIVERS)/empty.o \ |
| r14896 | r14897 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | static void counters_load(running_machine &machine, int config_type, xml_data_node *parentnode); |
| 23 | 23 | static void counters_save(running_machine &machine, int config_type, xml_data_node *parentnode); |
| 24 | static void interrupt_reset(running_machine &machine); | |
| 25 | 24 | |
| 26 | 25 | |
| 27 | 26 | |
| r14896 | r14897 | |
| 39 | 38 | |
| 40 | 39 | /* memory card status */ |
| 41 | 40 | int memcard_inserted; |
| 42 | ||
| 43 | /* interrupt status for up to 8 CPUs */ | |
| 44 | device_t * interrupt_device[8]; | |
| 45 | UINT8 interrupt_enable[8]; | |
| 46 | 41 | }; |
| 47 | 42 | |
| 48 | 43 | |
| 49 | 44 | |
| 50 | 45 | /*************************************************************************** |
| 51 | INLINE FUNCTIONS | |
| 52 | ***************************************************************************/ | |
| 53 | ||
| 54 | /*------------------------------------------------- | |
| 55 | interrupt_enabled - return true if interrupts | |
| 56 | are enabled for the given CPU | |
| 57 | -------------------------------------------------*/ | |
| 58 | ||
| 59 | INLINE int interrupt_enabled(device_t *device) | |
| 60 | { | |
| 61 | generic_machine_private *state = device->machine().generic_machine_data; | |
| 62 | for (int index = 0; index < ARRAY_LENGTH(state->interrupt_device); index++) | |
| 63 | if (state->interrupt_device[index] == device) | |
| 64 | return state->interrupt_enable[index]; | |
| 65 | return TRUE; | |
| 66 | } | |
| 67 | ||
| 68 | ||
| 69 | ||
| 70 | /*************************************************************************** | |
| 71 | 46 | INITIALIZATION |
| 72 | 47 | ***************************************************************************/ |
| 73 | 48 | |
| r14896 | r14897 | |
| 92 | 67 | state->coinlockedout[counternum] = 0; |
| 93 | 68 | } |
| 94 | 69 | |
| 95 | // map devices to the interrupt state | |
| 96 | memset(state->interrupt_device, 0, sizeof(state->interrupt_device)); | |
| 97 | execute_interface_iterator iter(machine.root_device()); | |
| 98 | int index = 0; | |
| 99 | for (device_execute_interface *exec = iter.first(); exec != NULL && index < ARRAY_LENGTH(state->interrupt_device); exec = iter.next()) | |
| 100 | state->interrupt_device[index++] = &exec->device(); | |
| 101 | ||
| 102 | 70 | /* register coin save state */ |
| 103 | 71 | machine.save().save_item(NAME(state->coin_count)); |
| 104 | 72 | machine.save().save_item(NAME(state->coinlockedout)); |
| r14896 | r14897 | |
| 107 | 75 | /* reset memory card info */ |
| 108 | 76 | state->memcard_inserted = -1; |
| 109 | 77 | |
| 110 | /* register a reset callback and save state for interrupt enable */ | |
| 111 | machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(interrupt_reset), &machine)); | |
| 112 | machine.save().save_item(NAME(state->interrupt_enable)); | |
| 113 | ||
| 114 | 78 | /* register for configuration */ |
| 115 | 79 | config_register(machine, "counters", config_saveload_delegate(FUNC(counters_load), &machine), config_saveload_delegate(FUNC(counters_save), &machine)); |
| 116 | 80 | |
| r14896 | r14897 | |
| 549 | 513 | |
| 550 | 514 | |
| 551 | 515 | |
| 516 | ||
| 552 | 517 | /*************************************************************************** |
| 553 | | |
| 518 | | |
| 554 | 519 | ***************************************************************************/ |
| 555 | 520 | |
| 556 | 521 | /*------------------------------------------------- |
| 557 | interrupt_reset - reset the interrupt enable | |
| 558 | states on a reset | |
| 522 | custom_port_read - act like input_port_read | |
| 523 | but it is a custom port, it is useful for | |
| 524 | e.g. input ports which expect the same port | |
| 525 | repeated both in the upper and lower half | |
| 559 | 526 | -------------------------------------------------*/ |
| 560 | 527 | |
| 561 | ||
| 528 | CUSTOM_INPUT_MEMBER( | |
| 562 | 529 | { |
| 563 | generic_machine_private *state = machine.generic_machine_data; | |
| 564 | int cpunum; | |
| 565 | ||
| 566 | /* on a reset, enable all interrupts */ | |
| 567 | for (cpunum = 0; cpunum < ARRAY_LENGTH(state->interrupt_enable); cpunum++) | |
| 568 | state->interrupt_enable[cpunum] = 1; | |
| 530 | const char *tag = (const char *)param; | |
| 531 | return input_port_read(machine(), tag); | |
| 569 | 532 | } |
| 570 | 533 | |
| 571 | 534 | |
| 572 | /*------------------------------------------------- | |
| 573 | irq_pulse_clear - clear a "pulsed" IRQ line | |
| 574 | -------------------------------------------------*/ | |
| 535 | void generic_pulse_irq_line(device_t *device, int irqline, int cycles) { device->machine().driver_data()->generic_pulse_irq_line(device->execute(), irqline, cycles); } | |
| 536 | void generic_pulse_irq_line_and_vector(device_t *device, int irqline, int vector, int cycles) { device->machine().driver_data()->generic_pulse_irq_line_and_vector(device->execute(), irqline, vector, cycles); } | |
| 575 | 537 | |
| 576 | static TIMER_CALLBACK( irq_pulse_clear ) | |
| 577 | { | |
| 578 | device_t *device = (device_t *)ptr; | |
| 579 | int irqline = param; | |
| 580 | device_set_input_line(device, irqline, CLEAR_LINE); | |
| 581 | } | |
| 538 | INTERRUPT_GEN( nmi_line_pulse ) { device->machine().driver_data()->nmi_line_pulse(*device); } | |
| 539 | INTERRUPT_GEN( nmi_line_assert ) { device->machine().driver_data()->nmi_line_assert(*device); } | |
| 582 | 540 | |
| 541 | INTERRUPT_GEN( irq0_line_hold ) { device->machine().driver_data()->irq0_line_hold(*device); } | |
| 542 | INTERRUPT_GEN( irq0_line_pulse ) { device->machine().driver_data()->irq0_line_pulse(*device); } | |
| 543 | INTERRUPT_GEN( irq0_line_assert ) { device->machine().driver_data()->irq0_line_assert(*device); } | |
| 583 | 544 | |
| 584 | /*------------------------------------------------- | |
| 585 | generic_pulse_irq_line - "pulse" an IRQ line by | |
| 586 | asserting it and then clearing it x cycle(s) | |
| 587 | later | |
| 588 | -------------------------------------------------*/ | |
| 545 | INTERRUPT_GEN( irq1_line_hold ) { device->machine().driver_data()->irq1_line_hold(*device); } | |
| 546 | INTERRUPT_GEN( irq1_line_pulse ) { device->machine().driver_data()->irq1_line_pulse(*device); } | |
| 547 | INTERRUPT_GEN( irq1_line_assert ) { device->machine().driver_data()->irq1_line_assert(*device); } | |
| 589 | 548 | |
| 590 | void generic_pulse_irq_line(device_t *device, int irqline, int cycles) | |
| 591 | { | |
| 592 | assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET && cycles > 0); | |
| 593 | device_set_input_line(device, irqline, ASSERT_LINE); | |
| 549 | INTERRUPT_GEN( irq2_line_hold ) { device->machine().driver_data()->irq2_line_hold(*device); } | |
| 550 | INTERRUPT_GEN( irq2_line_pulse ) { device->machine().driver_data()->irq2_line_pulse(*device); } | |
| 551 | INTERRUPT_GEN( irq2_line_assert ) { device->machine().driver_data()->irq2_line_assert(*device); } | |
| 594 | 552 | |
| 595 | cpu_device *cpudevice = downcast<cpu_device *>(device); | |
| 596 | attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cycles * cpudevice->min_cycles()); | |
| 597 | device->machine().scheduler().timer_set(target_time - device->machine().time(), FUNC(irq_pulse_clear), irqline, (void *)device); | |
| 598 | } | |
| 553 | INTERRUPT_GEN( irq3_line_hold ) { device->machine().driver_data()->irq3_line_hold(*device); } | |
| 554 | INTERRUPT_GEN( irq3_line_pulse ) { device->machine().driver_data()->irq3_line_pulse(*device); } | |
| 555 | INTERRUPT_GEN( irq3_line_assert ) { device->machine().driver_data()->irq3_line_assert(*device); } | |
| 599 | 556 | |
| 557 | INTERRUPT_GEN( irq4_line_hold ) { device->machine().driver_data()->irq4_line_hold(*device); } | |
| 558 | INTERRUPT_GEN( irq4_line_pulse ) { device->machine().driver_data()->irq4_line_pulse(*device); } | |
| 559 | INTERRUPT_GEN( irq4_line_assert ) { device->machine().driver_data()->irq4_line_assert(*device); } | |
| 600 | 560 | |
| 601 | /*------------------------------------------------- | |
| 602 | generic_pulse_irq_line_and_vector - "pulse" an | |
| 603 | IRQ line by asserting it and then clearing it | |
| 604 | x cycle(s) later, specifying a vector | |
| 605 | -------------------------------------------------*/ | |
| 561 | INTERRUPT_GEN( irq5_line_hold ) { device->machine().driver_data()->irq5_line_hold(*device); } | |
| 562 | INTERRUPT_GEN( irq5_line_pulse ) { device->machine().driver_data()->irq5_line_pulse(*device); } | |
| 563 | INTERRUPT_GEN( irq5_line_assert ) { device->machine().driver_data()->irq5_line_assert(*device); } | |
| 606 | 564 | |
| 607 | void generic_pulse_irq_line_and_vector(device_t *device, int irqline, int vector, int cycles) | |
| 608 | { | |
| 609 | assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET && cycles > 0); | |
| 610 | device_set_input_line_and_vector(device, irqline, ASSERT_LINE, vector); | |
| 565 | INTERRUPT_GEN( irq6_line_hold ) { device->machine().driver_data()->irq6_line_hold(*device); } | |
| 566 | INTERRUPT_GEN( irq6_line_pulse ) { device->machine().driver_data()->irq6_line_pulse(*device); } | |
| 567 | INTERRUPT_GEN( irq6_line_assert ) { device->machine().driver_data()->irq6_line_assert(*device); } | |
| 611 | 568 | |
| 612 | cpu_device *cpudevice = downcast<cpu_device *>(device); | |
| 613 | attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cycles * cpudevice->min_cycles()); | |
| 614 | device->machine().scheduler().timer_set(target_time - device->machine().time(), FUNC(irq_pulse_clear), irqline, (void *)device); | |
| 615 | } | |
| 616 | ||
| 617 | ||
| 618 | ||
| 619 | /*************************************************************************** | |
| 620 | INTERRUPT GENERATION CALLBACK HELPERS | |
| 621 | ***************************************************************************/ | |
| 622 | ||
| 623 | /*------------------------------------------------- | |
| 624 | NMI callbacks | |
| 625 | -------------------------------------------------*/ | |
| 626 | ||
| 627 | INTERRUPT_GEN( nmi_line_pulse ) { if (interrupt_enabled(device)) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); } | |
| 628 | INTERRUPT_GEN( nmi_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE); } | |
| 629 | ||
| 630 | ||
| 631 | /*------------------------------------------------- | |
| 632 | IRQn callbacks | |
| 633 | -------------------------------------------------*/ | |
| 634 | ||
| 635 | INTERRUPT_GEN( irq0_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 0, HOLD_LINE); } | |
| 636 | INTERRUPT_GEN( irq0_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 0, 1); } | |
| 637 | INTERRUPT_GEN( irq0_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 0, ASSERT_LINE); } | |
| 638 | ||
| 639 | INTERRUPT_GEN( irq1_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 1, HOLD_LINE); } | |
| 640 | INTERRUPT_GEN( irq1_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 1, 1); } | |
| 641 | INTERRUPT_GEN( irq1_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 1, ASSERT_LINE); } | |
| 642 | ||
| 643 | INTERRUPT_GEN( irq2_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 2, HOLD_LINE); } | |
| 644 | INTERRUPT_GEN( irq2_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 2, 1); } | |
| 645 | INTERRUPT_GEN( irq2_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 2, ASSERT_LINE); } | |
| 646 | ||
| 647 | INTERRUPT_GEN( irq3_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 3, HOLD_LINE); } | |
| 648 | INTERRUPT_GEN( irq3_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 3, 1); } | |
| 649 | INTERRUPT_GEN( irq3_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 3, ASSERT_LINE); } | |
| 650 | ||
| 651 | INTERRUPT_GEN( irq4_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 4, HOLD_LINE); } | |
| 652 | INTERRUPT_GEN( irq4_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 4, 1); } | |
| 653 | INTERRUPT_GEN( irq4_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 4, ASSERT_LINE); } | |
| 654 | ||
| 655 | INTERRUPT_GEN( irq5_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 5, HOLD_LINE); } | |
| 656 | INTERRUPT_GEN( irq5_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 5, 1); } | |
| 657 | INTERRUPT_GEN( irq5_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 5, ASSERT_LINE); } | |
| 658 | ||
| 659 | INTERRUPT_GEN( irq6_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 6, HOLD_LINE); } | |
| 660 | INTERRUPT_GEN( irq6_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 6, 1); } | |
| 661 | INTERRUPT_GEN( irq6_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 6, ASSERT_LINE); } | |
| 662 | ||
| 663 | INTERRUPT_GEN( irq7_line_hold ) { if (interrupt_enabled(device)) device_set_input_line(device, 7, HOLD_LINE); } | |
| 664 | INTERRUPT_GEN( irq7_line_pulse ) { if (interrupt_enabled(device)) generic_pulse_irq_line(device, 7, 1); } | |
| 665 | INTERRUPT_GEN( irq7_line_assert ) { if (interrupt_enabled(device)) device_set_input_line(device, 7, ASSERT_LINE); } | |
| 666 | ||
| 667 | ||
| 668 | ||
| 669 | /*************************************************************************** | |
| 670 | WATCHDOG READ/WRITE HELPERS | |
| 671 | ***************************************************************************/ | |
| 672 | ||
| 673 | /*------------------------------------------------- | |
| 674 | 8-bit reset read/write handlers | |
| 675 | -------------------------------------------------*/ | |
| 676 | ||
| 677 | WRITE8_MEMBER( driver_device::watchdog_reset_w ) { watchdog_reset(machine()); } | |
| 678 | READ8_MEMBER( driver_device::watchdog_reset_r ) { watchdog_reset(machine()); return space.unmap(); } | |
| 679 | ||
| 680 | ||
| 681 | /*------------------------------------------------- | |
| 682 | 16-bit reset read/write handlers | |
| 683 | -------------------------------------------------*/ | |
| 684 | ||
| 685 | WRITE16_MEMBER( driver_device::watchdog_reset16_w ) { watchdog_reset(machine()); } | |
| 686 | READ16_MEMBER( driver_device::watchdog_reset16_r ) { watchdog_reset(machine()); return space.unmap(); } | |
| 687 | ||
| 688 | ||
| 689 | /*------------------------------------------------- | |
| 690 | 32-bit reset read/write handlers | |
| 691 | -------------------------------------------------*/ | |
| 692 | ||
| 693 | WRITE32_MEMBER( driver_device::watchdog_reset32_w ) { watchdog_reset(machine()); } | |
| 694 | READ32_MEMBER( driver_device::watchdog_reset32_r ) { watchdog_reset(machine()); return space.unmap(); } | |
| 695 | ||
| 696 | ||
| 697 | ||
| 698 | /*************************************************************************** | |
| 699 | PORT READING HELPERS | |
| 700 | ***************************************************************************/ | |
| 701 | ||
| 702 | /*------------------------------------------------- | |
| 703 | custom_port_read - act like input_port_read | |
| 704 | but it is a custom port, it is useful for | |
| 705 | e.g. input ports which expect the same port | |
| 706 | repeated both in the upper and lower half | |
| 707 | -------------------------------------------------*/ | |
| 708 | ||
| 709 | CUSTOM_INPUT_MEMBER( driver_device::custom_port_read ) | |
| 710 | { | |
| 711 | const char *tag = (const char *)param; | |
| 712 | return input_port_read(machine(), tag); | |
| 713 | } | |
| 569 | INTERRUPT_GEN( irq7_line_hold ) { device->machine().driver_data()->irq7_line_hold(*device); } | |
| 570 | INTERRUPT_GEN( irq7_line_pulse ) { device->machine().driver_data()->irq7_line_pulse(*device); } | |
| 571 | INTERRUPT_GEN( irq7_line_assert ) { device->machine().driver_data()->irq7_line_assert(*device); } |
| r14896 | r14897 | |
|---|---|---|
| 110 | 110 | void generic_pulse_irq_line_and_vector(device_t *device, int irqline, int vector, int cycles); |
| 111 | 111 | |
| 112 | 112 | |
| 113 | ||
| 114 | /* ----- common interrupt callbacks ----- */ | |
| 115 | ||
| 116 | 113 | INTERRUPT_GEN( nmi_line_pulse ); |
| 117 | 114 | INTERRUPT_GEN( nmi_line_assert ); |
| 118 | 115 |
| r14896 | r14897 | |
|---|---|---|
| 74 | 74 | : device_interface(device), |
| 75 | 75 | // m_cothread(cothread_entry_delegate(FUNC(device_execute_interface::run_thread_wrapper), this)), |
| 76 | 76 | m_disabled(false), |
| 77 | m_vblank_interrupt(NULL), | |
| 77 | m_vblank_interrupt_legacy(NULL), | |
| 78 | 78 | m_vblank_interrupt_screen(NULL), |
| 79 | m_timed_interrupt(NULL), | |
| 79 | m_timed_interrupt_legacy(NULL), | |
| 80 | 80 | m_timed_interrupt_period(attotime::zero), |
| 81 | 81 | m_is_octal(false), |
| 82 | 82 | m_nextexec(NULL), |
| r14896 | r14897 | |
| 138 | 138 | device_execute_interface *exec; |
| 139 | 139 | if (!device.interface(exec)) |
| 140 | 140 | throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device.tag()); |
| 141 | exec->m_vblank_interrupt_legacy = function; | |
| 142 | exec->m_vblank_interrupt_screen = tag; | |
| 143 | } | |
| 144 | ||
| 145 | void device_execute_interface::static_set_vblank_int(device_t &device, device_interrupt_delegate function, const char *tag, int rate) | |
| 146 | { | |
| 147 | device_execute_interface *exec; | |
| 148 | if (!device.interface(exec)) | |
| 149 | throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device.tag()); | |
| 141 | 150 | exec->m_vblank_interrupt = function; |
| 151 | exec->m_vblank_interrupt_legacy = NULL; | |
| 142 | 152 | exec->m_vblank_interrupt_screen = tag; |
| 143 | 153 | } |
| 144 | 154 | |
| r14896 | r14897 | |
| 153 | 163 | device_execute_interface *exec; |
| 154 | 164 | if (!device.interface(exec)) |
| 155 | 165 | throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT called on device '%s' with no execute interface", device.tag()); |
| 166 | exec->m_timed_interrupt_legacy = function; | |
| 167 | exec->m_timed_interrupt_period = rate; | |
| 168 | } | |
| 169 | ||
| 170 | void device_execute_interface::static_set_periodic_int(device_t &device, device_interrupt_delegate function, attotime rate) | |
| 171 | { | |
| 172 | device_execute_interface *exec; | |
| 173 | if (!device.interface(exec)) | |
| 174 | throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT called on device '%s' with no execute interface", device.tag()); | |
| 156 | 175 | exec->m_timed_interrupt = function; |
| 176 | exec->m_timed_interrupt_legacy = NULL; | |
| 157 | 177 | exec->m_timed_interrupt_period = rate; |
| 158 | 178 | } |
| 159 | 179 | |
| r14896 | r14897 | |
| 238 | 258 | |
| 239 | 259 | |
| 240 | 260 | //------------------------------------------------- |
| 241 | // set_irq_callback - install a driver-specific | |
| 261 | // set_irq_acknowledge_callback - install a driver-specific | |
| 242 | 262 | // callback for IRQ acknowledge |
| 243 | 263 | //------------------------------------------------- |
| 244 | 264 | |
| 245 | void device_execute_interface::set_irq_callback(device_irq_callback callback) | |
| 265 | void device_execute_interface::set_irq_acknowledge_callback(device_irq_acknowledge_callback callback) | |
| 246 | 266 | { |
| 247 | 267 | m_driver_irq = callback; |
| 248 | 268 | } |
| r14896 | r14897 | |
| 486 | 506 | void device_execute_interface::interface_validity_check(validity_checker &valid) const |
| 487 | 507 | { |
| 488 | 508 | // validate the interrupts |
| 489 | if (m_vblank_interrupt != NULL) | |
| 509 | if (!m_vblank_interrupt.isnull() || m_vblank_interrupt_legacy != NULL) | |
| 490 | 510 | { |
| 491 | 511 | screen_device_iterator iter(device().mconfig().root_device()); |
| 492 | 512 | if (iter.first() == NULL) |
| r14896 | r14897 | |
| 495 | 515 | mame_printf_error("VBLANK interrupt references a non-existant screen tag '%s'\n", m_vblank_interrupt_screen); |
| 496 | 516 | } |
| 497 | 517 | |
| 498 | if (m_timed_interrupt != NULL && m_timed_interrupt_period == attotime::zero) | |
| 518 | if ((!m_timed_interrupt.isnull() || m_timed_interrupt_legacy != NULL) && m_timed_interrupt_period == attotime::zero) | |
| 499 | 519 | mame_printf_error("Timed interrupt handler specified with 0 period\n"); |
| 500 | else if (m_timed_interrupt == NULL && m_timed_interrupt_period != attotime::zero) | |
| 520 | else if ((m_timed_interrupt.isnull() && m_timed_interrupt_legacy == NULL) && m_timed_interrupt_period != attotime::zero) | |
| 501 | 521 | mame_printf_error("No timer interrupt handler specified, but has a non-0 period given\n"); |
| 502 | 522 | } |
| 503 | 523 | |
| r14896 | r14897 | |
| 699 | 719 | |
| 700 | 720 | // generate the interrupt callback |
| 701 | 721 | if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) |
| 702 | (*m_vblank_interrupt)(&device()); | |
| 722 | { | |
| 723 | if (m_vblank_interrupt_legacy != NULL) | |
| 724 | (*m_vblank_interrupt_legacy)(&device()); | |
| 725 | else if (!m_vblank_interrupt.isnull()) | |
| 726 | m_vblank_interrupt(device()); | |
| 727 | } | |
| 703 | 728 | } |
| 704 | 729 | |
| 705 | 730 | |
| r14896 | r14897 | |
| 716 | 741 | void device_execute_interface::trigger_periodic_interrupt() |
| 717 | 742 | { |
| 718 | 743 | // bail if there is no routine |
| 719 | if (m_timed_interrupt != NULL && !suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) | |
| 720 | (*m_timed_interrupt)(&device()); | |
| 744 | if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) | |
| 745 | { | |
| 746 | if (m_timed_interrupt_legacy != NULL) | |
| 747 | (*m_timed_interrupt_legacy)(&device()); | |
| 748 | else if (!m_timed_interrupt.isnull()) | |
| 749 | m_timed_interrupt(device()); | |
| 750 | } | |
| 721 | 751 | } |
| 722 | 752 | |
| 723 | 753 |
| r14896 | r14897 | |
|---|---|---|
| 106 | 106 | // IRQ callback to be called by device implementations when an IRQ is actually taken |
| 107 | 107 | #define IRQ_CALLBACK(func) int func(device_t *device, int irqline) |
| 108 | 108 | |
| 109 | // interrupt generator callback called as a VBLANK or periodic interrupt | |
| 110 | #define INTERRUPT_GEN(func) void func(device_t *device) | |
| 111 | #define INTERRUPT_GEN_MEMBER(func) void func(device_t &device) | |
| 109 | 112 | |
| 110 | 113 | |
| 114 | ||
| 111 | 115 | //************************************************************************** |
| 112 | 116 | // INTERFACE CONFIGURATION MACROS |
| 113 | 117 | //************************************************************************** |
| r14896 | r14897 | |
| 118 | 122 | #define MCFG_DEVICE_VBLANK_INT(_tag, _func) \ |
| 119 | 123 | device_execute_interface::static_set_vblank_int(*device, _func, _tag); \ |
| 120 | 124 | |
| 125 | #define MCFG_DEVICE_VBLANK_INT_DRIVER(_tag, _class, _func) \ | |
| 126 | device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device())), _tag); \ | |
| 127 | ||
| 121 | 128 | #define MCFG_DEVICE_PERIODIC_INT(_func, _rate) \ |
| 122 | 129 | device_execute_interface::static_set_periodic_int(*device, _func, attotime::from_hz(_rate)); \ |
| 123 | 130 | |
| 131 | #define MCFG_DEVICE_PERIODIC_INT_DRIVER(_class, _func, _rate) \ | |
| 132 | device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device())), attotime::from_hz(_rate)); \ | |
| 124 | 133 | |
| 125 | 134 | |
| 135 | ||
| 126 | 136 | //************************************************************************** |
| 127 | 137 | // TYPE DEFINITIONS |
| 128 | 138 | //************************************************************************** |
| r14896 | r14897 | |
| 132 | 142 | |
| 133 | 143 | |
| 134 | 144 | // interrupt callback for VBLANK and timed interrupts |
| 145 | typedef delegate<void (device_t &)> device_interrupt_delegate; | |
| 135 | 146 | typedef void (*device_interrupt_func)(device_t *device); |
| 136 | 147 | |
| 137 | 148 | // IRQ callback to be called by executing devices when an IRQ is actually taken |
| 138 | typedef int (*device_irq_callback)(device_t *device, int irqnum); | |
| 149 | typedef delegate<void (device_t &, int)> device_irq_acknowledge_delegate; | |
| 150 | typedef int (*device_irq_acknowledge_callback)(device_t *device, int irqnum); | |
| 139 | 151 | |
| 140 | 152 | |
| 141 | 153 | |
| r14896 | r14897 | |
| 166 | 178 | // static inline configuration helpers |
| 167 | 179 | static void static_set_disable(device_t &device); |
| 168 | 180 | static void static_set_vblank_int(device_t &device, device_interrupt_func function, const char *tag, int rate = 0); |
| 181 | static void static_set_vblank_int(device_t &device, device_interrupt_delegate function, const char *tag, int rate = 0); | |
| 169 | 182 | static void static_set_periodic_int(device_t &device, device_interrupt_func function, attotime rate); |
| 183 | static void static_set_periodic_int(device_t &device, device_interrupt_delegate function, attotime rate); | |
| 170 | 184 | |
| 171 | 185 | // execution management |
| 172 | 186 | bool executing() const; |
| r14896 | r14897 | |
| 180 | 194 | void set_input_line_vector(int linenum, int vector) { m_input[linenum].set_vector(vector); } |
| 181 | 195 | void set_input_line_and_vector(int linenum, int state, int vector) { m_input[linenum].set_state_synced(state, vector); } |
| 182 | 196 | int input_state(int linenum) { return m_input[linenum].m_curstate; } |
| 183 | void set_irq_callback(device_irq_callback callback); | |
| 197 | void set_irq_acknowledge_callback(device_irq_acknowledge_callback callback); | |
| 184 | 198 | |
| 185 | 199 | // suspend/resume |
| 186 | 200 | void suspend(UINT32 reason, bool eatcycles); |
| r14896 | r14897 | |
| 274 | 288 | |
| 275 | 289 | // configuration |
| 276 | 290 | bool m_disabled; // disabled from executing? |
| 277 | device_interrupt_func m_vblank_interrupt; // for interrupts tied to VBLANK | |
| 291 | device_interrupt_delegate m_vblank_interrupt; // for interrupts tied to VBLANK | |
| 292 | device_interrupt_func m_vblank_interrupt_legacy; // for interrupts tied to VBLANK | |
| 278 | 293 | const char * m_vblank_interrupt_screen; // the screen that causes the VBLANK interrupt |
| 279 | device_interrupt_func m_timed_interrupt; // for interrupts not tied to VBLANK | |
| 294 | device_interrupt_delegate m_timed_interrupt; // for interrupts not tied to VBLANK | |
| 295 | device_interrupt_func m_timed_interrupt_legacy; // for interrupts not tied to VBLANK | |
| 280 | 296 | attotime m_timed_interrupt_period; // period for periodic interrupts |
| 281 | 297 | bool m_is_octal; // to determine if messages/debugger will show octal or hex |
| 282 | 298 | |
| r14896 | r14897 | |
| 284 | 300 | device_execute_interface *m_nextexec; // pointer to the next device to execute, in order |
| 285 | 301 | |
| 286 | 302 | // input states and IRQ callbacks |
| 287 | device_irq_callback | |
| 303 | device_irq_acknowledge_callback | |
| 288 | 304 | device_input m_input[MAX_INPUT_LINES]; // data about inputs |
| 289 | 305 | emu_timer * m_timedint_timer; // reference to this device's periodic interrupt timer |
| 290 | 306 | |
| r14896 | r14897 | |
| 449 | 465 | } |
| 450 | 466 | |
| 451 | 467 | // install a driver-specific callback for IRQ acknowledge |
| 452 | inline void device_set_irq_callback(device_t *device, device_irq_callback callback) | |
| 468 | inline void device_set_irq_callback(device_t *device, device_irq_acknowledge_callback callback) | |
| 453 | 469 | { |
| 454 | device_execute(device)->set_irq_callback(callback); | |
| 470 | device_execute(device)->set_irq_acknowledge_callback(callback); | |
| 455 | 471 | } |
| 456 | 472 | |
| 457 | 473 |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | driver_device::driver_device(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | 53 | : device_t(mconfig, type, "Driver Device", tag, NULL, 0), |
| 54 | m_system(NULL), | |
| 55 | m_palette_init(NULL), | |
| 56 | 54 | m_generic_paletteram_8(*this, "paletteram"), |
| 57 | 55 | m_generic_paletteram2_8(*this, "paletteram2"), |
| 58 | 56 | m_generic_paletteram_16(*this, "paletteram"), |
| 59 | 57 | m_generic_paletteram2_16(*this, "paletteram2"), |
| 60 | 58 | m_generic_paletteram_32(*this, "paletteram"), |
| 61 | m_generic_paletteram2_32(*this, "paletteram2") | |
| 59 | m_generic_paletteram2_32(*this, "paletteram2"), | |
| 60 | m_system(NULL), | |
| 61 | m_palette_init(NULL), | |
| 62 | m_latch_clear_value(0), | |
| 63 | m_flip_screen_x(0), | |
| 64 | m_flip_screen_y(0) | |
| 62 | 65 | { |
| 63 | memset(m_callbacks, 0, sizeof(m_callbacks)); | |
| 66 | memset(m_legacy_callbacks, 0, sizeof(m_legacy_callbacks)); | |
| 67 | memset(m_latched_value, 0, sizeof(m_latched_value)); | |
| 68 | memset(m_latch_read, 0, sizeof(m_latch_read)); | |
| 64 | 69 | } |
| 65 | 70 | |
| 66 | 71 | |
| r14896 | r14897 | |
| 99 | 104 | |
| 100 | 105 | |
| 101 | 106 | //------------------------------------------------- |
| 102 | // static_set_machine_start - set the legacy | |
| 103 | // machine start callback in the device | |
| 104 | // configuration | |
| 107 | // static_set_callback - set the a callback in | |
| 108 | // the device configuration | |
| 105 | 109 | //------------------------------------------------- |
| 106 | 110 | |
| 107 | 111 | void driver_device::static_set_callback(device_t &device, callback_type type, legacy_callback_func callback) |
| 108 | 112 | { |
| 113 | downcast<driver_device &>(device).m_legacy_callbacks[type] = callback; | |
| 114 | } | |
| 115 | ||
| 116 | void driver_device::static_set_callback(device_t &device, callback_type type, driver_callback_delegate callback) | |
| 117 | { | |
| 109 | 118 | downcast<driver_device &>(device).m_callbacks[type] = callback; |
| 110 | 119 | } |
| 111 | 120 | |
| r14896 | r14897 | |
| 139 | 148 | |
| 140 | 149 | void driver_device::machine_start() |
| 141 | 150 | { |
| 142 | if (m_callbacks[CB_MACHINE_START] != NULL) | |
| 143 | (*m_callbacks[CB_MACHINE_START])(machine()); | |
| 144 | 151 | } |
| 145 | 152 | |
| 146 | 153 | |
| r14896 | r14897 | |
| 151 | 158 | |
| 152 | 159 | void driver_device::sound_start() |
| 153 | 160 | { |
| 154 | if (m_callbacks[CB_SOUND_START] != NULL) | |
| 155 | (*m_callbacks[CB_SOUND_START])(machine()); | |
| 156 | 161 | } |
| 157 | 162 | |
| 158 | 163 | |
| r14896 | r14897 | |
| 163 | 168 | |
| 164 | 169 | void driver_device::video_start() |
| 165 | 170 | { |
| 166 | if (m_callbacks[CB_VIDEO_START] != NULL) | |
| 167 | (*m_callbacks[CB_VIDEO_START])(machine()); | |
| 168 | 171 | } |
| 169 | 172 | |
| 170 | 173 | |
| r14896 | r14897 | |
| 185 | 188 | |
| 186 | 189 | void driver_device::machine_reset() |
| 187 | 190 | { |
| 188 | if (m_callbacks[CB_MACHINE_RESET] != NULL) | |
| 189 | (*m_callbacks[CB_MACHINE_RESET])(machine()); | |
| 190 | 191 | } |
| 191 | 192 | |
| 192 | 193 | |
| r14896 | r14897 | |
| 197 | 198 | |
| 198 | 199 | void driver_device::sound_reset() |
| 199 | 200 | { |
| 200 | if (m_callbacks[CB_SOUND_RESET] != NULL) | |
| 201 | (*m_callbacks[CB_SOUND_RESET])(machine()); | |
| 202 | 201 | } |
| 203 | 202 | |
| 204 | 203 | |
| r14896 | r14897 | |
| 209 | 208 | |
| 210 | 209 | void driver_device::video_reset() |
| 211 | 210 | { |
| 212 | if (m_callbacks[CB_VIDEO_RESET] != NULL) | |
| 213 | (*m_callbacks[CB_VIDEO_RESET])(machine()); | |
| 214 | 211 | } |
| 215 | 212 | |
| 216 | 213 | |
| r14896 | r14897 | |
| 243 | 240 | |
| 244 | 241 | void driver_device::device_start() |
| 245 | 242 | { |
| 243 | // bind our legacy callbacks | |
| 244 | for (int index = 0; index < ARRAY_LENGTH(m_legacy_callbacks); index++) | |
| 245 | if (m_legacy_callbacks[index] != NULL) | |
| 246 | m_callbacks[index] = driver_callback_delegate(m_legacy_callbacks[index], "legacy_callback", &machine()); | |
| 247 | ||
| 246 | 248 | // reschedule ourselves to be last |
| 247 | 249 | device_iterator iter(*this); |
| 248 | 250 | for (device_t *test = iter.first(); test != NULL; test = iter.next()) |
| r14896 | r14897 | |
| 262 | 264 | |
| 263 | 265 | // start the various pieces |
| 264 | 266 | driver_start(); |
| 265 | machine_start(); | |
| 266 | sound_start(); | |
| 267 | video_start(); | |
| 267 | ||
| 268 | if (!m_callbacks[CB_MACHINE_START].isnull()) | |
| 269 | m_callbacks[CB_MACHINE_START](); | |
| 270 | else | |
| 271 | machine_start(); | |
| 272 | ||
| 273 | if (!m_callbacks[CB_SOUND_START].isnull()) | |
| 274 | m_callbacks[CB_SOUND_START](); | |
| 275 | else | |
| 276 | sound_start(); | |
| 277 | ||
| 278 | if (!m_callbacks[CB_VIDEO_START].isnull()) | |
| 279 | m_callbacks[CB_VIDEO_START](); | |
| 280 | else | |
| 281 | video_start(); | |
| 282 | ||
| 283 | // save generic states | |
| 284 | save_item(NAME(m_flip_screen_x)); | |
| 285 | save_item(NAME(m_flip_screen_y)); | |
| 268 | 286 | } |
| 269 | 287 | |
| 270 | 288 | |
| r14896 | r14897 | |
| 278 | 296 | { |
| 279 | 297 | // reset each piece |
| 280 | 298 | driver_reset(); |
| 281 | machine_reset(); | |
| 282 | sound_reset(); | |
| 283 | video_reset(); | |
| 299 | ||
| 300 | if (!m_callbacks[CB_MACHINE_RESET].isnull()) | |
| 301 | m_callbacks[CB_MACHINE_RESET](); | |
| 302 | else | |
| 303 | machine_reset(); | |
| 304 | ||
| 305 | if (!m_callbacks[CB_SOUND_RESET].isnull()) | |
| 306 | m_callbacks[CB_SOUND_RESET](); | |
| 307 | else | |
| 308 | sound_reset(); | |
| 309 | ||
| 310 | if (!m_callbacks[CB_VIDEO_RESET].isnull()) | |
| 311 | m_callbacks[CB_VIDEO_RESET](); | |
| 312 | else | |
| 313 | video_reset(); | |
| 284 | 314 | } |
| 315 | ||
| 316 | ||
| 317 | ||
| 318 | //************************************************************************** | |
| 319 | // INTERRUPT ENABLE AND VECTOR HELPERS | |
| 320 | //************************************************************************** | |
| 321 | ||
| 322 | //------------------------------------------------- | |
| 323 | // irq_pulse_clear - clear a "pulsed" IRQ line | |
| 324 | //------------------------------------------------- | |
| 325 | ||
| 326 | void driver_device::irq_pulse_clear(void *ptr, INT32 param) | |
| 327 | { | |
| 328 | device_execute_interface *exec = reinterpret_cast<device_execute_interface *>(ptr); | |
| 329 | int irqline = param; | |
| 330 | exec->set_input_line(irqline, CLEAR_LINE); | |
| 331 | } | |
| 332 | ||
| 333 | ||
| 334 | //------------------------------------------------- | |
| 335 | // generic_pulse_irq_line - "pulse" an IRQ line by | |
| 336 | // asserting it and then clearing it x cycle(s) | |
| 337 | // later | |
| 338 | //------------------------------------------------- | |
| 339 | ||
| 340 | void driver_device::generic_pulse_irq_line(device_execute_interface &exec, int irqline, int cycles) | |
| 341 | { | |
| 342 | assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET && cycles > 0); | |
| 343 | exec.set_input_line(irqline, ASSERT_LINE); | |
| 344 | ||
| 345 | attotime target_time = exec.local_time() + exec.cycles_to_attotime(cycles * exec.min_cycles()); | |
| 346 | machine().scheduler().timer_set(target_time - machine().time(), timer_expired_delegate(FUNC(driver_device::irq_pulse_clear), this), irqline, (void *)&exec); | |
| 347 | } | |
| 348 | ||
| 349 | ||
| 350 | //------------------------------------------------- | |
| 351 | // generic_pulse_irq_line_and_vector - "pulse" an | |
| 352 | // IRQ line by asserting it and then clearing it | |
| 353 | // x cycle(s) later, specifying a vector | |
| 354 | //------------------------------------------------- | |
| 355 | ||
| 356 | void driver_device::generic_pulse_irq_line_and_vector(device_execute_interface &exec, int irqline, int vector, int cycles) | |
| 357 | { | |
| 358 | assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET && cycles > 0); | |
| 359 | exec.set_input_line_and_vector(irqline, ASSERT_LINE, vector); | |
| 360 | ||
| 361 | attotime target_time = exec.local_time() + exec.cycles_to_attotime(cycles * exec.min_cycles()); | |
| 362 | machine().scheduler().timer_set(target_time - machine().time(), timer_expired_delegate(FUNC(driver_device::irq_pulse_clear), this), irqline, (void *)&exec); | |
| 363 | } | |
| 364 | ||
| 365 | ||
| 366 | ||
| 367 | //************************************************************************** | |
| 368 | // INTERRUPT GENERATION CALLBACK HELPERS | |
| 369 | //************************************************************************** | |
| 370 | ||
| 371 | //------------------------------------------------- | |
| 372 | // NMI callbacks | |
| 373 | //------------------------------------------------- | |
| 374 | ||
| 375 | INTERRUPT_GEN_MEMBER( driver_device::nmi_line_pulse ) { device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); } | |
| 376 | INTERRUPT_GEN_MEMBER( driver_device::nmi_line_assert ) { device.execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } | |
| 377 | ||
| 378 | ||
| 379 | //------------------------------------------------- | |
| 380 | // IRQn callbacks | |
| 381 | //------------------------------------------------- | |
| 382 | ||
| 383 | INTERRUPT_GEN_MEMBER( driver_device::irq0_line_hold ) { device.execute().set_input_line(0, HOLD_LINE); } | |
| 384 | INTERRUPT_GEN_MEMBER( driver_device::irq0_line_pulse ) { generic_pulse_irq_line(device.execute(), 0, 1); } | |
| 385 | INTERRUPT_GEN_MEMBER( driver_device::irq0_line_assert ) { device.execute().set_input_line(0, ASSERT_LINE); } | |
| 386 | ||
| 387 | INTERRUPT_GEN_MEMBER( driver_device::irq1_line_hold ) { device.execute().set_input_line(1, HOLD_LINE); } | |
| 388 | INTERRUPT_GEN_MEMBER( driver_device::irq1_line_pulse ) { generic_pulse_irq_line(device.execute(), 1, 1); } | |
| 389 | INTERRUPT_GEN_MEMBER( driver_device::irq1_line_assert ) { device.execute().set_input_line(1, ASSERT_LINE); } | |
| 390 | ||
| 391 | INTERRUPT_GEN_MEMBER( driver_device::irq2_line_hold ) { device.execute().set_input_line(2, HOLD_LINE); } | |
| 392 | INTERRUPT_GEN_MEMBER( driver_device::irq2_line_pulse ) { generic_pulse_irq_line(device.execute(), 2, 1); } | |
| 393 | INTERRUPT_GEN_MEMBER( driver_device::irq2_line_assert ) { device.execute().set_input_line(2, ASSERT_LINE); } | |
| 394 | ||
| 395 | INTERRUPT_GEN_MEMBER( driver_device::irq3_line_hold ) { device.execute().set_input_line(3, HOLD_LINE); } | |
| 396 | INTERRUPT_GEN_MEMBER( driver_device::irq3_line_pulse ) { generic_pulse_irq_line(device.execute(), 3, 1); } | |
| 397 | INTERRUPT_GEN_MEMBER( driver_device::irq3_line_assert ) { device.execute().set_input_line(3, ASSERT_LINE); } | |
| 398 | ||
| 399 | INTERRUPT_GEN_MEMBER( driver_device::irq4_line_hold ) { device.execute().set_input_line(4, HOLD_LINE); } | |
| 400 | INTERRUPT_GEN_MEMBER( driver_device::irq4_line_pulse ) { generic_pulse_irq_line(device.execute(), 4, 1); } | |
| 401 | INTERRUPT_GEN_MEMBER( driver_device::irq4_line_assert ) { device.execute().set_input_line(4, ASSERT_LINE); } | |
| 402 | ||
| 403 | INTERRUPT_GEN_MEMBER( driver_device::irq5_line_hold ) { device.execute().set_input_line(5, HOLD_LINE); } | |
| 404 | INTERRUPT_GEN_MEMBER( driver_device::irq5_line_pulse ) { generic_pulse_irq_line(device.execute(), 5, 1); } | |
| 405 | INTERRUPT_GEN_MEMBER( driver_device::irq5_line_assert ) { device.execute().set_input_line(5, ASSERT_LINE); } | |
| 406 | ||
| 407 | INTERRUPT_GEN_MEMBER( driver_device::irq6_line_hold ) { device.execute().set_input_line(6, HOLD_LINE); } | |
| 408 | INTERRUPT_GEN_MEMBER( driver_device::irq6_line_pulse ) { generic_pulse_irq_line(device.execute(), 6, 1); } | |
| 409 | INTERRUPT_GEN_MEMBER( driver_device::irq6_line_assert ) { device.execute().set_input_line(6, ASSERT_LINE); } | |
| 410 | ||
| 411 | INTERRUPT_GEN_MEMBER( driver_device::irq7_line_hold ) { device.execute().set_input_line(7, HOLD_LINE); } | |
| 412 | INTERRUPT_GEN_MEMBER( driver_device::irq7_line_pulse ) { generic_pulse_irq_line(device.execute(), 7, 1); } | |
| 413 | INTERRUPT_GEN_MEMBER( driver_device::irq7_line_assert ) { device.execute().set_input_line(7, ASSERT_LINE); } | |
| 414 | ||
| 415 | ||
| 416 | ||
| 417 | //************************************************************************** | |
| 418 | // WATCHDOG READ/WRITE HELPERS | |
| 419 | //************************************************************************** | |
| 420 | ||
| 421 | //------------------------------------------------- | |
| 422 | // 8-bit reset read/write handlers | |
| 423 | //------------------------------------------------- | |
| 424 | ||
| 425 | WRITE8_MEMBER( driver_device::watchdog_reset_w ) { watchdog_reset(machine()); } | |
| 426 | READ8_MEMBER( driver_device::watchdog_reset_r ) { watchdog_reset(machine()); return space.unmap(); } | |
| 427 | ||
| 428 | ||
| 429 | //------------------------------------------------- | |
| 430 | // 16-bit reset read/write handlers | |
| 431 | //------------------------------------------------- | |
| 432 | ||
| 433 | WRITE16_MEMBER( driver_device::watchdog_reset16_w ) { watchdog_reset(machine()); } | |
| 434 | READ16_MEMBER( driver_device::watchdog_reset16_r ) { watchdog_reset(machine()); return space.unmap(); } | |
| 435 | ||
| 436 | ||
| 437 | //------------------------------------------------- | |
| 438 | // 32-bit reset read/write handlers | |
| 439 | //------------------------------------------------- | |
| 440 | ||
| 441 | WRITE32_MEMBER( driver_device::watchdog_reset32_w ) { watchdog_reset(machine()); } | |
| 442 | READ32_MEMBER( driver_device::watchdog_reset32_r ) { watchdog_reset(machine()); return space.unmap(); } | |
| 443 | ||
| 444 | ||
| 445 | ||
| 446 | //************************************************************************** | |
| 447 | // GENERIC SOUND COMMAND LATCHING | |
| 448 | //************************************************************************** | |
| 449 | ||
| 450 | //------------------------------------------------- | |
| 451 | // soundlatch_sync_callback - time-delayed | |
| 452 | // callback to set a latch value | |
| 453 | //------------------------------------------------- | |
| 454 | ||
| 455 | void driver_device::soundlatch_sync_callback(void *ptr, INT32 param) | |
| 456 | { | |
| 457 | UINT16 value = param >> 8; | |
| 458 | int which = param & 0xff; | |
| 459 | ||
| 460 | // if the latch hasn't been read and the value is changed, log a warning | |
| 461 | if (!m_latch_read[which] && m_latched_value[which] != value) | |
| 462 | logerror("Warning: sound latch %d written before being read. Previous: %02x, new: %02x\n", which, m_latched_value[which], value); | |
| 463 | ||
| 464 | // store the new value and mark it not read | |
| 465 | m_latched_value[which] = value; | |
| 466 | m_latch_read[which] = 0; | |
| 467 | } | |
| 468 | ||
| 469 | ||
| 470 | //------------------------------------------------- | |
| 471 | // soundlatch_byte_w - global write handlers for | |
| 472 | // writing to sound latches | |
| 473 | //------------------------------------------------- | |
| 474 | ||
| 475 | WRITE8_MEMBER( driver_device::soundlatch_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 0 | (data << 8)); } | |
| 476 | WRITE16_MEMBER( driver_device::soundlatch_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 0 | (data << 8)); } | |
| 477 | WRITE8_MEMBER( driver_device::soundlatch2_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 1 | (data << 8)); } | |
| 478 | WRITE16_MEMBER( driver_device::soundlatch2_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 1 | (data << 8)); } | |
| 479 | WRITE8_MEMBER( driver_device::soundlatch3_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 2 | (data << 8)); } | |
| 480 | WRITE16_MEMBER( driver_device::soundlatch3_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 2 | (data << 8)); } | |
| 481 | WRITE8_MEMBER( driver_device::soundlatch4_byte_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 3 | (data << 8)); } | |
| 482 | WRITE16_MEMBER( driver_device::soundlatch4_word_w ) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(driver_device::soundlatch_sync_callback), this), 3 | (data << 8)); } | |
| 483 | ||
| 484 | ||
| 485 | //------------------------------------------------- | |
| 486 | // soundlatch_byte_r - global read handlers for | |
| 487 | // reading from sound latches | |
| 488 | //------------------------------------------------- | |
| 489 | ||
| 490 | READ8_MEMBER( driver_device::soundlatch_byte_r ) { return m_latched_value[0]; } | |
| 491 | READ16_MEMBER( driver_device::soundlatch_word_r ) { return m_latched_value[0]; } | |
| 492 | READ8_MEMBER( driver_device::soundlatch2_byte_r ) { return m_latched_value[1]; } | |
| 493 | READ16_MEMBER( driver_device::soundlatch2_word_r ) { return m_latched_value[1]; } | |
| 494 | READ8_MEMBER( driver_device::soundlatch3_byte_r ) { return m_latched_value[2]; } | |
| 495 | READ16_MEMBER( driver_device::soundlatch3_word_r ) { return m_latched_value[2]; } | |
| 496 | READ8_MEMBER( driver_device::soundlatch4_byte_r ) { return m_latched_value[3]; } | |
| 497 | READ16_MEMBER( driver_device::soundlatch4_word_r ) { return m_latched_value[3]; } | |
| 498 | ||
| 499 | ||
| 500 | //------------------------------------------------- | |
| 501 | // soundlatch_clear_byte_w - global write handlers | |
| 502 | // for clearing sound latches | |
| 503 | //------------------------------------------------- | |
| 504 | ||
| 505 | WRITE8_MEMBER( driver_device::soundlatch_clear_byte_w ) { m_latched_value[0] = m_latch_clear_value; } | |
| 506 | WRITE8_MEMBER( driver_device::soundlatch2_clear_byte_w ) { m_latched_value[1] = m_latch_clear_value; } | |
| 507 | WRITE8_MEMBER( driver_device::soundlatch3_clear_byte_w ) { m_latched_value[2] = m_latch_clear_value; } | |
| 508 | WRITE8_MEMBER( driver_device::soundlatch4_clear_byte_w ) { m_latched_value[3] = m_latch_clear_value; } | |
| 509 | ||
| 510 | ||
| 511 | ||
| 512 | //************************************************************************** | |
| 513 | // GENERIC FLIP SCREEN HANDLING | |
| 514 | //************************************************************************** | |
| 515 | ||
| 516 | //------------------------------------------------- | |
| 517 | // updateflip - handle global flipping | |
| 518 | //------------------------------------------------- | |
| 519 | ||
| 520 | void driver_device::updateflip() | |
| 521 | { | |
| 522 | // push the flip state to all tilemaps | |
| 523 | machine().tilemap().set_flip_all((TILEMAP_FLIPX & m_flip_screen_x) | (TILEMAP_FLIPY & m_flip_screen_y)); | |
| 524 | ||
| 525 | // flip the visible area within the screen width/height | |
| 526 | int width = machine().primary_screen->width(); | |
| 527 | int height = machine().primary_screen->height(); | |
| 528 | rectangle visarea = machine().primary_screen->visible_area(); | |
| 529 | if (m_flip_screen_x) | |
| 530 | { | |
| 531 | int temp = width - visarea.min_x - 1; | |
| 532 | visarea.min_x = width - visarea.max_x - 1; | |
| 533 | visarea.max_x = temp; | |
| 534 | } | |
| 535 | if (m_flip_screen_y) | |
| 536 | { | |
| 537 | int temp = height - visarea.min_y - 1; | |
| 538 | visarea.min_y = height - visarea.max_y - 1; | |
| 539 | visarea.max_y = temp; | |
| 540 | } | |
| 541 | ||
| 542 | // reconfigure the screen with the new visible area | |
| 543 | attoseconds_t period = machine().primary_screen->frame_period().attoseconds; | |
| 544 | machine().primary_screen->configure(width, height, visarea, period); | |
| 545 | } | |
| 546 | ||
| 547 | ||
| 548 | //------------------------------------------------- | |
| 549 | // flip_screen_set - set global flip | |
| 550 | //------------------------------------------------- | |
| 551 | ||
| 552 | void driver_device::flip_screen_set(UINT32 on) | |
| 553 | { | |
| 554 | // normalize to all 1 | |
| 555 | if (on) | |
| 556 | on = ~0; | |
| 557 | ||
| 558 | // if something's changed, handle it | |
| 559 | if (m_flip_screen_x != on || m_flip_screen_y != on) | |
| 560 | { | |
| 561 | if (!on) | |
| 562 | updateflip(); // flip visarea back | |
| 563 | m_flip_screen_x = m_flip_screen_y = on; | |
| 564 | updateflip(); | |
| 565 | } | |
| 566 | } | |
| 567 | ||
| 568 | ||
| 569 | //------------------------------------------------- | |
| 570 | // flip_screen_set_no_update - set global flip | |
| 571 | // do not call update_flip. | |
| 572 | //------------------------------------------------- | |
| 573 | ||
| 574 | void driver_device::flip_screen_set_no_update(UINT32 on) | |
| 575 | { | |
| 576 | // flip_screen_y is not updated on purpose | |
| 577 | // this function is for drivers which | |
| 578 | // where writing to flip_screen_x to | |
| 579 | // bypass update_flip | |
| 580 | if (on) | |
| 581 | on = ~0; | |
| 582 | m_flip_screen_x = on; | |
| 583 | } | |
| 584 | ||
| 585 | ||
| 586 | //------------------------------------------------- | |
| 587 | // flip_screen_x_set - set global horizontal flip | |
| 588 | //------------------------------------------------- | |
| 589 | ||
| 590 | void driver_device::flip_screen_x_set(UINT32 on) | |
| 591 | { | |
| 592 | // normalize to all 1 | |
| 593 | if (on) | |
| 594 | on = ~0; | |
| 595 | ||
| 596 | // if something's changed, handle it | |
| 597 | if (m_flip_screen_x != on) | |
| 598 | { | |
| 599 | m_flip_screen_x = on; | |
| 600 | updateflip(); | |
| 601 | } | |
| 602 | } | |
| 603 | ||
| 604 | ||
| 605 | //------------------------------------------------- | |
| 606 | // flip_screen_y_set - set global vertical flip | |
| 607 | //------------------------------------------------- | |
| 608 | ||
| 609 | void driver_device::flip_screen_y_set(UINT32 on) | |
| 610 | { | |
| 611 | // normalize to all 1 | |
| 612 | if (on) | |
| 613 | on = ~0; | |
| 614 | ||
| 615 | // if something's changed, handle it | |
| 616 | if (m_flip_screen_y != on) | |
| 617 | { | |
| 618 | m_flip_screen_y = on; | |
| 619 | updateflip(); | |
| 620 | } | |
| 621 | } | |
| 622 | ||
| 623 | ||
| 624 | ||
| 625 | //************************************************************************** | |
| 626 | // 8-BIT PALETTE WRITE HANDLERS | |
| 627 | //************************************************************************** | |
| 628 | ||
| 629 | // 3-3-2 RGB palette write handlers | |
| 630 | WRITE8_MEMBER( driver_device::paletteram_BBGGGRRR_byte_w ) { palette_8bit_byte_w<3,3,2, 0,3,6>(space, offset, data, mem_mask); } | |
| 631 | WRITE8_MEMBER( driver_device::paletteram_RRRGGGBB_byte_w ) { palette_8bit_byte_w<3,3,2, 5,2,0>(space, offset, data, mem_mask); } | |
| 632 | WRITE8_MEMBER( driver_device::paletteram_BBGGRRII_byte_w ) | |
| 633 | { | |
| 634 | m_generic_paletteram_8[offset] = data; | |
| 635 | int i = (data >> 0) & 3; | |
| 636 | palette_set_color_rgb(machine(), offset, pal4bit(((data >> 0) & 0x0c) | i), | |
| 637 | pal4bit(((data >> 2) & 0x0c) | i), | |
| 638 | pal4bit(((data >> 4) & 0x0c) | i)); | |
| 639 | } | |
| 640 | ||
| 641 | ||
| 642 | ||
| 643 | //************************************************************************** | |
| 644 | // 16-BIT PALETTE WRITE HANDLERS | |
| 645 | //************************************************************************** | |
| 646 | ||
| 647 | // 4-4-4 RGB palette write handlers | |
| 648 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_byte_le_w ) { palette_16bit_byte_le_w<4,4,4, 0,4,8>(space, offset, data, mem_mask); } | |
| 649 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_byte_be_w ) { palette_16bit_byte_be_w<4,4,4, 0,4,8>(space, offset, data, mem_mask); } | |
| 650 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<4,4,4, 0,4,8>(space, offset, data, mem_mask); } | |
| 651 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<4,4,4, 0,4,8>(space, offset, data, mem_mask); } | |
| 652 | WRITE16_MEMBER( driver_device::paletteram_xxxxBBBBGGGGRRRR_word_w ) { palette_16bit_word_w<4,4,4, 0,4,8>(space, offset, data, mem_mask); } | |
| 653 | ||
| 654 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_byte_le_w ) { palette_16bit_byte_le_w<4,4,4, 4,0,8>(space, offset, data, mem_mask); } | |
| 655 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_byte_be_w ) { palette_16bit_byte_be_w<4,4,4, 4,0,8>(space, offset, data, mem_mask); } | |
| 656 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<4,4,4, 4,0,8>(space, offset, data, mem_mask); } | |
| 657 | WRITE8_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<4,4,4, 4,0,8>(space, offset, data, mem_mask); } | |
| 658 | WRITE16_MEMBER( driver_device::paletteram_xxxxBBBBRRRRGGGG_word_w ) { palette_16bit_word_w<4,4,4, 4,0,8>(space, offset, data, mem_mask); } | |
| 659 | ||
| 660 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRBBBBGGGG_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<4,4,4, 8,0,4>(space, offset, data, mem_mask); } | |
| 661 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRBBBBGGGG_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<4,4,4, 8,0,4>(space, offset, data, mem_mask); } | |
| 662 | ||
| 663 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_byte_le_w ) { palette_16bit_byte_le_w<4,4,4, 8,4,0>(space, offset, data, mem_mask); } | |
| 664 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_byte_be_w ) { palette_16bit_byte_be_w<4,4,4, 8,4,0>(space, offset, data, mem_mask); } | |
| 665 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<4,4,4, 8,4,0>(space, offset, data, mem_mask); } | |
| 666 | WRITE8_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<4,4,4, 8,4,0>(space, offset, data, mem_mask); } | |
| 667 | WRITE16_MEMBER( driver_device::paletteram_xxxxRRRRGGGGBBBB_word_w ) { palette_16bit_word_w<4,4,4, 8,4,0>(space, offset, data, mem_mask); } | |
| 668 | ||
| 669 | WRITE8_MEMBER( driver_device::paletteram_RRRRGGGGBBBBxxxx_byte_be_w ) { palette_16bit_byte_be_w<4,4,4, 12,8,4>(space, offset, data, mem_mask); } | |
| 670 | WRITE8_MEMBER( driver_device::paletteram_RRRRGGGGBBBBxxxx_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<4,4,4, 12,8,4>(space, offset, data, mem_mask); } | |
| 671 | WRITE8_MEMBER( driver_device::paletteram_RRRRGGGGBBBBxxxx_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<4,4,4, 12,8,4>(space, offset, data, mem_mask); } | |
| 672 | WRITE16_MEMBER( driver_device::paletteram_RRRRGGGGBBBBxxxx_word_w ) { palette_16bit_word_w<4,4,4, 12,8,4>(space, offset, data, mem_mask); } | |
| 673 | ||
| 674 | // 4-4-4-4 IRGB palette write handlers | |
| 675 | template<int _IShift, int _RShift, int _GShift, int _BShift> | |
| 676 | inline void set_color_irgb(running_machine &machine, pen_t color, UINT16 data) | |
| 677 | { | |
| 678 | static const UINT8 ztable[16] = { 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11 }; | |
| 679 | UINT8 i = ztable[(data >> _IShift) & 15]; | |
| 680 | UINT8 r = ((data >> _RShift) & 15) * i; | |
| 681 | UINT8 g = ((data >> _GShift) & 15) * i; | |
| 682 | UINT8 b = ((data >> _BShift) & 15) * i; | |
| 683 | palette_set_color_rgb(machine, color, r, g, b); | |
| 684 | } | |
| 685 | ||
| 686 | WRITE16_MEMBER( driver_device::paletteram_IIIIRRRRGGGGBBBB_word_w ) | |
| 687 | { | |
| 688 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 689 | set_color_irgb<12,8,4,0>(machine(), offset, m_generic_paletteram_16[offset]); | |
| 690 | } | |
| 691 | ||
| 692 | WRITE16_MEMBER( driver_device::paletteram_RRRRGGGGBBBBIIII_word_w ) | |
| 693 | { | |
| 694 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 695 | set_color_irgb<0,12,8,4>(machine(), offset, m_generic_paletteram_16[offset]); | |
| 696 | } | |
| 697 | ||
| 698 | // 5-5-5 RGB palette write handlers | |
| 699 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_byte_le_w ) { palette_16bit_byte_le_w<5,5,5, 0,5,10>(space, offset, data, mem_mask); } | |
| 700 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_byte_be_w ) { palette_16bit_byte_be_w<5,5,5, 0,5,10>(space, offset, data, mem_mask); } | |
| 701 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<5,5,5, 0,5,10>(space, offset, data, mem_mask); } | |
| 702 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<5,5,5, 0,5,10>(space, offset, data, mem_mask); } | |
| 703 | WRITE16_MEMBER( driver_device::paletteram_xBBBBBGGGGGRRRRR_word_w ) { palette_16bit_word_w<5,5,5, 0,5,10>(space, offset, data, mem_mask); } | |
| 704 | ||
| 705 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBRRRRRGGGGG_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<5,5,5, 5,0,10>(space, offset, data, mem_mask); } | |
| 706 | WRITE8_MEMBER( driver_device::paletteram_xBBBBBRRRRRGGGGG_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<5,5,5, 5,0,10>(space, offset, data, mem_mask); } | |
| 707 | ||
| 708 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_byte_le_w ) { palette_16bit_byte_le_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); } | |
| 709 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_byte_be_w ) { palette_16bit_byte_be_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); } | |
| 710 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_byte_split_lo_w ) { palette_16bit_byte_split_lo_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); } | |
| 711 | WRITE8_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_byte_split_hi_w ) { palette_16bit_byte_split_hi_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); } | |
| 712 | WRITE16_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_word_w ) { palette_16bit_word_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); } | |
| 713 | WRITE32_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_dword_be_w ) { palette_16bit_dword_be_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); } | |
| 714 | WRITE32_MEMBER( driver_device::paletteram_xRRRRRGGGGGBBBBB_dword_le_w ) { palette_16bit_dword_le_w<5,5,5, 10,5,0>(space, offset, data, mem_mask); } | |
| 715 | ||
| 716 | WRITE16_MEMBER( driver_device::paletteram_xGGGGGRRRRRBBBBB_word_w ) { palette_16bit_word_w<5,5,5, 5,10,0>(space, offset, data, mem_mask); } | |
| 717 | WRITE16_MEMBER( driver_device::paletteram_xGGGGGBBBBBRRRRR_word_w ) { palette_16bit_word_w<5,5,5, 0,10,5>(space, offset, data, mem_mask); } | |
| 718 | WRITE16_MEMBER( driver_device::paletteram_RRRRRGGGGGBBBBBx_word_w ) { palette_16bit_word_w<5,5,5, 11,6,1>(space, offset, data, mem_mask); } | |
| 719 | WRITE16_MEMBER( driver_device::paletteram_GGGGGRRRRRBBBBBx_word_w ) { palette_16bit_word_w<5,5,5, 6,11,1>(space, offset, data, mem_mask); } | |
| 720 | WRITE16_MEMBER( driver_device::paletteram_RRRRGGGGBBBBRGBx_word_w ) | |
| 721 | { | |
| 722 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 723 | data = m_generic_paletteram_16[offset]; | |
| 724 | palette_set_color_rgb(machine(), offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)), | |
| 725 | pal5bit(((data >> 7) & 0x1e) | ((data >> 2) & 0x01)), | |
| 726 | pal5bit(((data >> 3) & 0x1e) | ((data >> 1) & 0x01))); | |
| 727 | } | |
| 728 | ||
| 729 | ||
| 730 | //************************************************************************** | |
| 731 | // 32-BIT PALETTE WRITE HANDLERS | |
| 732 | //************************************************************************** | |
| 733 | ||
| 734 | // 8-8-8 RGB palette write handlers | |
| 735 | WRITE16_MEMBER( driver_device::paletteram_xrgb_word_be_w ) { palette_32bit_word_be_w<8,8,8, 16,8,0>(space, offset, data, mem_mask); } | |
| 736 | WRITE16_MEMBER( driver_device::paletteram_xbgr_word_be_w ) { palette_32bit_word_be_w<8,8,8, 0,8,16>(space, offset, data, mem_mask); } |
| r14896 | r14897 | |
|---|---|---|
| 51 | 51 | // TYPE DEFINITIONS |
| 52 | 52 | //************************************************************************** |
| 53 | 53 | |
| 54 | typedef delegate<void ()> driver_callback_delegate; | |
| 54 | 55 | |
| 56 | ||
| 55 | 57 | // ======================> driver_device |
| 56 | 58 | |
| 57 | 59 | // base class for machine driver-specific devices |
| r14896 | r14897 | |
| 61 | 63 | // construction/destruction |
| 62 | 64 | driver_device(const machine_config &mconfig, device_type type, const char *tag); |
| 63 | 65 | virtual ~driver_device(); |
| 66 | ||
| 67 | // getters | |
| 68 | const game_driver &system() const { assert(m_system != NULL); return *m_system; } | |
| 64 | 69 | |
| 65 | 70 | // indexes into our generic callbacks |
| 66 | 71 | enum callback_type |
| r14896 | r14897 | |
| 77 | 82 | // inline configuration helpers |
| 78 | 83 | static void static_set_game(device_t &device, const game_driver &game); |
| 79 | 84 | static void static_set_callback(device_t &device, callback_type type, legacy_callback_func callback); |
| 85 | static void static_set_callback(device_t &device, callback_type type, driver_callback_delegate callback); | |
| 80 | 86 | static void static_set_palette_init(device_t &device, palette_init_func callback); |
| 81 | 87 | |
| 82 | 88 | // generic helpers |
| 89 | template<class _DriverClass, void (_DriverClass::*_Function)()> | |
| 90 | static void static_wrapper(driver_device &device) | |
| 91 | { | |
| 92 | (downcast<_DriverClass &>(device).*_Function)(); | |
| 93 | } | |
| 94 | ||
| 95 | // generic interrupt generators | |
| 96 | void generic_pulse_irq_line(device_execute_interface &exec, int irqline, int cycles); | |
| 97 | void generic_pulse_irq_line_and_vector(device_execute_interface &exec, int irqline, int vector, int cycles); | |
| 83 | 98 | |
| 99 | INTERRUPT_GEN_MEMBER( nmi_line_pulse ); | |
| 100 | INTERRUPT_GEN_MEMBER( nmi_line_assert ); | |
| 101 | ||
| 102 | INTERRUPT_GEN_MEMBER( irq0_line_hold ); | |
| 103 | INTERRUPT_GEN_MEMBER( irq0_line_pulse ); | |
| 104 | INTERRUPT_GEN_MEMBER( irq0_line_assert ); | |
| 105 | ||
| 106 | INTERRUPT_GEN_MEMBER( irq1_line_hold ); | |
| 107 | INTERRUPT_GEN_MEMBER( irq1_line_pulse ); | |
| 108 | INTERRUPT_GEN_MEMBER( irq1_line_assert ); | |
| 109 | ||
| 110 | INTERRUPT_GEN_MEMBER( irq2_line_hold ); | |
| 111 | INTERRUPT_GEN_MEMBER( irq2_line_pulse ); | |
| 112 | INTERRUPT_GEN_MEMBER( irq2_line_assert ); | |
| 113 | ||
| 114 | INTERRUPT_GEN_MEMBER( irq3_line_hold ); | |
| 115 | INTERRUPT_GEN_MEMBER( irq3_line_pulse ); | |
| 116 | INTERRUPT_GEN_MEMBER( irq3_line_assert ); | |
| 117 | ||
| 118 | INTERRUPT_GEN_MEMBER( irq4_line_hold ); | |
| 119 | INTERRUPT_GEN_MEMBER( irq4_line_pulse ); | |
| 120 | INTERRUPT_GEN_MEMBER( irq4_line_assert ); | |
| 121 | ||
| 122 | INTERRUPT_GEN_MEMBER( irq5_line_hold ); | |
| 123 | INTERRUPT_GEN_MEMBER( irq5_line_pulse ); | |
| 124 | INTERRUPT_GEN_MEMBER( irq5_line_assert ); | |
| 125 | ||
| 126 | INTERRUPT_GEN_MEMBER( irq6_line_hold ); | |
| 127 | INTERRUPT_GEN_MEMBER( irq6_line_pulse ); | |
| 128 | INTERRUPT_GEN_MEMBER( irq6_line_assert ); | |
| 129 | ||
| 130 | INTERRUPT_GEN_MEMBER( irq7_line_hold ); | |
| 131 | INTERRUPT_GEN_MEMBER( irq7_line_pulse ); | |
| 132 | INTERRUPT_GEN_MEMBER( irq7_line_assert ); | |
| 133 | ||
| 84 | 134 | // watchdog read/write handlers |
| 85 | 135 | DECLARE_WRITE8_MEMBER( watchdog_reset_w ); |
| 86 | 136 | DECLARE_READ8_MEMBER( watchdog_reset_r ); |
| r14896 | r14897 | |
| 89 | 139 | DECLARE_WRITE32_MEMBER( watchdog_reset32_w ); |
| 90 | 140 | DECLARE_READ32_MEMBER( watchdog_reset32_r ); |
| 91 | 141 | |
| 142 | // generic audio | |
| 143 | void soundlatch_setclearedvalue(UINT16 value) { m_latch_clear_value = value; } | |
| 144 | ||
| 92 | 145 | // sound latch readers |
| 93 | DECLARE_READ8_MEMBER( soundlatch_r ); | |
| 94 | DECLARE_READ8_MEMBER( soundlatch2_r ); | |
| 95 | DECLARE_READ8_MEMBER( soundlatch3_r ); | |
| 96 | DECLARE_READ8_MEMBER( soundlatch4_r ); | |
| 146 | DECLARE_READ8_MEMBER( soundlatch_byte_r ); | |
| 147 | DECLARE_READ8_MEMBER( soundlatch2_byte_r ); | |
| 148 | DECLARE_READ8_MEMBER( soundlatch3_byte_r ); | |
| 149 | DECLARE_READ8_MEMBER( soundlatch4_byte_r ); | |
| 97 | 150 | DECLARE_READ16_MEMBER( soundlatch_word_r ); |
| 98 | 151 | DECLARE_READ16_MEMBER( soundlatch2_word_r ); |
| 99 | 152 | DECLARE_READ16_MEMBER( soundlatch3_word_r ); |
| 100 | 153 | DECLARE_READ16_MEMBER( soundlatch4_word_r ); |
| 101 | 154 | |
| 102 | 155 | // sound latch writers |
| 103 | DECLARE_WRITE8_MEMBER( soundlatch_w ); | |
| 104 | DECLARE_WRITE8_MEMBER( soundlatch2_w ); | |
| 105 | DECLARE_WRITE8_MEMBER( soundlatch3_w ); | |
| 106 | DECLARE_WRITE8_MEMBER( soundlatch4_w ); | |
| 156 | DECLARE_WRITE8_MEMBER( soundlatch_byte_w ); | |
| 157 | DECLARE_WRITE8_MEMBER( soundlatch2_byte_w ); | |
| 158 | DECLARE_WRITE8_MEMBER( soundlatch3_byte_w ); | |
| 159 | DECLARE_WRITE8_MEMBER( soundlatch4_byte_w ); | |
| 107 | 160 | DECLARE_WRITE16_MEMBER( soundlatch_word_w ); |
| 108 | 161 | DECLARE_WRITE16_MEMBER( soundlatch2_word_w ); |
| 109 | 162 | DECLARE_WRITE16_MEMBER( soundlatch3_word_w ); |
| 110 | 163 | DECLARE_WRITE16_MEMBER( soundlatch4_word_w ); |
| 111 | 164 | |
| 112 | 165 | // sound latch clearers |
| 113 | DECLARE_WRITE8_MEMBER( soundlatch_clear_w ); | |
| 114 | DECLARE_WRITE8_MEMBER( soundlatch2_clear_w ); | |
| 115 | DECLARE_WRITE8_MEMBER( soundlatch3_clear_w ); | |
| 116 | DECLARE_WRITE8_MEMBER( soundlatch4_clear_w ); | |
| 166 | DECLARE_WRITE8_MEMBER( soundlatch_clear_byte_w ); | |
| 167 | DECLARE_WRITE8_MEMBER( soundlatch2_clear_byte_w ); | |
| 168 | DECLARE_WRITE8_MEMBER( soundlatch3_clear_byte_w ); | |
| 169 | DECLARE_WRITE8_MEMBER( soundlatch4_clear_byte_w ); | |
| 117 | 170 | |
| 118 | // general palette helpers | |
| 119 | void set_color_332(pen_t color, int rshift, int gshift, int bshift, UINT32 data); | |
| 120 | void set_color_444(pen_t color, int rshift, int gshift, int bshift, UINT32 data); | |
| 121 | void set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT32 data); | |
| 122 | void set_color_565(pen_t color, int rshift, int gshift, int bshift, UINT32 data); | |
| 123 | void set_color_888(pen_t color, int rshift, int gshift, int bshift, UINT32 data); | |
| 124 | void set_color_4444(pen_t color, int ishift, int rshift, int gshift, int bshift, UINT16 data); | |
| 171 | // generic video | |
| 172 | void flip_screen_set(UINT32 on); | |
| 173 | void flip_screen_set_no_update(UINT32 on); | |
| 174 | void flip_screen_x_set(UINT32 on); | |
| 175 | void flip_screen_y_set(UINT32 on); | |
| 176 | UINT32 flip_screen() const { return m_flip_screen_x; } | |
| 177 | UINT32 flip_screen_x() const { return m_flip_screen_x; } | |
| 178 | UINT32 flip_screen_y() const { return m_flip_screen_y; } | |
| 125 | 179 | |
| 180 | // templatized palette writers for 8-bit palette data | |
| 181 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE8_MEMBER( palette_8bit_byte_w ); | |
| 182 | ||
| 183 | // templatized palette writers for 16-bit palette data | |
| 184 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE8_MEMBER( palette_16bit_byte_le_w ); | |
| 185 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE8_MEMBER( palette_16bit_byte_be_w ); | |
| 186 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE8_MEMBER( palette_16bit_byte_split_lo_w ); | |
| 187 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE8_MEMBER( palette_16bit_byte_split_hi_w ); | |
| 188 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE16_MEMBER( palette_16bit_word_w ); | |
| 189 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE32_MEMBER( palette_16bit_dword_le_w ); | |
| 190 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE32_MEMBER( palette_16bit_dword_be_w ); | |
| 191 | ||
| 192 | // templatized palette writers for 32-bit palette data | |
| 193 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE16_MEMBER( palette_32bit_word_le_w ); | |
| 194 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE16_MEMBER( palette_32bit_word_be_w ); | |
| 195 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> DECLARE_WRITE32_MEMBER( palette_32bit_dword_w ); | |
| 196 | ||
| 126 | 197 | // 3-3-2 RGB palette write handlers |
| 127 | DECLARE_WRITE8_MEMBER( paletteram_BBGGGRRR_w ); | |
| 128 | DECLARE_WRITE8_MEMBER( paletteram_RRRGGGBB_w ); | |
| 129 | DECLARE_WRITE8_MEMBER( paletteram_BBGGRRII_w ); | |
| 130 | DECLARE_WRITE8_MEMBER( paletteram_IIBBGGRR_w ); | |
| 198 | DECLARE_WRITE8_MEMBER( paletteram_BBGGGRRR_byte_w ); | |
| 199 | DECLARE_WRITE8_MEMBER( paletteram_RRRGGGBB_byte_w ); | |
| 200 | DECLARE_WRITE8_MEMBER( paletteram_BBGGRRII_byte_w ); | |
| 131 | 201 | |
| 132 | 202 | // 4-4-4 RGB palette write handlers |
| 133 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_le_w ); | |
| 134 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_be_w ); | |
| 135 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_split1_w ); // uses paletteram | |
| 136 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_split2_w ); // uses paletteram2 | |
| 137 | DECLARE_WRITE16_MEMBER( paletteram16_xxxxBBBBGGGGRRRR_word_w ); | |
| 203 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_byte_le_w ); | |
| 204 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_byte_be_w ); | |
| 205 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w ); | |
| 206 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w ); | |
| 207 | DECLARE_WRITE16_MEMBER( paletteram_xxxxBBBBGGGGRRRR_word_w ); | |
| 138 | 208 | |
| 139 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_le_w ); | |
| 140 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_be_w ); | |
| 141 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_split1_w ); // uses paletteram | |
| 142 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_split2_w ); // uses paletteram2 | |
| 143 | DECLARE_WRITE16_MEMBER( paletteram16_xxxxBBBBRRRRGGGG_word_w ); | |
| 209 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_byte_le_w ); | |
| 210 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_byte_be_w ); | |
| 211 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_byte_split_lo_w ); | |
| 212 | DECLARE_WRITE8_MEMBER( paletteram_xxxxBBBBRRRRGGGG_byte_split_hi_w ); | |
| 213 | DECLARE_WRITE16_MEMBER( paletteram_xxxxBBBBRRRRGGGG_word_w ); | |
| 144 | 214 | |
| 145 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRBBBBGGGG_split1_w ); // uses paletteram | |
| 146 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRBBBBGGGG_split2_w ); // uses paletteram2 | |
| 215 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRBBBBGGGG_byte_split_lo_w ); | |
| 216 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRBBBBGGGG_byte_split_hi_w ); | |
| 147 | 217 | |
| 148 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_le_w ); | |
| 149 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_be_w ); | |
| 150 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_split1_w ); // uses paletteram | |
| 151 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_split2_w ); // uses paletteram2 | |
| 152 | DECLARE_WRITE16_MEMBER( paletteram16_xxxxRRRRGGGGBBBB_word_w ); | |
| 218 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_byte_le_w ); | |
| 219 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_byte_be_w ); | |
| 220 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_byte_split_lo_w ); | |
| 221 | DECLARE_WRITE8_MEMBER( paletteram_xxxxRRRRGGGGBBBB_byte_split_hi_w ); | |
| 222 | DECLARE_WRITE16_MEMBER( paletteram_xxxxRRRRGGGGBBBB_word_w ); | |
| 153 | 223 | |
| 154 | DECLARE_WRITE8_MEMBER( paletteram_RRRRGGGGBBBBxxxx_be_w ); | |
| 155 | DECLARE_WRITE8_MEMBER( paletteram_RRRRGGGGBBBBxxxx_split1_w ); // uses paletteram | |
| 156 | DECLARE_WRITE8_MEMBER( paletteram_RRRRGGGGBBBBxxxx_split2_w ); // uses paletteram2 | |
| 157 | DECLARE_WRITE16_MEMBER( paletteram16_RRRRGGGGBBBBxxxx_word_w ); | |
| 224 | DECLARE_WRITE8_MEMBER( paletteram_RRRRGGGGBBBBxxxx_byte_be_w ); | |
| 225 | DECLARE_WRITE8_MEMBER( paletteram_RRRRGGGGBBBBxxxx_byte_split_lo_w ); | |
| 226 | DECLARE_WRITE8_MEMBER( paletteram_RRRRGGGGBBBBxxxx_byte_split_hi_w ); | |
| 227 | DECLARE_WRITE16_MEMBER( paletteram_RRRRGGGGBBBBxxxx_word_w ); | |
| 158 | 228 | |
| 159 | 229 | // 4-4-4-4 IRGB palette write handlers |
| 160 | DECLARE_WRITE16_MEMBER( paletteram16_IIIIRRRRGGGGBBBB_word_w ); | |
| 161 | DECLARE_WRITE16_MEMBER( paletteram16_RRRRGGGGBBBBIIII_word_w ); | |
| 230 | DECLARE_WRITE16_MEMBER( paletteram_IIIIRRRRGGGGBBBB_word_w ); | |
| 231 | DECLARE_WRITE16_MEMBER( paletteram_RRRRGGGGBBBBIIII_word_w ); | |
| 162 | 232 | |
| 163 | 233 | // 5-5-5 RGB palette write handlers |
| 164 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_le_w ); | |
| 165 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_be_w ); | |
| 166 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_split1_w ); // uses paletteram | |
| 167 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_split2_w ); // uses paletteram2 | |
| 168 | DECLARE_WRITE16_MEMBER( paletteram16_xBBBBBGGGGGRRRRR_word_w ); | |
| 234 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_byte_le_w ); | |
| 235 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_byte_be_w ); | |
| 236 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w ); | |
| 237 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w ); | |
| 238 | DECLARE_WRITE16_MEMBER( paletteram_xBBBBBGGGGGRRRRR_word_w ); | |
| 169 | 239 | |
| 170 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBRRRRRGGGGG_split1_w ); // uses paletteram | |
| 171 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBRRRRRGGGGG_split2_w ); // uses paletteram2 | |
| 240 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBRRRRRGGGGG_byte_split_lo_w ); | |
| 241 | DECLARE_WRITE8_MEMBER( paletteram_xBBBBBRRRRRGGGGG_byte_split_hi_w ); | |
| 172 | 242 | |
| 173 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_le_w ); | |
| 174 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_be_w ); | |
| 175 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_split1_w ); | |
| 176 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_split2_w ); | |
| 177 | DECLARE_WRITE16_MEMBER( paletteram16_xRRRRRGGGGGBBBBB_word_w ); | |
| 243 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_byte_le_w ); | |
| 244 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_byte_be_w ); | |
| 245 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_byte_split_lo_w ); | |
| 246 | DECLARE_WRITE8_MEMBER( paletteram_xRRRRRGGGGGBBBBB_byte_split_hi_w ); | |
| 247 | DECLARE_WRITE16_MEMBER( paletteram_xRRRRRGGGGGBBBBB_word_w ); | |
| 248 | DECLARE_WRITE32_MEMBER( paletteram_xRRRRRGGGGGBBBBB_dword_be_w ); | |
| 249 | DECLARE_WRITE32_MEMBER( paletteram_xRRRRRGGGGGBBBBB_dword_le_w ); | |
| 178 | 250 | |
| 179 | DECLARE_WRITE16_MEMBER( paletteram16_xGGGGGRRRRRBBBBB_word_w ); | |
| 180 | DECLARE_WRITE16_MEMBER( paletteram16_xGGGGGBBBBBRRRRR_word_w ); | |
| 251 | DECLARE_WRITE16_MEMBER( paletteram_xGGGGGRRRRRBBBBB_word_w ); | |
| 252 | DECLARE_WRITE16_MEMBER( paletteram_xGGGGGBBBBBRRRRR_word_w ); | |
| 253 | DECLARE_WRITE16_MEMBER( paletteram_RRRRRGGGGGBBBBBx_word_w ); | |
| 254 | DECLARE_WRITE16_MEMBER( paletteram_GGGGGRRRRRBBBBBx_word_w ); | |
| 255 | DECLARE_WRITE16_MEMBER( paletteram_RRRRGGGGBBBBRGBx_word_w ); | |
| 181 | 256 | |
| 182 | DECLARE_WRITE16_MEMBER( paletteram16_RRRRRGGGGGBBBBBx_word_w ); | |
| 183 | DECLARE_WRITE16_MEMBER( paletteram16_GGGGGRRRRRBBBBBx_word_w ); | |
| 184 | DECLARE_WRITE16_MEMBER( paletteram16_RRRRGGGGBBBBRGBx_word_w ); | |
| 185 | ||
| 186 | 257 | // 8-8-8 RGB palette write handlers |
| 187 | DECLARE_WRITE16_MEMBER( paletteram16_xrgb_word_be_w ); | |
| 188 | DECLARE_WRITE16_MEMBER( paletteram16_xbgr_word_be_w ); | |
| 258 | DECLARE_WRITE16_MEMBER( paletteram_xrgb_word_be_w ); | |
| 259 | DECLARE_WRITE16_MEMBER( paletteram_xbgr_word_be_w ); | |
| 189 | 260 | |
| 190 | 261 | // generic input port helpers |
| 191 | 262 | // custom handler |
| r14896 | r14897 | |
| 216 | 287 | inline UINT16 paletteram16_split(offs_t offset) const { return m_generic_paletteram_8[offset] | (m_generic_paletteram2_8[offset] << 8); } |
| 217 | 288 | inline UINT32 paletteram32_be(offs_t offset) const { return m_generic_paletteram_16[offset | 1] | (m_generic_paletteram_16[offset & ~1] << 16); } |
| 218 | 289 | |
| 219 | // internal state | |
| 220 | const game_driver * m_system; // pointer to the game driver | |
| 221 | ||
| 222 | legacy_callback_func m_callbacks[CB_COUNT]; // generic legacy callbacks | |
| 223 | palette_init_func m_palette_init; // one-time palette init callback | |
| 224 | ||
| 225 | 290 | public: |
| 226 | 291 | // generic pointers |
| 227 | 292 | optional_shared_ptr<UINT8> m_generic_paletteram_8; |
| r14896 | r14897 | |
| 230 | 295 | optional_shared_ptr<UINT16> m_generic_paletteram2_16; |
| 231 | 296 | optional_shared_ptr<UINT32> m_generic_paletteram_32; |
| 232 | 297 | optional_shared_ptr<UINT32> m_generic_paletteram2_32; |
| 298 | ||
| 299 | private: | |
| 300 | // helpers | |
| 301 | void irq_pulse_clear(void *ptr, INT32 param); | |
| 302 | void soundlatch_sync_callback(void *ptr, INT32 param); | |
| 303 | void updateflip(); | |
| 304 | ||
| 305 | // internal state | |
| 306 | const game_driver * m_system; // pointer to the game driver | |
| 307 | palette_init_func m_palette_init; // one-time palette init callback | |
| 308 | driver_callback_delegate m_callbacks[CB_COUNT]; // start/reset callbacks | |
| 309 | legacy_callback_func m_legacy_callbacks[CB_COUNT]; // legacy start/reset callbacks | |
| 310 | ||
| 311 | // generic audio | |
| 312 | UINT16 m_latch_clear_value; | |
| 313 | UINT16 m_latched_value[4]; | |
| 314 | UINT8 m_latch_read[4]; | |
| 315 | ||
| 316 | // generic video | |
| 317 | UINT32 m_flip_screen_x; | |
| 318 | UINT32 m_flip_screen_y; | |
| 233 | 319 | }; |
| 234 | 320 | |
| 235 | 321 | |
| r14896 | r14897 | |
| 243 | 329 | } |
| 244 | 330 | |
| 245 | 331 | |
| 332 | ||
| 333 | //************************************************************************** | |
| 334 | // PALETTE WRITER TEMPLATES | |
| 335 | //************************************************************************** | |
| 336 | ||
| 337 | // write 8-bit palette data | |
| 338 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 339 | WRITE8_MEMBER(driver_device::palette_8bit_byte_w) | |
| 340 | { | |
| 341 | m_generic_paletteram_8[offset] = data; | |
| 342 | UINT8 paldata = m_generic_paletteram_8[offset]; | |
| 343 | palette_set_color_rgb(machine(), offset, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 344 | } | |
| 345 | ||
| 346 | // write 16-bit palette data to consecutive 8-bit addresses with LSB first | |
| 347 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 348 | WRITE8_MEMBER(driver_device::palette_16bit_byte_le_w) | |
| 349 | { | |
| 350 | m_generic_paletteram_8[offset] = data; | |
| 351 | UINT16 paldata = m_generic_paletteram_8[offset & ~1] | (m_generic_paletteram_8[offset | 1] << 8); | |
| 352 | palette_set_color_rgb(machine(), offset / 2, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 353 | } | |
| 354 | ||
| 355 | // write 16-bit palette data to consecutive 8-bit addresses with MSB first | |
| 356 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 357 | WRITE8_MEMBER(driver_device::palette_16bit_byte_be_w) | |
| 358 | { | |
| 359 | m_generic_paletteram_8[offset] = data; | |
| 360 | UINT16 paldata = m_generic_paletteram_8[offset | 1] | (m_generic_paletteram_8[offset & ~1] << 8); | |
| 361 | palette_set_color_rgb(machine(), offset / 2, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 362 | } | |
| 363 | ||
| 364 | // write 16-bit palette data to split 8-bit addresses (LSB) | |
| 365 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 366 | WRITE8_MEMBER(driver_device::palette_16bit_byte_split_lo_w) | |
| 367 | { | |
| 368 | m_generic_paletteram_8[offset] = data; | |
| 369 | UINT16 paldata = m_generic_paletteram_8[offset] | (m_generic_paletteram2_8[offset] << 8); | |
| 370 | palette_set_color_rgb(machine(), offset, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 371 | } | |
| 372 | ||
| 373 | // write 16-bit palette data to split 8-bit addresses (MSB) | |
| 374 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 375 | WRITE8_MEMBER(driver_device::palette_16bit_byte_split_hi_w) | |
| 376 | { | |
| 377 | m_generic_paletteram2_8[offset] = data; | |
| 378 | UINT16 paldata = m_generic_paletteram_8[offset] | (m_generic_paletteram2_8[offset] << 8); | |
| 379 | palette_set_color_rgb(machine(), offset, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 380 | } | |
| 381 | ||
| 382 | // write 16-bit palette data to 16-bit addresses | |
| 383 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 384 | WRITE16_MEMBER(driver_device::palette_16bit_word_w) | |
| 385 | { | |
| 386 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 387 | UINT16 paldata = m_generic_paletteram_16[offset]; | |
| 388 | palette_set_color_rgb(machine(), offset, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 389 | } | |
| 390 | ||
| 391 | // write 16-bit palette data to packed 32-bit addresses (lower entry in lower 16 bits) | |
| 392 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 393 | WRITE32_MEMBER(driver_device::palette_16bit_dword_le_w) | |
| 394 | { | |
| 395 | COMBINE_DATA(&m_generic_paletteram_32[offset]); | |
| 396 | if (ACCESSING_BITS_0_15) | |
| 397 | { | |
| 398 | UINT16 paldata = m_generic_paletteram_32[offset]; | |
| 399 | palette_set_color_rgb(machine(), offset * 2 + 0, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_GreenBits>(paldata >> _BlueShift)); | |
| 400 | } | |
| 401 | if (ACCESSING_BITS_16_31) | |
| 402 | { | |
| 403 | UINT16 paldata = m_generic_paletteram_32[offset] >> 16; | |
| 404 | palette_set_color_rgb(machine(), offset * 2 + 1, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_GreenBits>(paldata >> _BlueShift)); | |
| 405 | } | |
| 406 | } | |
| 407 | ||
| 408 | // write 16-bit palette data to packed 32-bit addresses (lower entry in upper 16 bits) | |
| 409 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 410 | WRITE32_MEMBER(driver_device::palette_16bit_dword_be_w) | |
| 411 | { | |
| 412 | COMBINE_DATA(&m_generic_paletteram_32[offset]); | |
| 413 | if (ACCESSING_BITS_16_31) | |
| 414 | { | |
| 415 | UINT16 paldata = m_generic_paletteram_32[offset] >> 16; | |
| 416 | palette_set_color_rgb(machine(), offset * 2 + 0, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 417 | } | |
| 418 | if (ACCESSING_BITS_0_15) | |
| 419 | { | |
| 420 | UINT16 paldata = m_generic_paletteram_32[offset]; | |
| 421 | palette_set_color_rgb(machine(), offset * 2 + 1, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 422 | } | |
| 423 | } | |
| 424 | ||
| 425 | // write 32-bit palette data to consecutive 16-bit addresses with LSW first | |
| 426 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 427 | WRITE16_MEMBER(driver_device::palette_32bit_word_le_w) | |
| 428 | { | |
| 429 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 430 | UINT32 paldata = m_generic_paletteram_16[offset & ~1] | (m_generic_paletteram_16[offset | 1] << 16); | |
| 431 | palette_set_color_rgb(machine(), offset / 2, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 432 | } | |
| 433 | ||
| 434 | // write 32-bit palette data to consecutive 16-bit addresses with MSW first | |
| 435 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 436 | WRITE16_MEMBER(driver_device::palette_32bit_word_be_w) | |
| 437 | { | |
| 438 | COMBINE_DATA(&m_generic_paletteram_16[offset]); | |
| 439 | UINT32 paldata = m_generic_paletteram_16[offset | 1] | (m_generic_paletteram_16[offset & ~1] << 16); | |
| 440 | palette_set_color_rgb(machine(), offset / 2, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 441 | } | |
| 442 | ||
| 443 | // write 32-bit palette data to 32-bit addresses | |
| 444 | template<int _RedBits, int _GreenBits, int _BlueBits, int _RedShift, int _GreenShift, int _BlueShift> | |
| 445 | WRITE32_MEMBER(driver_device::palette_32bit_dword_w) | |
| 446 | { | |
| 447 | COMBINE_DATA(&m_generic_paletteram_32[offset]); | |
| 448 | UINT32 paldata = m_generic_paletteram_32[offset]; | |
| 449 | palette_set_color_rgb(machine(), offset, palexpand<_RedBits>(paldata >> _RedShift), palexpand<_GreenBits>(paldata >> _GreenShift), palexpand<_BlueBits>(paldata >> _BlueShift)); | |
| 450 | } | |
| 451 | ||
| 246 | 452 | #endif /* __DRIVER_H__ */ |
| r14896 | r14897 | |
|---|---|---|
| 270 | 270 | #define MCFG_MACHINE_START(_func) \ |
| 271 | 271 | driver_device::static_set_callback(*owner, driver_device::CB_MACHINE_START, MACHINE_START_NAME(_func)); \ |
| 272 | 272 | |
| 273 | #define MCFG_MACHINE_START_DRIVER(_class, _func) \ | |
| 274 | driver_device::static_set_callback(*owner, driver_device::CB_MACHINE_START, driver_callback_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device()))); | |
| 275 | ||
| 273 | 276 | #define MCFG_MACHINE_RESET(_func) \ |
| 274 | 277 | driver_device::static_set_callback(*owner, driver_device::CB_MACHINE_RESET, MACHINE_RESET_NAME(_func)); \ |
| 275 | 278 | |
| 279 | #define MCFG_MACHINE_RESET_DRIVER(_class, _func) \ | |
| 280 | driver_device::static_set_callback(*owner, driver_device::CB_MACHINE_RESET, driver_callback_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device()))); | |
| 276 | 281 | |
| 282 | ||
| 277 | 283 | // core sound functions |
| 278 | 284 | #define MCFG_SOUND_START(_func) \ |
| 279 | 285 | driver_device::static_set_callback(*owner, driver_device::CB_SOUND_START, SOUND_START_NAME(_func)); \ |
| 280 | 286 | |
| 287 | #define MCFG_SOUND_START_DRIVER(_class, _func) \ | |
| 288 | driver_device::static_set_callback(*owner, driver_device::CB_SOUND_START, driver_callback_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device()))); | |
| 289 | ||
| 281 | 290 | #define MCFG_SOUND_RESET(_func) \ |
| 282 | 291 | driver_device::static_set_callback(*owner, driver_device::CB_SOUND_RESET, SOUND_RESET_NAME(_func)); \ |
| 283 | 292 | |
| 293 | #define MCFG_SOUND_RESET_DRIVER(_class, _func) \ | |
| 294 | driver_device::static_set_callback(*owner, driver_device::CB_SOUND_RESET, driver_callback_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device()))); | |
| 284 | 295 | |
| 296 | ||
| 285 | 297 | // core video functions |
| 286 | 298 | #define MCFG_PALETTE_INIT(_func) \ |
| 287 | 299 | driver_device::static_set_palette_init(*owner, PALETTE_INIT_NAME(_func)); \ |
| r14896 | r14897 | |
| 289 | 301 | #define MCFG_VIDEO_START(_func) \ |
| 290 | 302 | driver_device::static_set_callback(*owner, driver_device::CB_VIDEO_START, VIDEO_START_NAME(_func)); \ |
| 291 | 303 | |
| 304 | #define MCFG_VIDEO_START_DRIVER(_class, _func) \ | |
| 305 | driver_device::static_set_callback(*owner, driver_device::CB_VIDEO_START, driver_callback_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device()))); | |
| 306 | ||
| 292 | 307 | #define MCFG_VIDEO_RESET(_func) \ |
| 293 | 308 | driver_device::static_set_callback(*owner, driver_device::CB_VIDEO_RESET, VIDEO_RESET_NAME(_func)); \ |
| 294 | 309 | |
| 310 | #define MCFG_VIDEO_RESET_DRIVER(_class, _func) \ | |
| 311 | driver_device::static_set_callback(*owner, driver_device::CB_VIDEO_RESET, driver_callback_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device()))); | |
| 295 | 312 | |
| 313 | ||
| 296 | 314 | // add/remove devices |
| 297 | 315 | #define MCFG_DEVICE_ADD(_tag, _type, _clock) \ |
| 298 | 316 | device = config.device_add(owner, _tag, _type, _clock); \ |
| r14896 | r14897 | |
|---|---|---|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
| 299 | //------------------------------------------------- | |
| 300 | // palexpand - expand a palette value to 8 bits | |
| 301 | //------------------------------------------------- | |
| 302 | ||
| 303 | template<int _NumBits> | |
| 304 | inline UINT8 palexpand(UINT8 data) | |
| 305 | { | |
| 306 | if (_NumBits == 1) return pal1bit(data); | |
| 307 | if (_NumBits == 2) return pal2bit(data); | |
| 308 | if (_NumBits == 3) return pal3bit(data); | |
| 309 | if (_NumBits == 4) return pal4bit(data); | |
| 310 | if (_NumBits == 5) return pal5bit(data); | |
| 311 | if (_NumBits == 6) return pal6bit(data); | |
| 312 | if (_NumBits == 7) return pal7bit(data); | |
| 313 | return data; | |
| 314 | } | |
| 315 | ||
| 316 | ||
| 299 | 317 | /*------------------------------------------------- |
| 300 | 318 | pal332 - create a 3-3-2 color by extracting |
| 301 | 319 | bits from a UINT32 |
| r14896 | r14897 | |
|---|---|---|
| 487 | 487 | /* accessing the LSB only is not mapped */ |
| 488 | 488 | if (mem_mask != 0x00ff) |
| 489 | 489 | { |
| 490 | state->soundlatch_w(*space, 0, data >> 8); | |
| 490 | state->soundlatch_byte_w(*space, 0, data >> 8); | |
| 491 | 491 | |
| 492 | 492 | audio_cpu_assert_nmi(space->machine()); |
| 493 | 493 | |
| r14896 | r14897 | |
| 502 | 502 | static READ8_HANDLER( audio_command_r ) |
| 503 | 503 | { |
| 504 | 504 | ng_aes_state *state = space->machine().driver_data<ng_aes_state>(); |
| 505 | UINT8 ret = state->soundlatch_r(*space, 0); | |
| 505 | UINT8 ret = state->soundlatch_byte_r(*space, 0); | |
| 506 | 506 | |
| 507 | 507 | if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", cpu_get_pc(&space->device()), ret); |
| 508 | 508 |
| r14896 | r14897 | |
|---|---|---|
| 1113 | 1113 | AM_RANGE( 0xe90000, 0xe9001f ) AM_READWRITE( supracan_sound_r, supracan_sound_w ) |
| 1114 | 1114 | AM_RANGE( 0xe90020, 0xe9003f ) AM_WRITE( supracan_dma_w ) |
| 1115 | 1115 | AM_RANGE( 0xf00000, 0xf001ff ) AM_READWRITE( supracan_video_r, supracan_video_w ) |
| 1116 | AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM AM_WRITE(paletteram | |
| 1116 | AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM AM_WRITE(paletteram | |
| 1117 | 1117 | AM_RANGE( 0xf40000, 0xf5ffff ) AM_READWRITE(supracan_vram_r, supracan_vram_w) |
| 1118 | 1118 | AM_RANGE( 0xfc0000, 0xfdffff ) AM_MIRROR(0x30000) AM_RAM /* System work ram */ |
| 1119 | 1119 | ADDRESS_MAP_END |
| Previous | 15994 Revisions | Next |